Code interpretation method

By leveraging the collaborative work of task management and execution agents, a task list is generated based on the language features of SQL files, and target tasks are processed. This solves the accuracy problem of large language models in interpreting complex SQL statements and achieves automated and accurate interpretation of SQL code.

CN121597216APending Publication Date: 2026-03-03BEIJING PACTERA JINXIN TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511756954.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-26
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

In traditional techniques, methods based on large language models cannot accurately generate Chinese explanation text for SQL files when processing complex SQL statements, resulting in low accuracy of code interpretation methods.

Method used

Through task management and task execution agents, tasks are orchestrated based on the language features of SQL files to generate a task list. The task execution agent then processes the target tasks until all tasks are completed, generating an interpretation text of the SQL files. Finally, toolsets and a memory database are used for data processing and adjustment.

Benefits of technology

It achieves accurate Chinese interpretation of SQL statements in complex database scenarios, improving the accuracy and automation of code interpretation methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121597216A_ABST
    Figure CN121597216A_ABST
Patent Text Reader

Abstract

The invention relates to a code interpretation method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the steps of obtaining a to-be-explained structured query language (SQL) file, and performing task arrangement based on a task management agent and language features of the to-be-explained SQL file to obtain a task list of the to-be-explained SQL file; processing a target task in the task list through a task execution agent to obtain a task result and a current task state of the target task; on the basis of the task result and the current task state, determining a next target task until all tasks in the task list are executed, and obtaining an explanation text of the to-be-explained SQL file; wherein the next target task is determined based on the judgment result of the current task state and the task execution progress. By adopting the method, the efficiency of the code interpretation method can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a code interpretation method, apparatus, computer device, computer-readable storage medium, and computer program product. Background Technology

[0002] In data warehouse development tasks, for existing SQL (Structured Query Language) files, in order to check the logical accuracy of SQL statements in the SQL file or to perform secondary development on the SQL file, the logic of the SQL statements is often analyzed and an interpretation text of the SQL file is output.

[0003] In traditional technologies, metadata and business document information of SQL files are input into a large language model through processing methods such as vector retrieval and graph retrieval. The large language model then interprets the metadata and business document information to obtain the interpreted text of the SQL file in natural language form.

[0004] However, in traditional techniques, when SQL statements have complex logic, the fixed workflow orchestration based on a large language model cannot accurately determine the Chinese interpretation of the SQL statement, and therefore cannot accurately generate the interpretation text of the SQL file. Therefore, the accuracy of current code interpretation methods is relatively low. Summary of the Invention

[0005] Therefore, it is necessary to provide a code interpretation method, apparatus, computer device, computer-readable storage medium, and computer program product to address the aforementioned technical problems.

[0006] Firstly, this application provides a code interpretation method, including:

[0007] Obtain the structured query language (SQL) file to be interpreted, and perform task orchestration based on the task management agent and the language features of the SQL file to be interpreted to obtain the task list of the SQL file to be interpreted;

[0008] The task execution agent processes the target tasks in the task list to obtain the task results and current task status of the target tasks.

[0009] Based on the task results and the current task status, the next target task is determined until all tasks in the task list are completed, and the interpreted text of the SQL file to be interpreted is obtained; wherein, the next target task is determined based on the judgment result of the current task status and the task execution progress.

[0010] In one embodiment, the task orchestration based on the task management agent and the language features of the SQL file to be interpreted, to obtain a task list for the SQL file to be interpreted, includes:

[0011] Based on the task management intelligent agent, feature extraction is performed on each SQL statement in the SQL file to be interpreted to obtain structural features, syntactic features and contextual relationship features;

[0012] Based on the structural features, the syntactic features, and the contextual relationship features, construct the language features of the SQL file to be interpreted;

[0013] Tasks are orchestrated based on the task management agent and the language features to obtain a task list for the SQL file to be interpreted; the task list contains tasks of each task type; the tasks are used to interpret the SQL file to be interpreted.

[0014] In one embodiment, the step of processing target tasks in the task list through a task execution agent to obtain the task result and current task status of the target tasks includes:

[0015] The first unexecuted task in the task list is identified as the target task, and the task information of the target task is transmitted to the task execution agent.

[0016] The task execution agent invokes the task execution big model to execute the target task, thereby obtaining the task results and key information of the target task.

[0017] The task results and key information are transmitted to the task management agent, and the current task status of the target task is evaluated based on the task results, key information, and task information of the target task.

[0018] In one embodiment, the task execution agent integrates a toolset; the toolset includes various tool subsets; each tool subset is a data acquisition tool subset, a data storage tool subset, a data retrieval tool subset, and a data processing tool subset.

[0019] In one embodiment, the step of invoking the task execution big model through the task execution agent to execute the task information of the target task and obtain the task result and key information of the target task includes:

[0020] The task execution agent invokes the task execution big model to process the task information of the target task, thereby obtaining a tool call list and each sub-task.

[0021] Based on the tool call list, the toolset is invoked to process each of the subtasks, and the execution results of each subtask are obtained;

[0022] Retrieve short-term context information from the short-term memory database, and determine whether the target task can be completed based on the execution results and the short-term context information.

[0023] If the target task can be completed, the execution results and short-term context information are processed based on the task execution model to obtain the task results and key information of the target task.

[0024] In one embodiment, after determining whether the target task can be completed, the method further includes:

[0025] If the target task cannot be completed, with the goal of completing the target task, data processing is performed on each execution result and the short-term context information based on the task execution big model to obtain processing results, key information, pending items, new tool call list and new sub-tasks;

[0026] The processing result, the key information, the tool call list, each of the sub-tasks, and the target task are constructed into a short-term memory data, and the short-term memory data is stored in a short-term memory database;

[0027] Based on the new tool call list and the new sub-tasks, the steps of calling the toolset based on the tool call list to process each sub-task and obtaining the execution results of each sub-task are performed until the target task can be completed.

[0028] In one embodiment, after processing the execution results and short-term context information based on the task execution big model to obtain the task results and key information of the target task, the method further includes:

[0029] The task results, key information, tool call list, task information of each subtask and the target task are constructed into a short-term memory data, and the short-term memory data is stored in a short-term memory database;

[0030] Compress each short-term memory data in the short-term memory database according to a preset data length to obtain compressed short-term memory data, and then clear each short-term memory data in the short-term memory database.

[0031] In one embodiment, determining the next target task based on the task result and the current task state includes:

[0032] Based on the task results and the current task status, determine whether to update the task list;

[0033] If the task list is needed, the task list is rearranged according to the task execution agent and the task result to obtain an updated task list, and the first unexecuted task in the updated task list is determined as the target task.

[0034] If the task list is not updated, then the next task after the target task in the task list will be identified as the target task.

[0035] In one embodiment, the step of rearranging the task list based on the task execution agent and the task result to obtain an updated task list includes:

[0036] Based on the task management agent and the task results, determine the task update type;

[0037] Based on the task update type, the task list is rearranged to obtain an updated task list.

[0038] In one embodiment, if the task update type is "new", then based on the task management agent and the task result, a new task is generated and added to the target task in the task list to obtain the updated task list;

