Task processing method and device, electronic equipment and storage medium

By constructing an error prediction model and generating an error control strategy, the agent can identify and avoid potential errors before task execution, thus solving the problem of low task success rate and improving the success rate and stability of task execution.

CN122431815APending Publication Date: 2026-07-21TENCENT TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TENCENT TECH (BEIJING) CO LTD
Filing Date
2026-03-20
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Intelligent agents may make mistakes during task execution, resulting in a low success rate and a tendency to repeat the same errors.

Method used

By constructing an error prediction model and training it with a set of execution error cases of the agent, the model can predict possible errors in the task, generate error control policies, and adjust the task execution strategy to avoid errors.

Benefits of technology

Identify potential errors before task execution and take targeted measures to reduce errors and improve task success rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122431815A_ABST
    Figure CN122431815A_ABST
Patent Text Reader

Abstract

The application discloses a task processing method and device, electronic equipment and storage medium. The method comprises the following steps: obtaining task context information of a target task; predicting an error occurring in the process of an intelligent agent executing the target task according to the task context information through an error prediction model to obtain error prediction information; the error prediction model is obtained by training an execution error case set constructed for the intelligent agent; if the error prediction information indicates that a first error is predicted, generating an error control strategy for the first error according to the error prediction information and the task context information; adjusting a task execution strategy generated by the intelligent agent for the target task according to the error control strategy to obtain a target task execution strategy; and executing the target task according to the target task execution strategy by the intelligent agent. The present scheme can improve the success rate of task execution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a method, apparatus, electronic device, and storage medium for controlling the execution of a task. Background Technology

[0002] With the development of artificial intelligence technology, intelligent agents are gradually being applied to various industries. However, intelligent agents may make mistakes during task execution, and may repeat the same mistakes multiple times, resulting in a low overall success rate of task execution. Summary of the Invention

[0003] In view of the above problems, this application proposes a task processing method, apparatus, electronic device and storage medium to solve the problem of low success rate of intelligent agents performing tasks in related technologies.

[0004] Firstly, a task processing method is provided, including: Obtain the task context information of the target task; The error prediction model predicts errors that the agent may make during the execution of the target task based on the task context information, thereby obtaining error prediction information; the error prediction model is trained on a set of execution error cases constructed for the agent. If the error prediction information indicates that a first error has been predicted, an error control strategy for the first error is generated based on the error prediction information and the task context information. Based on the error control strategy, the task execution strategy generated by the agent for the target task is adjusted to obtain the target task execution strategy; The intelligent agent executes the target task according to the target task execution strategy.

[0005] Secondly, a task processing apparatus is provided, comprising: The acquisition module is used to obtain the task context information of the target task; The error prediction module is used to predict errors that may occur in the process of the agent performing the target task based on the task context information using an error prediction model, and to obtain error prediction information; the error prediction model is trained based on a set of execution error cases constructed for the agent; The generation module is configured to generate an error control strategy for the first error based on the error prediction information and the task context information if the error prediction information indicates that a first error has been predicted. The strategy adjustment module is used to adjust the task execution strategy generated by the agent for the target task according to the error control strategy, so as to obtain the target task execution strategy. An execution module is used by the intelligent agent to execute the target task according to the target task execution strategy.

[0006] In some embodiments, the generation module includes: The deduction unit is used to perform execution process deduction based on the task context information and the error prediction information to determine the first error information when the first error occurs; The attribution analysis unit is used to perform attribution analysis based on the first error information to determine the first candidate cause of the first error. The strategy generation unit is used to generate a prevention strategy based on the first candidate cause, thereby obtaining an error control strategy for the first error.

[0007] In some embodiments, the task processing apparatus further includes: An error detection module is used to detect errors in the execution process of the target task during the process of the agent executing the target task according to the target task execution strategy; An error correction module is used to adjust the execution strategy of the target task according to the real-time execution status of the target task and the error control strategy if the first error is detected, so as to correct the first error.

[0008] In some embodiments, the task execution strategy for generating the target task is generated by the decision model of the agent; the error correction module includes: The re-prediction unit is used to regenerate the action information of the reference execution step where the first error occurred, based on the real-time execution status of the target task and the error control strategy, by the decision model. The adjustment unit is used to adjust the actions of the reference execution steps in the target task execution strategy according to the action information of the reference execution steps, and the agent restarts execution from the reference execution steps according to the adjusted target task execution strategy.

[0009] In some embodiments, the task processing apparatus further includes: The acquisition module is used to acquire second error information of the second error if a second error other than the first error is detected during the execution of the target task by the intelligent agent; The correction strategy generation module is used to generate candidate correction strategies for the second error based on the second error information and the execution error case set; The case generation module is used to combine the second error information and the candidate correction strategy to generate an execution error case for the second error; An add module is provided to add the execution error case of the second error to the execution error case set.

[0010] In some embodiments, each execution error case in the execution error case set includes error information of historical errors that occurred during the execution of historical tasks and error correction strategies for the historical errors; The correction strategy generation module includes: The cluster center determination unit is used to determine the target cluster center to which the second error belongs based on the second error information and the cluster centers to which each historical error in the execution error case set belongs; A feature similarity calculation unit is used to calculate the feature similarity between the second error information and the error information of each historical error belonging to the target cluster center; The candidate historical error determination unit is used to determine candidate historical errors whose feature similarity is higher than the similarity threshold among historical errors belonging to the target cluster center; The candidate correction strategy determination unit is used to select one of the candidate historical error correction strategies as the candidate correction strategy for the second error.

[0011] In some embodiments, each execution error case in the execution error case set includes error information of historical errors that occurred during the execution of historical tasks; the task processing device further includes: The first acquisition module is used to acquire the task context information of the historical task; The first prediction model is used to predict errors that the agent may make during the execution of the historical task based on the task context information of the historical task, thereby obtaining historical error prediction information. The error prediction loss calculation module is used to calculate the error prediction loss based on the historical error prediction information and the error information of the historical errors. The first adjustment module is used to adjust the parameters of the error prediction model according to the error prediction loss until the first training termination condition is met.

[0012] In some embodiments, the task execution strategy is generated by the agent's decision model; the task processing device further includes: The second acquisition module is used to, in response to the end of the target statistical period, acquire execution error cases generated during the target statistical period from the execution error case set, as the first execution error case; the first execution error case includes error correction strategies for historical errors that occurred during the execution of historical tasks; The third acquisition module is used to acquire the historical task execution strategy corresponding to each of the historical tasks, wherein the historical task execution strategy is generated by the decision model for the historical task in the target statistical period. The second adjustment module is used to adjust the historical task execution strategy corresponding to the historical task according to the error correction strategy of the historical error corresponding to the historical task in the first execution error case, so as to obtain the reference task execution strategy corresponding to the historical task. The strategy prediction loss calculation module is used to calculate the strategy prediction loss based on the reference task execution strategy corresponding to the historical task and the historical task execution strategy corresponding to the historical task. The first update training module is used to update and train the decision model according to the loss predicted by the strategy until the second training termination condition is met.

[0013] In some embodiments, the first update training module is configured to: update and train the decision model according to the policy prediction loss and the learning rate determined for the target statistical period, until a second training termination condition is met; the task processing device further includes: The error ratio determination module is used to determine the error ratio in the target statistical period based on the number of the first execution error cases; The parameter adjustment determination module is used to determine the learning rate adjustment parameter based on the error ratio; the learning rate adjustment parameter is negatively correlated with the error ratio. The historical learning rate acquisition module is used to acquire the historical learning rate of the previous statistical period of the target statistical period; The learning rate adjustment module is used to adjust the historical learning rate according to the learning rate adjustment parameters to obtain the learning rate for the target statistical period.

[0014] In some embodiments, the task processing apparatus further includes: The fourth acquisition module is used to acquire execution error cases generated in the next statistical period in response to the end of the next statistical period of the target statistical period, as the second execution error case; The reference historical error determination module is used to determine, based on the first execution error case and the second execution error case, a reference historical error that occurs more frequently in the next statistical period than in the target statistical period; The re-determination module is used to re-determine a new error correction strategy for the reference historical error based on the error information of the reference historical error in the second execution error case and the first error correction strategy of the reference historical error in the first execution error case; The update module is used to update the second execution error case where the reference history error is located according to the new error correction strategy of the reference history error; The second update training module is used to update and train the decision model based on the updated second execution error case.

[0015] In some embodiments, the task processing apparatus further includes: The first execution module is used to execute the target task by the intelligent agent according to the task execution strategy if the error prediction information indicates that no error will occur.

[0016] Thirdly, an electronic device is provided, comprising: a processor; and a memory storing computer instructions, wherein when the computer instructions are executed by the processor, the task processing method described above is implemented.

[0017] Fourthly, a computer-readable storage medium is provided, on which computer instructions are stored, which, when executed by a processor, implement the task processing method described above.

[0018] Fifthly, a computer program product is provided, including computer instructions that, when executed by a processor, implement the task processing method described above.

[0019] In this application, before the agent executes the target task, an error prediction model first predicts errors that the agent may encounter during the execution of the target task based on the task context information, obtaining error prediction information. If the error prediction information indicates that a first error has been predicted, an error control policy is generated for the first error. Based on the error control policy, the task execution policy generated by the agent for the target task is adjusted to obtain the target task execution policy. Subsequently, the agent executes the target task according to the target task execution policy. This achieves the early identification of potential errors before the execution of the target task and the generation of targeted error control policies to adjust the task execution control policy in advance, proactively avoiding predicted errors as much as possible during the execution of the target task. This predictive control mechanism effectively reduces the possibility of errors occurring during task execution and improves the success rate of the agent's task execution. Attached Figure Description

