Search

CN-121981250-A - User request processing method, terminal equipment and computer program product

CN121981250ACN 121981250 ACN121981250 ACN 121981250ACN-121981250-A

Abstract

The application is applicable to the technical field of intelligent agents, and provides a user request processing method, terminal equipment and a computer program product, wherein the method comprises the following steps: by analyzing the user request and combining the history session context and the callable tool, a task tree containing subtask decomposition is dynamically generated and further converted into a code-form target task graph which clearly defines the execution sequence and the dependency relationship. The task generation method is not limited by a preset flow, can intelligently understand and decompose open-domain and fuzzy user natural language instructions, and generates an executable plan matched with the open-domain and fuzzy user natural language instructions in real time according to a dynamic change environment or an unforeseen scene, the task graph in a code form can be directly scheduled and executed, the execution efficiency is improved, and meanwhile, by integrating historical session information, the system can make a context-aware decision, so that the task plan has continuity and intelligence, and more accurate and coherent services are provided for users.

Inventors

  • ZHENG ZHENGFANG
  • ZHANG LE

Assignees

  • 金蝶软件(中国)有限公司

Dates

Publication Date
20260505
Application Date
20251205

Claims (10)

  1. 1. A method for processing a user request, comprising: responding to a received user request, and analyzing the user request to obtain a user task to be executed; acquiring historical session information and a preset callable tool, wherein the callable tool is a preset tool for completing user request permission calling; planning the user task according to the historical session information and the callable tool to generate a task tree of the user task, wherein the task tree comprises subtasks to be executed; Generating a target task graph in a code form according to a preset prompt word and the task tree, wherein the target task graph is a structured script for representing the execution sequence of the subtasks and the dependency relationship between the subtasks; And executing the target task graph to obtain a task execution result.
  2. 2. The method for processing a user request according to claim 1, wherein the generating a code-form target task graph according to a preset prompt word and the task tree includes: generating an initial task graph in a code form according to a preset prompt word and the task tree; The initial task graph is subjected to examination processing to obtain an examination result, wherein the examination processing comprises examination whether the grammar of codes in the initial task graph meets a preset specification and/or examination whether the codes in the initial task graph can complete the user request; And if the examination result represents that the error exists in the initial task graph, correcting the initial task graph to obtain the target task graph.
  3. 3. The method for processing a user request according to claim 2, wherein after performing an examination process on the initial task graph to obtain an examination result, the method further comprises: And if the examination result represents that no error exists in the initial task graph, determining that the initial task graph is the target task graph.
  4. 4. A method for processing a user request according to any one of claims 1 to 3, wherein executing the target task graph to obtain a task execution result includes: Executing the target task graph; in the execution process of the target task graph, if the node task in the target task graph fails to execute, acquiring a failure reason of the node task which fails to execute; Generating a correction subgraph of the node task in the form of codes according to the failure reason; correcting the node task by using the correction subgraph to obtain a corrected target task graph; And executing the corrected target task graph to obtain a task execution result.
  5. 5. The method for processing the user request according to claim 4, wherein the correcting the node task by using the correction sub-graph to obtain a corrected target task graph includes: If a plurality of correction subgraphs exist, scoring information of each correction subgraph is obtained, wherein different correction subgraphs are generated based on different correction methods for the node tasks, and the scoring information comprises at least one of a passing rate of the correction subgraphs through predefined assertions, a historical success rate of correction by using the correction subgraphs, a resource consumption rate of resources required to be consumed by using the correction subgraphs and a risk score of using the correction subgraphs; evaluating each correction subgraph according to the scoring information to obtain scoring results of each correction subgraph; And correcting the node task by using the correction subgraph with the highest scoring result to obtain a corrected target task graph.
  6. 6. The method for processing a user request according to claim 1, wherein the generating a code-form target task graph according to a preset prompt word and the task tree includes: and generating a code-form target task graph by adopting a coding structure of the script code according to the preset prompt word and the task tree.
  7. 7. The method of processing a user request according to claim 1, wherein the method further comprises: the interaction module receives a user request and analyzes the user request to obtain a user task to be executed; The interaction module acquires historical session information and a preset callable tool from the context management module; the interaction module sends the user task, the historical session information and the callable tool to an inference engine; the reasoning engine plans the user task according to the historical session information and the callable tool to generate a task tree of the user task; The reasoning engine generates a target task graph in a code form according to a preset prompt word and the task tree; the reasoning engine sends the target task graph to a script execution engine; and the script execution engine executes the target task graph to obtain a task execution result.
  8. 8. The method of processing a user request according to claim 7, wherein the method further comprises: in the process that the script execution engine executes the target task graph, the script execution engine detects a subtask result of each node task in the target task graph; If the subtask result is determined to represent the task failure, the script execution engine sends a subtask result and a failure reason of the node task which is failed to be executed to a feedback and repair module; the feedback and repair module generates a correction subgraph of the node task in a code form according to the failure reason; the feedback and repair module sends the corrected subgraph to the reasoning engine; the reasoning engine corrects the node task with the execution failure by using the correction subgraph to obtain a corrected target task graph; The reasoning engine sends the corrected target task graph to the script execution engine, and the script execution engine executes the corrected target task graph to obtain a task execution result.
  9. 9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method of handling user requests according to any of claims 1 to 8 when executing the computer program.
  10. 10. A computer program product, characterized in that the computer program product, when run on a terminal device, causes the terminal device to perform the method of processing a user request according to any of claims 1 to 8.