[0039] If the task update type is deletion, then based on the task management agent and the task result, the task to be deleted is determined in the task list, and the task to be deleted is deleted to obtain the updated task list;

[0040] If the task update type is the change, the first unexecuted task in the task list is determined as the task to be changed, and the task information of the task to be changed is changed based on the task management agent and the task result to obtain the updated task list.

[0041] Secondly, this application also provides a code interpretation apparatus, comprising:

[0042] The acquisition module is used to acquire the structured query language (SQL) file to be interpreted, and to perform task orchestration based on the language features of the task management agent and the SQL file to be interpreted, thereby obtaining a task list of the SQL file to be interpreted.

[0043] The execution module is used to process the target tasks in the task list through the task execution agent, and obtain the task results and current task status of the target tasks;

[0044] The determination module is used to determine the next target task based on the task result and the current task status, until all tasks in the task list are completed and the interpretation text of the SQL file to be interpreted is obtained; wherein, the next target task is determined based on the judgment result of the current task status and the task execution progress.

[0045] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0046] Obtain the structured query language (SQL) file to be interpreted, and perform task orchestration based on the task management agent and the language features of the SQL file to be interpreted to obtain the task list of the SQL file to be interpreted;

[0047] The task execution agent processes the target tasks in the task list to obtain the task results and current task status of the target tasks.

[0048] Based on the task results and the current task status, the next target task is determined until all tasks in the task list are completed, and the interpreted text of the SQL file to be interpreted is obtained; wherein, the next target task is determined based on the judgment result of the current task status and the task execution progress.

[0049] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0050] Obtain the structured query language (SQL) file to be interpreted, and perform task orchestration based on the task management agent and the language features of the SQL file to be interpreted to obtain the task list of the SQL file to be interpreted;

[0051] The task execution agent processes the target tasks in the task list to obtain the task results and current task status of the target tasks.

[0052] Based on the task results and the current task status, the next target task is determined until all tasks in the task list are completed, and the interpreted text of the SQL file to be interpreted is obtained; wherein, the next target task is determined based on the judgment result of the current task status and the task execution progress.

[0053] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0054] Obtain the structured query language (SQL) file to be interpreted, and perform task orchestration based on the task management agent and the language features of the SQL file to be interpreted to obtain the task list of the SQL file to be interpreted;

[0055] The task execution agent processes the target tasks in the task list to obtain the task results and current task status of the target tasks.

[0056] Based on the task results and the current task status, the next target task is determined until all tasks in the task list are completed, and the interpreted text of the SQL file to be interpreted is obtained; wherein, the next target task is determined based on the judgment result of the current task status and the task execution progress.

[0057] The aforementioned code interpretation method, apparatus, computer device, computer-readable storage medium, and computer program product acquire a Structured Query Language (SQL) file to be interpreted, and arrange tasks based on the language features of the task management agent and the SQL file to be interpreted to obtain a task list for the SQL file to be interpreted. A task execution agent processes the target tasks in the task list to obtain the task results and current task status of the target tasks. Based on the task results and current task status, the next target task is determined until all tasks in the task list are executed, resulting in the interpreted text of the SQL file to be interpreted. The next target task is determined based on the judgment result of the current task status and the task execution progress. This method generates tasks for interpreting code through the task management agent and the language features of the SQL file to be interpreted, and flexibly determines the next target task based on the task results and current task status during task execution. This enables adaptive adjustment of subsequent tasks based on task results, allowing the task execution agent to accurately determine the Chinese interpretation of SQL statements in complex database scenarios, thereby achieving automated and accurate interpretation of SQL code and improving the accuracy of the code interpretation method. Attached Figure Description

[0058] 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.

[0059] Figure 1 This is a flowchart illustrating a code interpretation method in one embodiment;

[0060] Figure 2 This is a flowchart illustrating the process of determining a task list in one embodiment;

[0061] Figure 3 This is a flowchart illustrating the process of determining the task result and the current task status in one embodiment;

[0062] Figure 4 This is a flowchart illustrating the execution of a target task in one embodiment;

[0063] Figure 5 This is a flowchart illustrating the process of storing a short-term memory database in one embodiment;

[0064] Figure 6 This is a flowchart illustrating the process of managing a short-term memory database in one embodiment;

[0065] Figure 7 This is a flowchart illustrating the process of determining the target task in one embodiment;

[0066] Figure 8 This is a flowchart illustrating the process of updating the task list in one embodiment;

[0067] Figure 9 This is a flowchart illustrating the process of updating the task list in another embodiment;

[0068] Figure 10 This is an architecture diagram of a code interpretation system in an exemplary embodiment;

[0069] Figure 11 An architecture diagram of an exemplary embodiment of the toolset;

[0070] Figure 12 This is an architecture diagram of the memory management module in an exemplary embodiment;

[0071] Figure 13 This is a structural block diagram of a code interpretation device in one embodiment;

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

[0073] 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.

[0074] In one embodiment, such as Figure 1 As shown, a code interpretation method is provided. This application embodiment uses the application of this method to a computer device as an example for illustration. This application embodiment does not limit the execution device for executing the code interpretation method, and includes the following steps 102 to 106. Wherein:

[0075] Step 102: Obtain the structured query language (SQL) file to be interpreted, and perform task orchestration based on the language features of the task management agent and the SQL file to be interpreted to obtain the task list of the SQL file to be interpreted.

[0076] The SQL file to be interpreted is a file containing SQL statements that needs to be converted into natural language.

[0077] In implementation, the computer device acquires the SQL file to be interpreted. Then, the computer device inputs the SQL file into a task management agent, which extracts the language features of the SQL file. Next, the computer device orchestrates tasks based on the task management agent and the language features, obtaining a task list for the SQL file to be interpreted. This task list contains tasks of various task types.

[0078] Specifically, the computer device retrieves the SQL file to be interpreted from the database. This file contains the SQL statements that need to be interpreted. It may contain comments on these SQL statements. However, these comments only clarify the execution logic of the SQL file for the developers who wrote it; they do not clarify the logic for non-developers or other developers, preventing further application of the SQL file. Therefore, the SQL file needs to be interpreted to obtain a natural language interpretation text. The computer device inputs the SQL file into a task management agent, which extracts features from the file to obtain the structural, syntactic, and contextual features of each SQL statement. Then, the computer device constructs the language features of the SQL file based on these features and arranges a task list for the SQL file to be interpreted according to these language features.

[0079] Step 104: The task execution agent processes the target task in the task list to obtain the task result and current task status of the target task.

[0080] In implementation, the computer device includes a task execution agent and a task management agent. The task management agent in the computer device identifies the target task from the task list and sends the target task's task information to the task execution agent. The task execution agent executes the target task based on the target task's task information, obtains the target task's task result, and determines the target task's current task status based on the task result.