[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0021] Figure 1 This is a schematic diagram illustrating an application scenario of this application according to an embodiment of this application.

[0022] Figure 2 This is a flowchart illustrating a task processing method according to an embodiment of this application.

[0023] Figure 3 This is a flowchart illustrating a task processing method according to another embodiment of this application.

[0024] Figure 4 This is a flowchart illustrating a task processing method according to another embodiment of this application.

[0025] Figure 5 This is a flowchart illustrating a task processing method according to another embodiment of this application.

[0026] Figure 6 This is a flowchart illustrating a task processing method according to another embodiment of this application.

[0027] Figure 7 This is a flowchart illustrating the determination of the learning rate for a target statistical period, according to an embodiment of this application.

[0028] Figure 8 This is a flowchart illustrating the steps following step 650 according to an embodiment of this application.

[0029] Figure 9 This is a flowchart illustrating a task processing method according to another embodiment of this application.

[0030] Figure 10 This is a block diagram of a task processing apparatus according to an embodiment of this application.

[0031] Figure 11 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown. Detailed Implementation

[0032] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.

[0033] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort are within the scope of protection of the present application.

[0034] In the following description, the terms "first" and "second" are used only to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first" and "second" 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.

[0035] In this document, "multiple" refers to two or more. "And / or" describes the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following associated objects are in an "or" relationship. In the following description, references to "some embodiments or some embodiment methods" describe a subset of all possible embodiments. However, it is understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with each other without conflict.

[0036] First, the terms used in this application are explained as follows: An intelligent agent is an agent that can perceive the environment and take actions to accomplish a specific task. It is an intelligent system that achieves specific tasks by perceiving the environment, making autonomous decisions, and executing actions. Like a "digital assistant", it proactively understands needs, breaks down tasks to generate execution strategies, and calls on tools to complete tasks.

[0037] Error prediction model: In this application, the model is obtained by training a neural network model with a set of execution error cases corresponding to the agent. The error prediction model is used to predict the errors that may occur in the process of the agent performing the task before the agent performs the task.

[0038] Figure 1 This is a schematic diagram illustrating an application scenario of this application according to an embodiment of this application. For example... Figure 1 As shown, the method of this application can be executed by electronic device 110, which can be a terminal or a server. The terminal can be a smartphone, tablet computer, laptop computer, desktop computer, smart TV, vehicle terminal, etc., and is not specifically limited here.

[0039] A server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides 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 networks (CDN), and big data and artificial intelligence platforms.

[0040] like Figure 1 As shown, an intelligent agent can be deployed on the electronic device 110. This agent can perform tasks, which are not limited to text processing, image processing, spreadsheet processing, etc. During the execution of the task, the agent also detects whether errors occur and records the errors. Based on the errors that occur, execution error cases are generated and added to the execution error case set, thereby constructing a targeted execution error case set for the agent.

[0041] In this application, an error prediction model can be trained using a set of execution error cases of the agent. Subsequently, before the task (taking the target task as an example) is executed, the error prediction model first predicts the errors that the agent may encounter during the execution of the target task based on the task context information of the target task, thus obtaining error prediction information. If the error prediction information indicates that a first error has been predicted, an error control policy for the first error is generated based on the error prediction information and the task context information. Based on the error control policy, the task execution policy generated by the agent for the target task is adjusted to obtain the target task execution policy. The agent then executes the target task according to the target task execution policy.

[0042] In this way, by predicting potential errors before executing the target task and taking corresponding error control strategies for the predicted errors, errors can be avoided during task execution, thereby improving the success rate of task execution.

[0043] In addition, during the process of the agent executing the target task according to the target task execution strategy, error detection is also performed in real time, and the detected errors are recorded to generate new execution error cases and add them to the execution error case set, so as to dynamically update the agent's execution error case set.

[0044] Figure 2 This is a flowchart illustrating a task processing method according to an embodiment of this application. The method can be executed by an electronic device, which may be a terminal, server, etc., without specific limitation herein. (Refer to...) Figure 2 As shown, the method includes at least steps 210 to 250, which are described in detail below: Step 210: Obtain the task context information of the target task.

[0045] The target task generally refers to the task that the intelligent agent is currently waiting to execute. The intelligent agent can obtain task execution requests, and the task requested by the task execution request can be used as the target task in this application. The task execution request can be initiated by the user through the interactive interface of the terminal, or it can be automatically generated by the intelligent agent based on the perceived environment.

[0046] Depending on the deployment scenario, the tasks that intelligent agents can perform vary. For example, intelligent agents in the scientific research field can be used to perform scientific research tasks, such as designing experimental schemes and predicting the microscopic three-dimensional structure of synthesized products; intelligent agents in the gaming field can perform tasks such as participating in game matches; intelligent agents in the general domain can perform tasks such as text analysis, image generation, video generation, video analysis, and data table analysis; and intelligent agents in the programming field can perform tasks such as reviewing code and testing code.

[0047] The task context information of the target task can also be understood as the task details information of the target task. The task context information of the target task includes the task content and the input data of the target task.

[0048] Step 220: Based on the task context information, the error prediction model is used to predict the errors that the agent will make during the execution of the target task, and the error prediction information is obtained. The error prediction model is trained on the set of execution error cases constructed for the agent.

[0049] In this application, an execution error case set is constructed specifically for each agent. The execution error case set for each agent contains multiple execution error cases, each including error information of historical errors that occurred during the execution of historical tasks and error correction strategies for those historical errors.

[0050] Historical errors refer to errors that occurred during the execution of historical tasks by an agent. Error information for historical errors can include the error type, the frequency of occurrence, and the error context. Error types include, but are not limited to, processing logic errors, input data errors, tool usage errors, and external interference.

[0051] Error context information for historical errors can include the task identifier, task type, and step information of the execution step where the error occurred during the execution of the historical task. Step information includes, for example, the step name, input and output data, and step content. The step content can also be understood as the operations required in the execution step, such as the data verification method used in a data verification step, the image enhancement method used in an image enhancement step, or the external tools invoked in a step that calls external tools.

[0052] An intelligent agent includes a decision model. Before executing a task, the decision model generates a task execution strategy based on the task context information. A task execution strategy reflects the execution steps required to perform the task and the execution order of these steps.

[0053] In some embodiments, the agent also includes a reflection model. During the process of the agent executing a task according to the historical task's execution strategy, for each execution step of the historical task's execution strategy completed, the reflection model, based on a reflection mechanism, reflects on that execution step to determine whether an error occurred in that step. The reflection mechanism involves the agent evaluating and reviewing its perceived environmental data, decision-making process, and action results to identify errors that occurred during execution.

[0054] The reflexive model reflects on whether the input data in the execution step is incorrect, whether the processing logic of the execution step is correct, whether the output data of the execution step deviates from the normal numerical range, and whether the tool called in the execution step is accurate. For example, if the tool called is not a different type of tool called in other similar execution steps, then the tool called is determined to be inaccurate; or, if the goal to be achieved by the currently called tool does not match the function of the currently called tool, that is, the goal that needs to be achieved cannot be achieved by calling the current tool, then the tool called is determined to be inaccurate.

[0055] In some embodiments, the reflection model can be pre-defined with multiple reflection prompts to guide the model in reflecting on the execution steps. These prompts may include prompts to reflect on the accuracy of the input data for the execution step, the rationality of the processing logic of the execution step, whether the output data of the execution step deviates from the normal numerical range, and whether the tools invoked in the execution step are accurate.

[0056] Therefore, when the agent completes each execution step of a historical task, the agent reflects on that execution step through the reflection model in the agent. Through reflection, historical errors that occur during the execution of historical tasks can be automatically detected, and the error information of historical errors can be collected and recorded accordingly.

[0057] In other embodiments, during the process of the agent executing a task according to the historical task's execution strategy, a monitoring person can provide manual feedback at each execution step of the historical task's execution strategy. This manual feedback indicates whether an error occurred in that execution step and, if so, the specific content of the error. In this case, based on the manual feedback for that execution step, it can be determined whether an error occurred, and if an error occurred, the corresponding error information can be collected.

[0058] Error correction strategies for historical errors refer to strategies that can correct historical errors and return to the normal processing procedure. In other words, after a historical error occurs, the execution steps where the historical error occurred are re-executed according to the error correction strategy for historical errors, and theoretically, the historical error will not occur again.

[0059] An error prediction model is a model trained on a set of execution error cases of an agent and used to predict errors that the agent may make during task execution. This model can be a machine learning model, such as a regression model or a neural network model, etc., without specific limitations.

[0060] In step 220, the error prediction model can predict whether errors will occur in each execution step of the target task during the agent's execution of the target task, and the specific content of any errors that may occur. In other words, the error prediction information indicates whether errors are predicted to occur during the agent's execution of the target task, and the specific content of any errors that may occur. In some embodiments, since the agent's execution of the target task involves multiple execution steps, the error prediction information also indicates the execution step in which the predicted error occurs. For example, if the agent needs to execute the following three execution steps in sequence during the execution of the target task: execution step A1, execution step A2, and execution step A3, the error prediction information indicates that no error will occur in execution step A1, no error will occur in execution step A2, but an "output data error" will occur in execution step A3.

[0061] In some embodiments, in step 220, the decision model of the agent can be obtained, and the task execution strategy of the target task can be generated based on the task context information of the target task; the task execution strategy of the target task and the task context information of the target task are input into the error prediction model, and the error prediction model performs error prediction and outputs error prediction information.

[0062] In some embodiments, such as Figure 3 As shown, before step 220, it can be done according to Figure 3 The process shown involves training the error prediction model, including steps 310-340, which are detailed below: Step 310: Obtain the task context information of historical tasks.

