Task processing method and device, computer equipment, storage medium and product
By querying process templates that match the task in the large language model and integrating prompt words to generate tool call sequences, the problem of low efficiency of autonomous reasoning tools in large language models is solved, and task processing efficiency and success rate are improved.
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
Large language models need to autonomously reason about the tools they call at each step in task processing, resulting in low efficiency in task processing.
By determining the multidimensional matching factors of the target task, querying the process template that matches the target task, and integrating the process template with the prompt words of the large language model, a tool call sequence is generated for direct task processing.
It reduces the number of times the tool needs to be determined, improves task processing efficiency and response rate, reduces random errors in autonomous planning, and increases the success rate of tool invocation.
Smart Images

Figure CN122019625A_ABST
Abstract
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 perform tasks in a manner similar to human problem-solving. In the task processing process, ReAct first needs to determine the first-step tool to be invoked. After invoking the first-step tool to process the task, it determines whether to continue invoking tools based on the processing result. If continued tool invocation is required, it needs to determine the second-step tool to invoke, until the task is completed. Because ReAct needs to autonomously reason about the tools invoked at each step, it takes a considerable amount of time, resulting in 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 a multi-dimensional matching factor for the target task, the multi-dimensional matching factor being a feature of the target task in multiple dimensions; based on the multi-dimensional matching factor, querying a first process template matching the target task; fusing the first process template with prompts from a large language model to obtain a fusion result; generating a first tool invocation sequence using the large language model based on the fusion result; and processing the target task using tools from the first tool invocation sequence 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 a multi-dimensional matching factor for the target task in response to a processing request for a target task, the multi-dimensional matching factor being a feature of the target task in multiple dimensions; a querying module, configured to query a first process template matching the target task based on the multi-dimensional matching factor; a fusion module, configured to fuse the first process template with prompts from a large language model to obtain a fusion result; a generating module, configured to generate a first tool invocation sequence using the large language model based on the fusion result; and a processing module, configured to process the target task based on tools in the first tool invocation sequence 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 a multi-dimensional matching factor for the target task, the multi-dimensional matching factor being a feature of the target task in multiple dimensions; based on the multi-dimensional matching factor, querying a first process template matching the target task; fusing the first process template with prompts from a large language model to obtain a fusion result; generating a first tool invocation sequence through the large language model based on the fusion result; and processing the target task based on tools in the first tool invocation sequence 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 a multi-dimensional matching factor for the target task, the multi-dimensional matching factor being a feature of the target task in multiple dimensions; based on the multi-dimensional matching factor, querying a first process template matching the target task; fusing the first process template with prompts from a large language model to obtain a fusion result; generating a first tool invocation sequence through the large language model based on the fusion result; and processing the target task based on tools in the first tool invocation sequence 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 a multi-dimensional matching factor for the target task, the multi-dimensional matching factor being a feature of the target task in multiple dimensions; based on the multi-dimensional matching factor, querying a first process template matching the target task; fusing the first process template with prompts from a large language model to obtain a fusion result; generating a first tool invocation sequence through the large language model based on the fusion result; and processing the target task based on tools in the first tool invocation sequence 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 multi-dimensional matching factors for the target task. These multi-dimensional matching factors represent the target task's features across multiple dimensions. Then, based on these multi-dimensional matching factors, a first process template matching the target task is queried. This first process template is then fused with prompts from a large language model to obtain a fusion result. Following this fusion result, a first tool invocation sequence is generated using the large language model. The target task is then processed using the tools in this sequence to obtain the first processing result. It is evident that by first querying a process template matching the task and then fusion it with prompts from the large language model, and because the process template includes process steps, a tool invocation sequence can be generated in one step based on the fusion result using the large language model. This avoids repeatedly determining the required tools, reducing the number of tool determinations and thus the determination time, thereby improving task processing efficiency and response speed. Furthermore, since the process template includes process steps, the large language model avoids constructing process steps from scratch, thus reducing processing steps and further improving task processing efficiency and response speed. Furthermore, since the process template includes process steps, it can avoid random errors in the autonomous planning of large language models. Therefore, it can ensure that tools are called in accordance with the specifications, which can improve the success rate of tool calls and thus improve the success rate of task 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 schematic diagram illustrating the expansion of a process template in one embodiment;
[0013] Figure 4 This is a schematic diagram of the architecture of a task processing method in one embodiment;
[0014] Figure 5 This is a flowchart illustrating the task processing method in another embodiment;
[0015] Figure 6 This is a structural block diagram of a task processing device in one embodiment;
[0016] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0017] 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.
[0018] 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.
[0019] 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.
[0020] 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 by determining a multi-dimensional matching factor for the target task. The multi-dimensional matching factor is the multi-dimensional feature of the target task. Then, based on the multi-dimensional matching factor of the target task, it queries a first process template that matches the target task. The first process template is then fused with the prompt words of a large language model to obtain a fusion result. Subsequently, based on the fusion result, a first tool invocation sequence is generated through the large language model. The target task is then processed based on the tools in the first tool invocation sequence 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.
[0021] In one embodiment, such as Figure 2As 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:
[0022] S202, in response to the processing request for the target task, determines the multidimensional matching factor of the target task.
[0023] 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 multidimensional matching factors of the target task are the features of the target task in multiple dimensions. These multiple dimensions can be at least two, i.e., two or more dimensions.
[0024] Upon receiving a processing request for a target task, a multidimensional matching factor for the target task can be determined in response to the request. This multidimensional matching factor can be determined by performing semantic parsing on the target task.
[0025] In this embodiment, when executed by a terminal, it can receive user input requesting the processing of a target task, and then, in response to the processing request, determine the multidimensional matching factor of the target task.
[0026] 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 multi-dimensional matching factors. The processing request may include the target task. The client can be any client corresponding to the server.
[0027] S204, based on the multi-dimensional matching factors of the target task, queries the first process template that matches the target task.
[0028] A process template is a predefined sequence of multi-step tool calls for a specific task type, or a standardized and reusable framework used to describe the steps, structure, rules, and specifications of a specific process, including standardized execution steps, tool selection logic, parameter configuration rules, and dependencies. Specific task types can include online searches, product price inquiries, etc. Specific processes can be various task processing flows, such as financial data statistics flows, academic literature retrieval flows, etc. A process template can include a sequence of steps, parameter examples, scenario constraints, and exception handling rules. The sequence of steps in a process template is a series of operation instructions arranged in a logical order to complete the task. The sequence of steps in a process template can include step information. The step information in a process template is information about the steps required to complete the task. The parameter examples in a process template are specific examples of the variable information that needs to be filled in at each step of the process template. The scenario constraints in a process template are information that clarifies the specific conditions, prerequisites, and environments under which the process template is applicable and inapplicable. The exception handling rules in a process template are backup plans or processing procedures to be followed when the process execution deviates from the normal sequence of steps.
[0029] The first process template is a stored vertical process template. A vertical process template is a structured operational framework customized to meet one or more needs in a specific domain, scenario, or business, incorporating domain best practices and professional knowledge. The first process template that matches the target task is a vertical process template that satisfies the matching conditions for the target task. Vertical process templates can be stored locally, in a dedicated database, or on a dedicated server.
[0030] Based on the multidimensional matching factors of the target task, a first process template matching the target task can be queried. Also based on the multidimensional matching factors of the target task, a vertical process template that meets the matching conditions of the target task can be queried from the stored vertical process templates, thus obtaining the first process template matching the target task.
[0031] S206, the first process template is fused with the prompt words of the large language model to obtain the fusion result.
[0032] Large language model prompts, or LLM prompts, are information used to guide the large language model in understanding and completing tasks.
[0033] The first-process template can be fused with the prompts from the large language model to obtain a fusion result. The information included in the first-process template can be fused with the prompts from the large language model to obtain a fusion result.
[0034] S208, Based on the fusion results, the first tool call sequence is generated through the large language model.
[0035] A tool invocation sequence is a detailed record or plan of executing a series of external tools in a specific order to complete a particular task. The first tool invocation sequence is a detailed record or plan of executing a series of external tools in a specific order to complete the target task.
[0036] The first tool call sequence can be generated based on the fusion results through a large language model.
[0037] S210, based on the tools in the first tool call sequence, process the target task to obtain the first processing result of the target task.
[0038] The first processing result of the target task is the result after processing the target task. The first processing result of the target task can include the processing results of all steps of the target task, or it can include the processing results of one or more steps of the target task.
[0039] The target task can be processed using tools in the first tool call sequence to obtain the first processing result. Alternatively, the target task can be processed by calling tools in the first tool call sequence to obtain the first processing result.
[0040] In the above embodiments, a process template matching the target task is first queried. Then, the queried process template is fused with the prompts from the large language model. Since the process template includes process steps, the large language model can generate a tool call sequence in one go based on the fusion result. This avoids repeatedly determining the required tools, reducing the number of tool determinations and thus reducing tool determination time, thereby improving task processing efficiency and response rate. Furthermore, since the process template includes process steps, the large language model avoids building process steps from scratch, thus reducing processing steps and further improving task processing efficiency and response rate. Moreover, since the process template includes process steps, random errors in the large language model's autonomous planning, such as missing steps or incorrect order, are avoided. This ensures that tools are called according to specifications, improving the success rate of tool calls and thus improving task processing success rate. Furthermore, since vertical process templates incorporate domain rules and support multi-tool coordination, the adaptability between complex tasks and vertical process templates is improved. Corresponding vertical process templates can be matched to complex tasks, thereby improving the success rate of complex task processing.
[0041] In one embodiment, the multidimensional matching factors of the target task include the basic information of the target task and the task tools. Determining the multidimensional matching factors of the target task includes: extracting entity information from the target task to obtain the task entity of the target task; performing semantic analysis on the target task based on the task entity of the target task to obtain the basic information of the target task; and selecting the tools required for the target task from the tool library based on the basic information of the target task to obtain the task tools of the target task.
[0042] The multidimensional matching factors for a target task can include the basic information of the target task and the task tools. The basic information of the target task is information used to ensure that the target task is understandable and executable. The task tools are the tools needed to complete the target task.
[0043] Entity information can be extracted from the target task to obtain the task entity. Alternatively, entity extraction rules can be used to extract entities from the target task. Entity extraction rules are rules used to extract entities from a task. The task entity of a target task is a specific thing, concept, or object with specific attributes within the target task. The task entity of a target task may include the time, location, and object of the target task. For example, the task entity of a target task may include the time, location, product name, and department to which it belongs.
[0044] Semantic analysis of the target task can be performed based on the task entities of the target task, that is, LLM analysis of the target task can be performed based on the task entities of the target task to obtain the basic information of the target task.
[0045] Based on the basic information of the target task, the necessary tools can be selected from the tool library to obtain the task tools. The tool library is a repository that stores all available tools.
[0046] In the above embodiments, by performing deep semantic analysis on the target task, the basic information and tools of the target task can be obtained. Based on the basic information and tools of the target task, a process template matching the target task can be queried, which can improve the accuracy and reliability of process template matching.
[0047] In one embodiment, the basic information of the target task includes at least one of the target task's task type, scenario features, and core keywords; semantic analysis of the target task based on its task entities yields the basic information of the target task, including: semantic analysis of the target task based on its task entities to obtain the target task's task intent, task type, and scenario features; summarizing the target task's behavior based on its task intent, task type, and scenario features to obtain the target task's behavioral keywords; and determining the target task's core keywords based on its task entities and behavioral keywords.
[0048] The basic information of the target task may include at least one of the following: task type, scenario characteristics, and core keywords. The task type refers to the type or category of the target task. The scenario characteristics refer to information about the scenario in which the target task is performed. The core keywords are keywords used to describe the core and essence of the target task.
[0049] If the basic information of the target task includes its task type, semantic analysis can be performed on the target task based on its task entities; that is, LLM analysis can be performed on the target task based on its task entities to obtain its task type. Similarly, if the basic information of the target task includes its scene features, semantic analysis can be performed on the target task based on its task entities to obtain its scene features. Finally, if the basic information of the target task includes both its task type and scene features, semantic analysis can be performed on the target task based on its task entities to obtain both its task type and scene features.
[0050] Given that the basic information of the target task includes core keywords, or task type and core keywords, or scenario features and core keywords, or task type, scenario features, and core keywords, semantic analysis can be performed on the target task based on its task entities. This involves performing LLM analysis on the target task based on its task entities to obtain the task intent, task type, and scenario features. Then, based on the task intent, task type, and scenario features, the behavior of the target task can be summarized to obtain behavioral keywords. Based on the task entities and behavioral keywords, the core keywords of the target task can be determined. The task intent of the target task is the fundamental goal, purpose, or inherent need that the target task aims to achieve. The behavioral keywords of the target task are descriptive words for the specific actions, operations, or behaviors required to complete the target task.
[0051] Based on at least one of the following: task intent, task type, scenario characteristics, and behavioral keywords, the necessary tools for the target task can be selected from the tool library to obtain the task tools. The tool library is a repository that stores all available tools. It should be understood that the more information used when selecting tools, the more accurate the selected tools will be.
[0052] In specific domains, domain-specific features can be extracted. For example, if the target task is financial statistics, features such as "department" and "reimbursement date" can be extracted. If the target task is e-commerce, features such as "product model" and "platform name" can be extracted.
[0053] Given that the basic information of the target task includes its task type, scenario characteristics, and core keywords, structured task information can be generated based on these elements to provide data support for subsequent process template matching. For example, structured task information for an e-commerce price comparison task might look like this:
[0054] {
[0055] "task_intent": "Query and compare the latest promotional prices of product XX (256GB) on Platform 1, Platform 2, and Platform 3", #task intent
[0056] "task_type": "e-commerce price comparison", #task type
[0057] "core_keywords": ["XX mobile phone", "256G", "Platform 1", "Platform 2", "Platform 3", "Promotional price", "Price comparison"], #core keywords
[0058] "scene_features": {"product_type": "mobile phone", "platform_requirement": ["platform1", "platform2", "platform3"],"price_type": "promotional price"}, #scene features
[0059] "required_tools": ["Browser Tools", "E-commerce Platform API Tools", "Product Parsing Tools", "Data Statistics Tools"], #Task Tools
[0060] "entity_info": {"product_name": "XX mobile phone", "specification": "256G"}, #Task entity
[0061] "task_priority": "normal", #Task priority: normal
[0062] "expected_output": "Price comparison report (including platform, price, promotional information, and final price)" # Expected output
[0063] }
[0064] In the above embodiments, by performing deep semantic analysis on the target task, at least one of the target task's task type, scenario features, and core keywords can be obtained. This allows for the querying of process templates that match the target task based on the target task's task tools and at least one of the task type, scenario features, and core keywords, thereby improving the accuracy and reliability of process template matching.
[0065] In one embodiment, querying a first process template that matches the target task based on the multidimensional matching factor of the target task includes: determining the semantic matching degree between the target task and vertical process templates in the process template library based on the multidimensional matching factor of the target task; determining the overlap between the target task and vertical process templates in the process template library based on the multidimensional matching factor of the target task; determining the fusion similarity between the target task and vertical process templates in the process template library based on the semantic matching degree and overlap between the target task and vertical process templates in the process template library; and selecting vertical process templates whose fusion similarity satisfies the similarity condition to obtain the first process template.
[0066] The process template library is a centralized repository for storing and managing all process templates. It allows for the registration, storage, updating, and retrieval of various preset process templates, supporting dynamic expansion and version management. Templates are categorized by task scenario, industry sector, and tool type. The library can include one general process template and multiple vertical process templates (at least two). The general process template is a highly abstract, adaptable, and industry-independent standardized framework of steps for completing a specific type of task. It can be applied to online searches, file operations, data calculations, information extraction, email processing, and office document generation. Vertical process templates can be applied to specific vertical industry scenarios. These scenarios could include e-commerce price comparison, financial data processing, academic literature retrieval, legal provision lookup, medical information organization, cross-border logistics tracking, and internal enterprise approval processes. The following provides an example of a process template.
[0067] For example, a general process template can be as follows:
[0068] {
[0069] "template_id": "web_search_001", #template identifier
[0070] "task_type": ["Network Search", "Information Query"], #Task type
[0071] "applicable_scenarios": ["General Information Query", "Hot Event Verification", "Basic Data Acquisition"], #Applicable Scenarios
[0072] "applicable_tools": ["browser tools", "webpage parsing tools", "error retry tools"], #available tools
[0073] "semantic_keywords": ["Open webpage", "Search engine", "Enter keywords", "Search results", "Parsed content", "Retry after timeout"],#semantic keywords
[0074] "steps": [ #steps
[0075] {
[0076] "step_id": "step1", #Step 1
[0077] "tool_name": "Browser Tools", #Tool Name
[0078] "action": "open_url", # Action: Open the URL
[0079] "params": {"url": "{search_engine_url}", "timeout": 10000}, # Parameters: url: search engine URL, timeout 10000s
[0080] "description": "Opens the homepage of the specified search engine (default is Baidu, supports user-specified Google, Bing, etc.)", #description
[0081] "next_step_condition": "Page loaded successfully (HTTP status code 200)", #Next step condition
[0082] "exception_handler": { #Exception handling
[0083] "error_type": "Timeout / Loading Failure", #Error Type
[0084] "processing_step": "Invoke the exception retry tool, change the search engine URL (e.g., switch from Baidu to Bing), and retry twice; if it still fails, return an error message." #Exception handling steps
[0085] }
[0086] },
[0087] {
[0088] "step_id": "step2", #Step 2
[0089] "tool_name": "Browser Tools", #Tool Name
[0090] "action": "input_keyword", #Action: Input keyword
[0091] "params": {"keyword": "{user_query}", "input_field_selector": "#kw"}, #Parameters: Keyword: User query, Input field selector
[0092] "description": "Enter user search keywords in the search engine input box", #description
[0093] "next_step_condition": "Keyword input completed and input box validation passed", #next step condition
[0094] "exception_handler": { #Exception handling
[0095] "error_type": "Input box not found", #Error type
[0096] "processing_step": "Invokes the webpage parsing tool to relocate the input box DOM node; if it is still not found, returns a format error message." #Exception handling steps
[0097] }
[0098] },
[0099] {
[0100] "step_id": "step3", #Step 3
[0101] "tool_name": "Browser Tools", #Tool Name
[0102] "action": "execute_search", # Action: Execute a search
[0103] "params": {"click_selector": "#su"}, #Parameter: Click selector
[0104] "description": "Triggering the search button click will execute a search request", #description
[0105] "next_step_condition": "Search results page has finished loading", #Next step condition
[0106] "exception_handler": { #Exception handling
[0107] "error_type": "Search button not found", #Error type
[0108] "processing_step": "Execute the search using the shortcut key (Enter). If it fails, return an operation failure message." #Error handling steps
[0109] }
[0110] },
[0111] {
[0112] "step_id": "step4", #Step 4
[0113] "tool_name": "Web page parsing tool", #tool name
[0114] "action": "extract_content", # Action: Extract content
[0115] "params": {"target_fields": ["title", "summary", "url", "publish_time"], "max_results": 10}, # Parameters: target fields: title, summary, URL, publication time, maximum number of results
[0116] "description": "Analyze the core content of the search results page, extracting the title, summary, source link, and publication time", #description
[0117] "next_step_condition": "At least one valid result must be extracted", #Condition for the next step
[0118] "exception_handler": { #Exception handling
[0119] "error_type": "No valid result", #Error type
[0120] "processing_step": "Adjust keywords (synonym replacement), re-execute steps 2-4, up to 2 times; if no results are found, return a no-match message." #Exception handling steps
[0121] }
[0122] }
[0123] ],
[0124] "version": "1.2", #Version number: 1.2
[0125] "update_time": "2025-05-10", #update time
[0126] "match_score_threshold": 0.7, # Matching threshold
[0127] "author": "system", #Author: System
[0128] "extension_support": true #Extension support: supported
[0129] }
[0130] For example, an e-commerce price comparison template in a vertical industry scenario can be as follows:
[0131] {
[0132] "template_id": "e_commerce_price_compare_001", #template identifier
[0133] "task_type": ["e-commerce price comparison", "product price query"], #task type
[0134] "applicable_scenarios": ["Price comparison on major platforms", "Price comparison of similar products", "Promotional price search"], #Usable scenarios
[0135] "applicable_tools": ["Browser Tools", "E-commerce Platform API Tools", "Product Analysis Tools", "Data Statistics Tools"], #Available Tools
[0136] "semantic_keywords": ["JD.com", "Taobao", "PDD", "Product Name", "Comparison of Similar Products", "Price Extraction", "Promotional Information", "Price Comparison Report"], #semantic keywords
[0137] "steps": [ #steps
[0138] {
[0139] "step_id": "step1", #Step 1
[0140] "tool_name": "Product Analysis Tool", #Tool Name
[0141] "action": "extract_product_info", #Action: Extract product information
[0142] "params": {"product_name": "{user_query}"}, #Parameter: Product Name
[0143] "description": "Parses the user-inputted product name, extracts core keywords (such as brand, model, specifications), and removes redundant information", #description
[0144] "next_step_condition": "Successfully extracted at least one core keyword", #Condition for the next step
[0145] "exception_handler": { #Exception handling
[0146] "error_type": "Keyword extraction failed", #Error type
[0147] "processing_step": "Prompt the user to provide more detailed product information (such as model and specifications)" #Error handling steps
[0148] }
[0149] },
[0150] {
[0151] "step_id": "step2", #Step 2
[0152] "tool_name": "Browser Tools", #Tool Name
[0153] "action": "open_platform", # Action: Open the platform
[0154] "params": {"platform_list": ["Platform1", "Platform2", "Platform3"], "current_platform": "Platform1"}, # Parameters: Platform list: Platform1, Platform2, Platform3, Current platform: Platform1
[0155] "description": "Opens the homepage of the first e-commerce platform (Platform 1) in the preset order", #description
[0156] "next_step_condition": "Platform homepage loaded successfully", #Condition for the next step
[0157] "exception_handler": { #Exception handling
[0158] "error_type": "Platform inaccessible", #Error type
[0159] "processing_step": "Skip this platform, switch to the next platform (Taobao), and record information about inaccessible platforms" #Exception handling steps
[0160] }
[0161] },
[0162] {
[0163] "step_id": "step3", #Step 3
[0164] "tool_name": "E-commerce platform API tool", #tool name
[0165] "action": "search_product", #Action: Search for product
[0166] "params": {"keyword": "{core_keywords}", "platform": "{current_platform}", "sort_type": "sales"}, #Parameters: Keyword: Core keyword, Platform: Current platform, Sort type: Sales
[0167] "description": "Uses the current platform API to search for products by core keywords and sort by sales volume (prioritizing popular similar products)", #description
[0168] "next_step_condition": "Return at least 3 product records", #Next step condition
[0169] "exception_handler": { #Exception handling
[0170] "error_type": "API call failed / insufficient result", #error type
[0171] "processing_step": "Switch to browser search (step3 - browser version), re-execute the search" #Error handling steps
[0172] }
[0173] },
[0174] {
[0175] "step_id": "step4", #Step 4
[0176] "tool_name": "Product Analysis Tool", #Tool Name
[0177] "action": "match_same_product", # Action: Match identical products
[0178] "params":{"product_data":"{step3_result}", "core_keywords": "{step1_result}"}, #Parameters: Product data: the result of step 3, Core keywords: the result of step 1
[0179] "description": "Filter for similar products from search results (matching brands, models, and specifications)", #description
[0180] "next_step_condition": "Filter for at least 1 product of the same type", #next step condition
[0181] "exception_handler": { #Exception handling
[0182] "error_type": "No similar product found", #error type
[0183] "processing_step": "Relax matching criteria (e.g., ignore color differences) and re-filter; if no results are found, record that there is no similar product on this platform." #Exception handling steps
[0184] }
[0185] },
[0186] {
[0187] "step_id": "step5", #Step5
[0188] "tool_name": "Product Analysis Tool", #Tool Name
[0189] "action": "extract_price_info", #Action: Extract price information
[0190] "params": {"product_data": "{step4_result}"}, #Parameters: Product data: The result of step 4
[0191] "description": "Retrieves the current price, promotional price, coupon information, shipping fee, and estimated final price for the same product", #description
[0192] "next_step_condition": "Price information successfully retrieved", #Condition for the next step
[0193] "exception_handler": { #Exception handling
[0194] "error_type": "Failed to extract price information", #Error type
[0195] "processing_step": "Skip this product and select the next most similar product" #Exception handling steps
[0196] }
[0197] },
[0198] {
[0199] "step_id": "step6", #Step6
[0200] "tool_name": "Browser Tools", #Tool Name
[0201] "action": "switch_platform", #Action: Platform Switching
[0202] "params": {"platform_list": ["platform1", "platform2", "platform3"], "current_platform": "{next_platform}"}, # Parameters: Platform list: Platform1, Platform2, Platform3; Current platform: Next platform
[0203] "description": "Switch to the next e-commerce platform and repeat steps 3-5", #description
[0204] "next_step_condition": "All platforms have completed processing", #Condition for the next step
[0205] "exception_handler": { #Exception handling
[0206] "error_type": "No more platforms available", #error type
[0207] "processing_step": "Entering the data statistics step" #Exception handling step
[0208] }
[0209] },
[0210] {
[0211] "step_id": "step7", #Step 7
[0212] "tool_name": "Data Statistics Tool", #Tool Name
[0213] "action": "generate_price_report", #Action: Generate a price report
[0214] "params": {"price_data": "{all_platforms_result}", "sort_by": "final_price"}, # Parameters: Price data: Results for all platforms, sorted in ascending order: Final price
[0215] "description": "Aggregates product price information from all platforms, sorts by final price, and generates a price comparison report (including platform, product link, price, and promotional information)", #description
[0216] "next_step_condition": "Report generated successfully", #Condition for the next step
[0217] "exception_handler": { #Exception handling
[0218] "error_type": "Insufficient data", #Error type
[0219] "processing_step": "Returns the retrieved platform price information, indicating that some platforms do not have the relevant products" #Error handling steps
[0220] }
[0221] }
[0222] ],
[0223] "version": "1.1", #Version number: 1.1
[0224] "update_time": "2025-06-15", #update time
[0225] "match_score_threshold": 0.75, # Matching threshold
[0226] "author": "e_commerce_team", #Author: eCommerce Team
[0227] "extension_support": true #Extension support: supported
[0228] }
[0229] For example, a financial data statistics template for a vertical industry scenario can be as follows:
[0230] {
[0231] "template_id": "financial_data_stat_001", #template identifier
[0232] "task_type": ["Financial Statistics", "Reimbursement Amount Summary", "Excel Report Generation"], #Task Type
[0233] "applicable_scenarios": ["Department Monthly Expense Statistics", "Project Expense Summary", "Individual Expense Verification"], #Applicable Scenarios
[0234] "applicable_tools": ["File reading tools", "Data parsing tools", "Data validation tools", "Excel generation tools"], #Available tools
[0235] "semantic_keywords": ["expense report", "Excel", "summary", "invoice verification", "department", "monthly", "report"], #semantic keywords
[0236] "steps": [ #steps
[0237] {
[0238] "step_id": "step1", #Step 1
[0239] "tool_name": "File reading tool", #tool name
[0240] "action": "read_reimbursement_files", # Action: Read reimbursement files
[0241] "params": {"file_path": "{reimbursement_folder}", "file_format": ["xlsx", "xls", "csv"]}, # Parameters: file path: reimbursement folder, file format: xlsx, xls, csv
[0242] "description": "Reads all expense report files in the specified folder, supports Excel and CSV formats", #description
[0243] "next_step_condition": "Successfully read at least one file", #Condition for the next step
[0244] "exception_handler": { #Exception handling
[0245] "error_type": "No valid file", #Error type
[0246] "processing_step": "Prompt the user to check the file path and format" #Error handling steps
[0247] }
[0248] },
[0249] {
[0250] "step_id": "step2", #Step 2
[0251] "tool_name": "Data parsing tool", #tool name
[0252] "action": "extract_reimbursement_data", # Action: Retriev reimbursement data
[0253] "params": {"fields": ["Name", "Department", "Reimbursement Date", "Expense Type", "Amount", "Invoice Number", "Approval Status"]}, #Parameters: Field list: Name, Department, Reimbursement Date, Expense Type, Amount, Invoice Number, Approval Status
[0254] "description": "Extract key field data from expense reimbursement documents and standardize the data format (e.g., round amounts to two decimal places)", #description
[0255] "next_step_condition": "At least one valid expense reimbursement record must be retrieved", #Condition for the next step
[0256] "exception_handler": { #Exception handling
[0257] "error_type": "Field extraction failed", #Error type
[0258] "processing_step": "Calls the data validation tool to identify the file format; if it is a non-standard format, prompts the user to upload a standard template." #Exception handling steps
[0259] }
[0260] },
[0261] {
[0262] "step_id": "step3", #Step 3
[0263] "tool_name": "Data Validation Tool", #Tool Name
[0264] "action": "verify_reimbursement_data", #Action: Verify reimbursement data
[0265] "params": {"data": "{step2_result}", "rules": ["Amount>0", "Unique Invoice Number", "Approval Status is Passed"]}, #Parameters: Data: The result of step 2, Rules: Amount>0, Unique Invoice Number, Approval Status is Passed"]}, #Parameters: Data: The result of step 2, Rules: Amount>0, Unique Invoice Number, Approval Status is Passed
[0266] "description": "Verify reimbursement data according to financial rules (amount is positive, invoice number is unique, and approval has been granted)", #description
[0267] "next_step_condition": "Percentage of records that passed verification ≥ 80%", #Condition for the next step
[0268] "exception_handler": { #Exception handling
[0269] "error_type": "Too many verification failure records", #Error type
[0270] "processing_step": "Output details of verification failures (such as duplicate invoice numbers, unapproved records), prompting the user to correct and re-upload" #Error handling steps
[0271] }
[0272] },
[0273] {
[0274] "step_id": "step4", #Step 4
[0275] "tool_name": "Data Statistics Tool", #Tool Name
[0276] "action": "aggregate_reimbursement_data", #Action: Aggregate reimbursement data
[0277] "params": {"data": "{step3_result}", "group_by": ["department", "expense type"], "stat_type": ["sum", "count"]}, #Parameters: Data: The result of step 3, grouping dimensions: department, expense type, statistical type: sum, count
[0278] "description": "Group by department and expense type to calculate total reimbursement amount and number of reimbursements", #description
[0279] "next_step_condition": "Statistical results are not empty", #Condition for the next step
[0280] "exception_handler": { #Exception handling
[0281] "error_type": "Statistical results are empty", #Error type
[0282] "processing_step": "Returns message indicating no valid reimbursement data" #Error handling steps
[0283] }
[0284] },
[0285] {
[0286] "step_id": "step5", #Step5
[0287] "tool_name": "Excel Generation Tool", #Tool Name
[0288] "action": "create_stat_report", #Action: Create a statistical report
[0289] "params": {"data": "{step4_result}", "sheet_name": "Department Expense Reimbursement Statistics", "file_name": "Monthly Expense Reimbursement Statistics_{date}.xlsx"}, #Parameters: Data: The result of step 4, Report Name: Department Expense Reimbursement Statistics, File Name: Monthly Expense Reimbursement Statistics
[0290] "description": "Generates an Excel-formatted expense report, including grouped statistical results and original valid records", #description
[0291] "next_step_condition": "Report generated successfully and saved to the specified path", #Condition for the next step
[0292] "exception_handler": { #Exception handling
[0293] "error_type": "Report generation failed", #Error type
[0294] "processing_step": "Switch to CSV format to generate the report; if it still fails, return the statistical results text." #Exception handling steps
[0295] }
[0296] }
[0297] ],
[0298] "version": "1.0", #Version number: 1.0
[0299] "update_time": "2025-07-02", #update time
[0300] "match_score_threshold": 0.8, # Matching threshold
[0301] "author": "finance_team", #Author: Finance Team
[0302] "extension_support": true #Extension support: supported
[0303] }
[0304] It should be understood that the above is an exemplary description of the process template and does not limit the process template.
[0305] The process template library can utilize a distributed database to store general process templates and multiple vertical process templates, supporting high-concurrency retrieval and dynamic updates. For example, vertical process templates from different domains can be stored separately, while those from the same domain can be stored together. The metadata and step data of the process templates can be stored in separate tables; metadata is stored in one table, and step data is stored in another. This includes a metadata table and a step data table. The metadata table stores the metadata of the process template, and the step data table stores the process data. Since matching a task using a process template may only require the metadata, matching can be achieved based solely on the metadata table, eliminating the need for the step data table. This reduces the amount of data processed, improving template matching efficiency and consequently, task processing efficiency. The metadata of the process template is structured data describing its core information, including template identifier, task type tag, applicable toolset, step description, semantic keywords, applicable scenarios, version number, update time, and matching threshold, providing data support for retrieval and matching.
[0306] The process template library can include multi-dimensional indexes. These multi-dimensional indexes can include at least two of the following: task type index, task scenario index, keyword index, and task tool index. For example, multi-dimensional indexes could include e-commerce scenarios and browser tools.
[0307] Based on the multidimensional matching factors of the target task, the semantic matching degree between the target task and the vertical process templates in the process template library can be determined. The semantic matching degree between the target task and the vertical process template represents the degree of similarity between the target task and the vertical process template at the semantic level.
[0308] The overlap between a target task and a vertical process template in the process template library can be determined based on the multidimensional matching factors of the target task. The overlap between the target task and the vertical process template is the proportion or degree of overlap or common parts between the target task and the vertical process template.
[0309] The fusion similarity between a target task and vertical process templates in a process template library can be determined based on the semantic matching degree and overlap between the target task and the vertical process templates in the process template library. The fusion similarity between the target task and the vertical process templates in the process template library can be obtained by fusing the semantic matching degree and overlap.
[0310] Then, you can select a vertical process template from the vertical process templates in the process template library that meets the similarity condition to obtain the first process template.
[0311] In the above embodiments, because the vertical process template matching process considers not only the semantic matching degree between the task and the vertical process template, but also the overlap between the task and the vertical process template, the matching degree between the task and the vertical process template is considered from different dimensions. Therefore, the reliability and accuracy of the matched vertical process template can be improved. Since the reliability and accuracy of the matched vertical process template are improved, the reliability and accuracy of the generated tool call sequence can be improved, thereby increasing the success rate of task processing and the reliability and accuracy of task answers.
[0312] In one embodiment, determining the semantic matching degree between the target task and the vertical process templates in the process template library based on the multidimensional matching factor of the target task includes: determining the task feature vector of the target task based on the multidimensional matching factor of the target task; determining the fusion value between the task feature vector of the target task and the template feature vector of the vertical process template in the process template library; determining the length of the task feature vector of the target task to obtain the task length; determining the length of the template feature vector of the vertical process template to obtain the template length; and determining the semantic matching degree between the target task and the vertical process template based on the fusion value, the task length, and the template length.
[0313] The task feature vector of a target task can be determined based on multidimensional matching factors. The task feature vector is a vector that includes the features of the target task. When the multidimensional matching factors of the target task include task type, scene features, core keywords, and task tools, the task type vector can be determined based on the task type, the scene feature vector based on the scene features, the core keyword vector based on the core keywords, and the task tool vector based on the task tools. The task type vector, scene feature vector, core keyword vector, and task tool vector can be concatenated to obtain the target task's task feature vector. Similarly, the template feature vector of a vertical process template in the process template library can be determined. The template feature vector of a vertical process template is a vector that includes the features of the vertical process template.
[0314] The fusion value between the task feature vector of the target task and the template feature vector of the vertical process template in the process template library can be determined. In one case, the product between the task feature vector of the target task and the template feature vector of the vertical process template can be determined, and the fusion value can be determined based on this product. The product between the task feature vector of the target task and the template feature vector of the vertical process template can be either the dot product or the cross product. When the product between the task feature vector of the target task and the template feature vector of the vertical process template is the dot product, this product can be determined as the fusion value between the task feature vector of the target task and the template feature vector of the vertical process template. When the product of the target task's task feature vector and the template feature vector of the vertical process template is the cross product of their respective features, the length or magnitude of this cross product can be determined as the fusion value between the target task's task feature vector and the vertical process template's template feature vector. Alternatively, a weighted sum of the target task's task feature vector and the vertical process template's template feature vector can be obtained, yielding a weighted feature vector. Based on this weighted feature vector, the fusion value between the target task's task feature vector and the vertical process template's template feature vector can be determined.
[0315] The task length can be obtained by determining the length of the task feature vector of the target task. The length of the task feature vector of the target task is the magnitude of the task feature vector. Similarly, the template length can be obtained by determining the length of the template feature vector of the vertical process template.
[0316] The semantic matching degree between the target task and the vertical process template can be determined based on the fusion value, task length, and template length.
[0317] For example, the semantic matching degree between the target task and the vertical process template can be represented as follows:
[0318]
[0319] in, The semantic matching degree between the target task and the vertical process template. This represents the task feature vector of the target task. This is the template feature vector of the vertical process template. This is the fusion value between the task feature vector of the target task and the template feature vector of the vertical process template. For task length, For template length, For model.
[0320] In the above embodiments, since the semantic matching degree between the target task and the vertical process template is determined based on the fusion value of the semantic matching degree between the task feature vector of the target task and the template feature vector of the vertical process template, the length of the task feature vector of the target task and the length of the template feature vector of the vertical process template, it not only considers the fusion value of the task feature vector and the template feature vector, but also considers the length of the task feature vector and the template feature vector, which can improve the accuracy and reliability of the semantic matching degree between the target task and the vertical process template.
[0321] In one embodiment, determining the overlap between the target task and the vertical process template based on the multidimensional matching factor of the target task includes: determining the number of tasks with the same features in the task feature vector of the target task and the template feature vector of the vertical process template; determining the total number of tasks with different features in the task feature vector of the target task and the template feature vector of the vertical process template; and determining the overlap between the target task and the vertical process template based on the number of tasks with the same features and the total number of tasks with different features.
[0322] The number of identical features can be determined between the task feature vector of the target task and the template feature vector of the vertical process template. In other words, the number of identical features in the task feature vector of the target task and the template feature vector of the vertical process template can be determined. Identical features can be understood as the same value or information for the same feature. For example, if the task type of the target task and any applicable task type of the vertical process template are the same, it indicates that the task type feature is the same. For instance, if the task type of the target task is e-commerce price comparison, and the applicable task types of the vertical process template include e-commerce price comparison, it can be determined that the task type of the target task and the task type of the vertical process template are the same.
[0323] The total number of distinct features can be determined from the task feature vector of the target task and the template feature vector of the vertical process template. This total number of distinct features can be understood as the total number of unique features. For example, assuming the task feature vector of the target task may include a1, a2, a3, and a4, and the template feature vector of the vertical process template may include a1, a5, a6, and a4, then the total number of distinct features is 6. The total number of distinct features can be a target total number or the difference between the target total number and the number of identical features mentioned above. The target total number is the sum of the number of features included in the task feature vector of the target task and the number of features included in the vertical process template.
[0324] The overlap between the target task and the vertical process template can be determined based on the number of identical features and the total number of different features. Alternatively, the ratio of the number of identical features to the total number of different features can be used to determine the overlap between the target task and the vertical process template.
[0325] For example, the overlap between the target task and the vertical process template can be represented as follows:
[0326]
[0327] in, The degree of overlap between the target task and the vertical process template. This represents the number of identical features in the task feature vector and the template feature vector. for The intersection with B, for The union of B and B, This represents the total number of different features in the task feature vector and the template feature vector.
[0328] In the above embodiments, in determining the overlap between the target task and the vertical process template, not only the number of identical features in the task feature vector of the target task and the template feature vector of the vertical process template are considered, but also the total number of different features in the task feature vector of the target task and the template feature vector of the vertical process template are considered, which can ensure the accuracy and reliability of the overlap between the target task and the vertical process template.
[0329] In one embodiment, determining the fusion similarity between the target task and the vertical process template based on the semantic matching degree and overlap between the target task and the vertical process template includes: obtaining a first weight and a second weight; and performing a weighted summation of the semantic matching degree and overlap between the target task and the vertical process template based on the first weight and the second weight to obtain the fusion similarity between the target task and the vertical process template.
[0330] A first weight and a second weight can be obtained. The first weight can be the weight of the semantic matching degree between the target task and the vertical process template, and the second weight can be the overlap degree between the target task and the vertical process template. The first and second weights can be fixed values or not. Semantic matching degree can be prioritized with overlap degree as a secondary factor, or overlap degree can be prioritized with semantic matching degree as a secondary factor, or both semantic matching degree and overlap degree can be equally important. When semantic matching degree is prioritized with overlap degree as a secondary factor, the first weight is greater than the second weight. When overlap degree is prioritized with semantic matching degree as a secondary factor, the first weight is less than the second weight. When semantic matching degree and overlap degree are equally important, the first weight and the second weight are the same.
[0331] Based on the first and second weights, the semantic matching degree and overlap between the target task and the vertical process template can be weighted and summed to obtain the fusion similarity between the target task and the vertical process template.
[0332] For example, the fusion similarity between the target task and the vertical process template can be represented as follows:
[0333]
[0334] in, As the first weight, As the second weight, and They can be the same or different. and The sum can be 1.
[0335] In the above embodiments, since the fusion similarity between the target task and the vertical process template is a weighted sum of the semantic matching degree and the overlap degree between the target task and the vertical process template, their weights can be determined based on the importance of the semantic matching degree and the overlap degree to the matching of the process template, which can ensure the accuracy and reliability of the determined fusion similarity between the target task and the vertical process template.
[0336] In one embodiment, obtaining the first weight and the second weight includes: determining the task domain of the target task; and obtaining the first weight and the second weight based on the task domain of the target task.
[0337] The task domain of the target task is defined as the domain of the target task. When semantic matching is prioritized over overlap, or vice versa, the contribution of semantic matching and overlap between the task and the vertical process template to the process template matching may differ depending on the task domain, and their weights may also differ. Therefore, the task domain of the target task can be determined first, and then the first and second weights can be obtained based on this domain.
[0338] Semantic analysis can be performed on the target task to determine its task domain. The task domain can also be determined based on the target task's intent.
[0339] It can store the correspondence between task domain, first weight and second weight, and can obtain the first weight and second weight corresponding to the task domain of the target task based on the correspondence.
[0340] In the above embodiments, the task domain of the target task can be determined, and then a first weight and a second weight can be obtained based on the task domain of the target task. Since the contribution of semantic matching degree and overlap to the matching of process templates in different domains is considered, the flexibility of determining the fusion similarity corresponding to vertical process templates in different domains can be improved, thereby ensuring the accuracy and reliability of the fusion similarity corresponding to vertical process templates in different domains.
[0341] In one embodiment, selecting vertical process templates whose fusion similarity satisfies the similarity condition to obtain a first process template includes: when the target fusion similarity is greater than or equal to a first template threshold, selecting a vertical process template corresponding to the target fusion similarity from the process template library to obtain the first process template, where the target fusion similarity is the maximum fusion similarity; when the target fusion similarity is less than the first template threshold but greater than or equal to a second template threshold, selecting M vertical process templates with the maximum fusion similarity from the process template library, where M is an integer greater than 1; and selecting one vertical process template from the M vertical process templates based on the task information of the target task and the tools in the tool library to obtain the first process template.
[0342] Since a higher fusion similarity between a vertical process template and a target task indicates a higher probability of matching, after determining the fusion similarity between the target task and all vertical process templates in the process template library, the highest fusion similarity can be selected from the determined fusion similarities to obtain the target fusion similarity.
[0343] Next, it can be determined whether the target fusion similarity is greater than or equal to the first template threshold. If the target fusion similarity is greater than or equal to the first template threshold, it indicates that the matching degree between the target task and the vertical process template corresponding to the target fusion similarity is high. The vertical process template corresponding to the target fusion similarity can then be selected from the process template library to obtain the first process template. The first template threshold is the minimum fusion similarity required to determine the matching vertical process template. The first template threshold can be a fixed value or determined based on the task type of the target task.
[0344] If the target fusion similarity is less than the first template threshold, it can be further determined whether the target fusion similarity is greater than or equal to the second template threshold. If the target fusion similarity is less than the second template threshold, it indicates that the matching degree between the target task and the vertical process template corresponding to the target fusion similarity is small, and there is no vertical process template matching the target task. If the target fusion similarity is greater than or equal to the second template threshold, it indicates that the matching degree between the target task and the vertical process template corresponding to the target fusion similarity is moderate, and there may be a vertical process template matching the target task. The M vertical process templates with the highest fusion similarity can be selected from the process template library. Then, based on the task information of the target task and the tools in the tool library, one vertical process template can be selected from the M vertical process templates to obtain the first process template. M is an integer greater than 1. For example, M can be 3, 4, or other values. The second template threshold is less than the first template threshold and is a fixed value. For example, the second template threshold can be 0.5, 0.55, or other values.
[0345] Based on the task information of the target task and the tools in the tool library, the LLM can select one vertical process template from M vertical process templates. It can parse and process the user questions included in the target task to obtain the task question, and further refine the task question to obtain the task sub-questions. Based on the task type, task question, and task sub-questions of the target task, the search results, and the tools in the tool library, the LLM can select one vertical process template from M vertical process templates. The search results are the answers found by the LLM for the task question and task sub-questions of the target task.
[0346] In the above embodiments, when the maximum fusion similarity is greater than or equal to the first template threshold, the vertical process template corresponding to the maximum fusion similarity is determined as the process model matching the target task. This ensures that the determined process model is the most suitable vertical process template, improving the accuracy and reliability of process template matching. When the maximum fusion similarity is less than the first template threshold but greater than or equal to the second template threshold, based on the task information of the target task and the tools in the tool library, a process model matching the target task is selected from the M vertical process templates with the highest fusion similarity. This ensures that the selected process model is the most suitable vertical process model. Therefore, different ranges of maximum fusion similarity lead to different methods of determining the matching process model, which can improve the flexibility and success rate of determining the matching process model.
[0347] In one embodiment, the task processing method further includes: obtaining the correspondence between task types and template thresholds; and obtaining the template threshold corresponding to the task type of the target task based on the correspondence between task types and template thresholds to obtain a first template threshold.
[0348] Because the minimum fusion similarity required to determine the matching vertical process template may differ depending on the type of task, a correspondence between task type and template threshold can be obtained. This allows us to determine the task type of the target task and, based on the correspondence, obtain the template threshold corresponding to the task type of the target task, thus obtaining the first template threshold.
[0349] The first template threshold for the target task type can be determined based on user satisfaction, task execution status, and the accuracy of the test set corresponding to the target task type. User satisfaction refers to user satisfaction with the vertical workflow template corresponding to the target task type. Task execution status refers to the processing performance of the vertical workflow template for the target task type. Task execution status can include task completion status, user cancellation status, task timeout status, and task exception status. The test set for the target task type is the set of tasks used to test the vertical workflow template for the target task type.
[0350] In the above embodiments, different task types correspond to different template thresholds. Therefore, a first template threshold can be determined based on the task type first, and then a process template matching the task can be queried based on the first template threshold, which can ensure the accuracy and reliability of the queried matching process templates.
[0351] In one embodiment, the first process template is fused with the prompts from the large language model to obtain a fusion result, including: extracting the step sequence, parameter examples, scene constraints, and exception handling rules from the first process template; fusing the step sequence, parameter examples, scene constraints, and exception handling rules from the first process template, the multidimensional matching factors of the target task, and the prompts from the large language model to obtain the fusion result.
[0352] The step sequence, parameter examples, scene constraints, and exception handling rules can be extracted from the first process template. The prompt words of the large language model can be obtained. Then, the step sequence, parameter examples, scene constraints, and exception handling rules of the first process template, the multi-dimensional matching factors of the target task, and the prompt words of the large language model can be integrated. In other words, the step sequence, parameter examples, scene constraints, and exception handling rules of the first process template, as well as the multi-dimensional matching factors of the target task, are fully integrated into the prompt words of the large language model to obtain the fusion result.
[0353] In one embodiment, the multidimensional matching factor of the target task mentioned above can be replaced with the structured task information of the target task.
[0354] The fusion result may include information such as non-skippable steps, parameter input specifications, and exception handling priorities. Non-skippable steps are those steps in the first workflow template that cannot be skipped or must be executed during the processing of the target task. Parameter input specifications are the rules or specifications for entering or writing parameter values. Exception handling priorities are the steps that are executed first when handling exceptions.
[0355] For example, assuming the target task is an e-commerce price comparison task and the first process template is the e-commerce price comparison template mentioned above, the fusion result can be as follows:
[0356] # Role
[0357] You are an enhanced ReACT planner for e-commerce price comparison scenarios. You need to strictly follow the provided process template and generate tool call sequences based on real-time feedback.
[0358] # Core Constraints
[0359] 1. Key steps that cannot be skipped: Product analysis (step 1), platform switching (step 6), and data statistics (step 7);
[0360] 2. Parameter entry guidelines: Core keywords must include the product model (256G), and the platform list must cover Platform 1, Platform 2, and Platform 3;
[0361] 3. Exception handling priority: Skip the exception if the platform is inaccessible, and notify the user if the ticket number is duplicated.
[0362] # Process Template Reference (E-commerce Price Comparison Template v1.1)
[0363] {matched_template_steps} #Matching template steps
[0364] # Current task information
[0365] {structured_task_description} #Structured task information
[0366] # Performed actions and feedback
[0367] {execution_history} Execution history
[0368] # Planning Requirements
[0369] 1. Follow the template steps in sequence first, and fill in the step parameters with the current task entity information (e.g., product model 256G);
[0370] 2. If the feedback does not match the template's expectations (e.g., API call failure), the template's pre-defined exception handling steps will be executed first.
[0371] 3. If the exception handling steps fail, local steps can be adjusted (such as switching the tool invocation method) while keeping the core constraints unchanged.
[0372] 4. Do not generate operations that conflict with the core logic of the template (such as skipping price comparison on a certain platform or omitting the extraction of promotional information);
[0373] 5. Outputs structured tool call commands (tool name, action, parameters, step ID), eliminating the need for redundant thought processes.
[0374] In the above embodiments, because the fusion result integrates the step sequence of the process template, parameter examples, scenario constraints, and exception handling rules, the multi-dimensional matching factors of the task, and the prompts from the large language model, a tool call sequence can be accurately generated in one go based on the fusion result. This avoids repeatedly determining the required tools, reduces the number of tool determinations, and thus reduces tool determination time, thereby improving task processing efficiency and response rate. Since the generated tool call sequence has high precision and accuracy, it ensures that tools are called according to specifications, improving the success rate of tool calls and thus improving the success rate of task processing.
[0375] In one embodiment, the task processing method further includes: if the first processing result of the target task is failure, performing exception handling based on the exception handling rules in the first process template; if the exception handling fails, determining the steps to be adjusted in the first process template based on the first processing result and the unprocessed steps in the first process template; adjusting the steps to be adjusted in the first process template to obtain a second process template; and processing the target task based on the second process template to obtain a second processing result of the target task.
[0376] After obtaining the first processing result of the target task, this result can be identified. If the first processing result is successful, the answer to the target task can be output based on this result. If the first processing result is unsuccessful, exception handling can be performed according to the exception handling rules in the first process template, i.e., the exception handling steps in the first process template can be executed. After exception handling is completed, the processing result can be identified. If the exception handling result is successful, and the target task is not yet completed, processing can continue; if the target task is completed, the answer to the target task can be output based on the exception handling result.
[0377] If the exception handling fails, the steps to be adjusted in the first process template can be determined based on the first processing result and the unprocessed steps in the first process template. It should be understood that the steps to be adjusted in the first process template are non-critical steps. The logic of the critical steps in the first process template cannot be modified. For example, critical steps could be product parsing, data validation, etc.
[0378] Based on the task's problems, the current execution steps, the first processing result, and the unprocessed steps in the first process template, the steps to be adjusted in the first process template can be determined. The unprocessed steps in the first process template are those steps that were not successfully executed in the first process template.
[0379] Then, the steps to be adjusted in the first process template can be modified to obtain the second process template. The target task can then be processed based on the second process template to obtain the second processing result. Adjustments to the steps to be adjusted in the first process template can include modifying the parameters of the steps, the tool invocation methods of the steps, or both the parameters and the tool invocation methods of the steps. It should be understood that the first and second process templates should satisfy the conditions of unchanged step dependencies and achievable task objectives.
[0380] The first processing result of the target task can include the processing result of one step of the target task, or it can include the processing results of all steps of the target task. The processing result of a step can include at least one of the following: step status information, result data, error information, and exception reason. Step status information indicates whether the step was executed successfully. Step status information can be either success or failure. Step result data is the data content obtained after the step is executed. Step error information indicates that the step failed. Step error information can be an error code. The exception reason is the reason why the step failed.
[0381] Since task processing requires sequential execution of steps, after generating the first tool call sequence, the first step in the first process template can be determined first. Based on the first tool call sequence, the first tool corresponding to the first step in the first process template can be identified. Parameter validation rules can be used to validate the parameters used by the first tool. If validation fails, it indicates that the input parameters are invalid, and the first tool is not called to process the target task. This avoids invalid calls, thereby reducing power consumption and improving task processing efficiency. If validation passes, it indicates that the input parameters are valid, and the first tool can be called to process the target task, obtaining the processing result of the first step.
[0382] During the process of using the first tool to process the target task, the execution status, execution time, error codes, and returned data of the first tool can be monitored. After the first tool completes its processing, the processing result of the first tool can be generated based on its status information, execution time, error codes, and returned data. Feedback information of the first tool can be generated based on its processing result, and the processing result of the first step can be determined based on the feedback information. The execution status of the tool can be successful, failed, or in progress. The tool's status information indicates whether the tool has successfully processed the task; it can be successful or failed. The execution time of the tool is the time taken by the tool to process the task. The error code of the tool is the error code for a failed execution. The returned data of the tool is the data content obtained after the tool has completed processing. The feedback information of the first tool can be structured feedback information.
[0383] Key feedback information can be extracted from the processing results of the first tool, and structured feedback information can be generated based on this key feedback information. Key feedback information may include data content, error codes, status information, and reasons for exceptions. For example, assuming the target task is an e-commerce price comparison task, and the first process template is an e-commerce price comparison template, the structured feedback information generated based on the processing results of the e-commerce platform API tool could be as follows:
[0384] {
[0385] "execution_id": "exec_20251120_001", # Template identifier
[0386] "step_id": "step3", #step identifier
[0387] "tool_name": "E-commerce platform API tool", #tool name
[0388] "action": "search_product", #Action: Search for product
[0389] "status": "failed", #Status: Failed
[0390] "error_code": "API_403", #error code
[0391] "error_reason": "Platform API key expired", #Reason for error
[0392] "execution_time": 2000, #Execution duration
[0393] "return_data": {}, # The data content returned.
[0394] "suggested action": "Switch to browser search mode and execute step 3", #suggested action
[0395] "template_matching": "Matches with template exception handling rule (API call failed)" #template matching
[0396] }
[0397] If the status information, execution time, error code, or return data of the first tool is in a non-standard format, the status information, execution time, error code, or return data of the first tool can be standardized and mapped to obtain the status information, execution time, error code, or return data of the first tool in a standard format.
[0398] During the generation of feedback information for the first tool, key feedback information that affects the progress of the target task can be marked with high priority. Key feedback information may include tool call failure, data validation failure, etc.
[0399] If the first step fails, exception handling is performed based on the exception handling rules corresponding to the first step. If exception handling fails, based on the first step, its execution result, and unprocessed steps, the steps to be adjusted in the first process template are determined. These steps can be adjusted to obtain the second process template. If the first step succeeds, or if exception handling succeeds, the second step in the first process template can be determined. The above operation is repeated until all steps in the first process template have been executed. The first step is a step within the first process template. The second step is a step following the first step in the first process template.
[0400] It can be determined whether the version of the first tool is compatible with the tool version required in the first step. If the version of the first tool is compatible, it can be invoked to process the target task. If the version of the first tool is incompatible with the tool version required in the first step, a version of the first tool that is compatible with the tool version required in the first step can be invoked to process the target task, or a second tool can be invoked to process the target task. The second tool is a substitute for the first tool. For example, if the e-commerce application programming interface (API) tool is unavailable, a browser tool can be switched to.
[0401] The target task is processed based on the second process template to obtain a second processing result. This second process template can be fused with prompts from the large language model to obtain a second fusion result. Based on this second fusion result, a third tool invocation sequence can be generated using the large language model. The tools in this third tool invocation sequence can then be used to process the target task to obtain the second processing result. A detailed description can be found in the process of processing the target task based on the first process template, and will not be repeated here.
[0402] In the above embodiments, in the event of task processing failure, exception handling rules in the process template can be used to guide the LLM to handle exceptions according to specifications, preventing task interruption and ensuring normal task execution, thereby improving the success rate and efficiency of task processing. Furthermore, in the event of exception handling failure, non-critical steps in the process template can be modified so that the task can be processed based on the modified process template, preventing task interruption and ensuring normal task processing, thus improving the success rate and efficiency of task processing.
[0403] In one embodiment, the task processing method further includes: when the task requirements of the target task conflict with the target constraints of the first process template, outputting a prompt message to indicate whether to modify the target constraints; in response to a confirmation operation on the prompt message, displaying a modification area including the target constraints; in response to a modification operation on the modification area, modifying the target constraints of the first process template to obtain a third process template; and fusing the first process template with the prompt words of the large language model to obtain a fusion result, including: fusing the third process template with the prompt words of the large language model to obtain a fusion result.
[0404] The task requirements of the target task are the set of objectives, conditions, constraints, and requirements that must be met to complete the target task. The target constraints of the first process template are one or more constraints in the first process template.
[0405] The task requirements of the target task can be determined. Then, it can be determined whether there are any target constraints in the first process template that conflict with the task requirements of the target task. If there are target constraints in the first process template that conflict with the task requirements of the target task, that is, if the task requirements of the target task conflict with the target constraints of the first process template, it means that the first process template cannot meet the task requirements of the target task. A prompt message can be output to ask the user whether to modify the target constraints in the first process template. This allows the user to determine the conflict between the task requirements of the target task and the target constraints in the first process template based on the prompt message, which can improve the interactivity and fun of the interaction.
[0406] When a user needs to modify the target constraints in the first process template, the user can confirm the prompt message. Correspondingly, in response to the confirmation, a modification area including the target constraints can be displayed. The user can then modify the target constraints in this area. Consequently, in response to the modification of this area, the target constraints of the first process template can be modified to obtain a third process template. This third process template can then be fused with the prompts from the large language model to obtain the fusion result. The third process template and its version number can also be stored.
[0407] For example, suppose the target task is an e-commerce price comparison task, the first process template is the e-commerce price comparison template mentioned above, the e-commerce price comparison task requires comparison only on platform 1, and the e-commerce price comparison template includes 3 price comparison platforms by default. Since the requirements of the price comparison platforms conflict, a prompt message can be output asking whether to modify the price comparison platforms in the e-commerce price comparison template. In response to the confirmation operation of the prompt message, a modification area including the platform list can be displayed. In response to the modification operation of the platform list parameters, the platform list parameters of the e-commerce price comparison template can be modified.
[0408] In the above embodiments, when there is a conflict between the task requirements and the constraints of the matching process template, a prompt message can be output to indicate whether the constraints should be modified. This allows the user to determine the conflict between the target task's requirements and the constraints in the process template, improving the interactivity and engagement of the interaction. Users can modify the conflicting constraints in the process template as needed to process the task, avoiding situations where the task cannot be processed due to unmet requirements, thus improving the task processing success rate and efficiency.
[0409] In one embodiment, the task processing method further includes: generating a second tool call sequence based on a general process template in a process template library when the target fusion similarity is less than a second template threshold; and processing the target task based on the tools in the second tool call sequence to obtain a third processing result of the target task.
[0410] If the target fusion similarity is less than the second template threshold, it indicates that there is no vertical process template matching the target task. The general process template in the process template library can be identified as the process template matching the target task. A second tool call sequence can be generated based on the general process template. Then, the target task can be processed based on the tools in the second tool call sequence to obtain the third processing result of the target task.
[0411] The process can begin by identifying the first step in the general workflow template. Based on the second tool call sequence, the first tool corresponding to this first step can be determined. Parameter validation rules can be used to validate the parameters used by the first tool. If validation fails, it indicates that the input parameters are invalid, and the first tool is not called to process the target task, thus avoiding invalid calls, reducing power consumption, and improving task processing efficiency. If validation passes, it indicates that the input parameters are valid, and the first tool can be called to process the target task, obtaining the processing result of the first step. If the processing result of the first step fails, the LLM analyzes the reason for the failure and calls the first tool again to process the target task, and so on. After a preset number of failures in the first step, a prompt message indicating that the target task processing has failed can be output. If the processing result of the first step succeeds, the second step in the general workflow template can be determined, and the above operation is repeated until all steps in the general workflow template have been executed. The first step is a step within the general workflow template. The second step is the next step after the first step in the general workflow template.
[0412] If the target fusion similarity is less than the second template threshold, a vertical process template corresponding to the scene features of the target task can be output as a prompt. This allows users to determine whether a vertical process template for that scene is available, improving interactivity and engagement. When a user needs to add a vertical process template for the corresponding scene, the system can respond to the confirmation of the prompt by displaying a process template editing page and save the added vertical process template by saving the edits made on the process template editing page.
[0413] In the above embodiments, when the target fusion similarity is less than the second template threshold, the target task is processed based on the general process template, which can provide a reference for the processing of the target task and improve the success rate of task processing.
[0414] In one embodiment, the task processing method further includes: in response to an extension request for a process template, displaying a new control and a modification control on a process template extension page; in response to a trigger operation on a new control, displaying a first process template editing page; in response to an editing operation on an area to be edited in the first process template editing page, displaying editing information in the area to be edited in the first process template editing page; in response to a save operation on the edited information in the first process template editing page, generating a fourth process template based on the edited information in the first process template editing page; in response to a trigger operation on a modification control, displaying a process template list; in response to a selection operation on a fifth process template in the process template list, displaying information of the fifth process template on a second process template editing page; in response to a modification operation on target information in the second process template editing page, displaying the modified information; and in response to a save operation on information in the second process template editing page, generating a sixth process template based on the information in the second process template editing page.
[0415] Upon receiving a request to expand a process template, the system can respond by displaying new and modified controls on the process template expansion page. If a user needs to add a process template not currently in the template library, they can trigger an operation on the new control displayed on the expansion page. Correspondingly, in response to this triggering operation, the first process template editing page can be displayed. This first editing page can include multiple areas to be edited. These areas are for editing information required by the process template. This information may include scenario information, tool information, step information, exception handling rules, etc. Users can edit these areas as needed. Correspondingly, in response to editing operations on these areas, the system can display the edited information on the first process template editing page. If the user confirms that the edited information on the first process template editing page is correct, they can save the edited information. Correspondingly, in response to saving the edited information on the first process template editing page, a fourth process template can be generated based on the edited information on the first process template editing page. The "Extend Process Template" request is used to extend the process template. The "Process Template Extension Page" is the page used to display controls for the extended process template. The "Add Control" is the control used to trigger the addition of a new control to the process template. The "First Process Template Editing Page" is the page used to edit the information required for the process template. The edited information is the information entered by the user.
[0416] When a user needs to modify an existing process template, they can trigger an operation on the modification control in the process template extension page. Correspondingly, a process template list is displayed in response to the triggering of the modification control. The user can update the displayed process templates in the process template list by sliding the process templates through the list. When a user needs to modify the fifth process template in the process template list, they can select that template. Correspondingly, the information of the fifth process template is displayed on the second process template editing page in response to the selection. When a user needs to modify target information in the fifth process template, they can modify that target information on the second process template editing page. Modification operations can include at least one of the following: modifying steps, modifying parameters, modifying exception handling rules, etc. Correspondingly, the modified information is displayed in response to the modification of the target information on the second process template editing page. Once the user confirms that the information on the second process template editing page is correct, they can save the information. Accordingly, in response to a save operation on the information in the second process template editing page, a sixth process template can be generated based on the information in the second process template editing page. The modification control is used to trigger modifications to the process template. The first process template editing page is the page used to edit process templates. The process template list is a list of process templates in the process template library. The second process template editing page is the editing page for the fifth process template. The target information is the information in the fifth process template that needs to be modified.
[0417] For example, such as Figure 3 As shown, the fourth or sixth process template can first undergo automatic review. If the automatic review passes, the template can then undergo manual review. If the manual review passes, the template can be saved. If either the automatic or manual review fails, suggested modifications can be generated for the fourth or sixth process template, allowing users to make changes based on these suggestions. These suggestions may include issues such as missing dependencies or missing tools.
[0418] The process template can include a version number. When storing the fourth or sixth process template, the version number of the fourth or sixth process template can also be stored.
[0419] The version number of a process template can include a major version number and a minor version number. For example, the version number of a process template can be XY, where X is the major version number and Y is the minor version number. For instance, the version number of the process template is 1.0, where "1" is the major version number and "0" is the minor version number. The major version number of the process template can be updated when key steps or application scenarios are updated. The minor version number of the process template can be updated when parameters or exception handling rules are updated.
[0420] The updated information in the sixth process template relative to the fifth process template can be determined. If the updated information is a critical step or application scenario, the major version number of the fifth process template can be updated to obtain the version number of the sixth process template. If the updated information is parameters or exception handling rules, the minor version number of the fifth process template can be updated to obtain the version number of the sixth process template.
[0421] A sixth process template can be stored, but the fifth process template is not deleted. Therefore, different versions of process templates can be stored so that if one version encounters a problem, another version can be used, ensuring the availability of the process templates. For example, if a newer version of the process template encounters a problem, the system can switch to an older version, guaranteeing the availability of the process template.
[0422] It can record change logs for process templates. The change log for process templates can include information such as who modified the process template, the time of modification, and the content of the modification.
[0423] After generating a new process template, it can be made visible only to some users, and then made visible to all users after collecting feedback.
[0424] In the above embodiments, the process template can be expanded to ensure its richness. Furthermore, the process template can be expanded based on user needs, thus meeting user requirements and improving its flexibility.
[0425] In one embodiment, such as Figure 4As shown, the architecture can include a support layer, a core layer, and a user layer. The support layer can include a tool library and a domain knowledge base. The tool library can provide atomic tools, support the Model Context Protocol (MCP), and other protocols. The domain knowledge base is a system for structured storage, management, and reuse of knowledge within a specific technical field, providing expertise across different domains. The user layer can include regular users and advanced users (or developers). Regular users perform task detection. Advanced users (or developers) extend process templates. The core layer can include a task parsing module, a vector retrieval engine, a process template library, an enhanced ReACT planner, a tool invocation execution layer, an execution feedback module, and a process template management and extension module.
[0426] like Figure 4 and Figure 5 As shown, ordinary users can input tasks. For example, a task could be "Compare prices for XXX mobile phones 256G". After receiving the task input by the user, the task parsing module can parse the task input to obtain the task type, scenario characteristics, core keywords, and task tools. Based on the task type, scenario characteristics, core keywords, and task tools, it can generate structured task information for the task.
[0427] The vector retrieval engine can generate task feature vectors based on structured task information. Based on these feature vectors, it can calculate the fusion similarity between the task and vertical process templates in the process template library. Based on the maximum fusion similarity, it can determine if an optimal matching vertical process template exists. If an optimal matching template exists, it retrieves it from the process template library. If no optimal matching template exists, it can determine if a usable reference vertical process template exists based on the maximum fusion similarity. If a usable reference template exists, it selects the M vertical process templates with the highest fusion similarity from the process template library, and the LLM selects one from these M templates. If no usable reference template exists, it can return a general process template and output the vertical process template corresponding to the scene features used to prompt whether to add a task. If the maximum fusion similarity is greater than or equal to a first template threshold, an optimal matching vertical process template is confirmed to exist. If the maximum fusion similarity is less than the first template threshold but greater than or equal to a second template threshold, a usable reference vertical process template is confirmed to exist.
[0428] The enhanced ReACT planner fuses the matched vertical workflow template with LLM prompts. Based on the fusion result, the LLM generates a first tool call sequence, then determines the first step in the vertical workflow template. The tool call execution layer invokes the tool corresponding to the first step in the first tool call sequence to process the task. The execution feedback module determines structured feedback information based on the processing result of the tool corresponding to the first step. The enhanced ReACT planner can determine whether the task is completed. If the task is completed, it outputs the task result, i.e., the answer content. If the task is not completed, it determines whether the feedback meets the template expectations based on the structured feedback information. If the feedback meets the template expectations, it determines the next step according to the matched vertical workflow template. If the feedback does not meet the template expectations, it determines whether to trigger the exception handling of the matched vertical workflow template based on the structured feedback information. If the exception handling of the matched vertical workflow template is triggered, it executes the preset exception handling steps in the matched vertical workflow template. It can determine whether the exception handling is successful. If the exception handling is successful, it determines the next step according to the matched vertical workflow template. If the exception handling of the matching vertical process template is not triggered, or if the exception handling fails, the steps to be adjusted in the vertical process template can be identified and adjusted.
[0429] LLM can generate an initial tool call sequence based on a general process template. It can then generate a second tool call sequence that conforms to the template constraints. Next, it can determine the first step in the general process template. The tool call execution layer can then call the tool corresponding to the first step in the second tool call sequence to process the task. It can determine whether the task is completed. If the task is completed, it can output the task result, i.e., the answer content. If the task is not completed and the first step's processing result is a failure, it can analyze the reason for the failure and, based on the reason, call the tool corresponding to the first step in the second tool call sequence again to process the task. After a preset number of failures in the first step, it can output a prompt message indicating task processing failure. If the task is not completed and the first step's processing result is a success, it can determine the next step according to the general process template and repeat the above operations until all steps in the general process template have been executed.
[0430] like Figure 4 As shown, advanced users can extend the process templates in the process template library through the process template management and extension module.
[0431] 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.
[0432] It should be understood that the same or corresponding information in different embodiments can be referenced to each other.
[0433] 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.
[0434] In one embodiment, such as Figure 6 As shown, a task processing apparatus is provided, comprising:
[0435] The determination module 601 is used to determine the multidimensional matching factor of the target task in response to the processing request of the target task. The multidimensional matching factor of the target task is the feature of the target task in multiple dimensions.
[0436] Query module 602 is used to query the first process template that matches the target task based on the multidimensional matching factors of the target task;
[0437] The fusion module 603 is used to fuse the first process template with the prompt words of the large language model to obtain the fusion result;
[0438] The generation module 604 is used to generate the first tool call sequence based on the fusion result and the large language model;
[0439] The processing module 605 is used to process the target task based on the tools in the first tool call sequence to obtain the first processing result of the target task.
[0440] In one embodiment, the query module 602 is specifically used to: determine the semantic matching degree between the target task and the vertical process template in the process template library based on the multidimensional matching factor of the target task; determine the overlap between the target task and the vertical process template based on the multidimensional matching factor of the target task; determine the fusion similarity between the target task and the vertical process template based on the semantic matching degree and the overlap; and select the vertical process template whose fusion similarity satisfies the similarity condition to obtain the first process template.
[0441] In one embodiment, the query module 602 determines the semantic matching degree between the target task and the vertical process templates in the process template library based on the multidimensional matching factor of the target task, including: determining the task feature vector of the target task based on the multidimensional matching factor of the target task; determining the fusion value between the task feature vector and the template feature vector of the vertical process template in the process template library; determining the length of the task feature vector of the target task to obtain the task length; determining the length of the template feature vector of the vertical process template to obtain the template length; and determining the semantic matching degree between the target task and the vertical process template based on the fusion value, the task length, and the template length.
[0442] In one embodiment, the query module 602 determines the overlap between the target task and the vertical process template based on the multidimensional matching factor of the target task, including: determining the number of tasks with the same features in the task feature vector and the template feature vector; determining the total number of tasks with different features in the task feature vector and the template feature vector; and determining the overlap between the target task and the vertical process template based on the number of tasks with the same features and the total number of tasks with different features.
[0443] In one embodiment, the query module 602 determines the fusion similarity between the target task and the vertical process template based on semantic matching degree and overlap degree, including: obtaining a first weight and a second weight; and performing a weighted summation of semantic matching degree and overlap degree based on the first weight and the second weight to obtain the fusion similarity between the target task and the vertical process template.
[0444] In one embodiment, the query module 602 obtains a first weight and a second weight by: determining the task domain of the target task; and obtaining the first weight and the second weight based on the task domain of the target task.
[0445] In one embodiment, the query module 602 selects vertical process templates whose fusion similarity satisfies the similarity condition to obtain a first process template, including: when the target fusion similarity is greater than or equal to a first template threshold, selecting a vertical process template corresponding to the target fusion similarity from the process template library to obtain a first process template, wherein the target fusion similarity is the largest fusion similarity; when the target fusion similarity is less than the first template threshold but greater than or equal to a second template threshold, selecting M vertical process templates with the largest fusion similarity from the process template library, wherein M is an integer greater than 1; and selecting a vertical process template from the M vertical process templates based on the task information of the target task and the tools in the tool library to obtain the first process template.
[0446] In one embodiment, the task processing device further includes: an acquisition module, configured to acquire a correspondence between task types and template thresholds; the acquisition module is further configured to acquire a template threshold corresponding to the task type of the target task based on the correspondence, thereby obtaining a first template threshold.
[0447] In one embodiment, the processing module 605 is further configured to perform exception handling based on the exception handling rules in the first process template if the first processing result is a failure; and to determine the steps to be adjusted in the first process template based on the first processing result and the unprocessed steps in the first process template if the exception handling fails. The task processing device further includes: an adjustment module, configured to adjust the steps to be adjusted in the first process template to obtain a second process template; and the processing module 605 is further configured to process the target task based on the second process template to obtain a second processing result of the target task.
[0448] In one embodiment, the task processing device further includes: an output module, configured to output a prompt message indicating whether to modify the target constraints when the task requirements of the target task conflict with the target constraints of the first process template; a display module, configured to display a modification area including the target constraints in response to a confirmation operation on the prompt message; a modification module, configured to modify the target constraints of the first process template in response to a modification operation on the modification area to obtain a third process template; and a fusion module 603, specifically configured to fuse the third process template with the prompt words of the large language model to obtain a fusion result.
[0449] In one embodiment, the generation module 604 is further configured to generate a second tool call sequence based on a general process template in the process template library when the target fusion similarity is less than the second template threshold; the processing module 605 is further configured to process the target task based on the tools in the second tool call sequence to obtain a third processing result of the target task.
[0450] In one embodiment, the multidimensional matching factors of the target task include the basic information of the target task and the task tools. The determining module 601 is specifically used to: extract entity information from the target task to obtain the task entity of the target task; perform semantic analysis on the target task based on the task entity of the target task to obtain the basic information of the target task; and select the tools required for the target task from the tool library based on the basic information of the target task to obtain the task tools of the target task.
[0451] In one embodiment, the basic information of the target task includes at least one of the target task's task type, scene characteristics, and core keywords; the determining module 601 performs semantic analysis on the target task based on the target task's task entity to obtain the target task's basic information, including: performing semantic analysis on the target task based on the target task's task entity to obtain the target task's task intent, task type, and scene characteristics; summarizing the target task's behavior based on the target task's task intent, task type, and scene characteristics to obtain the target task's behavioral keywords; and determining the target task's core keywords based on the target task's task entity and behavioral keywords.
[0452] 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.
[0453] 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 7As 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.
[0454] Those skilled in the art will understand that Figure 7 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.
[0455] 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.
[0456] 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.
[0457] 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.
[0458] 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.
[0459] 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.
[0460] 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.
[0461] 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, a multidimensional matching factor for the target task is determined, wherein the multidimensional matching factor is a feature of the target task in multiple dimensions; Based on the multidimensional matching factors, query the first process template that matches the target task; The first process template is fused with the prompt words of the large language model to obtain the fusion result; Based on the fusion results, a first tool call sequence is generated using the large language model; The target task is processed based on the tools in the first tool call sequence to obtain the first processing result of the target task.
2. The method according to claim 1, characterized in that, The first process template for querying the target task based on the multidimensional matching factors includes: Based on the multidimensional matching factors, the semantic matching degree between the target task and the vertical process templates in the process template library is determined; Based on the multidimensional matching factor, the overlap between the target task and the vertical process template is determined; Based on the semantic matching degree and the overlap degree, the fusion similarity between the target task and the vertical process template is determined; Select the vertical process template that satisfies the similarity condition in the fusion similarity to obtain the first process template.
3. The method according to claim 2, characterized in that, The step of determining the semantic matching degree between the target task and the vertical process templates in the process template library based on the multidimensional matching factor includes: Based on the multidimensional matching factors, the task feature vector of the target task is determined; Determine the fusion value between the task feature vector and the template feature vector of the vertical process template in the process template library; Determine the length of the task feature vector of the target task to obtain the task length; Determine the length of the template feature vector of the vertical process template to obtain the template length; Based on the fusion value, the task length, and the template length, the semantic matching degree between the target task and the vertical process template is determined.
4. The method according to claim 3, characterized in that, Determining the overlap between the target task and the vertical process template based on the multidimensional matching factor includes: In the task feature vector and the template feature vector, determine the number of elements with the same features; In the task feature vector and the template feature vector, determine the total number of different features; The overlap between the target task and the vertical process template is determined based on the number of identical features and the total number of different features.
5. The method according to claim 2, characterized in that, The step of determining the fusion similarity between the target task and the vertical process template based on the semantic matching degree and the overlap degree includes: Obtain the first and second weights; Based on the first weight and the second weight, the semantic matching degree and the overlap degree are weighted and summed to obtain the fusion similarity between the target task and the vertical process template.
6. The method according to claim 5, characterized in that, The process of obtaining the first weight and the second weight includes: Determine the task domain of the target task; The first weight and the second weight are obtained based on the task domain.
7. The method according to claim 2, characterized in that, The step of selecting a vertical process template whose fusion similarity satisfies the similarity condition to obtain a first process template includes: If the target fusion similarity is greater than or equal to the first template threshold, a vertical process template corresponding to the target fusion similarity is selected from the process template library to obtain the first process template, wherein the target fusion similarity is the maximum fusion similarity. If the target fusion similarity is less than the first template threshold but greater than or equal to the second template threshold, select the M vertical process templates with the highest fusion similarity from the process template library, where M is an integer greater than 1; Based on the task information of the target task and the tools in the tool library, a vertical process template is selected from the M vertical process templates to obtain the first process template.
8. The method according to claim 7, characterized in that, The method further includes: Obtain the correspondence between task types and template thresholds; Based on the correspondence, the template threshold corresponding to the task type of the target task is obtained, and the first template threshold is obtained.
9. The method according to claim 1, characterized in that, The method further includes: If the first processing result is a failure, exception handling is performed based on the exception handling rules in the first process template. In the event of failure of the exception handling, based on the first processing result and the unprocessed steps in the first process template, the steps to be adjusted in the first process template are determined; The steps to be adjusted in the first process template are adjusted to obtain the second process template; The target task is processed based on the second process template to obtain the second processing result of the target task.
10. The method according to claim 1, characterized in that, The method further includes: If the task requirements of the target task conflict with the target constraints of the first process template, a prompt message is output to indicate whether the target constraints should be modified. In response to a confirmation action on the prompt message, a modification area including the target constraint is displayed; In response to the modification operation on the modified area, the target constraints of the first process template are modified to obtain the third process template; The step of fusing the first process template with the prompt words of the large language model to obtain the fusion result includes: The third process template is fused with the prompt words of the large language model to obtain the fusion result.
11. The method according to claim 7, characterized in that, The method further includes: If the target fusion similarity is less than the second template threshold, a second tool call sequence is generated based on the general process template in the process template library; The target task is processed based on the tools in the second tool call sequence to obtain the third processing result of the target task.
12. The method according to claim 1, characterized in that, The multidimensional matching factors for the target task include the basic information and tools of the target task. Determining the multidimensional matching factors for the target task includes: Extract entity information from the target task to obtain the task entity of the target task; Based on the task entity, semantic analysis is performed on the target task to obtain the basic information of the target task; Based on the aforementioned basic information, the tools required for the target task are selected from the tool library to obtain the task tools for the target task.
13. The method according to claim 12, characterized in that, The basic information of the target task includes at least one of the following: the task type, scenario characteristics, and core keywords of the target task; The semantic analysis of the target task based on the task entity to obtain the basic information of the target task includes: Based on the task entity, semantic analysis is performed on the target task to obtain the task intent, task type, and scene characteristics of the target task. Based on the task intent, the task type, and the scene characteristics, the behavior of the target task is summarized to obtain the behavioral keywords of the target task; Based on the task entity and the behavioral keywords, the core keywords of the target task are determined.
14. A task processing device, characterized in that, include: A determination module is used to determine a multidimensional matching factor of the target task in response to a processing request for the target task, wherein the multidimensional matching factor is a feature of the target task in multiple dimensions; The query module is used to query a first process template that matches the target task based on the multidimensional matching factors; The fusion module is used to fuse the first process template with the prompt words of the large language model to obtain the fusion result; A generation module is used to generate a first tool call sequence based on the fusion result and the large language model; The processing module is used to process the target task based on the tools in the first tool call sequence to obtain the first processing result of the target task.
15. 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 13.
16. 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 13.
17. 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 13.