[0081] Specifically, the task management agent in the computer device identifies the first unexecuted task in the task list as the target task. Then, the task management agent transmits the target task's task information to the task execution agent. This task information includes the task objective, the object to be processed, and the task background. If the target task is simple and the SQL file to be interpreted contains the necessary information, the task execution agent executes the target task based on the target task and the SQL file to be interpreted, obtaining the task result and key information. The required information in the SQL file to be interpreted is the complete information needed to complete the target task. For example, comments on the SQL statement or descriptions of fields in the SQL statement. The task execution agent then transmits the task result and key information to the task management agent. The task management agent evaluates the completion quality of the target task based on the task result and key information, obtaining the current task status.

[0082] In an optional embodiment, if the target task is complex or the SQL file to be interpreted does not contain the information required to complete it, the task execution agent in the computer device generates subtasks and tool invocation requests based on the target task's task information. The required information contained in the SQL file to be interpreted is the complete information needed to complete the target task. Then, the computer device invokes each target tool based on the tool invocation list to process each subtask until the target task is completed, obtaining the task result and key information. The task management agent evaluates the completion quality of the target task based on the task result and key information, obtaining the current task status.

[0083] In an optional embodiment, after completing the target task, the computer device generates legacy questions based on the current task status and the task list. Then, the computer device constructs long-term memory data based on the target task's task information, task results, key information, legacy questions, and the task list, and stores the long-term memory data in a long-term memory database.

[0084] Step 106: Based on the task results and the current task status, determine the next target task, until all tasks in the task list are completed, and obtain the interpretation text of the SQL file to be interpreted.

[0085] The next target task is determined based on the current task status and the task execution progress.

[0086] In implementation, the computer device determines whether to update the task list based on the task results and the current task status, obtaining a judgment result. Then, based on the judgment result, the task list, the task results, and the current task status, the computer device determines the next target task, until all tasks in the task list are executed. The computer device uses the task result of the last target task as the interpreted text of the SQL file to be interpreted.

[0087] Specifically, the computer device determines whether to update the task list based on the task result and the current task status, obtaining a decision result. If the decision result is to update the task list, the computer device rearranges the task list according to the task execution agent and the task result, obtaining an updated task list, and identifies the target task in the updated task list. If the decision result is not to update the task list, the computer device identifies the next task in the target task list as the target task. The computer device then checks if there are any unexecuted tasks in the task list. If there are no unexecuted tasks in the task list, the next target task is empty, and the computer device determines that the task result of the target task is the interpreted text of the SQL file to be interpreted. If the task list still contains unexecuted tasks, the computer device executes step 104 above until there are no unexecuted tasks in the task list. In other words, all tasks in the task list have been executed.

[0088] In the above code interpretation method, tasks for interpreting the code are generated by the task management agent and the language features of the SQL file to be interpreted. During the execution of the tasks, the next target task is flexibly determined based on the task results and the current task status. This enables the task execution agent to adaptively adjust subsequent tasks according to the task results, allowing the task execution agent to accurately determine the Chinese interpretation of SQL statements in complex database scenarios. This, in turn, enables the automated and accurate interpretation of SQL code, improving the accuracy of the code interpretation method.

[0089] In one exemplary embodiment, such as Figure 2 As shown, the specific processing steps in step 102, which involve task orchestration based on the task management agent and the language features of the SQL file to be interpreted to obtain a task list for the SQL file to be interpreted, include steps 202 to 206. Wherein:

[0090] Step 202: Based on the task management intelligent agent, feature extraction is performed on each SQL statement in the SQL file to be interpreted to obtain structural features, syntactic features and contextual relationship features.

[0091] In implementation, a task management agent and a task execution agent are set up in the computer equipment. The computer equipment inputs the SQL file to be interpreted into the task management agent. The task management agent extracts features from each SQL statement in the SQL file to be interpreted, obtaining the structural features, syntactic features, and contextual features of each SQL statement. The structural features are mainly reflected in the case-insensitive nature of SQL statement keywords, the use of semicolons at the end of sentences, the position of spaces and newlines, and the data type. The syntactic features are the functions of the SQL statements, namely, insert, delete, update, and query. The contextual features are the relationships and interactions between the keys of each SQL statement.

[0092] Step 204: Construct the language features of the SQL file to be interpreted based on structural features, syntactic features, and contextual relationship features.

[0093] In practice, computer equipment combines the structural features, syntactic features, and contextual features of each SQL statement to obtain the language features of the SQL file to be interpreted.

[0094] Step 206: Arrange tasks according to the task management agent and language features to obtain a task list of SQL files to be interpreted.

[0095] The task list contains tasks of various task types; tasks are used to interpret the SQL file to be interpreted.

[0096] In implementation, the task management agent in the computer device decomposes the task of interpreting the SQL file based on language features, resulting in individual tasks. Then, the task management agent orchestrates these tasks to obtain a task list for the SQL file to be interpreted.

[0097] In an optional embodiment, if the structure of the SQL statements in the SQL file to be interpreted is simple, the task list contains only one task, and the task type of this task is "Interpret SQL". If the SQL file to be interpreted contains a large number of SQL statements, the task list contains tasks of various task types, namely, interpreting SQL code, SQL / text slicing, text summarizing, key information extraction, and information retrieval. It should be noted that if there is a task of the SQL / text slicing task type, there must also be a task of the text summarizing task type.

[0098] Optionally, the task types include, but are not limited to, interpreting SQL code, SQL / text slicing, text summarizing, extracting key information, and information retrieval. Each task type may have, but is not limited to, only one task, which is determined according to the interpretation requirements. This application embodiment does not limit the task types and the number of tasks.

[0099] In this embodiment, by extracting the language features of the SQL file to be interpreted and decomposing the task of interpreting the SQL file into multiple tasks based on the language features, a task list is obtained, which simplifies the task of interpreting the SQL file and improves the accuracy of interpreting the SQL file.

[0100] In one exemplary embodiment, such as Figure 3 As shown, the specific processing procedure of step 104 includes steps 302 to 306. Wherein:

[0101] Step 302: The first unexecuted task in the task list is identified as the target task, and the task information of the target task is transmitted to the task execution agent.

[0102] In implementation, the task management agent in the computer device identifies the first unexecuted task as the target task and transmits the task information of the target task to the task execution agent. This task information includes the task objective, the object to be processed, and the task background; however, this embodiment does not limit the scope of the task information.

[0103] Step 304: The task execution agent calls the task execution big model to execute the task information of the target task, and obtains the task results and key information of the target task.

[0104] In implementation, the task execution agent in the computer device contains a large task execution model. The computer device invokes the large task execution model to process the task information of the target task, obtaining the task results and key information. Among them, the key information is identified as the important information recorded by the large task execution model during the processing.

[0105] Specifically, the large-scale task execution model in the computer device determines whether the target task can be completed directly. If the target task can be completed directly, the large-scale task execution model processes the target task information based on the task objective in the task information, obtaining the target task's result and key information. If the target task cannot be completed, the computer device decomposes the target task into sub-tasks and determines the tools required for each sub-task, obtaining a tool invocation list. Then, the large-scale task execution model in the computer device invokes the toolset based on the tool invocation list to process each sub-task until the target task is completed, obtaining the target task's result and key information. The key information includes the tool information invoked by each sub-task and the execution results of each tool.