[0063] For each execution error case in the set of execution error cases, the task context information of the historical task to which the historical error indicated by the execution error case belongs can be obtained. In some embodiments, each execution error case may include the task context information of the historical task to which the historical error belongs. In other embodiments, the task context information of the corresponding historical task can be obtained from the agent's execution task database based on the task identifier of the historical task included in the execution error case.

[0064] Step 320: The error prediction model predicts the errors that the agent will make during the execution of historical tasks based on the task context information of historical tasks, and obtains historical error prediction information.

[0065] Historical error prediction information is used to indicate whether an agent will encounter errors during the execution of historical tasks, and if an error is predicted, the historical error prediction information also indicates the content of the error. In some embodiments, when the error prediction model predicts that an error will occur during the execution of historical tasks, the historical error prediction information also indicates the execution step where the predicted error occurs.

[0066] In some embodiments, the agent's decision model can also obtain the historical task execution strategy generated for the historical task. This historical task execution strategy indicates the execution steps the agent will take during the execution of the historical task and the execution order of different execution steps. Based on this, the historical task execution strategy and the task context information of the historical task are input into the error prediction model, which predicts whether errors will occur in each execution step during the agent's execution of the historical task according to the historical task execution strategy, and the specific content of the errors.

[0067] Step 330: Calculate the error prediction loss based on historical error prediction information and historical error information.

[0068] The difference between historical incorrect predictions and historical erroneous information can be calculated using a loss function to obtain the error prediction loss. The loss function can be the absolute value loss function, the mean squared error loss function, the cross-entropy loss function, etc., and no specific limitation is made here.

[0069] In some embodiments, historical error prediction information may also indicate the probability of the predicted error occurring. In this case, the historical error information may include the probability of historical errors occurring, and historical errors in the agent's execution of historical task x. probability of occurrence It can be represented as: ;(Formula 1) in, This represents the number of times error e occurs during the execution of historical task x by the intelligent agent; This represents the total number of times the agent has executed historical task x.

[0070] The process of calculating the difference between historical error prediction information and historical error information will correspond to the calculation of the difference between the probability of historical error occurring in historical tasks indicated by the historical error error information and the probability of historical error occurring during the execution of historical tasks indicated by the historical error prediction information.

[0071] Step 340: Adjust the parameters of the error prediction model based on the error prediction loss until the first training termination condition is met.

[0072] The first training termination condition can be the convergence of the error prediction loss of the error prediction model, and / or the reaching of the number of iterations of the error prediction model.

[0073] In the above embodiments, the error prediction model is trained in a supervised manner using the set of execution error cases of the agent, so that the error prediction model can accurately predict whether the agent will make mistakes in each execution step of the task, and the specific content of the errors, based on the task context information.

[0074] Since the execution error case set of an agent reflects the errors that the agent makes in the process of performing historical tasks, the execution error case set of the agent can specifically reflect the agent's own weaknesses and prone errors. Using the execution error case set of the agent as training data for training the error prediction model can ensure that the trained error prediction model accurately learns the agent's weaknesses and prone errors, thereby ensuring the accuracy of the error prediction made after training.

[0075] Step 230: If the error prediction information indicates that a first error has been predicted, generate an error control strategy for the first error based on the error prediction information and the task context information.

[0076] The first error refers to the error that the agent is expected to make during the execution of the target task, as indicated by the error prediction information. The error control strategy for the first error refers to the preventative strategy to avoid its occurrence, indicating the correct actions to take during the execution of the target task to prevent the first error from occurring.

[0077] In some embodiments, step 230 includes: performing execution process deduction based on task context information and error prediction information to determine the first error information when the first error occurs; performing attribution analysis based on the first error information to determine the first candidate cause of the first error; and generating a prevention strategy based on the first candidate cause to obtain an error control strategy for the first error.

[0078] Based on the task context information of the target task, the execution process of the agent according to the task execution strategy of the target task can be deduced. In other words, by combining the task context information of the target task with the task execution strategy generated by the agent's decision model, and processing according to the execution steps involved in the task execution strategy, it is equivalent to pre-simulating the process of the agent executing the target task.

[0079] During the simulation, the execution step where the first error occurred, as indicated by the error prediction information, is located. Then, the first error information when the first error occurs in the located execution step is collected. This first error information includes relevant information related to the first error.

[0080] The first error information when a first error occurs includes at least the input data of the execution step where the first error occurs, the processing logic information of the execution step where the first error occurs, the output data of the execution step where the first error occurs, and the relevant environmental information when the first error occurs. In some embodiments, the first error information may also include the step execution information of each preceding execution step in the deduction process, which may include the specific content, input data, and output data of the corresponding preceding execution step.

[0081] A corrective policy prediction model can be deployed on the operating system of the agent. This model is constructed using a neural network. The corrective policy prediction model includes an inference sub-model, an attribution analysis sub-model, and a corrective policy sub-model. The task context information and error prediction information of the target task can be input into the inference sub-model. The inference sub-model simulates the process of the agent executing the target task according to the target task's execution policy, thus obtaining the first error information when the first error occurs.

[0082] The attribution analysis sub-model is used to perform attribution analysis on errors (taking error x1 as an example) to determine the cause of error x1; the correction strategy sub-model is used to generate a correction strategy based on the error content of error x1 and the cause of error x1, which is used to indicate the operation to avoid error x1.

[0083] Based on this, the first error information can be input into the attribution analysis sub-model, which will perform attribution analysis based on the first error information to obtain the first candidate cause of the first error; and the first candidate cause and the error information of the first error can be input into the correction strategy sub-model, which will generate a prevention strategy to obtain an error control strategy for the first error.

[0084] The process of the prediction model processed by the above-mentioned modified strategy can be described by the following formula 2: ;(Formula 2) This indicates the predicted error for the first time. Error control strategies; This indicates that the agent instructed by the erroneous prediction information is performing the target task. The first error occurred during the process. The probability of occurrence; Indicate the target task Task context information. This represents the modified strategy prediction model.

[0085] To ensure the accuracy of the error control policies generated by the corrective policy prediction model, it is necessary to pre-train the model using a set of execution error cases from the agent. The training process includes the following steps ①-⑦: ① Obtain the task context information of the historical task involved in the execution error case.

[0086] ② Input the task context information of the historical task and the historical errors indicated by the execution error cases into the inference sub-model. The inference sub-model will then perform execution process inference and output the reference prediction error information of the historical errors.

[0087] ③ The attribution analysis sub-model performs attribution analysis based on the reference prediction error information of historical errors, and outputs the reference prediction causes for historical errors.

[0088] ④ The correction strategy sub-model generates a prevention strategy based on the reference predicted causes of historical errors and the error information of historical errors obtained from execution error cases, thus obtaining a predictive control strategy for historical errors.

[0089] Considering that during training, the reference prediction error information of historical errors output by the inference sub-model may differ from the error information of historical errors in the execution error cases, if the reference prediction error information of historical errors output by the inference sub-model is input into the correction policy sub-model, the correction policy sub-model will fail to correctly learn the feature information of historical errors, thus failing to effectively generate accurate error control policies for historical errors. Therefore, in this embodiment, the error information of historical errors obtained from the execution error cases is input into the correction policy sub-model instead of the reference prediction error information of historical errors. This improves the training effect and increases the convergence speed of the correction policy sub-model.

[0090] ⑤ Calculate the extrapolated loss based on the reference error information of historical errors and the error information of historical errors obtained from execution error cases.

[0091] ⑥ Calculate the strategy prediction loss based on the prediction and control strategy for historical errors and the error correction strategy for historical errors obtained from execution error cases.

[0092] ⑦ Based on the inference loss and the policy prediction loss, adjust and correct the parameters of the policy prediction model until the reference training termination condition is met.

[0093] The weighted sum of the inference loss and the policy prediction loss can be used as the prediction loss of the modified policy prediction model. Then, based on the prediction loss of the modified policy prediction model, the parameters of the modified policy prediction model are iteratively adjusted using gradient descent. The training termination condition could be that the number of iterations of the modified policy prediction model reaches the second threshold, and / or that the prediction loss of the modified policy prediction model converges.

[0094] Through the training process described above, the correction strategy prediction model can learn the correlation between error-cause correction strategies, and accurately learn the correction methods for various types of errors reflected by the error correction strategies of historical errors in each execution error case set of the agent's execution error case set.

[0095] In some embodiments, the error correction strategies for historical errors in each execution error case in the initial set of execution error cases used to train the correction strategy prediction model may be labeled by annotators.

[0096] Furthermore, for this set of execution error cases, annotators can also label the causes of historical errors. Correspondingly, in the training process described above, the attribution loss is further calculated based on the reference predicted causes of historical errors and the causes of historical errors recorded in the execution error cases. In this case, the prediction loss of the modified policy prediction model is equal to the weighted sum of the inference loss, the attribution loss, and the policy prediction loss.

[0097] Step 240: Based on the error control strategy, adjust the task execution strategy generated by the agent for the target task to obtain the target task execution strategy.

[0098] For example, if the error control policy instructs to adjust the execution order of the execution steps in the task execution policy generated by the target task, then the execution order of the corresponding execution steps in the task execution policy of the target task will be adjusted according to the error control policy, and the adjusted task execution policy will be used as the target task execution policy.

[0099] For example, if the error control strategy indicates that tool A needs to be called in the first execution step, then, in accordance with the error control strategy, the tool called in the first execution step of the target task's task execution strategy will be adjusted to call tool A.