Description

User request processing method, terminal equipment and computer program product Technical Field The present application relates to the field of intelligent agent technologies, and in particular, to a method for processing a user request, a terminal device, and a computer program product. Background With the rapid development of artificial intelligence technologies such as large language models, the automatic execution of complex tasks by using natural language interaction has become an important paradigm of man-machine interaction. The key to the accurate and rapid execution of user requests by large language models is how to translate user-ambiguous, open natural language requests into a series of distinct, executable, and controllable sequences of operational steps. Currently, there are many methods for controlling the flow of liquid. The processing method for the user instruction generally adopts a predefined flow template to solidify the operation flow of the user instruction into an executable flow, and the method is difficult to understand and cope with the natural language instruction of the open domain, cannot adapt to the dynamically changed environment or the non-predefined scene, and has poor flexibility. Disclosure of Invention The embodiment of the application provides a processing method, terminal equipment and storage medium for user requests, which can process user instructions of any scene and improve the processing success rate and accuracy of the user instructions. In a first aspect, an embodiment of the present application provides a method for processing a user request, including: responding to a received user request, and analyzing the user request to obtain a user task to be executed; acquiring historical session information and a preset callable tool, wherein the callable tool is a preset tool for completing user request permission calling; planning the user task according to the historical session information and the callable tool to generate a task tree of the user task, wherein the task tree comprises subtasks to be executed; Generating a target task graph in a code form according to a preset prompt word and the task tree, wherein the target task graph is a structured script for representing the execution sequence of the subtasks and the dependency relationship between the subtasks; And executing the target task graph to obtain a task execution result. In the application, the task tree containing subtask decomposition is dynamically generated by analyzing the user request and combining the historical session context and the callable tool, and is further converted into a code-form target task graph which definitely defines the execution sequence and the dependency relationship. The task generation method is not limited by a preset flow any more, can intelligently understand and decompose open domain and fuzzy user natural language instructions, and can generate an executable plan matched with the dynamic environment or unforeseen scene in real time. The structured task graph clearly represents the logic dependence and execution path among the subtasks in a code form, so that the whole task flow is highly controllable and predictable, confusion and deviation in the execution process are avoided, and the accuracy of complex task processing is ensured. Meanwhile, by integrating historical session information, the system can make a context-aware decision, so that task planning is more continuous and intelligent, and more accurate and coherent service is provided for users. In a possible implementation manner of the first aspect, the generating a target task graph in a code form according to a preset prompt word and the task tree includes: generating an initial task graph in a code form according to a preset prompt word and the task tree; The initial task graph is subjected to examination processing to obtain an examination result, wherein the examination processing comprises examination whether the grammar of codes in the initial task graph meets a preset specification and/or examination whether the codes in the initial task graph can complete the user request; And if the examination result represents that the error exists in the initial task graph, correcting the initial task graph to obtain the target task graph. In the application, the initial task graph is subjected to examination processing, and errors in the initial task graph are corrected, so that the obtained target task graph is more accurate. In a possible implementation manner of the first aspect, after performing an inspection process on the initial task graph to obtain an inspection result, the method further includes: And if the examination result represents that no error exists in the initial task graph, determining that the initial task graph is the target task graph. In a possible implementation manner of the first aspect, the executing the target task graph to obtain a task execution result includes: Executing the ta