[0106] In an optional embodiment, if the target task is not the first task in the task list, the task execution agent retrieves long-term memory data from the memory management module before executing the target task and identifies the long-term memory data as long-term context information. Then, based on the task execution big model, the task execution agent processes the long-term context information and the target task's task information with the goal of completing the target task (in other words, with the target task's task objective as the goal), to obtain the target task's task result and key information.

[0107] Step 306: Transmit the task results and key information to the task management agent, and evaluate the current task status of the target task based on the task results, key information and task information of the target task.

[0108] The task information includes the task objectives of the target task.

[0109] In implementation, the task execution agent in the computer device transmits the task results and key information to the task management agent. The task execution agent in the computer device determines whether the task results and key information have achieved the target task's objective, thus obtaining the current task status of the target task. The current task status represents the task quality of the target task and is also the execution status of the target task.

[0110] Specifically, if the task results and key information meet the target task's objectives, the task management agent in the computer device determines the current task status as completed. If the task results and key information do not meet the target task's objectives, the task management agent in the computer device determines the current task status as incomplete.

[0111] In this embodiment, by using a task execution agent to execute the task information of the target task, the task management and task execution modules are separated, allowing the task execution module to focus on executing the target task, thereby improving the execution efficiency of the target task and thus improving the efficiency of the code interpretation method.

[0112] In an exemplary embodiment, the task execution agent integrates a toolset; the toolset includes various tool subsets; the tool subsets are a data acquisition tool subset, a data storage tool subset, a data retrieval tool subset, and a data processing tool subset.

[0113] In implementation, the computer device contains a task execution agent. This task execution agent integrates a toolset. This toolset includes subsets of various tool types: data acquisition tools (data acquisition type), data storage tools (data storage type), data retrieval tools (data retrieval type), and data processing tools (data processing type).

[0114] Specifically, this toolset is a SQL-oriented toolset. The toolset mainly consists of four components (which are also four subsets of tools):

[0115] Data acquisition tools (a subset of data acquisition tools). This subset of data acquisition tools is designed for data to be acquired, including but not limited to metadata, code, and business documents. Data acquisition tools may include, but are not limited to, database connectors, code readers, file readers, and multimodal data collectors.

[0116] Data processing tools (a subset of data processing tools) are tools used to process data such as code and documents. Data processing tools may include, but are not limited to, code parsers, text slicers, information extractors, relation builders, tag generators, and vector generators.

[0117] Data storage tools (a subset of data storage tools) do not expose data as external tools but serve as auxiliary components for other tools. They can be used to store the results of data acquisition tools, the results of data processing tools, and as retrieval objects for data retrieval tools. The content stored by data storage tools includes, but is not limited to, database structure, code text, data lineage, business logic, and task rules. Supported storage formats include, but are not limited to, relational databases, vector databases, graph databases, document databases, time-series databases, and cache databases.

[0118] Data retrieval tools (a subset of data retrieval tools) are tools that provide retrieval capabilities for data stored in data storage using organizational forms such as objects, relations, vectors, and graphs. Data retrieval tools may include, but are not limited to, precise retrieval, fuzzy retrieval, semantic retrieval, graph relation retrieval, rule-based retrieval, and hybrid retrieval.

[0119] Finally, based on the above components, data acquisition tools, data processing tools, and data retrieval tools are encapsulated into standardized interfaces to obtain a standardized tool t.

[0120] The computer device constructs a full tool list from the tool information of each tool in the toolset. This tool information includes at least the tool name, tool function, and parameter description. When the task execution big model is invoked, the task execution agent in the computer device inputs the full tool list as a parameter to the big model. Optionally, for task execution big models that do not support this mode, the task execution agent in the computer device inputs the full tool list as part of the prompt. The general format of the full tool list is as follows:

[0121] [{

[0122] "type": "function", / / Functionality;

[0123] "function": {

[0124] "name": Tool name;

[0125] "description": Tool description;

[0126] "parameters": Parameter descriptions;

[0127] "strict": True / / Strict formatting;

[0128] }

[0129] }, ...]

[0131] In this embodiment, by constructing toolsets for each tool type and integrating these toolsets into the task execution agent, the task execution agent can call upon the toolsets to complete the target task. This enhances the interpretability of the task execution agent and thus improves the accuracy of the task results.

[0132] In one exemplary embodiment, such as Figure 4 As shown, the specific processing procedure of step 304 includes steps 402 to 408. Wherein:

[0133] Step 402: The task execution agent calls the task execution big model to process the task information of the target task, and obtains the tool call list and each sub-task.

[0134] In implementation, the task execution agent in the computer device invokes the task execution big model to process the task information of the target task and decomposes the target task into sub-tasks. Then, the task execution big model determines the target tools required for each sub-task based on the full tool list and constructs a tool invocation list based on the tool information of the target tools.

[0135] Specifically, the task information summary includes the task objective, the processing object, and the task background. The task execution agent in the computer device invokes the task execution master model, inputting the task information and a full tool list into it. The master model then breaks down the target task into subtasks. Decomposing the target task into multiple subtasks simplifies its execution. Next, the task execution master model in the computer device determines the tool name of the target tool to be invoked for each subtask from the full tool list and generates the parameter content for invoking the target tool. Then, the master model in the computer device generates a tool invocation list based on the tool name and parameter content of each target tool. The tool name and parameter content of a target tool constitute the invocation information for that target tool. The parameter content in the invocation information is determined according to the task objective of the subtask. For example, the general format of the tool invocation list is as follows:

[0136] [{

[0137] "id": A unique identifier for this call;

[0138] "function": {

[0139] "name": The name of the tool being invoked;

[0140] "arguments": {parameter name: parameter value,...};

[0141] }

[0142] }, ...]

[0144] Optionally, the number of target tools can be 1 or 10, depending on the task requirements of the subtask. This application embodiment does not limit the number of target tools.

[0145] Step 404: Based on the tool call list, call the toolset to process each subtask and obtain the execution results of each subtask.

[0146] The tool call list contains call information for each tool, and each call information contains the tool name and parameter content of the target tool called by the subtask.

[0147] In implementation, for each call message, the computer device determines the calling interface of the target tool based on the tool name of the target tool in the call message. Then, the computer device sends the parameter content to the target tool based on the calling interface, so that the target tool processes the subtask based on the parameter content and obtains the execution result of the subtask.

[0148] Specifically, the target tool receives parameters by calling an interface and processes the corresponding subtasks based on these parameters to obtain the execution results of the subtasks. These subtasks are related to the functionality of the target tool. When all target tools have completed execution (or failed), the task execution intelligence will aggregate the execution results of each target tool and return them to the overall task execution model. The general format of the returned execution results is as follows:

[0149] [{

[0150] "tool_call_id": A unique identifier for this call;

[0151] "content": The result of the tool's execution;

[0152] }, ...]

[0154] Step 406: Obtain short-term context information from the short-term memory database, and determine whether the target task can be completed based on the execution results and the short-term context information.

[0155] The computer equipment includes a memory management module. This module contains a short-term memory database.