[0100] For example, if the error control strategy indicates that additional data validation is required for the input data of the first execution step in the first execution step, then according to the error control strategy, the processing logic for additional validation of the input data of the first execution step is added to the task execution strategy of the target task in the first execution step.

[0101] It is worth mentioning that the error control strategies listed above are merely illustrative examples and should not be considered as limiting the scope of this application.

[0102] Step 250: The agent executes the target task according to the target task execution strategy.

[0103] An intelligent agent can execute each step in the order indicated by the target task's execution strategy, based on the task context of the target task. If the last execution step in the target task's execution strategy is completed, it indicates that the target task has been completed, and the execution result is output accordingly.

[0104] In this application, before the agent executes the target task, an error prediction model first predicts errors that the agent may encounter during the execution of the target task based on the task context information, obtaining error prediction information. If the error prediction information indicates that a first error has been predicted, an error control policy is generated for the first error. Based on the error control policy, the task execution policy generated by the agent for the target task is adjusted to obtain the target task execution policy. Subsequently, the agent executes the target task according to the target task execution policy. This achieves the proactive identification of potential errors before the execution of the target task and the generation of targeted error control policies to adjust the task execution control policy in advance, thereby minimizing the occurrence of predicted errors during the execution of the target task. This proactive error avoidance mechanism improves the agent's adaptability to complex tasks and the stability of task execution.

[0105] Since the error prediction model is trained using a set of execution error cases of the agent, the set of execution error cases of the agent can specifically reflect the agent's own weaknesses. Therefore, the trained error prediction model can accurately identify the errors that the agent may make in the process of performing tasks and take targeted measures.

[0106] In some embodiments, such as Figure 4 As shown, the method further includes the following steps 410-420: Step 410: During the process of the agent executing the target task according to the target task execution strategy, error detection is performed on the execution process of the target task.

[0107] As the agent performs actions according to the execution steps of the target task execution strategy, it also reflects on the latest completed execution step after each step to determine whether any errors occurred in the latest completed execution step.

[0108] Step 420: If the first error is detected, adjust the execution strategy of the target task according to the real-time execution status and error control strategy of the target task to correct the first error.

[0109] If a first error is detected during the execution of the target task by the agent according to the target task execution strategy, it means that the previously predicted error control strategy for the first error has not achieved the purpose of avoiding the occurrence of the first error. Therefore, in this case, it is necessary to re-adopt the strategy to correct the first error.

[0110] If a first error is detected during the execution of the target task, corrective measures for the first error can be re-predicted based on the real-time execution status of the target task and the error control strategy. The execution strategy for the target task can then be adjusted according to these corrective measures. The corrective measures for the first error specify the action information for the reference execution step where the first error occurred.

[0111] In some embodiments, step 420 includes: the decision model in the agent regenerating the action information of the reference execution step where the first error occurred based on the real-time execution status of the target task and the error control strategy; adjusting the action of the reference execution step in the target task execution strategy based on the action information of the reference execution step; and having the agent restart execution from the reference execution step according to the adjusted target task execution strategy.

[0112] The reference execution step refers to the execution step in which the first error occurred during the execution of the target task. In this embodiment, inputting the error control strategy into the decision model in the agent is equivalent to giving the decision model feedback, which informs the decision model that it was unable to avoid the first error when executing according to the error control strategy.

[0113] When the first error occurs, the real-time execution status of the target task includes at least the task status of the execution flow of the target task in the previous execution step (referred to as the first task status for ease of description) and the status information reflected in the reference step. The first task status at least indicates the input data in the reference execution step. The status information reflected in the reference execution step at least reflects the action information performed in the previous execution of the reference execution step, and can also facilitate the decision model to analyze the cause of the first error in conjunction with the error control strategy, and then regenerate the action information of the reference execution step.

[0114] The action information for regenerating the reference execution steps by the decision model can be described by the following formula 3: ;(Formula 3) in, This indicates the action information of the reference execution step that has been re-predicted; Indicates the real-time execution status of the target task; This indicates the error control strategy for the first error. This represents the policy correction function in the decision-making model.

[0115] After regenerating the action information in the reference execution step, the action information in the target task execution strategy can be replaced with the regenerated action information to obtain the adjusted target task execution strategy.

[0116] For example, if the target task execution strategy is represented as ,in, Indicates the first execution step The action information is similar for others. Assume the second execution step... This is a reference execution step; the reference execution step is for reference only. The regenerated action information is The adjusted target task execution strategy is as follows: After that, proceed accordingly. Re-execute the second execution step. The first execution step does not need to be repeated. .

[0117] In the above embodiment, if the target task execution strategy is adjusted based on the predicted first error before execution, and if the first error is still detected during the execution of the target task according to the target task execution strategy, the target task execution strategy is adjusted according to the real-time execution status of the target task and the error control strategy for the first error to correct the first error. By adjusting the target task execution strategy in a timely manner through the error correction mechanism and correcting errors in real time, the reliability and stability of task execution can be improved.

[0118] Before executing the target task, predictive control is used to anticipate possible tasks and adjust the task execution strategy accordingly. During the execution of the target task, errors are corrected in real time through an error correction mechanism. In this way, the robustness of the agent in the face of external interference is enhanced through a multi-layered control mechanism (predictive control + real-time error correction mechanism), which can ensure that the agent can still operate stably in changing environments.

[0119] In some embodiments, if it is determined that the reference execution steps can be executed smoothly according to the action information redefined for the reference execution steps (i.e., no more errors occur), the action information redefined for the reference execution steps can be used as an error correction strategy for the first error. The error information of the first error and the error correction strategy for the first error are combined to generate an execution error case for the first error, which is then added to the agent's execution error case set, and the execution error case set is dynamically updated.

[0120] In some embodiments, such as Figure 5 As shown, after step 410, the method further includes steps 510-540, which are detailed below: Step 510: If a second error other than the first error is detected during the execution of the target task by the agent, collect the second error information of the second error.

[0121] The second error refers to any error other than the first error. It's understandable that if a second error occurs during the execution of the target task, it indicates that the error prediction model's predictions are incomplete. In this case, error information about the second error (i.e., second error information) can be collected to form an execution error case for the second error.

[0122] Step 520: Based on the second error information and the set of execution error cases, generate candidate correction strategies for the second error.

[0123] The candidate correction strategy for the second error refers to a correction strategy that can theoretically correct the second error. In this embodiment, the candidate correction strategy for the second error is a correction strategy with a high probability of correcting the second error, based on the error correction experience expressed by the execution error case set.

[0124] In some embodiments, a number of execution error cases that do not include error correction strategies can be initially collected for the agent. For ease of description, these execution error cases without error correction strategies are referred to as initial execution error cases. In this case, the initial execution error cases in the execution error case set can be classified and analyzed to determine the common error patterns of the agent, and targeted correction measures can be determined for each common error.

[0125] In some embodiments, the probability of occurrence of each error can be calculated based on the initial execution error cases in the execution error case set. The probability of occurrence of an error type can be expressed as: ;(Formula 4) This represents the probability of error e occurring; This indicates the number of tasks that encountered error 'e' during execution; This indicates the total number of tasks performed.

[0126] By analyzing the probability of each error, we can identify errors with a high probability of occurrence during task execution. These high-probability errors can be considered common errors of the agent. Based on this, we can select initial execution error cases from the set of execution error cases, corresponding to errors with a probability exceeding a first probability threshold, for cluster analysis.

[0127] In some embodiments, the K-means clustering algorithm can be used to perform cluster analysis on the selected initial execution error cases. The overall principle of the K-means clustering algorithm is that a good clustering result is that the sample points are clustered as close as possible to the cluster centers. Therefore, the sum of the distances from the sample points to each cluster center can be used as a measure of clustering quality, which can be expressed as: ;(Formula 5) J represents the sum of errors, This represents the distance from the error in the i-th initial execution error case to the k-th cluster center k. This represents the k-th cluster center. K is the total number of cluster centers, and n is the total number of initial execution error cases.

[0128] Using the K-means algorithm, the system can divide initial execution error cases into multiple cluster centers, with each cluster center representing a cluster category. Based on this, error attribution analysis can be performed on initial execution error cases belonging to a cluster category. Combining the attribution analysis results, error correction strategies for each initial execution error case are determined. The determined error correction strategies for each initial execution error case are then added to the corresponding initial execution error case, thus achieving the annotation of error correction strategies for initial execution error cases.

[0129] Through the above process, on the one hand, the cluster center of each execution error case in the execution error case set is determined, and on the other hand, it is ensured that each execution error case includes an error correction strategy. In this way, the execution error case set can provide error correction experience for subsequent errors.

[0130] In some embodiments, each execution error case in the execution error case set includes error information of historical errors that occurred during the execution of historical tasks and error correction strategies for historical errors; step 520 includes the following steps B1-B4: Step B1: Based on the second error information and the cluster centers of each historical error in the execution error case set, determine the target cluster center to which the second error belongs.

[0131] As described above, after cluster analysis, each cluster center has been determined. Therefore, based on the second error information and the multiple cluster centers determined for the execution error case set, the distance from the second error information to each cluster center can be calculated, and the cluster center with the smallest distance to the second error information can be taken as the target cluster center to which the second error belongs.

[0132] Step B2: Calculate the feature similarity between the second error message and the error messages of each historical error belonging to the target cluster center. The Euclidean distance or cosine distance between the second error message and the error messages of each historical error belonging to the target cluster center can be used as the feature similarity.

[0133] Step B3: Among the historical errors belonging to the target cluster center, identify candidate historical errors whose feature similarity is higher than the similarity threshold.

[0134] Step B4: Select one candidate historical error correction strategy as a candidate correction strategy for the second error.

