Query processing method and device, equipment, storage medium and computer program product
By acquiring task planning and call chain information in a multi-agent system, and locating and correcting abnormal execution nodes, the problem of query result errors in multi-agent systems is solved, achieving efficient and accurate error correction and improved reliability of query processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-22
- Publication Date
- 2026-04-07
AI Technical Summary
When multi-agent systems handle complex query tasks, the inherent illusion problem of LLM and the data uncertainty of external tools may lead to factual errors, logical contradictions or missing information in the final output answer. Existing error correction methods are inefficient and cannot accurately correct errors.
By acquiring task planning information and call chain information, abnormal execution nodes can be located, their original execution parameters can be corrected, and the tasks of abnormal execution nodes can be re-executed to generate updated query results, avoiding global re-execution and improving error correction efficiency and accuracy.
It effectively avoids the propagation of abnormalities, reduces computational overhead, improves the reliability and accuracy of query processing, and reduces the cost and error rate of manual review.
Smart Images

Figure CN121807912A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, device, storage medium, and computer program product for query processing. Background Technology
[0002] With the rapid development of large language model capabilities, multi-agent systems based on large language models (LLMs) can handle complex query tasks. Multi-agent systems can decompose complex user query requests into workflows or decision chains consisting of multiple sub-tasks, then schedule a series of tasks with specific functions to execute collaboratively, and finally integrate the results from each node to generate the final answer to the query.
[0003] Currently, using multi-agent systems to handle complex tasks can expand the application boundaries of LLM. However, due to the inherent illusion problem of LLM, and the data uncertainty of external tools and the error propagation effect in complex links, the final output answer of a multi-agent system may contain factual errors, logical contradictions, or missing information. In other words, the final output answer depends on the reliability and accuracy of each link. Therefore, how to efficiently and accurately locate and correct errors when problems occur has become a key challenge to improving the reliability of multi-agent systems. Summary of the Invention
[0004] Therefore, it is necessary to provide a query processing method, apparatus, device, storage medium, and computer program product that can efficiently and accurately locate and correct errors to improve the reliability of query processing, in order to address the above-mentioned technical problems.
[0005] Firstly, this application provides a query processing method. The method includes:
[0006] In the event that the initial query result generated for the target query is abnormal, the task planning information and call chain information for generating the initial query result are obtained. The task planning information is the planning information corresponding to the multiple execution nodes of the query task that executes the target query, and the call chain information is used to describe the call information corresponding to each execution node when executing the query task.
[0007] Based on task planning information and call chain information, identify the abnormal execution node that caused the initial query results to be abnormal;
[0008] The original execution parameters of the abnormal execution node are corrected to obtain the corrected execution parameters;
[0009] Execute the node task matching the abnormal execution node according to the corrected execution parameters, and obtain the updated query results for the target query.
[0010] Secondly, this application also provides a query processing apparatus. The apparatus includes:
[0011] The exception handling module is used to obtain the task planning information and call chain information for generating the initial query result when an exception occurs in the initial query result generated for the target query. The task planning information is the planning information corresponding to the multiple execution nodes of the query task that executes the target query, and the call chain information is used to describe the call information corresponding to each execution node when executing the query task.
[0012] The abnormal execution node determination module is used to determine the abnormal execution node that causes the initial query results to be abnormal, based on task planning information and call chain information.
[0013] The parameter correction module is used to correct the original execution parameters of the abnormal execution node to obtain the corrected execution parameters;
[0014] The re-query processing module is used to execute the node task matching the abnormal execution node according to the corrected execution parameters, and obtain the updated query result for the target query.
[0015] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0016] In the event that the initial query result generated for the target query is abnormal, the task planning information and call chain information for generating the initial query result are obtained. The task planning information is the planning information corresponding to the multiple execution nodes of the query task that executes the target query, and the call chain information is used to describe the call information corresponding to each execution node when executing the query task.
[0017] Based on task planning information and call chain information, identify the abnormal execution node that caused the initial query results to be abnormal;
[0018] The original execution parameters of the abnormal execution node are corrected to obtain the corrected execution parameters;
[0019] Execute the node task matching the abnormal execution node according to the corrected execution parameters, and obtain the updated query results for the target query.
[0020] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0021] In the event that the initial query result generated for the target query is abnormal, the task planning information and call chain information for generating the initial query result are obtained. The task planning information is the planning information corresponding to the multiple execution nodes of the query task that executes the target query, and the call chain information is used to describe the call information corresponding to each execution node when executing the query task.
[0022] Based on task planning information and call chain information, identify the abnormal execution node that caused the initial query results to be abnormal;
[0023] The original execution parameters of the abnormal execution node are corrected to obtain the corrected execution parameters;
[0024] Execute the node task matching the abnormal execution node according to the corrected execution parameters, and obtain the updated query results for the target query.
[0025] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0026] In the event that the initial query result generated for the target query is abnormal, the task planning information and call chain information for generating the initial query result are obtained. The task planning information is the planning information corresponding to the multiple execution nodes of the query task that executes the target query, and the call chain information is used to describe the call information corresponding to each execution node when executing the query task.
[0027] Based on task planning information and call chain information, identify the abnormal execution node that caused the initial query results to be abnormal;
[0028] The original execution parameters of the abnormal execution node are corrected to obtain the corrected execution parameters;
[0029] Execute the node task matching the abnormal execution node according to the corrected execution parameters, and obtain the updated query results for the target query.
[0030] The aforementioned query processing method, apparatus, computer equipment, storage medium, and computer program product, when encountering an anomaly in the initial query result generated for a target query, acquires task planning information and call chain information for generating the initial query result. The task planning information comprises the planning information corresponding to multiple execution nodes of the query task executing the target query, while the call chain information describes the call information corresponding to each execution node during the execution of the query task. Based on the task planning information and call chain information, the abnormal execution node causing the initial query result anomaly is identified. The original execution parameters of the abnormal execution node are corrected to obtain corrected execution parameters. The node task matching the abnormal execution node is executed according to the corrected execution parameters to obtain an updated query result for the target query. In the case of an anomaly in the initial query result, locating the abnormal execution node causing the anomaly through task planning information and call chain information can prevent the propagation of anomalies. Furthermore, locating the abnormal execution node reduces the time and economic costs associated with manual review and identification, and also lowers the error rate associated with manual review and identification. Secondly, it only needs to perform targeted retries and corrections on abnormal execution nodes, without having to re-execute the target query globally. This avoids repeated execution of normal execution nodes, significantly improving error correction efficiency and reducing computational overhead. As a result, it can efficiently and accurately locate and correct errors, thereby improving the reliability of query processing. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is an application environment diagram of the query processing method in one embodiment;
[0033] Figure 2 This is a schematic diagram of the system architecture flow and data interaction relationship in a query processing system according to one embodiment;
[0034] Figure 3 This is a flowchart illustrating a query processing method in one embodiment;
[0035] Figure 4 This is a schematic diagram of the interface that triggers exception feedback information in one embodiment;
[0036] Figure 5 This is a schematic diagram of the interface that triggers the exception feedback information in another embodiment;
[0037] Figure 6 This is a schematic diagram of an embodiment of a directed acyclic graph;
[0038] Figure 7 This is a schematic diagram illustrating an embodiment of task execution targeting a sub-execution node;
[0039] Figure 8 This is a schematic diagram illustrating an embodiment of executing tasks to leaf execution nodes;
[0040] Figure 9 This is a schematic diagram illustrating the correction of the node output result of the previous execution node in one embodiment;
[0041] Figure 10 This is a schematic diagram illustrating the updated query results obtained by executing a task according to modified execution parameters in one embodiment;
[0042] Figure 11 This is a schematic diagram illustrating the modification of the execution sub-node in one embodiment;
[0043] Figure 12 This is a schematic diagram of the process in one embodiment of executing the node task matching the abnormal execution node according to the modified execution parameters to obtain the updated query result for the target query again;
[0044] Figure 13 This is a schematic diagram illustrating the updated query results of the target query obtained in one embodiment;
[0045] Figure 14 This is a schematic diagram illustrating the dependency on execution nodes in one embodiment;
[0046] Figure 15 This is a schematic diagram illustrating the updated query result of the target query in another embodiment;
[0047] Figure 16 This is a complete flowchart of a query processing method in one embodiment;
[0048] Figure 17 This is a structural block diagram of a query processing device in one embodiment;
[0049] Figure 18 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0051] With the rapid development of large language model capabilities, LLM-based multi-agent systems can handle complex query tasks. Multi-agent systems can decompose complex user query requests into workflows or decision chains consisting of multiple sub-tasks, then schedule a series of tasks with specific functions to execute collaboratively, and finally integrate the results of each node to generate the final answer to the query. Currently, using multi-agent systems to handle complex tasks can expand the application boundaries of LLM. However, due to the inherent illusion problem of LLM, and the data uncertainty of external tools and the error propagation effect in complex chains, the final output answer of a multi-agent system may contain factual errors, logical contradictions, or missing information. In other words, the final output answer depends on the reliability and accuracy of each link.
[0052] For example, the most direct and common fault-tolerance solution is end-to-end re-execution. This means that when an error occurs, the solution is to discard all intermediate results, re-enter the user's original query into the system, and re-execute the entire planning and task flow from scratch. This relies on the randomness of multiple runs in the hope of obtaining a better result, but its efficiency is extremely low. Alternatively, a simple retry and rollback mechanism can be used, specifically targeting the failure or low-confidence output of a single node. The best result is selected based on voting or scoring. If multiple retries still fail, it may roll back to a default response or directly report an error. In this case, it is impossible to correct the end-to-end deviation caused by defects in the planning phase, resulting in inaccurate query processing. Therefore, how to efficiently and accurately locate and correct errors when problems occur has become a key challenge in improving the reliability of multi-agent systems.
[0053] This application provides a query processing method that can efficiently and accurately locate and correct errors, thereby improving the reliability of query processing. The query processing method provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on another server.
[0054] Specifically, taking server 104 as an example, when server 104 determines that the initial query result generated for the target query is abnormal, it obtains the task planning information and call chain information for generating the initial query result. The task planning information is the planning information corresponding to multiple execution nodes of the query task executing the target query, and the call chain information describes the call information corresponding to each execution node when executing the query task. Based on the task planning information and call chain information, the abnormal execution node causing the initial query result to be abnormal is identified. Then, the original execution parameters of the abnormal execution node are corrected to obtain corrected execution parameters. The node task matching the abnormal execution node is then executed according to the corrected execution parameters to obtain the updated query result for the target query. By locating the abnormal execution node causing the initial query result to be abnormal, the propagation of the error can be avoided. Furthermore, only the abnormal execution node needs to be retried and corrected, without globally re-executing the target query, thus avoiding repeated execution of normal execution nodes. This significantly improves error correction efficiency and reduces computational overhead, enabling efficient and accurate error location and correction, thereby improving the reliability of query processing.
[0055] The terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers. The query processing method provided in this embodiment can be applied to various scenarios, including but not limited to web searches, code execution, professional knowledge queries, and tool calls—scenarios requiring query processing for a target query.
[0056] The system architecture of the query processing system in this embodiment of the application comprises at least four major modules working together: a task execution engine, a metacognitive diagnostic engine, a link state memory, and a user interaction interface. For ease of understanding, as follows: Figure 2 The diagram shows the system architecture flow of the query processing system and the data interaction relationship. The query processing system's workflow includes at least the following steps: initial execution 202, diagnostic triggering 204, diagnostic analysis 206, planning and re-execution 208, impact propagation and updating 210, and result presentation 212.
[0057] The initial execution 202 process targets the target user's query and requires processing by the task execution engine. This involves decomposing the target query into a plan through the planning agent within the task execution engine, and scheduling multiple functional agents to execute each execution node in sequence. The intermediate query results output by each execution node, as well as the initial query results obtained, are stored in the link state storage. Finally, the intermediate query results and initial query results obtained for the target query are presented to the target user who issued the target query through the user interaction interface.
[0058] Based on this, in diagnostic trigger 204, if the target user determines that there is an anomaly in the intermediate query results and initial query results displayed through the user interaction interface, they can input text feedback or directly report the anomaly to trigger the error correction process. At this point, it is determined that the initial query results generated for the target query are abnormal. In the case of an anomaly, diagnostic analysis 206 is performed. During diagnostic analysis 206, the metacognitive diagnostic engine is activated. The metacognitive diagnostic engine retrieves complete task planning information and call chain information for generating the initial query results from the link state memory. This allows the diagnostic analysis agent in the metacognitive diagnostic engine to analyze based on the task planning information and call chain information, locating the abnormal execution node that caused the initial query result to be abnormal. Abnormal execution nodes can include, but are not limited to, execution nodes exhibiting hallucinations, factual errors, or discrepancies with user feedback. The aforementioned diagnostic analysis agent is a large language model used for anomaly analysis. In planning and re-execution 208, the metacognitive diagnostic engine still needs to formulate a correction plan, such as modifying the execution instructions of the abnormal execution node or modifying the input parameters of the abnormal execution node, that is, correcting the original execution parameters of the abnormal execution node to obtain the corrected execution parameters of the abnormal execution node. Furthermore, it is necessary to design the task execution engine to only partially re-execute abnormal execution nodes and their affected subsequent dependent nodes.
[0059] Based on this, in the influence propagation and update 210, targeted re-execution is performed through the task execution engine. This involves executing the node task matching the abnormal execution node according to the corrected execution parameters, obtaining the node output result matching the abnormal execution node, and, in the case of dependent execution nodes that depend on the abnormal execution node, using the node output result matching the abnormal execution node as input parameters for the dependent execution node. This allows the dependent execution node to execute its matching node task, obtaining its own node output result, thereby updating the node output result of the re-executed execution node. In other words, in influence propagation and update 210, during the re-execution of the abnormal execution node, dependent execution nodes affected by the abnormal execution node's node output result are identified, and these dependent execution nodes are re-executed, achieving incremental updates. Finally, in the result presentation 212, the node output results of non-dependent execution nodes, the node output results matching the abnormal execution node, and the node output results of dependent execution nodes are synthesized to obtain the updated query result for the target query. This updated query result is then presented again to the target user who issued the target query through the user interaction interface.
[0060] The following examples illustrate this in detail: In one exemplary embodiment, as shown... Figure 3 As shown, a query processing method is provided, which is applied to... Figure 1 Taking server 104 as an example, it can be understood that this method can also be applied to terminal 102, and also to a system including terminal 102 and server 104, and is implemented through the interaction between terminal 102 and server 104. In this embodiment, the method includes steps 302 to 308. Wherein:
[0061] Step 302: If the initial query result generated for the target query is abnormal, obtain the task planning information and call chain information for generating the initial query result; the task planning information is the planning information corresponding to the multiple execution nodes of the query task that executes the target query, and the call chain information is used to describe the call information corresponding to each execution node when executing the query task.
[0062] The target query, in this context, refers to the query issued by the target user seeking a specific question. Therefore, the target query varies depending on the application scenario. For example, in web search, the target query might be search text describing the search request, or multi-dimensional search information including the request (such as search text, search images, etc.). In professional knowledge query scenarios, the target query might be information pointing to a specific knowledge domain. And in tool invocation scenarios, the target query might be information pointing to invoking a target tool. Therefore, no specific limitations are imposed on the target query here.
[0063] Secondly, the initial query results are the preliminary query results obtained from the target query. In this embodiment, the target query is specifically decomposed into planning information by the planning agent within the task execution engine. This planning information includes multiple execution nodes (Nodes) that perform the query on the target query, as well as the execution order and dependencies between each node. Therefore, the task planning information is the planning information corresponding to the multiple execution nodes of the query task executing the target query; at this point, no query processing has been performed on the target query. Then, multiple functional agents are scheduled to run each execution node sequentially through the task planning information, thereby obtaining the intermediate query results output by each execution node and the initial query results for the target query. Based on this, anomalies in the initial query results may include, but are not limited to: the initial query results being illusory, the initial query results being factually incorrect, or the target user reporting that the initial query results do not meet the query requirements of the target query.
[0064] Furthermore, during the process of querying the target query to obtain the initial query results, that is, when executing the query task, the execution information of each execution node and the dependency information between each execution node are recorded. Therefore, the information recorded when executing the query task is the call information corresponding to each execution node, that is, the execution information of each execution node and the dependency information between each execution node, which is the call chain information for generating the initial query results.
[0065] Specifically, when a target user has a query processing need, they can enter their target query through a query application or subroutine that provides query processing functionality. For example, if a target user enters "I want to buy an iPhone 17" in a query application, then "I want to buy an iPhone 17" is the target query entered by the target user. Based on this, the program responds to the query request for the target query by processing the query through the program's backend server to obtain the initial query results, which are then displayed on the target user's login terminal, allowing the target user to confirm whether their query needs are met. Determining whether the initial query results are abnormal can be done through user feedback or by automatically performing anomaly detection on the target query. The following describes how to determine if the initial query results are abnormal:
[0066] In an exemplary optional embodiment, the query processing method further includes: determining that the initial query result is abnormal upon receiving abnormal feedback information from the target user regarding the initial query result generated for the target query; or determining that the initial query result is abnormal upon receiving a detection result indicating an abnormality in the initial query result generated for the target query.
[0067] The abnormal feedback information can be either information obtained from the target user triggering an abnormal feedback action based on the initial query results, or feedback information entered by the target user regarding the initial query results. Specifically, we will first introduce how to determine if the initial query results are abnormal through target user feedback. As mentioned above, the intermediate query results and the initial query results obtained for the target query can be presented to the target user who issued the target query through the user interaction interface. That is, multiple intermediate query results and the initial query results generated for the target query can be displayed on the target user's login terminal. If the target user believes that the results do not meet the query requirements based on the displayed intermediate query results and the initial query results, they can trigger an abnormal feedback action for the initial query results, thereby obtaining abnormal feedback information. Based on this, upon receiving abnormal feedback information from the target user regarding the initial query results generated for the target query, it can be determined that the initial query results are abnormal.
[0068] Therefore, when the target user's login terminal displays the initial query results, an exception feedback control for those results can also be displayed. This control can directly trigger an exception feedback action or prompt the user to fill in feedback information. Thus, by triggering the exception feedback control, the target user can obtain exception feedback information. For ease of understanding, as follows... Figure 4As shown, the intermediate query results and the initial query results are displayed to the target user, and an exception feedback control 402 is also displayed. The target user can obtain exception feedback information by triggering the exception feedback control 502.
[0069] Alternatively, the target user can trigger an exception feedback control. In this case, feedback information is entered, and an information feedback area for the initial query results is displayed in the login terminal. After the target user enters feedback information in the information feedback area for the initial query results and confirms, the exception feedback operation is triggered, and the exception feedback information is obtained through the entered feedback information. For ease of understanding, as follows: Figure 5 As shown, in Figure 5 Part (A) shows a schematic diagram of the interface for displaying intermediate and initial query results to the target user, and in Figure 5 Part (A) also displays an exception feedback control 502. When the target user triggers the exception feedback control 502, the system enters... Figure 5 The feedback area displayed in section (B) is for the initial query results. The target user fills in feedback information and confirms it in this area. The resulting error feedback information is... Figure 5 The feedback information entered in the feedback area shown in Part (B).
[0070] Secondly, the detection results are obtained by performing anomaly detection on intermediate and initial query results. These results can indicate either an anomaly or normality. Specifically, during query processing of a target query, the system can automatically perform anomaly detection on intermediate and initial query results generated during the process, thus obtaining detection results. If the detection results indicate an anomaly, it is determined that the initial query result is abnormal. Anomaly detection methods include, but are not limited to, confidence-based anomaly detection, rule-based validation, consistency checks, and result-based anomaly detection.
[0071] The specific implementation of confidence-based anomaly detection is as follows: After each execution node performs a matching node task for the target query, the output results of the matched nodes are obtained, along with a confidence score for each node's output. The confidence score represents the reliability of the node's output. This confidence score can be derived from the confidence score output by an LLM (Local Level Model), or it can be obtained by adding a confidence scoring model to score the node's output. Therefore, if the obtained confidence score is less than the confidence threshold, it indicates that the node's output is unreliable, and the detection result of the initial query result obtained based on the node's output will indicate an anomaly. Conversely, if the obtained confidence scores are all greater than the confidence threshold, it indicates that the node's output is reliable, and the detection result of the initial query result obtained based on the node's output will indicate normality.
[0072] Secondly, the specific implementation of rule-based anomaly verification is as follows: Preset rules are set to match the initial query results. If the matching degree is less than a matching degree threshold, the initial query result is detected as an anomaly. Conversely, if the matching degree reaches the matching degree threshold, the initial query result is detected as normal. The aforementioned preset rules can be that the output values in the initial query results are within a preset range, or that the initial query results must contain preset key fields or preset information, etc. Consistency-based anomaly checking requires checking consistency through multi-source information comparison or logical reasoning, specifically including multi-source cross-validation, logical consistency, and temporal consistency. Anomaly detection is used to detect anomalies in the intermediate query results output by nodes, including but not limited to abnormal output length, abnormal special markers, and duplicate content. There are many other ways to perform anomaly detection on the initial query results, which will not be elaborated here.
[0073] Furthermore, in the case where an anomaly is determined through the methods described in the foregoing embodiments, the task planning information and call chain information for generating the initial query result are obtained. Specifically, the task planning information and call chain information are obtained from the link state memory. That is, the task planning information and call chain information are generated during the process of generating the initial query result for the target query and are stored in the link state memory after generation. The following is a detailed description of how to generate and obtain the task planning information and call chain information:
[0074] First, we introduce how to generate task planning information and call link information. In an exemplary optional embodiment, the query processing method further includes: performing task planning on the target query to obtain a directed acyclic graph; the directed acyclic graph includes a set of execution nodes and a set of directed edges, each directed edge in the set of directed edges is used to describe the dependency relationship between the connected execution nodes; during the process of generating the initial query result based on the directed acyclic graph for the target query, the execution information of each execution node and the dependency information between each execution node are recorded; the directed acyclic graph, each execution information, and the dependency information are stored in the link state memory.
[0075] The directed acyclic graph (DAG) consists of a set of execution nodes and a set of directed edges. The set of execution nodes includes multiple execution nodes, each with a corresponding node function. Therefore, each execution node needs to be matched with a functional Agent for execution. The set of directed edges includes multiple directed edges, each connecting two different execution nodes and describing the dependencies between the connected execution nodes.
[0076] For ease of understanding, such as Figure 6 The shown directed acyclic graph (DAG) includes execution nodes A1, A2, A3, and A4. Directed edges B1 point from A1 to A2, B2 from A1 to A3, B3 from A2 to A4, and B4 from A3 to A4. Therefore, execution node A2 depends on execution node A1, and execution node A3 depends on execution node A1. Similarly, execution node A4 depends on execution node A2, and execution node A5 depends on execution node A3.
[0077] Therefore, directed edges in a directed acyclic graph (DAG) describe the dependencies between connected execution nodes, thus determining the dependency information between each execution node. In other words, the execution of one execution node depends on the output of its dependent execution nodes; that is, the output of one execution node affects the execution of another execution node that depends on it. Again, let's consider... Figure 4 For example, since execution node A2 depends on execution node A1, meaning execution node A2 needs to run based on the output of execution node A1, and the output of execution node A1 affects the operation of execution nodes A2 and A3, which depend on execution node A1. The execution information of an execution node specifically includes its input information and other related information.
[0078] Specifically, the server performs task planning on the target query to obtain a directed acyclic graph. The server then needs to proceed with intent understanding, task decomposition, and dependency analysis sequentially for the target query. First, intent analysis and intent clarification are performed. The server analyzes the target query's intent to obtain the initial query intent. The dimensions of intent analysis include, but are not limited to, the main objective, implicit needs, constraints, entity identification, task type, and success criteria. The main objective determines what the target user wants to achieve; implicit needs identify unspoken needs; constraints set time, quantity, quality, and format limitations according to the target query; entity identification identifies the entity information involved in the target query (e.g., people, places, products, concepts); task type indicates whether the target query is information retrieval, data analysis, content creation, decision support, etc.; and success criteria indicate what kind of query results will satisfy the target user. Based on this, the server also needs to clarify the initial query intent to obtain the target query intent. Situations requiring intent clarification include, but are not always the case, unclear or overly broad objectives, lack of key parameters (e.g., time range, quantity limits), and ambiguity (e.g., polysemy). After obtaining the target query intent, the target query intent is transformed into an intent feature vector.
[0079] Then, the intent feature vector of the target query is decomposed and atomized to obtain multiple query subtasks. Task decomposition methods include, but are not limited to, decomposition by time or logical order, decomposition into independent tasks that can be executed in parallel, and decomposition based on predefined templates. Next, dependency analysis is performed on the multiple query subtasks obtained after decomposition to obtain the dependencies between each query subtask. Dependency analysis includes, but is not limited to, data dependency analysis, logical dependency analysis, and resource dependency analysis. Each query subtask is treated as an execution node, and directed edges are constructed between execution nodes based on the dependencies between query subtasks, thus obtaining a directed acyclic graph including a set of execution nodes and a set of directed edges.
[0080] Furthermore, after obtaining the directed acyclic graph (DAG), the system specifically uses the DAG to perform a query on the target query and generate initial query results. During this process, the execution information of each execution node and the dependency information between each execution node are recorded. Considering that the query processing system needs to persistently store the lifecycle data of the task execution for the target query, a directed graph database or structured state storage service is required to meet this requirement. Specifically, the server stores the recorded DAG, the execution information of each execution node, and the dependency information between each execution node in the link state storage. In practical applications, the link state storage also includes other periodic data related to the task execution for the target query. This other periodic data includes, but is not limited to: detailed node information for each sub-execution node (node identifier, node type, node status), input prompts, and, considering that the node output results can be corrected in this embodiment, the other periodic data may also include the initial output results and the corrected output results. Node states may include, but are not limited to, pending execution, executed, currently executing, and execution failed states. Therefore, fine-grained data storage for target queries provides a reliable data foundation for subsequent backtracking analysis and impact propagation.
[0081] Based on this, the following describes how to obtain task planning information and call chain information. In an exemplary embodiment, the task planning information includes a directed acyclic graph (DAG) obtained before executing the query task for the target query. The call chain information includes the execution information of each execution node during the execution of the query task, as well as the dependency information between each execution node. The call chain information should also include information about the Agent matched to the node task executing each execution node, such as the sequential or parallel execution paths and dependencies formed by the Agent during the completion of the query task corresponding to the target query. As described above, the task planning information includes a DAG obtained before executing the query task for the target query. The DAG includes a set of execution nodes and a set of directed edges. The set of execution nodes includes multiple execution nodes and the node functions matched by each execution node. The set of directed edges includes multiple directed edges, and each directed edge connects two different execution nodes and describes the dependency relationship between the connected execution nodes.
[0082] Based on this, the task planning information and call chain information for generating the initial query results are obtained. Specifically, this includes retrieving the directed acyclic graph (DAG) for the target query, the execution information of each execution node, and the dependency information between each execution node from the link state memory. Specifically, in the event of an anomaly in the initial query results, the stored information can be retrieved from the link state memory, namely, the DAG for the target query, the execution information of each execution node, and the dependency information between each execution node. The DAG is then identified as the task planning information, and the execution information of each execution node and the dependency information between each execution node are identified as the call chain information.
[0083] The preceding section described how to record and store relevant information during the generation of initial query results. The following section describes how to generate initial query results. In an exemplary optional embodiment, the query processing method further includes: setting the node state of each execution node in the execution node set to a pending execution state; determining the root execution node from the execution node set and placing it in the pending execution queue; for the root execution node in the pending execution queue and in the pending execution state, executing the matching node task with the target query as input to the root execution node, obtaining the node output result of the root execution node, and updating the node state of the root execution node to the executed state; and when the node state of each execution node is in the executed state, synthesizing the node output results of each execution node to obtain the initial query result for the target query.
[0084] The root execution node is the execution node with an in-degree of 0, meaning it does not depend on any other execution nodes. For easier understanding, please refer to [link to previous document]. Figure 6 , Figure 6 In the graph, execution node A1 can point to execution nodes A2 and A3, but no other execution nodes point to execution node A1, meaning that the in-degree of execution node A1 is 0. Therefore, execution node A1 is the root execution node. Specifically, as described above, a directed acyclic graph includes a set of execution nodes and a set of directed edges. Therefore, in the process of generating initial query results for a target query based on a directed acyclic graph, it is necessary to first set the node state of each execution node in the execution node set to the pending state, and then determine the root execution node from the execution node set, that is, select the execution node with an in-degree of 0 as the root execution node. For example, as described in the previous embodiment, the in-degree of execution node A1 is 0, so execution node A1 is selected as the root execution node.
[0085] Furthermore, the server adds the root execution node to the execution queue, and then performs task execution on the queue. This involves selecting a root execution node from the queue and checking if it is in a pending execution state. If so, during execution, the target query is passed as input to the selected root execution node and then to the task agent of the matched node task. This yields the root execution node's output, and its state is updated to "success." During execution, the root execution node's state can also be updated to "executing." If not, meaning the root execution node is not in a pending execution state, the matched node task is not executed. It's understandable that during execution, the task agent of the matched node task might fail to output the root execution node's output, resulting in execution failure. In this case, the root execution node's state is updated to "failed."
[0086] Based on this, node tasks will be executed sequentially for other execution nodes in the queue until the output of each execution node is successfully obtained. At this point, the node status of each execution node will be updated to the executed state. Therefore, when the node status of each execution node in the execution node set is in the executed state, it means that the output of each execution node has been successfully obtained. Thus, the outputs of each execution node are combined to obtain the initial query result for the target query. As mentioned above, the node tasks for the target query need to be executed starting from the root node. So how do we determine if each execution node has completed its matched node task? Considering that the root node is an execution node with an in-degree of 0, and an execution node with an out-degree of 0 means that no further node task execution depends on that execution node, the query processing for the target query can be completed at the execution node with an out-degree of 0. This will be explained in detail below:
[0087] In an exemplary optional embodiment, the query processing method further includes: for child execution nodes that have a dependency relationship with the root execution node, using the node output result of the root execution node as the input of the child execution node to execute the matching node task, obtaining the node output result of the child execution node, and updating the node status of the child execution node to the executed status.
[0088] Specifically, the server first selects a root execution node from the queue of tasks to be executed, and checks whether the root execution node is in a pending execution state. If so, it passes the target query as input to the selected root execution node to the task agent of the matched node task, thereby obtaining the node output of the root execution node and updating the node state of the root execution node to the executed state. Based on this, the server then determines the child execution nodes that have dependencies on the root execution node according to the dependencies indicated by the directed edges in the directed acyclic graph. For easier understanding, please refer to [the previous section]. Figure 6 As can be seen from the above embodiments, execution node A1 is the root execution node, and execution node A1 can point to execution node A2 and execution node A3. That is, execution node A2 depends on execution node A1 (the root execution node), and execution node A3 also depends on execution node A1 (the root execution node). Therefore, execution node A2 and execution node A3 are child execution nodes that have a dependency relationship with the root execution node.
[0089] Furthermore, the server uses the root execution node's output as input to the child execution node and passes it to the task agent of the matching node task. The task agent then executes the matching node task, at which point the server obtains the child execution node's output and updates its node status to "executed." (For ease of understanding, based on...) Figure 6 Further explanation will be provided using examples, such as... Figure 7 As shown, execution node A1 is the root execution node, while execution nodes A2 and A3 are child execution nodes that have a dependency relationship with the root execution node (i.e., execution node A1). If execution node A1 obtains node output result C1, then execution node A2's node output result C1 is used as input to execution node A1, so that execution node A2's task agent executes the node task based on node output result C1 and outputs execution node A2's node output result C2. Similarly, execution node A3's node output result C1 is used as input to execution node A3, so that execution node A3's task agent executes the node task based on node output result C1 and outputs execution node A3's node output result C3.
[0090] Based on this, with each execution node in an executed state, the node outputs of each execution node are synthesized to obtain the initial query result for the target query. Specifically, this includes: executing node tasks sequentially for each sub-execution node according to the dependencies recorded in the directed acyclic graph, obtaining the node outputs of the leaf execution nodes, and with each execution node in an executed state, synthesizing the node outputs of each execution node to obtain the initial query result for the target query.
[0091] In this context, a leaf execution node is an execution node with an out-degree of 0, meaning that no other execution node depends on this node for task execution. For easier understanding, please refer to [link to previous text]. Figure 6 Execution node A4 depends on execution node A2, but no other execution node depends on execution node A4 for node task execution. Therefore, execution node A4 is a leaf execution node. Similarly, execution node A5 depends on execution node A3, but no other execution node depends on execution node A5 for node task execution. Therefore, execution node A5 is a leaf execution node.
[0092] Specifically, as described in the aforementioned embodiments, for each sub-execution node, node tasks are executed sequentially according to the dependencies recorded in the directed acyclic graph (DAG). That is, based on the dependencies indicated by the directed edges in the DAG, sub-execution nodes that have dependencies on the root execution node are identified. The node output of the root execution node is used as the input of the sub-execution node and passed to the task agent of the matching node task. The task agent then executes the matching node task, obtaining the node output of the sub-execution node and updating its node state to "executed." Then, for each sub-execution node, sub-execution nodes are determined based on the dependencies recorded in the DAG, and their node outputs and states are updated to "executed" in a similar manner. This process continues until it is determined that no other execution node depends on this sub-execution node for node task execution. Sub-execution nodes with an out-degree of 0 are designated as leaf execution nodes, and the query for the target query is stopped. The node outputs of each execution node are then synthesized to obtain the initial query result for the target query. In other words, the node outputs of the root execution node, the child execution nodes, and the leaf execution nodes are combined to obtain the initial query results for the target query.
[0093] For ease of understanding, based on Figure 7 The execution flow illustrated will be further described, such as... Figure 8As shown, since execution node A1 is the root execution node, using the node output C1 of execution node A1 as input to execution node A2 yields the node output C2 of execution node A2. Since execution node A2 points to execution node A4, using the node output C2 of execution node A2 as input to execution node A4 allows the task agent of execution node A4 to execute the node task based on the node output C2 and output the node output C4 of execution node A4. Similarly, using the node output C1 of execution node A1 as input to execution node A3 yields the node output C3 of execution node A3. Since execution node A3 points to execution node A5, using the node output C3 of execution node A3 as input to execution node A5 allows the task agent of execution node A5 to execute the node task based on the node output C3 and output the node output C5 of execution node A5. Since there are no dependent execution nodes after execution nodes A4 and A5, meaning that execution nodes A4 and A5 are both leaf nodes, the output results C1 to C5 of each of execution nodes A1 to A5 can be combined to obtain the initial query result for the target query.
[0094] Step 304: Based on the task planning information and call chain information, identify the abnormal execution node that caused the initial query result to be abnormal.
[0095] Specifically, the server analyzes the initial query results based on task planning information and call chain information, identifying the abnormal execution node that caused the initial query results to be abnormal from multiple execution nodes. Since the task planning information includes a directed acyclic graph obtained before executing the target query task, and the call chain information includes the execution information of each execution node during the execution of the query task, as well as the dependency information between each execution node, the diagnostic analysis agent essentially analyzes the initial query results according to the directed acyclic graph, the execution information of each execution node, and the dependency information between each execution node, locating the abnormal execution node that caused the initial query results to be abnormal from multiple execution nodes. Abnormal execution nodes may include, but are not limited to, execution nodes exhibiting hallucinations, factual errors, or discrepancies with user feedback. The aforementioned diagnostic analysis agent is a large language model used for anomaly analysis.
[0096] In one exemplary embodiment, based on task planning information and call chain information, the abnormal execution node that caused the initial query result to be abnormal is determined. Specifically, this includes: obtaining query suggestion words for analyzing query anomalies; and, based on task planning information and call chain information, calling a large language model according to the query suggestion words to analyze the abnormal execution node that caused the initial query result to be abnormal.
[0097] The query prompt is used to instruct the large language model to analyze query anomalies. Specifically, the server obtains the query prompt for analyzing query anomalies; that is, the server can directly obtain structured query prompts. The query prompts instruct the large language model to use thought chain reasoning to analyze which nodes' outputs may contain factual errors, logical inconsistencies, or fail to meet user needs, and provide reasons. For example, the query prompt might be: "You are a professional task execution auditor in an AI assistant. The user wants the AI assistant to help him complete the task {query}. The AI assistant has now completed the analysis step by step according to the following plan. The user is now dissatisfied with some steps. Please analyze where there are factual errors or logical conflicts, provide specific problems with the steps, and generate a correction plan. Below are the detailed steps already executed: {tree_detail}; Your correction plan is:."
[0098] As described above, target users can directly provide feedback on the initial query results, indicating which part is causing the problem. Furthermore, if the anomaly detection results indicate an anomaly, the problematic part can also be identified. Therefore, anomaly feedback or detected anomalies can be incorporated into query suggestions to guide the large language model's analysis. For example, query suggestions can instruct the large language model to analyze query anomalies. For instance, a query suggestion might be: "You are a professional task execution auditor in an AI assistant. The user wants the AI assistant to complete the task {query}. The AI assistant has now completed the analysis step-by-step according to the following plan. The user is now dissatisfied with some steps. Please review the entire execution process and the user's feedback, analyze where there are factual errors or logical conflicts, provide specific steps with problems, and generate a correction plan. Below are the detailed steps executed: {tree_detail} User feedback: {feedback} Your correction plan is:"
[0099] Based on this, if the abnormal feedback from the target user is: "Diagnose the node 'Summarize the price differences of different iPhone 17 configurations'", then the query suggestion would be: "You are a professional task execution auditor in an AI assistant. The user wants the AI assistant to help him complete the task of 'analyzing and summarizing the differences in the different configurations and prices of the iPhone 17'. The AI assistant has now completed the analysis step by step according to the following plan. The user is now dissatisfied with some steps. Please review the entire execution process and the user's feedback, analyze where there are factual errors or logical conflicts, provide specific steps with problems, and generate a correction plan."
[0100] The following are the detailed steps that have been performed:
[0101] 1. Search for iPhone 17 specifications and pricing information.
[0102] 1.1 Search for iPhone 17 version information on JD.com and summarize it into a list.
[0103] The result is: xxxxx
[0104] 1.2 Obtain the latest iPhone 17 prices from multiple platforms such as JD.com, Taobao, and Pinduoduo.
[0105] The result is: xxxxx
[0106] 2. Summarize the different configurations and prices of the iPhone 17 and generate a table for easy reference by users.
[0107] The result is: xxxxx
[0108] User feedback: Diagnose the point about "summarizing the price differences of different iPhone 17 configurations".
[0109] Your proposed revision plan is:
[0110] Based on this, after obtaining the query suggestion words, the large language model is called according to the task planning information and call chain information to analyze the abnormal execution nodes that caused the initial query results to be abnormal. That is, through the diagnostic analysis agent, based on the directed acyclic graph, the execution information of each execution node, and the dependency information between each execution node, the query suggestion words are analyzed to locate the abnormal execution node that caused the initial query results to be abnormal from multiple execution nodes, and the reason for the abnormality can also be output. For example: "The price data of execution node A3 may be outdated; node A5 did not perform the Android comparison requested by the user, which is a planning deficiency." Correction plan generation: Based on the location results, the diagnostic agent will generate a specific list of correction operations. For example: "Update Node (N5): Modify its input suggestion words, add 'and please compare prices and core parameters with mainstream Android flagship models'.", "Re-run Node (A5)", "Re-run Node (A6) (because execution node A6 depends on the output of execution node A5)".
[0111] Step 306: Correct the original execution parameters of the abnormal execution node to obtain the corrected execution parameters.
[0112] The original execution parameters may include, but are not limited to, the original input of the abnormal execution node, the original task execution instruction of the abnormal execution node, and the node parameters of the abnormal execution node. Specifically, the server corrects the original execution parameters of the abnormal execution node to obtain corrected execution parameters. As can be seen from the foregoing embodiments, during analysis, the abnormal execution node causing the initial query result to be abnormal can be located from multiple execution nodes, as well as the cause of the abnormality. Therefore, the original execution parameters that need to be corrected can be determined first by identifying the cause of the abnormality, and then the original execution parameters of the abnormal execution node can be corrected to obtain corrected execution parameters. For example, if the cause of the abnormality is that the original task execution instruction is unclear, the original execution parameters that need to be corrected are the original task execution instruction. Correcting the original execution parameters of the abnormal execution node involves rewriting the execution instruction, which can make the obtained corrected task execution instruction clearer and more specific. Alternatively, constraints can be added to the original task execution instruction to obtain the corrected task execution instruction. In this case, the obtained corrected execution parameters are the corrected task execution instruction.
[0113] Alternatively, if the anomaly is caused by missing information, then the original execution parameter that needs correction is the original input. This means information can be extracted from upstream nodes or user feedback and added to the original input to obtain the corrected input. In this case, the corrected execution parameter is the corrected input. Or, if the anomaly is caused by an incorrect search time range, then the original execution parameter that needs correction is the original time range in the node parameters. Modifying the original time range in the node parameters yields the corrected time range. In this case, the corrected execution parameter is the corrected time range. Or, if the anomaly is caused by incorrect code parameters during code execution, then the original execution parameter that needs correction is the original code parameters during code execution. Modifying the original code parameters yields the corrected code parameters. In this case, the corrected execution parameter is the corrected code parameters during code execution. It is understandable that the original execution parameters to be corrected and the method of correction need to be determined based on the actual circumstances of the anomaly.
[0114] To facilitate understanding, the following describes how to correct parameters when the original execution parameters are the original inputs of an abnormal execution node. In an exemplary embodiment, the original execution parameters of the abnormal execution node are corrected to obtain corrected execution parameters. Specifically, this includes: obtaining the node output of the previous execution node when the abnormal execution node has a dependency relationship; and correcting the node output of the previous execution node to obtain corrected execution parameters.
[0115] Specifically, when the abnormal execution node has a dependent previous execution node, the node output of the previous execution node is obtained. Then, based on the cause of the abnormality, a correction method is determined to correct the node output. This correction method includes, but is not limited to, information adjustment, information supplementation, and information deletion. Based on this, the node output of the previous execution node is corrected according to the correction method to obtain the corrected execution parameters. These corrected execution parameters are then the corrected node output of the previous execution node. For ease of understanding, based on... Figure 8 The example shown illustrates the method for adjusting the information in the node output, such as... Figure 9 As shown, the identified abnormal execution node is execution node A4. Therefore, as... Figure 9 As shown in section (A), the abnormal execution node (i.e., execution node A4) is identified as the previous execution node A2 with a dependency relationship. The node output C2 of execution node A2 is then obtained. By correcting the node output C2, the following can be obtained: Figure 9 The corrected node output result D1 is shown in part (B), and the node output result of node A4 is no longer node output result C4.
[0116] Step 308: Execute the node task matching the abnormal execution node according to the corrected execution parameters, and obtain the updated query results for the target query.
[0117] Specifically, the node tasks matching the abnormal execution nodes are executed according to the corrected execution parameters, thereby obtaining the node output results after the abnormal execution nodes are re-executed. Then, the node output results of the abnormal execution nodes are combined with the node output results of the non-abnormal execution nodes to obtain the updated query results for the target query, thus avoiding the resource and time consumption caused by re-executing all execution nodes. For ease of understanding, based on Figure 9 The image shows an example of the corrected node output obtained after adjusting the information in the node output, such as... Figure 10 As shown, by correcting the node output C2 of execution node A2, we obtain the corrected node output D1. This corrected node output D1 is then used as input to execution node A4, causing the task agent of execution node A4 to re-execute the node task based on the corrected node output D1 and output the node output C6 of execution node A4. At this point, the node outputs of execution nodes A1 to A5 (including node output C1, corrected node output D1, node output C3, node output C6, and node output C5 respectively) can be synthesized to obtain the updated query result for the target query.
[0118] For example, if a target user enters "I want to buy an iPhone 17" in a search application, then "I want to buy an iPhone 17" becomes the target query. The program responds to this query request by breaking it down into multiple execution nodes through the backend server, such as parameter extraction, online querying, image generation, and price comparison, to obtain the initial query results. If the target user reports "Why didn't it compare prices with Android phones?" regarding the initial query results, it indicates an anomaly in the initial query results. This reveals that the "price comparison" execution node only compared iPhone models, omitting Android models. Therefore, the "price comparison" execution node will then perform a "comparison with Android phone prices" task, ultimately generating updated query results that include comparisons with Android models.
[0119] In practical applications, there may be situations where the node task matching the execution node is divided into multiple node subtasks. That is, an execution node can be divided into multiple execution child nodes, and the identified abnormal execution node may be the execution child node that caused the initial query result to be abnormal. In this case, after correcting the original execution parameters of the execution child node to obtain the corrected execution parameters, the node output result obtained by the execution node subtask will affect the node output result of the node task matching the execution node, and thus affect the next execution node that has a dependency relationship with the execution node. Therefore, it is necessary to update the node output result of the execution node based on the node output result obtained by the execution node subtask, and then update the node output result of the dependent execution nodes based on the dependency relationship. For ease of understanding, if there are tasks 1, 2, 3, 4, and 5 planned for the target query, where tasks 2 and 3 are based on the result of task 1, task 4 is based on the result of task 2, and task 5 is based on the result of task 3, and task 2 is further divided into subtask 2-1 and subtask 2-2.
[0120] Based on this, such as Figure 11 As shown, through Figure 11 As shown in the diagram in section (A), tasks 1 to 5 are assigned to execution nodes A1 to A5. Since task 2 is further divided into subtasks 2-1 and 2-2, execution node A2 is actually divided into sub-nodes A2-1 and A2-2. If it is determined through the aforementioned embodiment that sub-node A2-1 is abnormal, then sub-node A2-1 needs to be re-executed to obtain... Figure 11The modified node output result 2-1 of the execution sub-node A2-1 shown in part (B) is obtained by the node output result C2 of the execution node A2 based on the output results of the execution sub-nodes A2-1 and A2-2. That is, the modified node output result D1 will be obtained by the modified node output result 2-1 and node output result 2-2. At this time, the modified node output result D1 of the execution node A2 affects the execution of the execution node A4. Therefore, the modified node output result D1 needs to be used as the input of the execution node A4 so that the task agent of the execution node A4 can re-execute the node task based on the modified node output result D1 and output the node output result C6 of the execution node A4.
[0121] It is understood that the foregoing examples are for the purpose of understanding this solution and should not be construed as specific limitations on this solution.
[0122] In the above query processing method, when the initial query result is abnormal, locating the abnormal execution node that caused the abnormality can prevent the error from propagating. Furthermore, locating the abnormal execution node reduces the time and economic costs of manual review and identification, and also lowers the error rate associated with manual review. Secondly, only the abnormal execution node needs to be retried and corrected; there is no need to globally re-execute the target query, avoiding repeated execution of normal execution nodes. This significantly improves error correction efficiency and reduces computational overhead, enabling efficient and accurate error location and correction, thereby enhancing the reliability of query processing.
[0123] In one exemplary embodiment, such as Figure 12 As shown, the node task matching the abnormal execution node is executed according to the corrected execution parameters, and the updated query results for the target query are obtained again, including:
[0124] Step 1202: Execute the node task matching the abnormal execution node according to the corrected execution parameters, and obtain the node output result matching the abnormal execution node.
[0125] Specifically, the node task matching the abnormal execution node is executed according to the corrected execution parameters, thus obtaining the node output result obtained after the abnormal execution node is re-executed. In other words, the server inputs the corrected execution parameters to the abnormal execution node, causing the task agent of the abnormal execution node to re-execute the node task based on the corrected execution parameters and output the node output result of the abnormal execution node. For ease of understanding, if the cause of the anomaly is missing information, then the original execution parameters that need to be corrected are the original input. If the abnormal execution node has a dependent previous execution node, then the original execution parameters that need to be corrected are the node output result of the previous execution node. Therefore, it is necessary to first obtain the node output result of the previous execution node, then determine the correction method for the node output result according to the cause of the anomaly, and then correct the node output result of the previous execution node according to the correction method to obtain the corrected execution parameters. At this point, the corrected execution parameters are the corrected node output result of the previous execution node. Then, the corrected node output result of the previous execution node is input to the abnormal execution node, causing the task agent of the abnormal execution node to re-execute the node task based on the corrected node output result of the previous execution node and output the node output result of the abnormal execution node. Alternatively, if the cause of the exception is an error in the code parameters during code execution, then the corrected original execution parameters are the original code parameters used in the code execution. The corrected code parameters are obtained by modifying the original code parameters. At this time, the server still inputs the original input to the abnormal execution node, but causes the task agent of the abnormal execution node to re-execute the node task according to the corrected code parameters, thereby outputting the node output result of the abnormal execution node.
[0126] As described above, after obtaining the node output of each execution node, the node status of each execution node is updated to the "executed" state. However, execution nodes in the "executed" state cannot be re-executed. Therefore, the server must adjust the node status of any abnormal execution nodes that need to be re-executed to ensure their successful re-execution. This is explained in detail below: In an exemplary embodiment, when the initial query result is obtained, the node status of the abnormal execution node is "executed." During the task execution of each execution node, the target query is passed as input to the selected root execution node to the task Agent of the matched node task, thereby obtaining the node output of the root execution node and updating its node status to "executed." Therefore, when the node status of each execution node in the execution node set is "executed," it indicates that the node output of each execution node has been successfully obtained. At this point, the node outputs of each execution node are synthesized to obtain the initial query result for the target query. If we can obtain the initial query results for the target query, it means that the node status of each execution node is already executed. Therefore, the node status of the abnormal execution node located from multiple execution nodes is also already executed.
[0127] Based on this, the node tasks matching the abnormal execution nodes are executed according to the modified execution parameters to obtain the node output results matching the abnormal execution nodes. Specifically, this includes: updating the node status of the abnormal execution nodes from the executed state to the pending state, and adding the abnormal execution nodes in the pending state to the re-execution queue; extracting the abnormal execution nodes in the pending state from the re-execution queue, executing the node tasks matching the abnormal execution nodes according to the modified execution parameters, and obtaining the node output results matching the abnormal execution nodes.
[0128] Specifically, after identifying the abnormal execution node, since its node state is in the "executed" state, it needs to be updated from "executed" (success) to "pending." Then, the abnormal execution node in the "pending" state is added to the re-execution queue, which now includes at least one such node. Based on this, execution nodes are extracted from the re-execution queue, and it is checked whether each node is in the "pending" state. If so, the corrected execution parameters are input to the "pending" abnormal execution node, causing its task agent to re-execute the node task based on the corrected parameters and output the node's output result. It is understandable that after re-executing and obtaining the node's output result, the node state of the abnormal execution node needs to be updated to "executed" in the link state memory, and the node's output result also needs to be updated.
[0129] Step 1204: Combine the node output results of the execution nodes that did not have any abnormalities and the node output results of the execution nodes that had abnormalities to obtain the updated query results for the target query.
[0130] Specifically, in the aforementioned embodiments, re-executing the abnormal execution node can yield the re-executed node output result and the node output result matched by the abnormal execution node. However, if no abnormality occurs and no re-execution is performed, the link state memory stores the node output result matched by the execution node that did not occur. Therefore, the node output result matched by the execution node that did not occur is extracted from the link state memory, and the node output result matched by the execution node that did not occur and the node output result matched by the abnormal execution node are synthesized to obtain the updated query result for the target query.
[0131] For ease of understanding, such as Figure 13 As shown, Figure 13 Part (A) shows that the located abnormal execution nodes are execution nodes A4 and A5, where execution node A4 depends on execution node A2, and execution node A5 depends on execution node A3. At this point, it is necessary to extract the node output result C2 of execution node A2 and the node output result C3 of execution node A3, and then correct the node output results C2 and C3. This yields the following result: Figure 13The corrected node outputs D1 and D2 are shown in section (B). Based on this, the corrected node output D1 is used as input to execution node A4, so that the task agent of execution node A4 re-executes the node task based on the corrected node output D1 and outputs the node output C6 of execution node A4. Similarly, the corrected node output D2 is used as input to execution node A5, so that the task agent of execution node A5 re-executes the node task based on the corrected node output D2 and outputs the node output C7 of execution node A5. At this time, the execution nodes without anomalies are execution nodes A1, A2, and A3, and the matched node outputs are node output C1, corrected node output D1, and corrected node output D2. Then, by combining node output C1, corrected node output D1, corrected node output D2, node output C6, and node output C7, the updated query result for the target query can be obtained.
[0132] In practical applications, it is also necessary to consider execution nodes that are dependent on the abnormal execution node. That is, the input of the execution node depends on the output of the abnormal execution node. Therefore, changes in the output of the abnormal execution node will also affect the input of the execution node, and the obtained result will also change. Therefore, the server can automatically identify these execution nodes affected by the results of the abnormal execution node and re-execute the affected execution nodes. This process does not require intervention from the target user, thereby ensuring the accuracy of the obtained result. The following is a detailed description: In an exemplary embodiment, the node output results matched by the execution node without an anomaly and the node output results matched by the execution node with an anomaly are synthesized to obtain an updated query result for the target query. Specifically, this includes: if there is a dependent execution node that has a dependency relationship with the execution node with an anomaly, the node output result matched by the execution node with an anomaly is used as the input parameter of the dependent execution node, so that the dependent execution node executes the matched node task, and the node output result of the dependent execution node is obtained; the node output results of the non-dependent execution nodes, the node output results matched by the execution node with an anomaly, and the node output results of the dependent execution nodes are synthesized to obtain an updated query result for the target query, where the non-dependent execution nodes and the execution node with an anomaly do not have a dependency relationship.
[0133] In this context, dependent execution nodes and abnormal execution nodes have a dependency relationship, meaning the input of a dependent execution node depends on the output of an abnormal execution node. Conversely, non-dependent execution nodes and abnormal execution nodes do not have a dependency relationship, meaning the input of a non-dependent execution node does not depend on the output of an abnormal execution node. Furthermore, the dependency relationship between dependent and abnormal execution nodes is determined based on task planning information. For ease of understanding, as follows... Figure 14 As shown, if the located abnormal execution nodes are execution nodes A4 and A5, and the input of execution node A6 depends on the node output result C4 output by execution node A4, and the input of execution node A7 depends on the node output result C5 output by execution node A5, then execution node A6 is a dependent execution node of execution node A4 (abnormal execution node), and execution node A7 is a dependent execution node of execution node A5 (abnormal execution node).
[0134] Specifically, after obtaining the node output results matched by the abnormal execution node, it is necessary to identify whether there are any dependent execution nodes that depend on the abnormal execution node, that is, whether there are any execution nodes that depend on the output of the abnormal execution node. If so, the execution nodes that depend on the output of the abnormal execution node are identified as dependent execution nodes. If not, that is, they do not exist, and the synthesis and determination of the updated query results are performed according to the aforementioned embodiment. Further, the server uses the re-executed node output results matched by the abnormal execution node as input parameters for the dependent execution nodes, so that the task Agent of the dependent execution node re-executes the node task based on the re-executed node output results matched by the abnormal execution node, thereby obtaining the node output results of the dependent execution nodes. Finally, the node output results of the non-dependent execution nodes, the node output results matched by the abnormal execution node, and the node output results of the dependent execution nodes are synthesized to obtain the updated query results for the target query.
[0135] For ease of understanding, based on Figure 14 The dependencies between the execution nodes shown are described below, such as... Figure 15 As shown, Figure 15 The abnormal execution nodes shown in section (A) are execution nodes A4 and A5. Following a similar approach to the aforementioned embodiments, we can obtain... Figure 15The corrected node outputs D1 and D2 are shown in section (B). Based on this, the corrected node output D1 is used as the input to execution node A4 to obtain the node output C6 of execution node A4. Similarly, the corrected node output D2 is used as the input to execution node A5 to obtain the node output C7 of execution node A5. Considering that execution node A6 is a dependent execution node of execution node A4, and execution node A7 is a dependent execution node of execution node A5, changing the node output C4 of execution node A4 to node output C6 will affect execution node A6, and changing the node output C5 of execution node A5 to node output C7 will also affect execution node A7. Therefore, node output C6 needs to be used as the input to execution node A6 so that the task agent of execution node A6 re-executes the node task based on node output C6, thereby obtaining the node output C10 of execution node A6. Similarly, node output C7 needs to be used as input to execution node A7 so that the task agent of execution node A7 re-executes the node task based on node output C7, thereby obtaining node output C11 of execution node A7. Finally, node output C1, corrected node output D1, corrected node output D2, node output C6, node output C7, node output C10, and node output C11 are combined to obtain the updated query result for the target query.
[0136] Similar to the previous description, after obtaining the output results of each execution node, the node status of each execution node is updated to the executed state. Since execution nodes in the executed state cannot be re-executed, the server also needs to adjust the node status of dependent execution nodes to ensure successful re-execution. This is described in detail below: In an exemplary embodiment, when the initial query result is obtained, the node status of dependent execution nodes is in the executed state. When the node status of each execution node in the execution node set is in the executed state, it indicates that the output results of each execution node have been successfully obtained. At this point, the node output results of each execution node are combined to obtain the initial query result for the target query. Therefore, if the initial query result for the target query is obtained, it means that the node status of each execution node is in the executed state, and the node status of dependent execution nodes among multiple execution nodes is also in the executed state.
[0137] Based on this, the output result of the node matched by the abnormal execution node is used as the input parameter of the dependent execution node, so that the dependent execution node executes the matching node task and obtains the node output result of the dependent execution node. Specifically, this includes: updating the node status of the dependent execution node from the executed state to the expired state, and adding the dependent execution node in the expired state to the re-execution queue; extracting the dependent execution node in the expired state from the re-execution queue, executing the node task matched by the dependent execution node according to the output result of the node matched by the abnormal execution node, and obtaining the node output result of the dependent execution node.
[0138] In this context, the stale state indicates that the upstream execution node on which the execution node depends has been updated, meaning the input to the upstream execution node is no longer valid. Therefore, the execution node is in a stale state. Specifically, when dependent execution nodes exist, since the node state of the dependent execution node is already executed, its node state needs to be updated from executed (success) to stale. Then, the stale dependent execution node is added to the re-execution queue, which now includes at least one stale dependent execution node. Based on this, execution nodes are extracted from the re-execution queue, and it is checked whether the node is stale. If so, the node output result matched by the abnormal execution node is input to the stale dependent execution node. This causes the task agent of the stale dependent execution node to re-execute the node task based on the node output result matched by the abnormal execution node and output the node output result of the dependent execution node. Understandably, after re-executing and obtaining the node output results of the dependent execution node, it is necessary to update the node state of the dependent execution node to the executed state in the link state memory, and update the node output results of the dependent execution node.
[0139] It is understood that the foregoing examples are for the purpose of understanding this solution and should not be construed as specific limitations on this solution.
[0140] In this embodiment, the node state of the abnormal execution node is adjusted to ensure that the abnormal execution node is successfully re-executed. Considering that there are dependent execution nodes that depend on the output of the abnormal execution node, the dependent execution nodes are automatically identified and re-executed based on the node output results obtained from the abnormal execution node. This further ensures the accuracy of the obtained query results. Moreover, since no intervention from the target user is required, the efficiency of query processing can be improved while ensuring accurate query results.
[0141] Based on the detailed description of the foregoing embodiments, the complete flow of the query processing method in the embodiments of this application will be described below. In an exemplary embodiment, such as... Figure 16As shown, a query processing method is provided, which is applied to... Figure 1 Taking server 104 as an example, it can be understood that this method can also be applied to terminal 102, and also to a system including terminal 102 and server 104, and is implemented through the interaction between terminal 102 and server 104. In this embodiment, the method includes the following steps 1601 to 1611. Wherein:
[0142] Step 1601: Perform task planning on the target query to obtain a directed acyclic graph; the directed acyclic graph includes a set of execution nodes and a set of directed edges, and each directed edge in the set of directed edges is used to describe the dependency relationship between the connected execution nodes.
[0143] Step 1602: Set the node state of each execution node in the execution node set to the pending execution state; determine the root execution node from the execution node set and put the root execution node into the pending execution queue.
[0144] Step 1603: For the root execution node that is in the queue to be executed and in the state of pending execution, the target query is used as the input of the root execution node to execute the matching node task, the node output result of the root execution node is obtained, and the node state of the root execution node is updated to the executed state; when the node state of each execution node is the executed state, the node output result of each execution node is synthesized to obtain the initial query result for the target query.
[0145] Step 1604: During the process of generating initial query results for the target query based on the directed acyclic graph, record the execution information of each execution node and the dependency information between each execution node; store the directed acyclic graph, each execution information, and the dependency information into the link state memory.
[0146] Step 1605: If an abnormal feedback message is received from the target user regarding the initial query result generated for the target query, it is determined that the initial query result is abnormal; or, if the detection result of the initial query result generated for the target query indicates an abnormality, it is determined that the initial query result is abnormal.
[0147] Step 1606: Obtain from the link state memory the directed acyclic graph for the target query, the execution information of each execution node, and the dependency information between each execution node; the task planning information includes the directed acyclic graph obtained before executing the query task for the target query, and the call link information includes the execution information of each execution node and the dependency information between each execution node when executing the query task.
[0148] Step 1607: Obtain query suggestion words for analyzing query anomalies; based on task planning information and call chain information, call the large language model according to the query suggestion words to analyze the abnormal execution nodes that caused the initial query results to be abnormal.
[0149] Step 1608: Correct the original execution parameters of the abnormal execution node to obtain the corrected execution parameters.
[0150] Step 1609: Update the node status of the abnormal execution node from the executed state to the pending state, and add the abnormal execution node in the pending state to the re-execution queue; extract the abnormal execution node in the pending state from the re-execution queue, execute the node task matching the abnormal execution node according to the corrected execution parameters, and obtain the node output result matching the abnormal execution node.
[0151] Step 1610: If there is a dependent execution node that has a dependency relationship with the abnormal execution node, use the node output result matched by the abnormal execution node as the input parameter of the dependent execution node, so that the dependent execution node executes the matching node task and obtains the node output result of the dependent execution node.
[0152] Step 1611: Combine the node output results of non-dependent execution nodes, the node output results of matched abnormal execution nodes, and the node output results of dependent execution nodes to obtain the updated query results for the target query. Non-dependent execution nodes and abnormal execution nodes have no dependency relationship.
[0153] It should be understood that the specific implementation methods of steps 1601 to 1611 are similar to those of the aforementioned embodiments, and will not be repeated here.
[0154] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.
[0155] Based on the same inventive concept, this application also provides a query processing apparatus for implementing the query processing method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more query processing apparatus embodiments provided below can be found in the limitations of the query processing method described above, and will not be repeated here.
[0156] In one exemplary embodiment, such as Figure 17 As shown, a query processing device is provided, including: an exception handling module 1702, an exception execution node determination module 1704, a parameter correction module 1706, and a re-query processing module 1708, wherein:
[0157] The exception handling module 1702 is used to obtain the task planning information and call chain information for generating the initial query result when an exception occurs in the initial query result generated for the target query.
[0158] The abnormal execution node determination module 1704 is used to determine the abnormal execution node that causes the initial query result to be abnormal based on task planning information and call chain information.
[0159] The parameter correction module 1706 is used to correct the original execution parameters of the abnormal execution node to obtain the corrected execution parameters;
[0160] The re-query processing module 1708 is used to execute the node task matching the abnormal execution node according to the corrected execution parameters, and to obtain the updated query result for the target query.
[0161] In an exemplary embodiment, the re-query processing module is specifically used to execute the node task matching the abnormal execution node according to the corrected execution parameters, and obtain the node output result matching the abnormal execution node; and to synthesize the node output result matching the execution node without abnormality and the node output result matching the abnormal execution node to obtain the updated query result for the target query.
[0162] In an exemplary embodiment, if the initial query result is obtained, the node status of the abnormal execution node is set to the executed state;
[0163] The re-query processing module is specifically used to update the node status of the abnormal execution node from the executed state to the pending state, and add the abnormal execution node in the pending state to the re-execution queue; extract the abnormal execution node in the pending state from the re-execution queue, execute the node task matching the abnormal execution node according to the corrected execution parameters, and obtain the node output result matching the abnormal execution node.
[0164] In an exemplary embodiment, the re-query processing module is specifically used to, if there is a dependent execution node that has a dependency relationship with the abnormal execution node, use the node output result matched by the abnormal execution node as the input parameter of the dependent execution node, so that the dependent execution node executes the matched node task and obtains the node output result of the dependent execution node; and synthesize the node output results of the non-dependent execution node, the node output result matched by the abnormal execution node, and the node output results of the dependent execution node to obtain the updated query result for the target query, wherein the non-dependent execution node and the abnormal execution node have no dependency relationship.
[0165] In an exemplary embodiment, if the initial query result is obtained, the node status that depends on the execution node is in the executed state;
[0166] The re-query processing module is specifically used to update the node status of the dependent execution node from the executed state to the expired state, and add the expired dependent execution node to the re-execution queue; extract the expired dependent execution node from the re-execution queue, execute the node task matched by the node according to the node output result matched by the abnormal execution node, and obtain the node output result of the dependent execution node.
[0167] In an exemplary embodiment, the task planning information includes a directed acyclic graph obtained before executing the query task of the target query, and the call chain information includes the execution information of each execution node and the dependency information between each execution node when executing the query task.
[0168] The exception handling module is specifically used to retrieve the directed acyclic graph for the target query, the execution information of each execution node, and the dependency information between each execution node from the link state memory.
[0169] In one exemplary embodiment, the query processing apparatus further includes a query processing module;
[0170] The query processing module is used to perform task planning on the target query to obtain a directed acyclic graph (DAG). The DAG includes a set of execution nodes and a set of directed edges. Each directed edge in the set of directed edges describes the dependency relationship between the connected execution nodes. During the process of generating the initial query result based on the DAG for the target query, the execution information of each execution node and the dependency information between each execution node are recorded. The DAG, each execution information, and the dependency information are stored in the link state memory.
[0171] In an exemplary embodiment, the query processing module is further configured to set the node state of each execution node in the execution node set to a pending execution state; determine the root execution node from the execution node set and place the root execution node into a pending execution queue; for the root execution node in the pending execution queue and in the pending execution state, execute the matching node task as the input of the root execution node to obtain the node output result of the root execution node, and update the node state of the root execution node to the executed state; when the node state of each execution node is in the executed state, synthesize the node output results of each execution node to obtain the initial query result for the target query.
[0172] In an exemplary embodiment, the query processing module is further configured to, for child execution nodes that have a dependency relationship with the root execution node, use the node output result of the root execution node as the input of the child execution node to execute the matching node task, obtain the node output result of the child execution node, and update the node status of the child execution node to the executed status.
[0173] The query processing module is specifically used to execute node tasks sequentially according to the dependencies recorded in the directed acyclic graph for the sub-execution nodes, and obtain the node output results of the leaf execution nodes. Under the condition that the node state of each execution node is already executed, the node output results of each execution node are synthesized to obtain the initial query result for the target query.
[0174] In an exemplary embodiment, the abnormal execution node determination module is specifically used to obtain query suggestion words for analyzing query anomalies; based on task planning information and call chain information, it calls the large language model according to the query suggestion words to analyze the abnormal execution nodes that caused the initial query results to be abnormal.
[0175] In an exemplary embodiment, the parameter correction module is specifically used to obtain the node output result of the previous execution node when the abnormal execution node has a dependency relationship with the previous execution node; and to correct the node output result of the previous execution node to obtain the corrected execution parameters.
[0176] In an exemplary embodiment, the exception handling module is specifically used to determine that the initial query result is abnormal when receiving exception feedback information from the target user regarding the initial query result generated for the target query.
[0177] In one exemplary embodiment, the exception handling module is specifically configured to determine that the initial query result is abnormal if the detection result of the initial query result generated for the target query indicates an anomaly.
[0178] In one exemplary embodiment, a computer device is provided, which can be a server or a terminal. This embodiment uses a server as an example for description, and its internal structure diagram can be as follows: Figure 18 As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The database stores task planning information and call chain information, as well as other data related to the embodiments of this application. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a query processing method.
[0179] Those skilled in the art will understand that Figure 18 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0180] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0181] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above-described method embodiments.
[0182] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0183] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0184] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, etc., and are not limited to these.
[0185] The technical features in the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0186] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A query processing method, characterized in that, The method includes: In the event that the initial query result generated for the target query is abnormal, the task planning information and call chain information for generating the initial query result are obtained; the task planning information is the planning information corresponding to multiple execution nodes of the query task that executes the target query, and the call chain information is used to describe the call information corresponding to each execution node when executing the query task; Based on the task planning information and call chain information, identify the abnormal execution node that caused the initial query result to be abnormal; The original execution parameters of the abnormal execution node are corrected to obtain the corrected execution parameters; Execute the node task matching the abnormal execution node according to the corrected execution parameters, and obtain the updated query result for the target query.
2. The method according to claim 1, characterized in that, The step of executing the node task matching the abnormal execution node according to the corrected execution parameters, and obtaining the updated query result for the target query, includes: Execute the node task matching the abnormal execution node according to the modified execution parameters, and obtain the node output result matching the abnormal execution node; The node output results matched by the execution nodes without anomalies and the node output results matched by the execution nodes with anomalies are combined to obtain the updated query result for the target query.
3. The method according to claim 2, characterized in that, If the initial query result is obtained, the node status of the abnormal execution node is set to "executed". The step of executing the node task matching the abnormal execution node according to the modified execution parameters, and obtaining the node output result matching the abnormal execution node, includes: Update the node status of the abnormal execution node from the executed state to the pending state, and add the abnormal execution node in the pending state to the re-execution queue; Extract the abnormal execution nodes that are in the pending execution state from the re-execution queue, execute the node tasks that match the abnormal execution nodes according to the corrected execution parameters, and obtain the node output results that match the abnormal execution nodes.
4. The method according to claim 2, characterized in that, The node output results matched by execution nodes without anomalies and the node output results matched by execution nodes with anomalies are combined to obtain the updated query result for the target query, including: If there is a dependent execution node that has a dependency relationship with the abnormal execution node, the output result of the node matching the abnormal execution node is used as the input parameter of the dependent execution node, so that the dependent execution node executes the matching node task and obtains the node output result of the dependent execution node; the dependency relationship between the dependent execution node and the abnormal execution node is determined based on the task planning information; The node output results of the non-dependent execution nodes, the node output results matched by the abnormal execution nodes, and the node output results of the dependent execution nodes are combined to obtain the updated query result for the target query. The non-dependent execution nodes and the abnormal execution nodes have no dependency relationship.
5. The method according to claim 4, characterized in that, If the initial query result is obtained, the node status of the dependent execution node is in the executed state; The step of using the node output result matched by the abnormal execution node as the input parameter of the dependent execution node, so that the dependent execution node executes the matched node task and obtains the node output result of the dependent execution node, includes: Update the node status of the dependent execution node from the executed state to the expired state, and add the dependent execution node in the expired state to the re-execution queue; Extract the dependent execution nodes that are in the expired state from the re-execution queue, execute the node tasks matched by the dependent execution nodes according to the node output results matched by the abnormal execution nodes, and obtain the node output results of the dependent execution nodes.
6. The method according to claim 1, characterized in that, The task planning information includes the directed acyclic graph obtained before executing the query task of the target query, and the call chain information includes the execution information of each execution node and the dependency information between each execution node when executing the query task. The process of obtaining the task planning information and call chain information for generating the initial query result includes: Retrieve from the link state memory the directed acyclic graph for the target query, the execution information of each execution node, and the dependency information between each execution node.
7. The method according to claim 6, characterized in that, The method further includes: Task planning is performed on the target query to obtain a directed acyclic graph; the directed acyclic graph includes a set of execution nodes and a set of directed edges, and each directed edge in the set of directed edges is used to describe the dependency relationship between the connected execution nodes; During the process of generating the initial query result based on the directed acyclic graph for the target query, the execution information of each execution node and the dependency information between each execution node are recorded. The directed acyclic graph, each execution information, and the dependency information are stored in the link state memory.
8. The method according to claim 7, characterized in that, The method further includes: Set the node state of each execution node in the execution node set to the pending execution state; The root execution node is determined from the set of execution nodes and placed into the queue to be executed. For the root execution node that is in the queue to be executed and in the state of pending execution, the target query is used as the input of the root execution node to execute the matching node task, the node output result of the root execution node is obtained, and the node state of the root execution node is updated to the executed state. When the node status of each execution node is "executed", the node output results of each execution node are combined to obtain the initial query result for the target query.
9. The method according to claim 8, characterized in that, The method further includes: For a child execution node that has a dependency relationship with the root execution node, the node output of the root execution node is used as the input of the child execution node to execute the matching node task, thereby obtaining the node output of the child execution node, and updating the node status of the child execution node to the executed state; When the node status of each execution node is "executed", the node output results of each execution node are synthesized to obtain an initial query result for the target query, including: If the node tasks are executed sequentially for the sub-execution nodes according to the dependencies recorded in the directed acyclic graph, and the node output results of the leaf execution nodes are obtained, and the node state of each execution node is an executed state, the node output results of each execution node are synthesized to obtain the initial query result for the target query.
10. The method according to claim 1, characterized in that, The step of identifying the abnormal execution node that caused the initial query result to be abnormal based on the task planning information and the call chain information includes: Obtain query suggestion words for analyzing query anomalies; Based on the task planning information and call chain information, the large language model is called according to the query prompt words to analyze the abnormal execution nodes that caused the initial query results to be abnormal.
11. The method according to claim 1, characterized in that, The process of correcting the original execution parameters of the abnormal execution node to obtain corrected execution parameters includes: In the case where the abnormal execution node has a previous execution node with which it has a dependency, obtain the node output result of the previous execution node; The node output result of the previous execution node is corrected to obtain the corrected execution parameters.
12. The method according to claim 1, characterized in that, The method further includes: Upon receiving abnormal feedback information regarding the initial query results generated by the target user for the target query, it is determined that the initial query results are abnormal; Alternatively, if the detection results of the initial query results generated for the target query indicate an anomaly, it is determined that the initial query results are abnormal.
13. A query processing device, characterized in that, The device includes: An exception handling module is used to obtain task planning information and call chain information for generating the initial query result when an exception occurs in the initial query result generated for the target query. The task planning information is the planning information corresponding to multiple execution nodes of the query task that executes the target query, and the call chain information is used to describe the call information corresponding to each execution node when the query task is executed. An abnormal execution node determination module is used to determine, based on the task planning information and the call chain information, the abnormal execution node that causes the initial query result to be abnormal; The parameter correction module is used to correct the original execution parameters of the abnormal execution node to obtain the corrected execution parameters; The re-query processing module is used to execute the node task matching the abnormal execution node according to the corrected execution parameters, and to obtain the updated query result for the target query.
14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 12.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 12.
16. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the method described in any one of claims 1 to 12.