[0156] In implementation, the computer device retrieves short-term context information from a short-term memory database. Based on the short-term context information and the execution results, the task execution agent of the computer device determines whether it can directly process and obtain the task result of the target task. If it can directly process and obtain the task result of the target task, the computer device determines that it can complete the target task and executes step 408 below. If it cannot directly process and obtain the task result of the target task, the computer device determines that it cannot complete the target task and executes step 502 below.

[0157] Specifically, the short-term context information refers to short-term memory data stored in the short-term memory database, and the computer device is configured to retrieve a certain number of short-term memory data, k. The selection of k follows the rule: sum(length of k memories) <= maximum context length supported by the task execution agent - task execution agent prompt length (fixed length) - task target length - other key information (key information generated during the previous execution, i.e., the key information in step 502). The length of k memories can be adaptively adjusted according to task requirements, but it must be at least less than the result of the maximum context length supported by the task execution agent - task execution agent prompt length (fixed length) - task target length.

[0158] Step 408: If the target task can be completed, perform data processing on each execution result and short-term context information based on the task execution big model to obtain the task results and key information of the target task.

[0159] In implementation, if the target task can be completed, the task execution agent in the computer device constructs input information based on the execution results, short-term context information, key information from the previous execution process, and the target task's task information, and inputs this input information into the large-scale task execution model. The large-scale task execution model will then process the execution results, short-term context information, task information, and key information, with the target task's objective as its goal, to obtain the target task's task results and key information.

[0160] In this embodiment, by breaking down the target task into sub-tasks and calling the sub-tasks in the toolset to execute each sub-task, the target task can be simplified into simple sub-tasks, improving the accuracy of each execution result and thus enhancing the accuracy of the interpreted text.

[0161] In one exemplary embodiment, if the target task cannot be completed, it is necessary to invoke tools to continue completing the target task. For example... Figure 5 As shown, after step 406 is executed, the specific processing procedure of this code interpretation method includes steps 502 to 506. Wherein:

[0162] Step 502: If the target task cannot be completed, with the goal of completing the target task, perform data processing on each execution result and short-term context information based on the task execution big model to obtain processing results, key information, pending items, new tool call list and new sub-tasks.

[0163] In implementation, if the target task cannot be completed, the task execution agent constructs input information based on the execution results, short-term context information, key information from the previous execution process, and the target task's task information, and inputs this input information into the task execution big model. The task execution big model, with the target task's objective as its goal, processes the execution results, short-term context information, task information, and key information to determine the processing results and key information. Then, based on the difference between the task objective and the processing results, the task big model determines the pending tasks and breaks them down into new sub-tasks. For each new sub-task, the task execution big model determines the new target tool that needs to be called from the full task list. Then, the task execution big model constructs a new tool call list based on each new sub-task and each new target tool. The process of generating the new tool call list is the same as the process of generating the tool call list; please refer to step 406 above for details, which will not be repeated here in this embodiment.

[0164] Unlike the key information for the successful execution of the target task mentioned above, the key information here includes not only the execution results of each subtask, the task objective, and the processing results, but also the reasons for the failure of the subtask execution and the reasons why the target task could not be successfully completed.

[0165] Step 504: Construct the processing results, key information, tool call list, each subtask and target task into a short-term memory data, and store the short-term memory data in the short-term memory database.

[0166] In implementation, the computer device combines the processing results, key information, tool call list, subtasks, pending items, and target task information into a short-term memory data set. The computer device then stores this short-term memory data in the short-term memory database of the memory management module.

[0167] Step 506: Based on the new tool call list and the new sub-tasks, execute the steps of calling the toolset based on the tool call list to process each sub-task and obtain the execution results of each sub-task, until the target task can be completed.

[0168] In implementation, the computer device continues to execute step 404 based on the new tool call list and each new subtask until the target task can be completed. That is, the computer device executes the toolset based on the new tool call list to process each new subtask and obtains the execution results of each new subtask. The specific processing procedure of step 404 has been described in detail in the above embodiments, and will not be repeated here in the embodiments of this application.

[0169] In this embodiment, by flexibly adjusting each subtask based on the target task's objective, the success rate of the target task's execution and the accuracy of the task results can be guaranteed, thereby improving the accuracy of the interpreted text. Furthermore, by constructing an intelligent agent + database tool approach, automated interpretation of SQL code for complex databases is achieved. By designing a toolkit including functions such as data acquisition, processing, and retrieval, constructing a memory management tool and an intelligent agent interaction mechanism, and solving the problems of highly complex task orchestration and extremely long contexts, the tool ultimately enables automated and accurate interpretation of SQL code in complex database scenarios.

[0170] In one exemplary embodiment, after obtaining the task results and key information of the target task, it is also necessary to process the short-term memory data. For example... Figure 6 As shown, after step 408 is executed, the specific processing procedure of this code interpretation method includes steps 602 to 604. Wherein:

[0171] Step 602: Construct a short-term memory data set by combining the task results, key information, tool call list, task information of each subtask and target task, and store the short-term memory data in the short-term memory database.

[0172] In practice, the computer device combines the task result, key information, tool call list, and target task information into a short-term memory record. Then, the computer device stores this short-term memory record in the short-term memory database of the memory management module.

[0173] Specifically, the computer device contains a task execution agent and a memory management module. The task execution agent combines the task result, key information, tool call list, and target task information into a short-term memory record, and transmits this short-term memory data to the memory management module. The memory management module receives this short-term memory data and stores it in a short-term memory database.

[0174] Step 604: Compress each short-term memory data in the short-term memory database according to the preset data length to obtain compressed short-term memory data, and clear each short-term memory data in the short-term memory database.

[0175] In implementation, the computer device has a pre-set data length of 1. Based on this data length, the computer device compresses the individual short-term memory data together to obtain compressed short-term memory data. Then, the computer device stores the uncompressed short-term memory data into the global memory database and clears all short-term memory data from the short-term memory database.

[0176] Specifically, the computer device includes a memory management module, a task management agent, and a task execution agent. The memory management module contains a long-term memory database, a short-term memory database, and a global memory database. The task execution agent has a pre-set data length. The task execution agent retrieves all short-term memory data from the short-term memory database and compresses each short-term memory data into compressed short-term memory data of length l. Then, the task execution agent transmits the compressed short-term memory data to the memory management module. The memory management module receives the compressed short-term memory data and stores all short-term memory data from the short-term memory database into the global memory database. The memory management module clears all short-term memory data from the short-term memory database and calls the integration model to integrate and update the compressed short-term memory data and the long-term data of the target task in the long-term memory database, obtaining new long-term memory data. The memory management module updates the global memory database with the new long-term memory data. This new long-term memory data serves as context information for each task orchestration or task evaluation by the task management agent. The data in the global memory database is provided to the task management agent and the task execution agent on demand through data retrieval. The provision can be done through the agent's active approach using Function Calling or MCP (Model Context Protocol, an open protocol), or passively based on the traditional RAG (Retrieval Enhanced Generation) framework.

[0177] Optionally, compression methods include, but are not limited to, large language models, neural networks, or rule-based summarization. This application does not limit the compression method used in its embodiments.