[0135] Since the feature similarity between the candidate historical error and the second error is higher than the similarity threshold, the second error and the candidate historical error are highly similar and belong to the same cluster center. Theoretically, the error correction strategy of the second error is also similar to the error correction strategy of the candidate historical error. Therefore, the error correction strategy in the execution error case where a candidate historical error is located can be approximated as the candidate correction strategy for the second error.

[0136] In some embodiments, if there are multiple candidate historical errors, the error correction strategy in the execution error case where any candidate historical error is located can be used as a candidate correction strategy for the second error. Alternatively, the error correction strategy corresponding to the candidate historical error with the highest feature similarity to the second error can be used as a candidate correction strategy for the second error.

[0137] Through the above embodiments, it is possible to utilize the experience data provided by the execution error case set to determine targeted error correction measures for newly emerging errors.

[0138] Step 530: Combine the second error information and candidate correction strategies to generate an execution error case for the second error.

[0139] Step 540: Add the second execution error case to the execution error case set.

[0140] Through the above process, the set of execution error cases of the agent can be dynamically updated based on new errors that occur during task execution. In this way, the decision model of the agent can be updated and trained again using the updated set of execution error cases, providing the agent with more error handling experience.

[0141] In this application, the execution error case set of the agent is a dynamically updated dataset. After each task execution, the agent updates the execution error case set based on the errors that occur during the task. Over time, more error samples accumulate in the execution error case set, reflecting the changing trends of the agent's errors. Therefore, the agent's behavior patterns can be continuously improved through the execution error case set, enhancing the agent's adaptive capabilities.

[0142] In the above embodiments, by recording errors that occur during the execution of tasks by the agent in real time and adding newly generated execution error cases to the agent's execution error case set, the updated execution error case set is equivalent to error feedback to the agent's decision model, which can be used to update and train the decision model, providing a solid foundation for the agent's adaptive learning and predictive control. This approach can improve the stability and robustness of the agent in complex tasks.

[0143] In some embodiments, anomaly detection algorithms (such as Z-score statistical methods or the Isolation Forest algorithm) can be used, combined with the occurrence probability of each error, to identify anomalies based on the agent's execution error case set, thereby identifying infrequent but impactful errors. These infrequent but impactful errors can be errors whose occurrence probability is higher than a second probability threshold within cluster centers containing fewer than a second threshold number of errors. This section on "infrequent but impactful errors" is a key focus for future agent optimization.

[0144] In some embodiments, for the part of "uncommon but significant errors", the large language model can be guided by the execution error case in which it is located to perform attribution analysis and generate correction strategies by combining the error information in the execution error case. If the error correction strategy generated by the large language model is different from the error correction strategy recorded in the execution error case, it can be manually checked. If the error correction strategy recorded in the execution error case is inaccurate, it can be modified to ensure the accuracy of the error correction strategy recorded in the execution error case after modification.

[0145] In other embodiments, the execution step in which the second error occurs is referred to as the second execution step. After the second error is detected, the real-time task status of the target task at the time of the second error can also be obtained. The decision model then re-predicts the action information of the second execution step based on the real-time task status of the target task at the time of the second error and the action information of the second execution step in the target task execution strategy. The second execution step is then re-executed according to the re-predicted action information.

[0146] During re-execution, if no errors occur in the second execution step, the subsequent execution steps of the second execution step continue; if the cumulative number of re-executions of the second execution step reaches the second threshold, the target task is determined to have failed. The second threshold can be set as needed, and the second threshold is a positive integer, such as 2, 3, 4, 5, etc., without specific limitations here.

[0147] Furthermore, if no error occurs during the re-execution of the second execution step, the most recently regenerated action information from the second execution step can be used as an error correction strategy for the second error. The error information of the second error and the error correction strategy for the second error are then used to generate an execution error case for the second error and added to the agent's execution error case set.

[0148] In some embodiments, after the step of generating an execution error case of the second error by combining the second error information and the candidate correction strategy, the method further includes: updating and training the error prediction model based on the execution error case of the second error.

[0149] Since the second error is an error that the error prediction model did not predict for the target task, updating and training the error prediction model using execution error cases of the second error can improve the accuracy and comprehensiveness of the error prediction model and enhance its performance.

[0150] In some embodiments, such as Figure 6 As shown, the method further includes the following steps 610-650: Step 610: In response to the end of the target statistical period, retrieve the execution error cases generated during the target statistical period from the execution error case set as the first execution error case; the first execution error case includes error correction strategies for historical errors that occurred during the execution of historical tasks.

[0151] The target statistical period can refer to any statistical period in general. The duration of a statistical period can be set as needed, such as 1 day, 2 days, 1 week, etc. The execution error case set is continuously updated over time. The execution error cases generated within the target statistical period can reflect the latest trends in agent errors. Therefore, the execution error cases generated within the target statistical period will be the focus for updating and training the agent's decision-making model.

[0152] Step 620: Obtain the historical task execution strategy corresponding to each historical task. The historical task execution strategy is generated by the decision model for the historical task during the target statistical period.

[0153] The historical task in step 620 refers to the task in which the error occurred in the first execution error case. The historical task execution strategy corresponding to each historical task is the task execution strategy generated by the decision model for that historical task before execution.

[0154] The historical task execution strategy corresponding to the historical task can be obtained from the task execution log of the historical task. The historical task execution strategy corresponding to the historical task is the task execution strategy generated by the decision model in the agent for the historical task before the historical task is executed.

[0155] Step 630: Based on the error correction strategy of the historical error corresponding to the historical task in the first execution error case, adjust the historical task execution strategy corresponding to the historical task to obtain the reference task execution strategy corresponding to the historical task.

[0156] It is understandable that, since the agent executes historical tasks according to the historical task execution strategy corresponding to the historical task during the target statistical period, and historical errors occur during the execution of historical tasks, the corresponding decision model generates historical task execution strategies for historical tasks in the target statistical period inaccurate.

[0157] The error correction strategy recorded in the first execution error case is a correction strategy with a high probability of correcting the historical error. Therefore, theoretically, adjusting the historical task execution strategy corresponding to the historical task according to the error correction strategy corresponding to the historical error in the first execution error case will result in a reference task execution strategy with a high probability of avoiding the historical error in the first execution error case. Therefore, in this application, the reference task execution strategy corresponding to the historical task is used as supervision information to update and train the agent's decision model.

[0158] Step 640: Calculate the strategy prediction loss based on the reference task execution strategy corresponding to the historical task and the historical task execution strategy corresponding to the historical task.

[0159] The difference between the execution strategy of the reference task corresponding to the historical task and the execution strategy of the historical task corresponding to the historical task can be calculated by using loss functions such as mean squared error loss function, cross-entropy loss function, absolute value loss function, and cosine loss function, so as to obtain the strategy prediction loss.

[0160] Step 650: Predict the loss based on the strategy and update the training of the decision model until the second training termination condition is met.

[0161] The second training termination condition could be the convergence of the policy prediction loss, and / or the reaching of the third iteration threshold of the decision model. The purpose of updating and training the decision model is to minimize errors that occur during task execution by adjusting the parameters of the decision model.

[0162] In some embodiments, if the decision model is constructed using decision trees, then during training, the decision rules of each decision tree in the decision model are adjusted according to the policy prediction loss. The decision rule corresponding to a decision tree t can be expressed as: ;(Formula 6) in and This represents the values ​​corresponding to the two branches of decision tree t. This represents the splitting feature used to make a decision on decision tree t; This refers to the segmentation features used on decision tree t. The set segmentation threshold.

[0163] During training, the loss can be predicted based on the strategy, the segmentation features applicable to each decision tree for segmentation can be adjusted, and the segmentation threshold can be updated. This can also be understood as updating the structure of the decision trees in the decision model, especially optimizing decision trees that are prone to errors, thereby updating the decision model and continuously improving the decision process of the decision model to enhance its performance.

[0164] In some embodiments, if the decision model is constructed using a neural network, a learning rate can be preset. Correspondingly, during training, the parameters of the decision model are updated using gradient descent according to the preset learning rate. In this case, the parameters of the decision model are updated in each iteration according to the following formula 7: ;(Formula 7) in, These are the parameters before the decision model was updated. These are the parameters after the decision model has been updated. It's the learning rate. Indicates the strategy predicts the loss. The gradient of the parameters relative to the decision model.

[0165] During training, the weight parameters in the neural network-based decision model related to specific features (such as error-prone task types and features related to tool selection in the task) are adjusted to prevent previously occurring errors from recurring after training. Training improves the decision model's performance in predicting task execution strategies; for example, the model can automatically select more appropriate tools in future tasks, avoiding the use of tools or methods that previously led to errors.

[0166] Through the above embodiments, the decision-making model is updated and trained according to statistical periods, thereby enabling the decision-making model to learn adaptively. In this way, the accuracy of the task execution strategy generated by the decision-making model in the agent can be gradually optimized, thereby reducing the occurrence of errors and improving the robustness and accuracy of the agent.

[0167] In some embodiments, since the performance of the decision model varies in different statistical periods, the learning rate can be determined specifically for each statistical period. The learning rate corresponding to a statistical period is used to train the decision model after the end of that statistical period.

[0168] The learning rate is a crucial hyperparameter in the optimization of decision model parameters. It determines the step size for each parameter update, directly impacting the model's convergence speed, stability, and final performance. A higher learning rate can accelerate model convergence, but excessively high rates can lead to oscillations in the loss value, potentially causing the model to skip global or local optima. A lower learning rate results in smaller update steps and a higher risk of getting trapped in local optima, but it makes model convergence more stable and can reduce the risk of overfitting to some extent. Therefore, a suitable learning rate can be determined for updating and training the decision model at the end of each statistical period, tailored to different statistical cycles.