[0178] In this embodiment, short-term memory data is obtained by recording the data of each toolset call, and the short-term memory data is used as the context information of the task execution agent. This can enrich the target task data executed by the task execution agent and improve the accuracy of the task results.

[0179] In one exemplary embodiment, such as Figure 7 As shown, the specific processing steps for determining the next target task based on the task result and the current task status in step 106 include steps 702 to 706. Wherein:

[0180] Step 702: Based on the task results and the current task status, determine whether to update the task list.

[0181] During implementation, the computer device determines whether the current task status is complete. If the current task status is complete, the computer device determines whether to update the task list based on the task result. If the current task status is incomplete, the computer device determines to update the task list.

[0182] Specifically, if the current task status is completed, the computer device determines the next task for the target task in the task list. The computer device then determines whether the task result satisfies the task objective of the next task. If the task result satisfies the task objective of the next task, the computer device determines to update the task list. If the task result does not satisfy the task objective of the next task, the computer device determines not to update the task list.

[0183] In an optional embodiment, if there is no next task for the target task in the task list, the computer device determines that the task result of the target task is the interpreted text of the SQL file to be interpreted.

[0184] Step 704: If the task list is updated, rearrange the task list according to the task execution agent and the task result to obtain the updated task list, and determine the first unexecuted task in the updated task list as the target task.

[0185] In implementation, if the task list needs updating, the task agent in the computer device determines the update type based on the task results. Then, the task agent rearranges the task list according to the update type and task results, resulting in an updated task list. Finally, the computer device identifies the first task in the updated task list that is in an "unexecuted" state as the target task.

[0186] Specifically, if the task list needs updating, the task agent in the computer device determines the update type based on the task results. Update types include addition, modification, and deletion. If the update type is addition, the task agent generates a new task and adds it to the task list after the target task, resulting in an updated task list. If the update type is modification, the computer device determines the next task in the task list and updates its task information, resulting in an updated task list. If the modification type is deletion, the computer device determines the task to be deleted in the task list and deletes it, resulting in an updated task list.

[0187] Step 706: If the task list is not updated, then the next task after the target task in the task list will be designated as the target task.

[0188] In practice, if the task list is not updated, the task management agent in the computer device will identify the next task after the target task as the target task.

[0189] In an optional embodiment, if the target task is the last task in the task list, then there is no next task for the target task in the task list; that is, the next task for the target task is empty. The computer device determines the task result of the target task as the interpreted text of the SQL file to be interpreted.

[0190] In this embodiment, the next target task is flexibly determined based on the task result and the current task status during the task execution process. This enables the task execution agent to adaptively adjust subsequent tasks according to the task result, allowing it to accurately determine the Chinese interpretation of SQL statements in complex database scenarios. This, in turn, enables the automated and accurate interpretation of SQL code, improving the accuracy of the code interpretation method.

[0191] In one exemplary embodiment, such as Figure 8 As shown, the specific processing steps in step 702, which involve rearranging the task list based on the task execution agent and the task results to obtain an updated task list, include steps 802 to 804. Wherein:

[0192] Step 802: Determine the task update type based on the task management agent and the task result.

[0193] During implementation, if the task result indicates that the target task is not completed, the task management agent in the computer device determines the task update type as "add". If the task result indicates that the target task is completed, the task management agent in the computer device determines the next task in the task list and judges whether the task result has met the task objective of the next task. If the task result has met the task objective of the next task, the task management agent in the computer device determines the task update type as "delete". If the task result has not met the task objective of the next task, the task management agent in the computer device determines the task update type as "modify".

[0194] Step 804: Based on the task update type, rearrange the task list to obtain the updated task list.

[0195] The task update types include changes, additions, and deletions.

[0196] In practice, the task management agent in the computer device rearranges the task list based on the task update type and task results to obtain the updated task list.

[0197] Specifically, if the update type is "addition," the task agent in the computer device generates a new task based on the task result and adds it to the task list after the target task, resulting in an updated task list. If the update type is "change," the computer device determines the next task in the task list and updates its task information based on the task result, resulting in an updated task list. If the change type is "deletion," the computer device determines the task to be deleted in the task list based on the task result and deletes it, resulting in an updated task list.

[0198] In this embodiment, the task update type is determined based on the task result, and the task list is flexibly adjusted based on the task update type. This enables the task execution agent to adaptively adjust subsequent tasks according to the task result, allowing it to accurately determine the Chinese interpretation of SQL statements in complex database scenarios. This, in turn, enables the automated and accurate interpretation of SQL code, improving the accuracy of the code interpretation method.

[0199] In one exemplary embodiment, task update types include addition, deletion, and modification, such as... Figure 9 As shown, the specific processing procedure of step 804 includes steps 902 to 906. Wherein:

[0200] Step 902: If the task update type is "add", then based on the task management agent and the task result, generate a new task and add the new task after the target task in the task list to obtain the updated task list.

[0201] In implementation, if the task update type is "add," the task management agent in the computer device generates a new task based on the difference between the task result and the target task's objective. Then, the computer device determines the add position based on the position after the target task in the task list and adds the target task in the add task processing, resulting in an updated task list. This new task will then become the next target task.

[0202] Step 904: If the task update type is deletion, then based on the task management agent and the task result, determine the task to be deleted in the task list and delete the task to be deleted to obtain the updated task list.

[0203] In implementation, if the task update type is deletion, the task management agent in the computer device determines the next task of the target task from the task list and judges whether the task result has achieved the task objective. If the task result has achieved the task objective, the computer device determines the task as a task to be deleted, determines the next task of the task to be deleted from the task list, and executes the step of judging whether the task result has achieved the task objective, until the task result has not achieved the task objective. If the task result has not achieved the task objective, the computer device stops determining the task to be deleted and removes it from the task list.

[0204] Step 906: If the task update type is change, determine the first unexecuted task in the task list as the task to be changed, and change the task information of the task to be changed based on the task management agent and the task result to obtain the updated task list.

[0205] In implementation, if the task update type is "change," the first unexecuted task in the task list on the computer device is identified as the task to be changed. This task to be changed is also the next task after the target task in the task list. The task management agent in the computer device modifies the task information of the task to be changed based on the task results and key information, resulting in an updated task list. Changes to the task information include, but are not limited to, changes to the task objective, task background, and processing object.

[0206] In an optional embodiment, the task management agent in the computer device obtains new long-term memory data from the global memory network, and modifies the task information of the task to be modified based on the new long-term memory network, task results, and key information to obtain an updated task list.

[0207] In this embodiment, the task list is deleted, added, or removed based on the task update type. This enables adaptive adjustment of subsequent tasks according to the task results, allowing the task execution agent to accurately determine the Chinese interpretation of SQL statements in complex database scenarios. Consequently, it can perform automated and accurate interpretation of SQL code, improving the accuracy of the code interpretation method.

[0208] In one exemplary embodiment, a code interpretation system 1000 is provided. Figure 10 This is an architecture diagram of a code interpretation system in an exemplary embodiment. Figure 10 As shown, the code interpretation system 1000 includes a task management agent 1001, a task execution agent 1002, and a memory management module 1003. Wherein:

[0209] The task management agent 1001 is used for task orchestration and evaluation, and interacts with the task execution agent 1002 and the memory management module 1003. Specifically, the task management agent 1001 obtains the structured query language (SQL) file to be interpreted, and orchestrates tasks based on the language features of the task management agent and the SQL file to be interpreted, obtaining a task list for the SQL file to be interpreted. Then, the task management agent 1001 identifies the first unexecuted task in the task list as the target task and transmits the task information of the target task to the task execution agent 1002. The task management agent 1001 receives the task results and key information of the target task transmitted by the task execution agent 1002, and evaluates the current task status of the target task based on the task results, key information, and the task information of the target task. Then, based on the task results and the current task status, the task management agent determines the next target task, until all tasks in the task list are executed, obtaining the interpreted text of the SQL file to be interpreted.

[0210] The task execution agent 1002 includes a large task execution model and a toolset. The task execution agent 1002 invokes the large task execution model to execute the task information of the target task, obtaining the task results and key information. Specifically, in cases where the target task is complex, the task execution agent 1002 invokes the toolset to process the target task.

[0211] The memory management module 1003 includes a long-term memory database, a short-term memory database, and a global memory database. The long-term memory database stores data generated during task orchestration and evaluation. The short-term memory database stores data generated by the task execution model and the invocation of toolsets. The global memory database stores data generated by the entire code interpretation method.

[0212] Among them, the task execution agent and the task management agent are both ordinary large language models.

[0213] Figure 11 This is an architecture diagram of an exemplary embodiment of a toolset. (As shown...) Figure 11 As shown, this toolset includes subsets of data acquisition tools, data storage tools, data retrieval tools, and data processing tools. Each tool in the toolset is encapsulated to obtain its calling interface. Tools are registered based on their calling interfaces and names, resulting in a complete tool list, which is then integrated into the task execution agent. When a tool needs to be invoked, the task execution model determines the target tools (the tools to be invoked) based on the complete tool list, forming a tool invocation list (tool request). The task execution model then invokes the toolset based on the tool invocation list to process the target task and obtain the task result.

[0214] Figure 12 This is an architecture diagram of a memory management module in an exemplary embodiment. (For example...) Figure 12 As shown, the memory management module 1003 includes a long-term memory database, a short-term memory database, and a global memory database. Each database in the memory management module 1003 interacts with the task management agent and the task execution agent. The specific interactions include:

[0215] Step 1201: The task management agent constructs the task background, task arrangement, execution status, outstanding issues, and follow-up plans of the target task into long-term memory data and stores it in the long-term memory database.

[0216] Step 1202: The task execution agent constructs short-term memory data from the task information of the target task, tool calls, execution results, key information, and pending items in the target task, and stores the short-term memory data in the short-term memory database.

[0217] Step 1203: Input the latest k (number of short-term memory data acquired) memories from the short-term memory database into the task execution agent as context information. The selection of k follows the rule: sum (length of k memories) <= maximum length of context supported by the task execution agent - length of system prompt (fixed length) - length of task target - other key information.

[0218] Step 1204: When the task-executing agent completes the target task, the full short-term memory data in the short-term memory database is compressed into compressed short-term memory data of length l. The value of l can be set manually or dynamically adjusted through rules. Memory compression can be achieved based on large language models, neural networks, or rule-based summarization. At the same time, all short-term memory data (uncompressed) is stored in the global memory database.

[0219] Step 1205: Integrate and update the compressed short-term memory data with the long-term memory data of the target task to obtain new long-term memory data.

[0220] Step 1206: Store the new long-term memory data in the global memory database, and use it as context information for each task orchestration or task evaluation by the task management agent.

[0221] Step 1207: Data from the global memory database is provided to the task management agent and the task execution agent on demand through data retrieval. This can be achieved through an active agent approach using Function Calling or MCP, or a passive approach based on the traditional RAG framework.

[0222] 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. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0223] Based on the same inventive concept, this application also provides a code interpretation apparatus for implementing the code interpretation method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more code interpretation apparatus embodiments provided below can be found in the limitations of the code interpretation method described above, and will not be repeated here.

[0224] In one exemplary embodiment, such as Figure 13 As shown, a code interpretation device 1300 is provided, including: an acquisition module 1301, an execution module 1302, and a determination module 1303, wherein:

[0225] The acquisition module 1301 is used to acquire the structured query language (SQL) file to be interpreted, and to perform task orchestration based on the language features of the task management agent and the SQL file to be interpreted, thereby obtaining a task list of the SQL file to be interpreted.

[0226] The execution module 1302 is used to process the target task in the task list through the task execution agent, and obtain the task result and current task status of the target task.

[0227] The determination module 1303 is used to determine the next target task based on the task result and the current task status, until all tasks in the task list are completed and the interpretation text of the SQL file to be interpreted is obtained; wherein, the next target task is determined based on the judgment result of the current task status and the task execution progress.

[0228] In an exemplary embodiment, the acquisition module 1301 includes a first acquisition submodule and a first arrangement submodule. Specifically, the first arrangement submodule is used to extract features from each SQL statement in the SQL file to be interpreted based on the task management agent, obtaining structural features, syntactic features, and contextual relationship features; construct language features of the SQL file to be interpreted based on the structural features, syntactic features, and contextual relationship features; arrange tasks according to the task management agent and the language features, obtaining a task list for the SQL file to be interpreted; the task list contains tasks of various task types; and the tasks are used to interpret the SQL file to be interpreted.

[0229] In one exemplary embodiment, the execution module 1302 includes:

[0230] The first determination submodule is used to identify the first unexecuted task in the task list as the target task and transmit the task information of the target task to the task execution agent.

[0231] The first execution submodule is used to call the task execution big model through the task execution agent to execute the task information of the target task and obtain the task results and key information of the target task.

[0232] The first evaluation submodule is used to transmit task results and key information to the task management agent, and evaluate the current task status of the target task based on the task results, key information and task information of the target task.

[0233] In one exemplary embodiment, the task execution agent integrates a toolset; the toolset includes various tool subsets; the tool subsets are a data acquisition tool subset, a data storage tool subset, a data retrieval tool subset, and a data processing tool subset.

[0234] In an exemplary embodiment, the first execution submodule is specifically configured to: invoke the task execution big model through the task execution agent to process the task information of the target task, thereby obtaining a tool invocation list and each subtask; invoke the toolset based on the tool invocation list to process each subtask, thereby obtaining the execution result of each subtask; obtain short-term context information from the short-term memory database, and determine whether the target task can be completed based on each execution result and the short-term context information; if the target task can be completed, perform data processing on each execution result and the short-term context information based on the task execution big model to obtain the task result and key information of the target task.

[0235] In an exemplary embodiment, the code interpretation device 1300 is further configured to, if the target task cannot be completed, perform data processing on each execution result and short-term context information based on the task execution big model with the goal of completing the target task, to obtain processing results, key information, pending items, a new tool call list, and new sub-tasks; construct the processing results, key information, tool call list, sub-tasks, and target task into a short-term memory data, and store the short-term memory data in a short-term memory database; and perform the step of calling the toolset based on the tool call list to process each sub-task based on the new tool call list and the new sub-tasks, to obtain the execution results of each sub-task, until the target task can be completed.