[0169] In some embodiments, a mapping relationship between statistical periods and learning rates can be pre-defined, wherein the learning rate corresponding to earlier statistical periods is greater than the learning rate corresponding to later statistical periods. That is, earlier statistical periods use a larger learning rate to update and train the decision model, while later statistical periods use a smaller learning rate.

[0170] In other embodiments, the learning rate applicable to training the decision model after the target statistical period can be determined specifically for that period, taking into account the performance of the decision model during the target statistical period. In this case, it can be done according to... Figure 7 The process shown is used to determine the learning rate corresponding to the target statistical period, including: Step 710: Determine the error rate in the target statistical period based on the number of first execution error cases.

[0171] The error rate in the target statistical period can be calculated by comparing the number of first execution error cases with the total number of tasks executed in the target statistical period.

[0172] The error rate within the target statistical period can reflect the performance of the decision-making model within that period to some extent. A higher error rate indicates lower accuracy in the task execution strategy predicted by the decision-making model within the target statistical period, while a lower error rate indicates higher accuracy in the task execution strategy predicted by the decision-making model within the target statistical period.

[0173] Step 720: Determine the learning rate adjustment parameter based on the error rate; the learning rate adjustment parameter is negatively correlated with the error rate.

[0174] The learning rate adjustment parameter reflects the degree of learning rate adjustment. In some embodiments, the difference between 1 and the error rate can be used as the learning rate adjustment parameter. In some embodiments, the ratio of the target value to the error rate can be used as the learning rate adjustment parameter, where the target value is a positive number.

[0175] Step 730: Obtain the historical learning rate of the previous statistical period of the target statistical period.

[0176] The historical learning rate of the previous statistical period before the target statistical period refers to the learning rate used to train the decision model after the previous statistical period ended and before the target statistical period.

[0177] Step 740: Adjust the historical learning rate according to the learning rate adjustment parameters to obtain the learning rate for the target statistical period.

[0178] In some embodiments, the product of the learning rate adjustment parameter and the historical learning rate can be used as the learning rate for the target statistical period. That is, the learning rate for the target statistical period can be calculated using the following formula: ;(Formula 8) in, This represents the learning rate during the target statistical period. This represents the historical learning rate in the previous statistical period preceding the target statistical period; Indicates the number of cases where the first execution fails. This indicates the total number of tasks executed during the target statistical period. Therefore, This refers to the percentage of errors within the target statistical period.

[0179] In the above embodiment, the execution error cases generated in a statistical period are used as training data to update and train the decision model in the agent before the start of the next statistical period, so as to achieve the effect of real-time feedback and online learning, enabling the decision model in the agent to be updated according to the statistical period, so that the decision model can continuously improve and adjust in each statistical period.

[0180] This allows the decision-making model to learn the characteristics of errors and corresponding error correction strategies from historical execution error cases, thereby improving the model's ability to respond to historical errors. By using a set of execution error cases for adaptive learning of the decision-making model, it achieves the effect of self-learning and optimization, which can not only improve task execution and reduce errors in static environments, but also dynamically adapt to complex and changing tasks and environments.

[0181] Furthermore, during the update and training of the decision-making model, the model's parameters can be dynamically adjusted based on relevant characteristics of historical errors (such as type and frequency of occurrence), achieving the effect of policy adjustment based on error correction. For example, if the tool selection error frequency is high in a certain task, the decision-making model in the agent will try to avoid using this tool in subsequent similar tasks, or select a more suitable tool based on the characteristics of the task.

[0182] Furthermore, the learning rate is adaptively determined for each statistical period, and the parameters of the decision model are adjusted accordingly based on the learning rate determined for the statistical period. The learning rate is specifically determined based on the performance of the decision model in each statistical period, so that the learning rate used for updating training is adapted to the performance of the decision model in the corresponding statistical period. This can ensure the stability of the decision model during training, adjust the parameters of the decision model with a more appropriate step size, avoid over-correction or under-correction of the parameters of the decision model, and ensure the balance and stability of the learning process.

[0183] In some embodiments, such as Figure 8 As shown, after step 650, the method further includes the following step 810: Step 810: In response to the end of the next statistical period of the target statistical period, obtain the execution error cases generated in the next statistical period as the second execution error cases.

[0184] Step 820: Based on the first execution error case and the second execution error case, determine the reference historical error that occurs more frequently in the next statistical period than in the target statistical period.

[0185] The first and second execution error cases are combined and categorized by error. That is, the first and second execution error cases involving the same historical error are grouped into one set, resulting in a set corresponding to each historical error. If, in the set corresponding to a historical error (taking historical error E1 as an example), the number of second execution error cases involving historical error E1 is greater than the number of first execution error cases involving historical error E1, then the occurrence frequency of historical error E1 in the next statistical period of the target statistical period is determined. If it is higher than the occurrence frequency in the target statistical period, historical error E1 is designated as a reference historical error.

[0186] Understandably, after the target statistical period ends, the decision model in the agent is updated and trained using execution error cases generated during the target statistical period (including the first execution error case involving reference history errors). However, the number of occurrences of reference history errors in the next statistical period after the target statistical period is higher than the number of occurrences in the target statistical period. This indicates that the training of the decision model after the target statistical period ends does not improve the policy prediction performance of the decision model in response to reference history errors.

[0187] In some embodiments, if it is determined, based on the first execution error case and the second execution error case, that there is no reference history error, indicating that the training of the decision model after the end of the target statistical period is effective and that the occurrence of errors has been reduced after training, then after the end of the next statistical period in the later stage of the target statistics, the decision model can be directly updated and trained using the second execution error case, without needing to perform the following steps 830-840.

[0188] Step 830: Based on the error information in the second execution error case and the first error correction strategy in the first execution error case, a new error correction strategy for the reference historical error is determined.

[0189] The first error correction strategy refers to the error correction strategy in the first execution error case that references historical errors. The first error correction strategy acts as negative feedback, causing the new error correction strategy that is redefined based on historical errors to deviate from the first error correction strategy.

[0190] In some embodiments, the cluster center to which the reference historical error belongs can be determined based on the error information in the second execution error case and the cluster center of the agent's execution error case set. For ease of description, this cluster center is referred to as the first cluster center.

[0191] Based on the error information in the second execution error case referencing historical errors and the error information in each execution error case belonging to the first cluster center, calculate the first feature similarity between the reference historical error and each historical error belonging to the first cluster center, and calculate the second feature similarity between the first error correction strategy and the error correction strategies in each execution error case belonging to the first cluster center. Among the execution error cases belonging to the first cluster center, identify candidate execution error cases where the first feature similarity between the historical error and the reference execution error is higher than a similarity threshold. Among these candidate execution error cases, identify the candidate execution error case with the smallest second feature similarity between the error correction strategy and the first error correction strategy, and use this as the target execution error case. Use the error correction strategy in the target execution error case as the new error correction strategy for the reference historical error.

[0192] In another embodiment, the correction strategy prediction model trained above can be used to redetermine a new error correction strategy for the reference historical error based on the error information of the reference historical error in the second execution error case and the first error correction strategy of the reference historical error in the first execution error case. Similarly, the first error correction strategy is used to provide negative feedback to the correction strategy prediction model, indicating that the first error correction strategy cannot correct the corresponding reference historical error.

[0193] Step 840: Update the second execution error case where the referenced historical error is located, based on the new error correction strategy for the referenced historical error.

[0194] That is, the error correction strategy in the second execution error case that references historical errors is replaced with a new error correction strategy that references historical errors.

[0195] Step 850: Update and train the decision model based on the updated second execution error case.

[0196] In step 850, the decision model is updated and trained by combining the updated second execution error case with other second execution error cases that do not need to be updated. The process of updating and training the decision model is basically similar to the process of updating and training the decision model after the end of the target statistical period, and will not be described in detail here.

[0197] In the above embodiments, after updating and training the decision model after the target statistical period ends, the performance of the decision model in the next statistical period after the target statistical period is also combined to verify the effect of updating and training the decision model after the target statistical period ends, so as to confirm whether the task execution strategy predicted by the decision model has reduced the occurrence of errors after updating and training the decision model after the target statistical period ends.

[0198] If it is determined that the occurrence of errors has not been reduced, the first error correction strategy in the first execution error case, referencing historical errors, is used as negative feedback. This negative feedback mechanism is then used to determine a new error correction strategy for the reference historical errors, ensuring that the new strategy is more effective in correcting and preventing them. Based on the new error correction strategy, the second execution error case containing the reference historical error is updated. Subsequently, the decision model is updated and trained based on the updated second execution error case. This is equivalent to adjusting the error correction strategy for reference historical errors when the updated training of the decision model after the target statistical period ends has not improved the model's performance on some tasks. This aims to improve the decision model's performance in dealing with reference historical errors and effectively reduce their occurrence in subsequent processes.

[0199] Through the above embodiments, the training direction of the decision model can be adjusted in a timely manner based on the performance of the decision model in the intelligent agent after the training is updated. New error data and experience feedback can be incorporated into the decision model in a timely manner, which can effectively improve the accuracy of the task execution strategy generated by the decision model.

[0200] In some embodiments, after step 220, the method further includes: if the error prediction information indicates that no error will occur, the agent executes the target task according to the task execution strategy.

[0201] In other words, under these circumstances, there is no need to predict errors and control strategies in advance, nor is it necessary to adjust the decision model to generate task execution strategies for the target task.

[0202] During the process of the agent executing the target task according to the task execution strategy, it is still necessary to reflect on the process after each execution step to determine whether any errors occurred in each step. If errors occur, they are recorded to generate execution error cases and updated to the agent's execution error case set. This ensures timely recording of errors and facilitates learning from error correction experiences in subsequent tasks, thereby better handling subsequent tasks and reducing the occurrence of errors.

[0203] The solution of this application will now be described with reference to a specific embodiment. Figure 9 As shown, it includes: Step 910, Error logging and analysis; Error logging and analysis primarily aims to record errors made by the agent during task execution in real time, forming a set of execution error cases. This set is then analyzed to identify the agent's weaknesses and common errors. During this process, the set of execution error cases is dynamically updated, and errors are categorized for subsequent updates to the agent's decision-making model.

[0204] Please continue reading. Figure 9 Step 910 further includes steps 911-914: Step 911, receiving the task; generating the task execution strategy from the decision model in the agent. In the first statistical period, creating an execution error case set for agent initialization.

[0205] Step 912, Execute the task. During the execution of the task by the agent, detect whether an error has occurred in each execution step. Error types include, but are not limited to, logical errors, data errors, and tool usage errors.

[0206] Step 913, Error Recording. If an error is detected during task execution, an execution error case is generated and added to the execution error case set based on the error type, error information (such as the environment, context, and frequency of the error), error cause, and error correction strategy.

[0207] Step 914, Error Classification and Analysis. Using algorithms such as clustering, cluster analysis is performed on the execution error cases in the execution error case set to identify common error patterns of the agent.

[0208] Step 920, agent adaptive learning.

[0209] The core objective of agent adaptive learning is to update and train the agent's decision-making model by executing a set of error cases. This allows the model to gradually adjust and optimize its decision-making strategies, reducing errors in future tasks. Adaptive learning enables the agent's decision-making model to automatically adjust its parameters based on accumulated historical error data, thereby improving the accuracy and efficiency of subsequent task execution.

[0210] Before updating and training the decision-making model, an appropriate learning rate can be determined, i.e., an adaptive learning rate can be used to avoid over- or under-correction of the model. Furthermore, a feedback mechanism is incorporated: after each training update, the model's performance in the next statistical period is used to validate the effectiveness of the previous update. If the updated model reduces errors, it is retained and further optimized; if the updated model does not improve task performance, training is readjusted until the most suitable error correction strategy is found.

[0211] The process of updating and training the decision-making model in the agent is described above and will not be repeated here. Step 930, Predictive Control and Error Correction.

[0212] In step 930, before the agent performs a task (e.g., a target task), an error prediction model is used to predict possible errors (e.g., a first error) that may occur during the execution of the target task. An error control strategy is then generated specifically for the predicted first error. The task execution strategy of the target task is then adjusted according to the error control strategy, with the aim of using the error control strategy before the error occurs, avoiding the error, and improving the robustness and stability of the agent.

[0213] Please continue reading. Figure 9 Step 930 includes: Step 931: Train the error prediction model by executing the error case set; Step 932: Using an error prediction model, predict possible errors during the execution of the target task to obtain error prediction information; Step 933: Generate an error control strategy for the first error indicated by the error prediction information based on the error prediction information.

[0214] Step 934: Adjust the task execution strategy of the target task according to the error control strategy.

[0215] Step 935, real-time error correction.

[0216] If a first error, as indicated by error prediction information, is detected during the execution of the target task, an error correction strategy is employed to correct the first error. The error correction strategy includes, but is not limited to, readjusting task steps and activating alternative tools or methods to replace operations that may have caused the error.

[0217] In addition, a feedback mechanism is activated to generate execution error cases based on the error information of the errors that occur, and add them to the execution error case set for future learning.

[0218] Step 936: Feedback and optimization after task completion.

[0219] After the target task is completed, the error prediction model is updated and trained based on the task's execution status. For example, if an error occurs during the execution of the target task that the error prediction model did not predict, the error prediction model is updated and trained based on the execution error case of that error to improve the accuracy of the error prediction model in subsequent predictions.

[0220] By employing the predictive control (i.e., predicting potential errors during task execution before execution) and error correction mechanisms (adjusting strategies before execution and promptly correcting errors after they occur) provided in this application, the agent can predict potential errors before task execution, adjust task execution strategies in a timely manner, avoid errors, and improve the agent's reliability and stability. Furthermore, timely error correction after errors occur effectively enhances the agent's accuracy, stability, and efficiency during task execution.

[0221] The following describes an apparatus embodiment of this application, which can be used to perform the methods described in the above embodiments of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the method embodiments described in the above embodiments of this application.

[0222] Figure 10 This is a block diagram of a task processing apparatus according to an embodiment of this application, such as... Figure 10 As shown, the task processing device includes: an acquisition module 1010 for acquiring task context information of the target task; an error prediction module 1020 for predicting errors that may occur during the execution of the target task by the agent using an error prediction model based on the task context information, thereby obtaining error prediction information; the error prediction model is trained based on a set of execution error cases constructed for the agent; a generation module 1030 for generating an error control policy for the first error if the error prediction information indicates that a first error has been predicted, based on the error prediction information and the task context information; a policy adjustment module 1040 for adjusting the task execution policy generated by the agent for the target task according to the error control policy, thereby obtaining a target task execution policy; and an execution module 1050 for the agent to execute the target task according to the target task execution policy.

[0223] In some embodiments, the generation module 1030 includes: a deduction unit, configured to perform execution process deduction based on task context information and error prediction information to determine the first error information when the first error occurs; an attribution analysis unit, configured to perform attribution analysis based on the first error information to determine the first candidate cause of the first error; and a strategy generation unit, configured to generate a prevention strategy based on the first candidate cause to obtain an error control strategy for the first error.

[0224] In some embodiments, the task processing apparatus further includes: an error detection module, configured to detect errors in the execution process of the target task during the process of the agent executing the target task according to the target task execution strategy; and an error correction module, configured to adjust the target task execution strategy according to the real-time execution status of the target task and the error control strategy if a first error is detected, so as to correct the first error.

[0225] In some embodiments, the task execution strategy for the target task is generated by the decision model of the agent; the error correction module includes: a re-prediction unit, used by the decision model to regenerate the action information of the reference execution step in which the first error occurred based on the real-time execution status of the target task and the error control strategy; and an adjustment unit, used to adjust the action of the reference execution step in the target task execution strategy based on the action information of the reference execution step, and the agent restarts execution from the reference execution step according to the adjusted target task execution strategy.

[0226] In some embodiments, the task processing apparatus further includes: a data acquisition module, configured to acquire second error information of the second error if a second error other than the first error is detected during the execution of the target task by the agent; a correction strategy generation module, configured to generate candidate correction strategies for the second error based on the second error information and an execution error case set; a case generation module, configured to combine the second error information and the candidate correction strategies to generate execution error cases of the second error; and an adding module, configured to add the execution error cases of the second error to the execution error case set.

[0227] In some embodiments, each execution error case in the execution error case set includes error information of historical errors that occurred during the execution of historical tasks and error correction strategies for historical errors; the correction strategy generation module includes: The cluster center determination unit is used to determine the target cluster center to which the second error belongs based on the second error information and the cluster centers to which each historical error in the execution error case set belongs; The feature similarity calculation unit is used to calculate the feature similarity between the second error information and the error information of each historical error belonging to the target cluster center; The candidate historical error determination unit is used to identify candidate historical errors whose feature similarity is higher than the similarity threshold among historical errors belonging to the target cluster center. The candidate correction strategy determination unit is used to select a candidate historical error correction strategy as a candidate correction strategy for the second error.

[0228] In some embodiments, each execution error case in the execution error case set includes error information of historical errors that occurred during the execution of historical tasks; the task processing device further includes: a first acquisition module, configured to acquire task context information of historical tasks; a first prediction module, configured to predict errors that occur in the process of executing historical tasks by the agent based on the task context information of historical tasks, thereby obtaining historical error prediction information; an error prediction loss calculation module, configured to calculate error prediction loss based on historical error prediction information and the error information of historical errors; and a first adjustment module, configured to adjust the parameters of the error prediction model based on the error prediction loss until a first training termination condition is met.

[0229] In some embodiments, the task execution strategy is generated by the agent's decision model; the task processing device further includes: a second acquisition module, configured to, in response to the end of the target statistical period, acquire execution error cases generated during the target statistical period from the set of execution error cases, as first execution error cases; the first execution error cases include error correction strategies for historical errors that occurred during the execution of historical tasks; a third acquisition module, configured to acquire historical task execution strategies corresponding to each historical task, the historical task execution strategies being generated by the decision model for the historical tasks during the target statistical period; a second adjustment module, configured to adjust the historical task execution strategies corresponding to the historical tasks according to the error correction strategies for the historical errors corresponding to the historical tasks in the first execution error cases, to obtain reference task execution strategies corresponding to the historical tasks; a strategy prediction loss calculation module, configured to calculate strategy prediction loss according to the reference task execution strategies corresponding to the historical tasks and the historical task execution strategies corresponding to the historical tasks; and a first update training module, configured to update and train the decision model according to the strategy prediction loss until the second training termination condition is met.

[0230] In some embodiments, the first update training module is configured to: update and train the decision model according to the policy prediction loss and the learning rate determined for the target statistical period until a second training termination condition is met; the task processing device further includes: an error ratio determination module, used to determine the error ratio in the target statistical period according to the number of first execution error cases; an adjustment parameter determination module, used to determine a learning rate adjustment parameter according to the error ratio; the learning rate adjustment parameter is negatively correlated with the error ratio; a historical learning rate acquisition module, used to acquire the historical learning rate of the previous statistical period of the target statistical period; and a learning rate adjustment module, used to adjust the historical learning rate according to the learning rate adjustment parameter to obtain the learning rate in the target statistical period.