[0236] In an exemplary embodiment, the code interpretation device 1300 is further configured to construct a short-term memory data into a short-term memory data, which includes task results, key information, tool call list, task information of each sub-task and target task, and store the short-term memory data in a short-term memory database; compress each short-term memory data in the short-term memory database according to a preset data length to obtain compressed short-term memory data, and clear each short-term memory data in the short-term memory database.

[0237] In an exemplary embodiment, the determining module 1303 includes a second determining submodule and a third determining submodule. The second determining submodule includes:

[0238] The first discrimination submodule is used to determine whether to update the task list based on the task result and the current task status.

[0239] The third arrangement submodule is used to rearrange the task list according to the task execution agent and the task result if a task list is needed, to obtain an updated task list, and to determine the first unexecuted task in the updated task list as the target task.

[0240] The fourth determination submodule is used to determine the next task of the target task in the task list as the target task if the task list is not updated.

[0241] In one exemplary embodiment, the third arrangement submodule includes a fourth arrangement submodule and a fourth determination submodule. The fourth arrangement submodule includes:

[0242] The fifth determination submodule is used to determine the task update type based on the task management agent and the task results.

[0243] The fifth arrangement submodule is used to rearrange the task list based on the task update type to obtain the updated task list.

[0244] In one exemplary embodiment, the task update types include addition, deletion, and modification. Specifically, the fifth arrangement submodule is used to: if the task update type is addition, generate a new task based on the task management agent and the task result, and add the new task to the target task in the task list to obtain an updated task list; if the task update type is deletion, determine the task to be deleted in the task list based on the task management agent and the task result, and delete the task to be deleted to obtain an updated task list; if the task update type is modification, determine the first unexecuted task in the task list as the task to be modified, and modify the task information of the task to be modified based on the task management agent and the task result to obtain an updated task list.

[0245] The modules in the aforementioned code interpretation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

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

[0247] Those skilled in the art will understand that Figure 14 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.

[0248] In one 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 method embodiments.

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

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

[0251] Those skilled in the art will understand that all or part of the processes in the methods of 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, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory 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, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

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

[0253] 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 code interpretation method, characterized in that, The method includes: Obtain the structured query language (SQL) file to be interpreted, and perform task orchestration based on the task management agent and the language features of the SQL file to be interpreted to obtain the task list of the SQL file to be interpreted; The task execution agent processes the target tasks in the task list to obtain the task results and current task status of the target tasks. Based on the task results and the current task status, the next target task is determined until all tasks in the task list are completed, and the interpreted text of the SQL file to be interpreted is obtained; wherein, the next target task is determined based on the judgment result of the current task status and the task execution progress.

2. The method according to claim 1, characterized in that, The task orchestration based on the task management agent and the language features of the SQL file to be interpreted yields a task list for the SQL file to be interpreted, including: Based on the task management intelligent agent, feature extraction is performed on each SQL statement in the SQL file to be interpreted to obtain structural features, syntactic features and contextual relationship features; Based on the structural features, the syntactic features, and the contextual relationship features, construct the language features of the SQL file to be interpreted; Tasks are orchestrated based on the task management agent and the language features to obtain a task list for the SQL file to be interpreted; the task list contains tasks of each task type; the tasks are used to interpret the SQL file to be interpreted.

3. The method according to claim 1, characterized in that, The process of handling target tasks in the task list through a task execution agent to obtain the task result and current task status of the target tasks includes: The first unexecuted task in the task list is identified as the target task, and the task information of the target task is transmitted to the task execution agent. The task execution agent invokes the task execution big model to execute the target task, thereby obtaining the task results and key information of the target task. The task results and key information are transmitted to the task management agent, and the current task status of the target task is evaluated based on the task results, key information, and task information of the target task.

4. The method according to claim 3, characterized in that, The task execution agent integrates a toolset; the toolset includes various tool subsets; each tool subset is a data acquisition tool subset, a data storage tool subset, a data retrieval tool subset, and a data processing tool subset.

5. The method according to claim 3, characterized in that, The process of using the task execution agent to invoke the task execution big model to execute the target task, thereby obtaining the task result and key information of the target task, includes: The task execution agent invokes the task execution big model to process the task information of the target task, thereby obtaining a tool call list and each sub-task. Based on the tool call list, the toolset is invoked to process each of the subtasks, and the execution results of each subtask are obtained; Retrieve short-term context information from the short-term memory database, and determine whether the target task can be completed based on the execution results and the short-term context information. If the target task can be completed, the execution results and short-term context information are processed based on the task execution model to obtain the task results and key information of the target task.

6. The method according to claim 5, characterized in that, After determining whether the target task can be completed, the method further includes: If the target task cannot be completed, with the goal of completing the target task, data processing is performed on each execution result and the short-term context information based on the task execution big model to obtain processing results, key information, pending items, new tool call list and new sub-tasks; The processing result, the key information, the tool call list, each of the sub-tasks, and the target task are constructed into a short-term memory data, and the short-term memory data is stored in a short-term memory database; Based on the new tool call list and the new sub-tasks, the steps of calling the toolset based on the tool call list to process each sub-task and obtaining the execution results of each sub-task are performed until the target task can be completed.

7. The method according to claim 5, characterized in that, After processing the execution results and short-term context information based on the task execution model to obtain the task results and key information of the target task, the method further includes: The task results, key information, tool call list, task information of each subtask and the target task are constructed into a short-term memory data, and the short-term memory data is stored in a short-term memory database; Compress each short-term memory data in the short-term memory database according to a preset data length to obtain compressed short-term memory data, and then clear each short-term memory data in the short-term memory database.

8. The method according to claim 1, characterized in that, The step of determining the next target task based on the task result and the current task status includes: Based on the task results and the current task status, determine whether to update the task list; If the task list is needed, the task list is rearranged according to the task execution agent and the task result to obtain an updated task list, and the first unexecuted task in the updated task list is determined as the target task. If the task list is not updated, then the next task after the target task in the task list will be identified as the target task.

9. The method according to claim 8, characterized in that, The step of rearranging the task list based on the task execution agent and the task result to obtain an updated task list includes: Based on the task management agent and the task results, determine the task update type; Based on the task update type, the task list is rearranged to obtain an updated task list.

10. The method according to claim 9, characterized in that, The task update types include addition, deletion, and modification. The process of rearranging the task list based on the task update types to obtain an updated task list includes: If the task update type is "new", then based on the task management agent and the task result, a new task is generated and added to the target task in the task list to obtain the updated task list; If the task update type is deletion, then based on the task management agent and the task result, the task to be deleted is determined in the task list, and the task to be deleted is deleted to obtain the updated task list; If the task update type is the change, the first unexecuted task in the task list is determined as the task to be changed, and the task information of the task to be changed is changed based on the task management agent and the task result to obtain the updated task list.