[0231] In some embodiments, the task processing apparatus further includes: a fourth acquisition module, configured to acquire, in response to the end of the next statistical period of the target statistical period, an execution error case generated in the next statistical period as a second execution error case; a reference historical error determination module, configured to determine, based on the first execution error case and the second execution error case, a reference historical error that occurs more frequently in the next statistical period than in the target statistical period; a re-determination module, configured to re-determine a new error correction strategy for the reference historical error based on the error information of the reference historical error in the second execution error case and the first error correction strategy of the reference historical error in the first execution error case; an update module, configured to update the second execution error case containing the reference historical error based on the new error correction strategy of the reference historical error; and a second update training module, configured to update and train the decision model based on the updated second execution error case.

[0232] In some embodiments, the task processing apparatus further includes: a first execution module, configured to, if error prediction information indicates that no error will occur, have the agent execute the target task according to the task execution strategy.

[0233] Figure 11 A schematic diagram of a computer system suitable for implementing the embodiments of this application is shown. It should be noted that... Figure 11 The computer system 1100 of the illustrated electronic device is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application. The electronic device may be the switching node mentioned above, or a management network switch connected to the switching node. The electronic device can be used to execute the task processing method provided in the application.

[0234] like Figure 11 As shown, the computer system 1100 includes a Central Processing Unit (CPU) 1101, which can perform various appropriate actions and processes, such as executing the methods described in the above embodiments, based on programs stored in Read-Only Memory (ROM) 1102 or programs loaded from storage portion 1108 into Random Access Memory (RAM) 1103. The RAM 1103 also stores various programs and data required for system operation. The CPU 1101, ROM 1102, and RAM 1103 are interconnected via a bus 1104. An Input / Output (I / O) interface 1105 is also connected to the bus 1104.

[0235] The following components are connected to I / O interface 1105: an input section 1106 including a keyboard, mouse, etc.; an output section 1107 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to I / O interface 1105 as needed. Removable media 1111, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1110 as needed so that computer programs read from them can be installed into storage section 1108 as needed.

[0236] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1109, and / or installed from removable medium 1111. When the computer program is executed by central processing unit (CPU) 1101, it performs various functions defined in the system of this application.

[0237] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0238] In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0239] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0240] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.

[0241] In another aspect, this application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable storage medium carries computer instructions that, when executed by a processor, implement the methods in any of the above embodiments.

[0242] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal. It can be implemented wholly or partially using software, hardware (e.g., processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that functions as a whole.

[0243] According to one aspect of the embodiments of this application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, causing the electronic device to perform the methods of any of the above embodiments.

[0244] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0245] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the methods according to the embodiments of this application.

[0246] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.

[0247] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A task processing method, characterized in that, include: Obtain the task context information of the target task; The error prediction model predicts errors that the agent may make during the execution of the target task based on the task context information, thereby obtaining error prediction information; the error prediction model is trained on a set of execution error cases constructed for the agent. If the error prediction information indicates that a first error has been predicted, an error control strategy for the first error is generated based on the error prediction information and the task context information. Based on the error control strategy, the task execution strategy generated by the agent for the target task is adjusted to obtain the target task execution strategy; The intelligent agent executes the target task according to the target task execution strategy.

2. The method according to claim 1, characterized in that, The step of generating an error control strategy for the first error based on the error prediction information and the task context information includes: Based on the task context information and the error prediction information, the execution process is deduced to determine the first error information when the first error occurs; Based on the first error information, an attribution analysis is performed to determine the first candidate cause of the first error; Based on the first candidate cause, a prevention strategy is generated to obtain an error control strategy for the first error.

3. The method according to claim 1, characterized in that, The method further includes: During the process of the agent executing the target task according to the target task execution strategy, error detection is performed on the execution process of the target task; If the first error is detected, the execution strategy of the target task is adjusted according to the real-time execution status of the target task and the error control strategy to correct the first error.

4. The method according to claim 3, characterized in that, The task execution strategy for the target task is generated by the decision model of the agent. The step of adjusting the execution strategy of the target task based on the real-time execution status of the target task and the error control strategy includes: The decision model regenerates the action information of the reference execution steps in which the first error occurred, based on the real-time execution status of the target task and the error control strategy. Based on the action information of the reference execution step, the action of the reference execution step in the target task execution strategy is adjusted, and the agent restarts execution from the reference execution step according to the adjusted target task execution strategy.

5. The method according to claim 3, characterized in that, After performing error detection on the execution process of the target task during the process of the agent executing the target task according to the target task execution strategy, the method further includes: If a second error other than the first error is detected during the execution of the target task by the intelligent agent, the second error information of the second error is collected; Based on the second error information and the execution error case set, a candidate correction strategy for the second error is generated; The second error information and the candidate correction strategy are combined to generate an execution error case for the second error. Add the execution error case of the second error to the execution error case set.

6. The method according to claim 5, characterized in that, Each execution error case in the execution error case set includes error information of historical errors that occurred during the execution of historical tasks and error correction strategies for the historical errors; The step of generating a candidate correction strategy for the second error based on the second error information and the execution error case set includes: Based on the second error information and the cluster centers of each historical error in the execution error case set, determine the target cluster center to which the second error belongs; Calculate the feature similarity between the second error message and the error messages of each historical error belonging to the target cluster center; Among the historical errors belonging to the target cluster center, candidate historical errors whose feature similarity is higher than the similarity threshold are identified; One of the candidate historical error correction strategies is used as a candidate correction strategy for the second error.

7. The method according to any one of claims 1 to 6, characterized in that, Each execution error case in the execution error case set includes error information of historical errors that occurred during the execution of historical tasks; Before obtaining error prediction information by predicting errors that the agent may make during the execution of the target task based on the task context information using an error prediction model, the method further includes: Obtain the task context information of the historical task; The error prediction model predicts the errors that the agent will make during the execution of the historical task based on the task context information of the historical task, thus obtaining historical error prediction information. Calculate the error prediction loss based on the historical error prediction information and the error information of the historical errors; Based on the error prediction loss, adjust the parameters of the error prediction model until the first training termination condition is met.

8. The method according to any one of claims 1 to 6, characterized in that, The task execution strategy is generated by the agent's decision model; the method further includes: In response to the end of the target statistical period, execution error cases generated during the target statistical period are obtained from the execution error case set and designated as first execution error cases; the first execution error cases include error correction strategies for historical errors that occurred during the execution of historical tasks; Obtain the historical task execution strategy corresponding to each of the historical tasks, wherein the historical task execution strategy is generated by the decision model for the historical tasks in the target statistical period; Based on the error correction strategy for the historical error corresponding to the historical task in the first execution error case, the historical task execution strategy corresponding to the historical task is adjusted to obtain the reference task execution strategy corresponding to the historical task. Calculate the strategy prediction loss based on the reference task execution strategy corresponding to the historical task and the historical task execution strategy corresponding to the historical task. Based on the predicted loss according to the strategy, the decision model is updated and trained until the second training termination condition is met.

9. The method according to claim 8, characterized in that, The step of predicting the loss according to the strategy and updating and training the decision model until the second training termination condition is met includes: The decision model is updated and trained based on the predicted loss according to the strategy and the learning rate determined for the target statistical period until the second training termination condition is met. The method further includes: Based on the number of the first execution error cases, determine the error rate in the target statistical period; The learning rate adjustment parameter is determined based on the error ratio; the learning rate adjustment parameter is negatively correlated with the error ratio. Obtain the historical learning rate of the previous statistical period of the target statistical period; The historical learning rate is adjusted according to the learning rate adjustment parameter to obtain the learning rate for the target statistical period.

10. The method according to claim 8, characterized in that, After updating and training the decision model based on the predicted loss according to the strategy and the learning rate determined for the target statistical period until the second training termination condition is met, the method further includes: In response to the end of the next statistical period of the target statistical period, an execution error case generated in the next statistical period is obtained as a second execution error case; Based on the first execution error case and the second execution error case, determine a reference historical error that occurs more frequently in the next statistical period than in the target statistical period; Based on the error information of the reference history error in the second execution error case and the first error correction strategy of the reference history error in the first execution error case, a new error correction strategy for the reference history error is determined. Based on the new error correction strategy for the reference history error, the second execution error case where the reference history error is located is updated; The decision model is updated and trained based on the updated second execution error case.

11. The method according to claim 1, characterized in that, After obtaining error prediction information by predicting errors that may occur in the execution of the target task by the agent based on the task context information using an error prediction model, the method further includes: If the error prediction information indicates that no error will occur, the agent will execute the target task according to the task execution strategy.

12. A task processing device, characterized in that, include: The acquisition module is used to obtain the task context information of the target task; The error prediction module is used to predict errors that may occur in the process of the agent performing the target task based on the task context information using an error prediction model, and to obtain error prediction information; the error prediction model is trained based on a set of execution error cases constructed for the agent; The generation module is configured to generate an error control strategy for the first error based on the error prediction information and the task context information if the error prediction information indicates that a first error has been predicted. The strategy adjustment module is used to adjust the task execution strategy generated by the agent for the target task according to the error control strategy, so as to obtain the target task execution strategy. An execution module is used by the intelligent agent to execute the target task according to the target task execution strategy.

13. An electronic device, characterized in that, include: processor; A memory storing computer instructions that, when executed by the processor, implement the method as described in any one of claims 1 to 11.

14. A computer-readable storage medium storing computer instructions thereon, characterized in that, When the computer instructions are executed by the processor, the method as described in any one of claims 1 to 11 is implemented.

15. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the method of any one of claims 1 to 11.