Code processing method, code repair method and model request processing method

By parsing the code and combining it with debugging components for dynamic analysis, this approach solves the problems existing in the prior art, improves the technical problems existing in the prior art, achieves solutions to the technical problems existing in the prior art, enhances the technical effectiveness of the prior art, and resolves the technical problems and defects existing in the prior art.

CN120950373BActive Publication Date: 2026-03-27ALIBABA (CHINA) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-15
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing automated program repair methods based on large language models mainly rely on static code understanding, which makes it difficult to capture complex logical errors that only appear when the code is running, and lacks dynamic analysis capabilities.

Method used

By calling the code processing model to parse the code, obtain debugging information, and combine it with the code debugging component for interactive debugging, the system performs in-depth dynamic analysis based on the code execution results, enabling flexible and precise processing of the code to be processed.

Benefits of technology

It improves the efficiency and accuracy of debugging code logic, enabling efficient and accurate repair or optimization of defects in the code, thereby enhancing development efficiency and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120950373B_ABST
    Figure CN120950373B_ABST
Patent Text Reader

Abstract

The embodiment of the present specification provides a code processing method, a code repair method and a model request processing method, wherein the code processing method comprises: obtaining to-be-processed code; calling a code processing model, parsing the to-be-processed code, and obtaining code debugging information, wherein the code debugging information is used for debugging the code logic of the to-be-processed code; calling a code debugging component, debugging and running the to-be-processed code based on the code debugging information, and obtaining a code running result; and processing the to-be-processed code according to the code running result, and obtaining target code after processing. In this way, the code processing model can actively interact with the code debugging component based on the code debugging information, obtain the code running result, and flexibly and deeply analyze the to-be-processed code based on the code running result, like an experienced human developer, debug the code logic of the to-be-processed code, and efficiently and accurately process the to-be-processed code.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present specification relate to the technical field of automatic program repair, and in particular to a code processing method. BACKGROUND

[0002] In recent years, large language models (LLM) have shown great potential in the field of automatic program repair (APR), and can automatically generate code and repair simple errors.

[0003] However, existing LLM-based APR methods mainly rely on static code understanding, and are difficult to capture complex logic errors that only appear at runtime. Therefore, there is an urgent need for a solution that can perform dynamic analysis on code. SUMMARY

[0004] Therefore, the embodiments of the present specification provide a code processing method. One or more embodiments of the present specification also relate to a code repair method, a request processing method based on a code processing model, a task platform, a computing device, an electronic device, a computer-readable storage medium, and a computer program product to solve the technical defects in the prior art.

[0005] According to a first aspect of the embodiments of the present specification, a code processing method is provided, comprising: obtaining to-be-processed code; calling a code processing model, parsing the to-be-processed code, and obtaining code debugging information, wherein the code debugging information is used to debug the code logic of the to-be-processed code; calling a code debugging component, debugging and running the to-be-processed code based on the code debugging information, and obtaining a code running result; and processing the to-be-processed code according to the code running result, and obtaining a target code after processing.

[0006] In one embodiment of the present specification, the code processing method comprises: obtaining to-be-processed code; calling a code processing model, parsing the to-be-processed code, and obtaining code debugging information, wherein the code debugging information is used to debug the code logic of the to-be-processed code; calling a code debugging component, debugging and running the to-be-processed code based on the code debugging information, and obtaining a code running result; and processing the to-be-processed code according to the code running result, and obtaining a target code after processing. In this way, the code processing model can actively interact with the code debugging component based on the code debugging information, obtain the code running result, and like an experienced human developer, flexibly and deeply analyze the to-be-processed code based on the code running result, debug the code logic of the to-be-processed code, and efficiently and accurately implement the processing of the to-be-processed code. BRIEF DESCRIPTION OF DRAWINGS

[0007] Figure 1 is a flowchart of a code processing method provided by an embodiment of the present specification;

[0008] Figure 2 is an architectural diagram of a code processing system provided by an embodiment of the present specification;

[0009] Figure 3 is a flowchart of a code repair method provided by an embodiment of the present specification;

[0010] Figure 4 is a flowchart of a request processing method based on a code processing model provided by an embodiment of the present specification;

[0011] Figure 5 is a structural schematic diagram of a task platform provided by an embodiment of the present specification;

[0012] Figure 6 is a schematic diagram of an intelligent coding auxiliary plug-in of an integrated development environment provided by an embodiment of the present specification;

[0013] Figure 7 is a schematic diagram of a code processing system provided by an embodiment of the present specification;

[0014] Figure 8 is a structural schematic diagram of a code processing apparatus provided by an embodiment of the present specification;

[0015] Figure 9 is a structural schematic diagram of a code repair apparatus provided by an embodiment of the present specification;

[0016] Figure 10 is a structural schematic diagram of a request processing apparatus provided by an embodiment of the present specification;

[0017] Figure 11 is a structural block diagram of a computing device provided by an embodiment of the present specification;

[0018] Figure 12 is a structural block diagram of an electronic device provided by an embodiment of the present specification. DETAILED DESCRIPTION

[0019] In the following description, a lot of specific details are set forth in order to facilitate a thorough understanding of the present specification. However, the present specification can be implemented in many different ways than described herein, and those skilled in the art can make similar extensions without departing from the spirit of the present specification, so the present specification is not limited to the specific implementation disclosed below.

[0020] The terminology used in this description of one or more embodiments is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the description. As used in this description of one or more embodiments and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0021] It will be understood that, although the terms first, second, etc. can be used herein to describe various information, these terms are not intended to denote a temporal sequence, but to distinguish between different types of information. For example, without departing from the scope of one or more embodiments of the description, first can be termed second, and similarly, second can be termed first. Depending on the context, the word "if' as used herein can be interpreted to mean "when" or "in response to determining" or "in response to a determination".

[0022] In addition, 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 for analysis, stored data, displayed data, etc.) involved in one or more embodiments of the description are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.

[0023] First, the terms involved in one or more embodiments of the description are explained.

[0024] Intelligent coding assistant: using large-scale language models and artificial intelligence technologies, it provides code completion, code generation, code error detection and repair, code optimization and other functions, helping developers reduce repetitive work and greatly improve development efficiency and code quality.

[0025] Automated program repair: aims to automatically generate patches for repairing defective code, its goal is to reduce the time and effort required for manual debugging and error repair, and improve the efficiency and reliability of software development.

[0026] Dynamic analysis (Dynamic Analysis): a technique for examining program behavior at runtime, used to capture runtime behavior that static analysis cannot reveal, such as variable state and execution path. Debugger tools are the basic tools for dynamic analysis, allowing developers to strategically set breakpoints, inspect variables, and perform step-by-step control to conduct in-depth program investigation strategies.

[0027] Code processing model: an artificial intelligence model that can analyze code, provide code completion, code generation, code error detection and repair, code optimization, and other functions, helping developers reduce repetitive work and greatly improve development efficiency and code quality. The code processing model can be a large language model or a multi-modal large model.

[0028] In recent years, large language models (LLMs) have shown great potential in the field of automated program repair (APR), capable of automatically generating code and fixing simple errors. However, existing LLM-based APR methods mainly rely on static code understanding, ignoring the key runtime behavior that reveals the root cause of defects (bugs), making it difficult to capture complex logic errors that only appear at runtime. Some methods that attempt to introduce dynamic information, such as simulation execution or simple log collection, also have poor results due to limited LLM reasoning capabilities or information redundancy. Specifically:

[0029] Static debugging: this method allows LLM to understand code mainly through syntax and semantic analysis, ignoring its runtime behavior. For example, some methods require LLM to explain code line by line to enhance static code understanding, but such methods can usually only identify surface errors and easily overlook subtle logic errors.

[0030] Static simulation debugging: this method prompts LLM to reason and simulate the execution trajectory of the program to obtain "pseudo-dynamic" information to improve patch quality. However, studies have shown that LLMs have limited reasoning capabilities when dealing with complex code, which can lead to incorrect runtime understanding and even reduce patch quality.

[0031] Standard operating procedure (SOP) dynamic debugging: this method automatically collects dynamic information through a fixed "instrumentation-reexecution" process. For example, some methods indiscriminately instrument to record variable states and complete execution trajectories. Some methods use templated instrumentation scripts and prompt LLM to generate interpretable output. The shortcomings of these methods are: the dynamic information collected is usually superficial and too lengthy, lacking semantic relevance, and lengthy logs make it difficult for LLM to capture key information. In addition, these methods are difficult to handle dynamic information of complex objects such as structures and custom classes.

[0032] In contrast, humans often use debuggers interactively when fixing complex program defects. Debuggers can introduce critical dynamic information, allowing developers to set breakpoints, inspect variable states in real time, step through code, and even modify program logic at runtime to verify hypotheses, thus enabling deep dynamic analysis of programs. This "process feedback" style of incremental debugging strategy enables humans to efficiently and accurately locate and fix bugs.

[0033] In view of the deficiency of the existing LLM-based APR method in dynamic analysis capability and the significant advantage of human debugging in handling complex runtime errors, an embodiment of the present specification provides a code processing method, comprising: obtaining to-be-processed code; calling a code processing model to parse the to-be-processed code and obtain code debugging information, wherein the code debugging information is used to debug the code logic of the to-be-processed code; calling a code debugging component to debug and run the to-be-processed code based on the code debugging information and obtain a code running result; and processing the to-be-processed code according to the code running result to obtain target code after processing. In this way, the code processing model can actively interact with the code debugging component based on the code debugging information, obtain the code running result, and flexibly and deeply analyze the to-be-processed code based on the code running result, like an experienced human developer, to efficiently and accurately implement processing of the to-be-processed code.

[0034] The present specification also relates to a code repair method, a request processing method based on a code processing model, a task platform, a computing device, an electronic device, a computer-readable storage medium, and a computer program product, which are described in detail in the following embodiments.

[0035] Reference is made to Figure 1 , Figure 1 A flowchart of a code processing method provided by an embodiment of the present specification is shown, which specifically includes the following steps.

[0036] Step 202: Obtain to-be-processed code.

[0037] It should be noted that the to-be-processed code refers to code that needs to be processed. The to-be-processed code can be a code with defects (bugs), and the corresponding function of the code cannot run normally, or there is a runtime exception, or there is a logic error. The to-be-processed code can also be a code that needs to be optimized, and the corresponding function of the code can run normally, but the function needs to be optimized to make the function more powerful. The to-be-processed code can refer to to-be-processed code in any software product or hardware product.

[0038] In actual application, the to-be-processed code can be part / whole code determined from product code by a user according to self needs (which can be product functions) and submitted to the code processing platform; or the to-be-processed code can be part / whole code determined from product code by the code processing platform according to specified rules.

[0039] Step 204: calling the code processing model, parsing the to-be-processed code, and obtaining code debugging information, wherein the code debugging information is used for debugging the code logic of the to-be-processed code.

[0040] It should be noted that the code processing model refers to a model capable of parsing the to-be-processed code and obtaining code debugging information. The code processing model can be a traditional model or an LLM or a multi-modal large model.

[0041] The traditional model refers to an artificial intelligence model specially trained for code parsing tasks. A large number of training samples are used to train the model and optimize the model parameters, so that the trained model can handle code parsing tasks. The training samples usually include to-be-processed sample code and corresponding sample code debugging information.

[0042] LLM refers to a language model based on the Transformer architecture, trained on a large amount of text data, and with a huge number of parameters (usually tens of billions or even hundreds of billions). Large language models are a subset of language models, but their "large" size brings a qualitative leap in emergent capabilities - not just predicting the next word, but also following instructions, reasoning, solving complex problems, and writing code.

[0043] The multi-modal large model refers to a large language model that simultaneously processes text, images, videos, audio, and other multi-modal data.

[0044] Code debugging information refers to information related to code debugging actions, including the name and specific debugging content of the debugging action. Code debugging information is used to debug the code logic of the to-be-processed code. For example, the debugging action is setting a breakpoint, and the code debugging information includes the setting position of the breakpoint; for another example, the debugging action is printing a variable, and the code debugging information includes the printing position and specific printing content; for another example, the debugging action is modifying code, and the code debugging information includes the modification position and specific modification content.

[0045] Code logic refers to a series of rules and steps that control how code is executed, how decisions are made, and how data is processed.

[0046] In actual applications, there are multiple ways to call the code processing model to parse the to-be-processed code and obtain the code debugging information, which are selected according to actual conditions, and the embodiments of the present specification do not make any limitation in this regard. In a possible implementation of the present specification, the code processing model is a traditional model, and the to-be-processed code is directly input into the code processing model for parsing, and the corresponding code debugging information is output.

[0047] In another possible implementation of the present specification, the code processing model is an LLM, and the to-be-processed code and the prompt word are input into the code processing model for parsing, and the corresponding code debugging information is output. The prompt word can be "please parse the input code, identify the defects of the code, and output the next debugging action", and can also be "please parse the input code, identify the optimization items of the code, and output the next debugging action".

[0048] In a possible embodiment of the present specification, the historical code running result of the to-be-processed code is obtained, wherein the historical code running result is obtained based on the historical code debugging information of the to-be-processed code; the code processing model is called to parse the to-be-processed code based on the historical code running result, and the code debugging information is obtained.

[0049] It should be noted that the historical code running result refers to the code running result of the to-be-processed code in a historical debugging period, and the historical code running result is obtained based on the historical code debugging information of the to-be-processed code. The code debugging process is divided into multiple debugging periods, and in each debugging period, the code processing model parses the to-be-processed code to obtain the code debugging information, and the code debugging component debugs and runs the to-be-processed code based on the code debugging information. Among them, in the current debugging period, the code processing model can parse the to-be-processed code based on the historical code running result to obtain the code debugging information. The historical code running result includes the code running result of multiple debugging periods before the current debugging period. For example, the historical code running result can be a variable printed at a breakpoint position of the to-be-processed code in a historical debugging period.

[0050] The historical code debugging information refers to the code debugging information output by the code processing model in a historical debugging period.

[0051] In actual applications, the historical code running result generated by calling the code debugging component to run the to-be-processed code will be sent to the code processing model, and after receiving the historical code running result, the code processing model will store the historical code running result in the code processing model. In this way, in the current debugging period, the code processing model can directly obtain the historical code running result from the code processing model.

[0052] There are various manners for the calling code processing model to analyze the to-be-processed code based on the historical code running result to obtain the code debugging information, which are selected according to actual conditions, and the embodiments of the present specification do not make any limitation on this. In a possible implementation manner of the present specification, the historical code running result and the to-be-processed code are input into the code processing model, the code processing model analyzes the to-be-processed code based on the historical code running result to obtain the code debugging information. The historical code running result can be a code running result of a previous debugging period of a current debugging period, or a code running result of a debugging period before the current debugging period. When the historical code running result and the to-be-processed code are input into the code processing model, a corresponding prompt word can also be input into the code processing model to guide the code processing model to output accurate code debugging information. The prompt word can be "please output the next step of code debugging information according to the historical code running result and the to-be-processed code".

[0053] By applying the scheme of the embodiments of the present specification, the historical code running result of the to-be-processed code is obtained, wherein the historical code running result is obtained based on the historical code debugging information for the to-be-processed code; and the code processing model is called to analyze the to-be-processed code based on the historical code running result to obtain the code debugging information. In this way, the code processing model analyzes the to-be-processed code based on the historical code running result, which can effectively reduce the repeated code analysis process and improve the analysis efficiency. By comparing the historical code running result and the to-be-processed code, the code processing model can achieve accurate change impact evaluation. Based on the historical code running result, the explainability and credibility of the inference of the code processing model can be improved. By accumulating the historical code running result, the code processing model can improve the knowledge accumulation and the intelligent level.

[0054] In another possible implementation manner of the present specification, the code processing model is called to analyze the to-be-processed code based on the historical code running result to obtain the code debugging information, including: obtaining current state information of a code debugging component, wherein the current state information is used to constrain a debugging action of the to-be-processed code; and calling the code processing model to analyze the to-be-processed code based on the current state information and the historical code running result to obtain the code debugging information.

[0055] It should be noted that the code debugging component refers to a component for debugging code, through which the internal part of the code can be deeply observed and each detail of the code running can be observed to find and repair problems. The code debugging component usually provides the following core functions: setting a breakpoint, controlling an execution flow (continuing, single-step execution, single-step entry, single-step exit), checking a program state (viewing a variable, viewing a call stack, viewing an expression), and dynamic modification. The code debugging component can be any component with a code debugging function, for example, the code debugging component can be a python debugger, a C language debugger.

[0056] The current state information refers to a state in which the code debugging component is currently located. For example, the current state information can be a state in which the code debugging component has not entered debugging, a state in which the code debugging component is debugging, or a state in which the code debugging component exits debugging.

[0057] The current state information can be used to restrict the debugging action of the to-be-processed code, that is, the debugging action of the to-be-processed code is different when the code debugging component is in different states. For example, when the current state information is a start state, the debugging action can be setting a breakpoint; when the current state information is a running state, the debugging action can be restarting or interactive execution.

[0058] The debugging action refers to a debugging action corresponding to the code debugging information. The debugging action can be at least one of setting a breakpoint, controlling execution, interactive code execution, and proposing a fault root cause.

[0059] Setting a breakpoint refers to setting a mark at a specified line of the code, and when the program runs to this line, it will be automatically paused.

[0060] Controlling execution includes continuing, single-step execution, single-step entry, single-step jump-out, and restarting. Continuing refers to continuing normal running from the current paused position until the next breakpoint or the end of the program; single-step execution refers to executing the next line of code, if the next line is a function call, the function will not be entered, but the function will be executed as a step; single-step entry refers to executing the next line of code, if the next line is a function call, the function will be entered to step by step debug the code in the function; single-step jump-out refers to quickly executing the entire function currently located and jumping back to the place where the function is called; and restarting refers to restarting the code debugging component to return to the start state.

[0061] Interactive code execution includes checking program status and dynamic modification. Checking program status can be printing the value of a variable; dynamic modification can be modifying the value of a variable, modifying, deleting, or adding part of the code.

[0062] Proposing a fault root cause refers to that the code processing model aggregates multiple debugging results into an explicit fault cause.

[0063] In actual application, there are various ways to obtain the current state information of the code debugging component, which is specifically selected according to actual conditions, and the embodiments of the present specification do not make any limitation on this. In a possible implementation manner of the present specification, the code debugging component can perceive the current state information of itself by listening to events from the operating system and the target process, and send the current state information to the code processing model.

[0064] In another possible implementation of the present specification, the current state information of the code debugging component is acquired by invoking an intermediate component to perform state monitoring on the code debugging component to obtain the current state information.

[0065] It should be noted that the intermediate component is an intelligent middleware connecting the code processing model and the code debugging component. The intermediate component can be any component capable of performing state monitoring on the code debugging component to obtain state information.

[0066] In actual application, the intermediate component can perform state monitoring on the code debugging component to obtain the current state information of the code debugging component, and send the current state information to the code processing model. The intermediate component can perceive state changes by listening to events from the operating system and the target process, for example, by listening to a process exit event to perceive the end.

[0067] The intermediate component can abstract the state of the code debugging component into a clear mode, and continuously parse and track the current mode to maintain the perception of the code processing model on the state of the code debugging component. The mode of the code debugging component includes at least one of a start state, a running state, a running error state, an after-debugging state, and a completion state.

[0068] The start state refers to the state after starting the code debugging component; the running state refers to the state of the code debugging component during running; the running error state refers to the state of the code debugging component generating an error when performing a debugging action of interactive code execution, which generates an error in an interactive session and does not cause the session to crash or the code debugging component to enter the after-debugging state, and the debugging action can be used to continue state transition in the running error state; the after-debugging state refers to the state entered before a crash when an error is encountered during code execution, which freezes the program state before the crash, and the error reason can be checked in this state, the code debugging component cannot continue to execute and set a breakpoint after entering the after-debugging state, and needs to be restarted to return to the start state. The completion state refers to the state of exiting the code debugging component.

[0069] By applying the scheme of the embodiment of the present specification, the intermediate component is invoked to perform state monitoring on the code debugging component to obtain the current state information. In this way, the state of the code debugging component can be effectively monitored by the intermediate component to maintain the perception of the code processing model on the state of the code debugging component.

[0070] In actual application, after obtaining the current state information of the code debugging component, the current state information, the historical code running result and the to-be-processed code are input into the code processing model, the code processing model analyzes the to-be-processed code based on the current state information and the historical code running result to obtain the code debugging information. The historical code running result can be a code running result of a previous debugging period of the current debugging period, or a code running result of a debugging period before the current debugging period. When the current state information, the historical code running result and the to-be-processed code are input into the code processing model, a corresponding prompt word can also be input into the code processing model to guide the code processing model to output accurate code debugging information. The prompt word can be "please output the next code debugging information according to the current state information, the historical code running result and the to-be-processed code".

[0071] By applying the scheme of the embodiments of the present specification, the current state information of the code debugging component is obtained, wherein the current state information is used to constrain the debugging action of the to-be-processed code; the code processing model is called to analyze the to-be-processed code based on the current state information and the historical code running result to obtain the code debugging information. In this way, the current state information provides the running state of the code debugging component at this moment, the code processing model can thus realize the dynamic debugging decision with context awareness, support the continuity of multi-round interactive debugging; the debugging action space can be constrained to reduce the frequency of invalid operations and realize accurate data flow analysis.

[0072] In another possible implementation manner of the present specification, the code processing model is called to analyze the to-be-processed code to obtain the code debugging information, comprising: obtaining a parsing example of the to-be-processed code and candidate debugging information; inputting the parsing example, the candidate debugging information and the to-be-processed code into the code processing model to obtain the code debugging information.

[0073] It should be noted that the parsing example refers to a sample example that can be referred to by the code processing model, each parsing example includes inference content and corresponding code debugging information. The parsing example is input into the code processing model, the code processing model can learn the relationship between the inference content and the code debugging information.

[0074] For example, the inference content is: analyze the code and previous observations, where the observations refer to the debugging results of the code, for example, during the debugging process, the value of a variable in the code is obtained. A specific hypothesis is proposed about the key variable that may be related to the error: for example, the value of variable X should be [expected value], but the test result shows that its actual value is [error value]. This difference is likely to occur at line 10 [during initialization / after calling function Y / when assigning value, etc.]. Verify this hypothesis by debugging the value of this variable at the key node of execution (if the value does not match the expected value, continue to track the initialization and modification history of this variable in the subsequent steps to determine the root cause of the error). Code debugging information: set breakpoint (11) to check the variable defined at line 10, set breakpoint at line 11 (after line 10 is executed); control execution ("continue"); interact with code execution ("print(obj.attr_a['key'])") to check the suspicious error variable, print is a print function, and obj.attr_a['key'] is the suspicious error variable; interact with code execution ("print(var_a)") to also check related variables (var_a) that directly affect obj in previous code lines.

[0075] The inference content is: make a hypothesis about the possible repair scheme. If it is suspected that necessary logic is missing before a certain line of code, the additional code can be debugged and run before that line, and then the execution is continued to verify. The code debugging information is: assuming that the execution has been navigated and paused at the missing logic, interact with code execution ("a = list(a)"), debug and run additional logic (potential bug fix), a is a variable, and list is a list function; control execution ("continue") to execute the subsequent code to test whether the remaining code will still trigger the bug, if no error occurs, it means that the assumed repair is correct.

[0076] The reasoning content is: a hypothesis about a potential fix is proposed. If there is suspicion that some existing code logic is itself problematic, it can be verified by debugging the alternative logic and subsequent code. The code debugging information is: it is assumed that execution has been navigated and paused before the problematic line of code. Interactively execute ("alternative logic"), debug the revised code logic (a potential fix for the bug), "alternative logic" refers to the revised code logic; interactively execute ("necessary codes \ ncode that triggered bug before"), debug the subsequent code to test whether the remaining code will still trigger the bug, "necessary codes" refers to necessary code, "ncode that triggered bug before" refers to the code that triggered the bug before. If no error occurs, it means that the assumed fix is correct. Do not continue to execute the program, because the problematic code logic cannot be skipped.

[0077] The reasoning content is: according to the analysis and debugging process of the defect, a repair scheme is proposed. The code debugging information is: a repair scheme is proposed ("the root cause of bug xxx is xxx. Replace line 10 with 'new code' and insert 'additional logic' before line 15 to fix the bug").

[0078] The candidate debugging information refers to the debugging actions pre-set by the code processing model, and the debugging actions corresponding to the code debugging information output by the code processing model are selected from the candidate debugging information. For example, the candidate debugging information includes setting breakpoints, controlling execution, interactive code execution, and proposing fault root causes. The code debugging information can be "interactive code execution" and specific code execution content selected from the candidate debugging information.

[0079] In actual application, the parsing example can be set by the user according to actual needs. The candidate debugging information can also be set by the user according to actual needs. The prompt word can be constructed based on the parsing example and the candidate debugging information, the prompt word is input into the code processing model, and the parsing example and the candidate debugging information of the code to be processed are obtained.

[0080] After obtaining the parsed sample and the candidate debugging information, the parsed sample, the candidate debugging information, and the to-be-processed code are input into the code processing model. The code processing model can parse the to-be-processed code according to the parsed sample, and autonomously select and combine a debugging action sequence from the candidate debugging information to generate code debugging information. For example, the code processing model parses the to-be-processed code and finds that the value of the variable X in the 10th line of the code may not meet the expectation. Then, the code processing model selects the debugging actions of “setting a breakpoint”, “controlling execution”, and “interactive code execution” from the candidate debugging information, combines them into a debugging action sequence, and generates the code debugging information as setting a breakpoint after the execution of the 10th line is completed, controlling the operation of “continuing”, and printing the value of the variable X in the interactive code execution.

[0081] By applying the scheme of the embodiments of the present specification, the parsed sample and the candidate debugging information of the to-be-processed code are obtained. The parsed sample, the candidate debugging information, and the to-be-processed code are input into the code processing model to obtain the code debugging information. In this way, the code processing model can imitate the parsing logic in the parsed sample to improve the semantic understanding of the code, and the candidate debugging information can provide reference information for the debugging information. The introduction of the parsed sample and the candidate debugging information as auxiliary input can significantly enhance the understanding ability of the code processing model for the to-be-processed code and the accuracy of the generation of the debugging information.

[0082] Step 206: calling the code debugging component to debug and run the to-be-processed code based on the code debugging information, and obtaining a code running result.

[0083] It should be noted that the code debugging component refers to a component for debugging code. Through the code debugging component, the internal details of the code can be observed during the running of the code, so that problems can be found and fixed. The code debugging component can be any component with a code debugging function, for example, the code debugging component can be a python debugger or a C language debugger.

[0084] The code running result refers to the result of the to-be-processed code running in the code debugging component.

[0085] The code debugging component debugs the to-be-processed code based on the code debugging information. After each debugging, the code debugging component obtains a corresponding debugging result (code running result) and sends the debugging result to the code processing model. After receiving multiple debugging results, the code processing model summarizes the multiple debugging results into an explicit fault cause.

[0086] In actual application, the code debugging component is invoked to debug and run the to-be-processed code based on the code debugging information, and the code running result is obtained. There are multiple manners for obtaining the code running result, which are selected according to actual conditions, and the embodiments of the present specification do not make any limitation on this. In a possible implementation manner of the present specification, after the code debugging information is obtained, the code debugging information is input into the code debugging component, the code debugging component can automatically configure based on the code debugging information, and the to-be-processed code is run in the debugging process to obtain the code running result.

[0087] In another possible implementation manner of the present specification, the code debugging component is invoked to debug and run the to-be-processed code based on the code debugging information, and the code running result is obtained, including: the code debugging component is invoked to debug and run the to-be-processed code based on the code debugging information in the code debugging environment, and the code running result is obtained, wherein the code debugging environment is created by the intermediate component based on the to-be-processed code, and the namespace of the code debugging environment is the same as the namespace of the to-be-processed code.

[0088] It should be noted that the code debugging environment refers to a running environment for finding, analyzing and repairing errors (bugs) in the code.

[0089] The namespace is essentially a logical container or scope, which is used to organize and manage identifiers (such as variable names, function names, class names, object names, etc.) in the program to avoid name conflicts and improve the readability and maintainability of the code.

[0090] In actual application, the intermediate component creates the code debugging environment based on the to-be-processed code. The intermediate component obtains the local variables and global variables of the to-be-processed code, and creates a code debugging environment in the code debugging component, which shares the namespace with the above local variables and global variables. In this way, it can be ensured that the state of the current program can be read in the code debugging environment, and the "write" operation in the code debugging environment will affect the subsequent debugging execution of the original program.

[0091] After the intermediate component creates the code debugging environment, the code debugging component can debug and run the to-be-processed code based on the code debugging information in the code debugging environment, and obtain the code running result.

[0092] By applying the scheme of the embodiments of the present specification, the code debugging component is invoked to debug and run the to-be-processed code based on the code debugging information in the code debugging environment, and the code running result is obtained. In this way, the intermediate component creates the code debugging environment, realizes a customized interactive environment, performs code debugging in the code debugging environment, ensures that the code running modification can update the execution context of the program, and realizes incremental debugging verification.

[0093] In an optional embodiment of the present specification, before the calling the code debugging component to debug and run the to-be-processed code based on the code debugging information and obtaining the code running result, the method further comprises: calling an intermediate component to generate a code debugging instruction based on the code debugging information; and calling the code debugging component to debug and run the to-be-processed code based on the code debugging information and obtaining the code running result, comprising: calling the code debugging component to debug and run the to-be-processed code based on the code debugging instruction and obtaining the code running result.

[0094] It should be noted that the code debugging instruction is an instruction obtained by converting the code debugging information. The code debugging instruction corresponds to the code debugging information. In some cases, the code debugging component cannot directly recognize the code debugging information, but the code debugging component can effectively recognize the code debugging instruction. Therefore, the intermediate component is needed to convert the code debugging information into the code debugging instruction.

[0095] In actual application, after obtaining the code debugging information, the intermediate component can convert the code debugging information according to a preset rule to generate a code debugging instruction that can be read by the code debugging component. The code debugging component debugs and runs the to-be-processed code based on the code debugging instruction and obtains the code running result. The preset rule can include the following steps: standardizing the code debugging information (such as converting to lowercase, correcting spelling errors), performing intent recognition on the code debugging information (the intent can be setting a breakpoint, checking a variable, modifying code, etc.), extracting parameters necessary for executing the intent from the code debugging information (for setting a breakpoint, the parameters can be a file name and a line number), and generating a code debugging instruction according to the recognized intent and parameters.

[0096] Exemplarily, the code debugging information is “action A (setting a breakpoint): set a breakpoint at line 4 in file 1 and observe the length of variable x before the start of the loop; action B (modifying a variable): before dividing by the length of x, check whether the length of x is 0, and if so, directly return 0 or other default value; action C (modifying code): replace code 1 in line 5 with code 2”; taking action C as an example, the debugging action is analyzed: standardizing action C; performing intent recognition to determine that the intent is modifying code through the keywords “replace”, “line...”, and “with”; determining the parameters necessary for the intent, the target file is file 1, the target behavior is line 5, the old code is code 1, and the new code is code 2; and generating a code debugging instruction, which can be a structured data object or a standardized editing script, for example, “update to: file 1, line 5; original code: code 1; target code: code 2”.

[0097] By applying the scheme of the embodiments of the present specification, the intermediate component is called to generate code debugging instructions based on the code debugging information; the code debugging component is called to debug and run the to-be-processed code based on the code debugging instructions, and the code running result is obtained. In this way, the code debugging information is converted into code debugging instructions by the intermediate component, and the analysis of the code debugging information is realized; the code debugging component can debug based on the readable code debugging instructions, and the running stability and response accuracy of the code debugging component can be improved.

[0098] In an optional embodiment of the present specification, before the code debugging component is called to debug and run the to-be-processed code based on the code debugging information, and the code running result is obtained, the method further includes: calling the intermediate component to verify the code debugging information and obtain a verification result; in a case where the verification result indicates that the code debugging information does not meet the debugging condition, returning to the step of calling the code processing model to parse the to-be-processed code and obtain the code debugging information until the code debugging information meets the debugging condition; and calling the code debugging component to debug and run the to-be-processed code based on the code debugging information, and obtaining the code running result, including: in a case where the verification result indicates that the code debugging information meets the debugging condition, calling the code debugging component to debug and run the to-be-processed code based on the code debugging information, and obtaining the code running result.

[0099] It should be noted that the verification result refers to a result obtained after the code debugging information is verified, and the verification result is used to represent whether the code debugging information meets the debugging condition. The verification result can include that the code debugging information meets the debugging condition and that the code debugging information does not meet the debugging condition.

[0100] The debugging condition refers to a condition required for the normal operation of the code debugging component. For example, the debugging condition can be a format specification requirement of the code debugging component, or a state transition requirement of the code debugging component.

[0101] In actual application, after receiving the code debugging information, the intermediate component verifies the code debugging information based on a preset verification method and obtains a verification result. The verification method can be a format matching method, a content matching method, or any method that can match the code debugging information with the debugging condition.

[0102] In a case where the verification result indicates that the code debugging information does not meet the debugging condition, the intermediate component can return the code debugging information to the code processing model and additionally add prompt information to guide the code processing model to generate correct code debugging information again. After receiving the returned prompt information, the code processing model performs the step of parsing the to-be-processed code to obtain the code debugging information again according to the prompt information until the code debugging information meets the debugging condition.

[0103] In a case where the check result indicates that the code debugging information meets the debugging condition, the intermediate component sends the code debugging information to the code debugging component, the code debugging component debugs and runs the to-be-processed code based on the code debugging information, and obtains a code running result.

[0104] By applying the scheme of the embodiments of the present specification, the intermediate component is invoked to check the code debugging information, and a check result is obtained. In a case where the check result indicates that the code debugging information does not meet the debugging condition, the step of obtaining the code debugging information is executed. In a case where the code debugging information meets the debugging condition, the step of obtaining the code running result is executed. In this way, by checking the code debugging information through the intermediate component, the correctness and logical consistency of the debugging information can be ensured, the system fault tolerance capability can be improved, the iterative optimization can be supported, the compatibility and security with the debugging environment can be enhanced, and the operability of the output can be improved. In a case where the code debugging information does not meet the debugging condition, the code debugging information is iteratively generated, so that the final code debugging information can meet the debugging condition.

[0105] Step 208: processing the to-be-processed code according to the code running result to obtain a target code processed.

[0106] It should be noted that the target code refers to the code after the to-be-processed code is processed, and the target code can be a repaired code (bug repair is completed) after the to-be-processed code is repaired, or an optimized code (optimization is completed) after the to-be-processed code is optimized.

[0107] In actual application, there are various ways to process the to-be-processed code according to the code running result to obtain a target code processed, which is selected according to actual conditions, and the embodiments of the present specification do not make any limitation in this regard. In a possible implementation manner of the present specification, the code running result and the to-be-processed code are input into a code repair tool, and the code repair tool can repair the to-be-processed code according to the code running result to obtain a target code repaired. The code repair tool integrates a complete code repair scheme.

[0108] In another possible implementation manner of the present specification, processing the to-be-processed code according to the code running result to obtain a target code processed includes: inputting a strategy generation prompt information and the code running result into a code processing model to obtain a code processing strategy, wherein the strategy generation prompt information is used to guide the code processing model to generate a code processing strategy corresponding to the code running result; and processing the to-be-processed code according to the code processing strategy to obtain a target code processed.

[0109] It should be noted that the code processing strategy refers to a complete scheme for processing the to-be-processed code. When repairing the to-be-processed code, the code processing strategy can include the bug occurrence position, bug generation reason, and specific repair plan of the to-be-processed code. When optimizing the to-be-processed code, the code processing strategy can include the optimization position, optimization reason, optimization function, and specific optimization plan of the to-be-processed code.

[0110] The strategy generation prompt information refers to information for prompting the code processing model to generate the code processing strategy, and is used to guide the code processing model to generate the code processing strategy corresponding to the code running result. The strategy generation prompt information can be prompt information that the code processing model reaches the inference step limit, can be prompt information that sufficient code running results (dynamic evidence) are collected, or can be condition information for generating the code processing strategy. For example, the strategy generation prompt information is "when it is judged that sufficient code running results are collected, execute the debugging action of proposing a fault root cause".

[0111] In actual application, the strategy generation prompt information and the code running result are input into the code processing model, the code processing model analyzes and summarizes the code running result according to the strategy generation prompt information, and obtains the code processing strategy. The strategy generation prompt information can be input into the code processing model as prompt words.

[0112] According to the code processing strategy, the to-be-processed code is processed, and the target code after processing is obtained. There are various ways to process the to-be-processed code according to the code processing strategy, which are selected according to actual conditions, and the embodiments of the present specification do not make any limitation on this. In a possible implementation manner of the present specification, the code processing strategy and the to-be-processed code are input into the code processing model, and the code processing model processes the to-be-processed code according to the code processing strategy, and obtains the target code after processing. When the code processing strategy and the to-be-processed code are input into the code processing model, the corresponding prompt words can also be input into the code processing model to guide the code processing model to process the to-be-processed code. The prompt words can be "please output the target code according to the code processing strategy and the to-be-processed code".

[0113] By applying the scheme of the embodiments of the present specification, the strategy generation prompt information and the code running result are input into the code processing model to obtain the code processing strategy; and the to-be-processed code is processed according to the code processing strategy to obtain the target code after processing. In this way, the code modification process is realized to be interpretable and controllable by introducing the code processing strategy; different code processing strategies can be generated according to different code running results, and the flexibility and adaptability of the processing logic are improved; and the decision and the execution are decoupled to improve the maintainability of the system.

[0114] In another possible implementation of the present specification, the code to be processed is processed according to the code processing strategy to obtain the target code after processing, including: inputting the code processing strategy and the code to be processed into a code processing model to obtain a code patch; repairing the code to be processed according to the code patch to obtain the target code.

[0115] It should be noted that the code patch refers to a small range of targeted modifications to the code to be processed, which is usually used to repair errors (bugs), improve security, improve performance, or add minor functions. The code patch is usually not a complete file, but a difference file that records the differences between the original code and the modified code. It will clearly indicate which file and which line are deleted and what is added. The purpose is to quickly and accurately apply changes and avoid errors that may be caused by manual modification.

[0116] In actual application, the code processing strategy and the code to be processed are input into the code processing model, and the code processing model processes the code to be processed according to the code processing strategy to obtain the code patch. When the code processing strategy and the code to be processed are input into the code processing model, the corresponding prompt word can also be input into the code processing model to guide the code processing model to generate the code patch. The prompt word can be "please generate the code patch according to the code processing strategy and the code to be processed".

[0117] There are various ways to repair the code to be processed according to the code patch to obtain the target code, which is selected according to actual conditions, and the embodiments of the present specification do not make any limitation on this. In a possible implementation of the present specification, the code patch and the code to be processed are input into a code repair tool, and the code repair tool can repair the code to be processed according to the code patch to obtain the target code after repair. The code repair tool integrates a complete code repair scheme.

[0118] In another possible implementation of the present specification, the code patch and the code to be processed are input into the code processing model, and the code processing model repairs the code to be processed according to the code patch to obtain the target code. When the code patch and the code to be processed are input into the code processing model, the corresponding prompt word can also be input into the code processing model to guide the code processing model to generate the target code. The prompt word can be "please generate the target code according to the code patch and the code to be processed".

[0119] According to the scheme of the embodiment of the present specification, the code processing strategy and the to-be-processed code are input into the code processing model to obtain a code patch; and the to-be-processed code is repaired according to the code patch to obtain target code. In this way, by introducing the code patch as an intermediate product of code repair, non-intrusive and reversible code modification is realized; the code patch can improve the reviewability and transparency of the repair process and support patch-level verification and testing.

[0120] In another possible implementation of the present specification, repairing the to-be-processed code according to the code patch to obtain target code includes: repairing the to-be-processed code according to the code patch to obtain repaired code; obtaining test code corresponding to the to-be-processed code, and testing the repaired code by using the test code to obtain a code test result; and in a case where the code test result indicates that the repaired code meets a test condition, determining the repaired code as the target code.

[0121] It should be noted that the repaired code refers to the code after the to-be-processed code is repaired, and the repaired code does not necessarily meet the requirements of the target code.

[0122] The test code refers to code with a complete test flow, which is used to test the repaired code to determine whether the repaired code meets a test condition. The test code includes code of a test case and code of a test flow.

[0123] The code test result refers to a test result obtained after the repaired code is tested. The code test result can include a test conclusion (which can be test passed or test failed, or can be that the repaired code meets a test condition or does not meet the test condition), test data (which can include a test case, a test process, and an error message). The code test result can indicate whether the repaired code meets a test condition.

[0124] The test condition refers to a condition required to be met for the code test to pass.

[0125] In actual application, the code patch and the to-be-processed code are input into the code processing model, and the code processing model repairs the to-be-processed code according to the code patch to obtain repaired code. When the code patch and the to-be-processed code are input into the code processing model, a corresponding prompt word can also be input into the code processing model to guide the code processing model to generate the repaired code. The prompt word can be "please generate repaired code according to the code patch and the to-be-processed code".

[0126] In a possible implementation of the present specification, the code patch and the to-be-processed code are input into a code repair tool, and the code repair tool can repair the to-be-processed code according to the code patch to obtain repaired code. The code repair tool is integrated with a complete code repair scheme.

[0127] In actual application, the test code can be formulated by a user according to a requirement, or can be automatically generated by the code processing model according to the prompt word.

[0128] The manner of testing the repair code by using the test code can be inputting the test code and the repair code into a code testing tool, testing the repair code according to the test code by the code testing tool, and obtaining a code test result. A complete code testing scheme is integrated in the code testing tool.

[0129] The manner of testing the repair code by using the test code can also be inputting the test code and the repair code into a code processing model, testing the repair code according to the test code by the code processing model, and obtaining a code test result. When inputting the test code and the repair code into the code processing model, the corresponding prompt word can also be inputted into the code processing model to guide the code processing model to generate the code test result. The prompt word can be "please generate the code test result according to the test code and the repair code".

[0130] In a case where the code test result indicates that the repair code meets the test condition, the repair code is determined as the target code.

[0131] By applying the scheme of the embodiments of the present specification, the repair code is obtained by repairing the to-be-processed code according to the code patch, the repair code is tested by using the test code, and the code test result is obtained. In a case where the code test result indicates that the repair code meets the test condition, the repair code is determined as the target code. In this way, the repair code is tested to verify the repair effectiveness and ensure that the problem is truly solved. By running a complete test suite, regression errors can be prevented. The test result can be used as a feedback signal to support feedback and optimization of the repair strategy. The test result provides quantifiable evidence to improve the credibility and practicality of the repair.

[0132] In a case where the code test result indicates that the repair code does not meet the test condition, the step of executing the code processing model to analyze the to-be-processed code and obtain the code debugging information is returned until the repair code meets the test condition.

[0133] It should be noted that the repair code not meeting the test condition indicates that the repair code still has problems, and the repair code needs to be regenerated at this time.

[0134] In actual applications, after obtaining the code test result, it is determined whether the repaired code meets the test condition according to the code test result. In the case where the repaired code does not meet the test condition, the repaired code needs to be input into the code processing model again, the code processing model parses the repaired code to obtain the code debugging information. The repaired code is generated again according to the code debugging information for testing until the repaired code meets the test condition. In the process of inputting the repaired code into the code processing model again, the code test result corresponding to the repaired code can also be input into the code processing model, and the code processing model parses the repaired code based on the code test result to obtain the code debugging information.

[0135] For example, the code processing model diagnoses the code test result, accurately understands the test failure information (error type, actual value and expected value); the code processing model evaluates the repaired code, judges why the current repaired code fails to pass the test (is a new problem introduced after solving the error? Or is the solution incomplete?); the code processing model reasons, infers the correct behavior that the code should have based on the expected value of the test case, instead of just not reporting an error; the code processing model locates, accurately locates the specific statement or expression in the current code that causes the behavior to be inconsistent with the expectation; the code processing model outputs the code debugging information, and gives a minimized and targeted code modification suggestion to align with the test expectation.

[0136] By applying the scheme of the embodiments of the present specification, in the case where the repaired code does not meet the test condition, the step of obtaining the code debugging information is returned to be executed until the repaired code meets the test condition. In this way, the automatic error correction and self-repair are realized by triggering the retry through the test feedback; the progressive problem solving is supported to deal with complex defects; the adaptability and robustness of the code processing model can be enhanced by utilizing the test feedback to drive deep analysis.

[0137] In an optional embodiment of the present specification, before calling the code processing model to parse the to-be-processed code to obtain the code debugging information, the following steps are further included: obtaining test code corresponding to the to-be-processed code, and testing the to-be-processed code by using the test code to obtain a code test result; calling the code processing model to parse the to-be-processed code to obtain the code debugging information, including: in the case where the code test result indicates that the to-be-processed code does not meet the test condition, calling the code processing model to parse the to-be-processed code to obtain the code debugging information.

[0138] It should be noted that before the code processing model is called to parse the to-be-processed code, the to-be-processed code can be tested to obtain a code test result, and the code test result can be used to determine whether subsequent processing of the to-be-processed code is needed. In the case where the code test result indicates that the to-be-processed code does not meet the test condition, subsequent processing of the to-be-processed code is needed; in the case where the code test result indicates that the to-be-processed code meets the test condition, subsequent processing of the to-be-processed code is not needed.

[0139] The test code refers to code with a complete test flow, which is used to test the to-be-processed code and determine whether the to-be-processed code meets the test condition. The test code includes the code of the test case and the code of the test flow.

[0140] The code test result refers to a test result obtained after the to-be-processed code is tested. The code test result can include a test conclusion (which can be test passed or test failed, or can be that the to-be-processed code meets the test condition or does not meet the test condition), test data (which can include a test case, a test process, and an error message). The code test result can indicate whether the to-be-processed code meets the test condition.

[0141] The test condition refers to a condition that needs to be met for the code test to pass.

[0142] In actual applications, the test code can be formulated by a user according to a requirement, or can be automatically generated by the code processing model according to a prompt word.

[0143] The manner in which the test code is used to test the to-be-processed code can be that the test code and the to-be-processed code are input into a code test tool, and the code test tool tests the to-be-processed code according to the test code to obtain a code test result. The code test tool has a complete code test solution integrated therein.

[0144] The manner in which the test code is used to test the to-be-processed code can also be that the test code and the to-be-processed code are input into a code processing model, and the code processing model tests the to-be-processed code according to the test code to obtain a code test result. When the test code and the to-be-processed code are input into the code processing model, a corresponding prompt word can also be input into the code processing model to guide the code processing model to generate the code test result. The prompt word can be "please generate a code test result according to the test code and the to-be-processed code".

[0145] In the case where the code test result indicates that the to-be-processed code does not meet the test condition, the code processing model is called to parse the to-be-processed code to obtain code debugging information. In the case where the code test result indicates that the to-be-processed code meets the test condition, the to-be-processed code does not need to be processed.

[0146] By applying the scheme of the embodiments of the present specification, the test code is used to test the to-be-processed code, and a code test result is obtained; in a case where the code test result indicates that the to-be-processed code does not meet a test condition, a code processing model is called to parse the to-be-processed code and obtain code debugging information. In this way, through pre-test, intelligent response driven by problems is realized, and invalid analysis is avoided; the test result contains rich diagnostic information, which can provide accurate failure context and guide the subsequent analysis direction.

[0147] By applying the scheme of the embodiments of the present specification, the to-be-processed code is obtained; a code processing model is called to parse the to-be-processed code and obtain code debugging information, wherein the code debugging information is used to debug the code logic of the to-be-processed code; a code debugging component is called to debug and run the to-be-processed code based on the code debugging information, and a code running result is obtained; and the to-be-processed code is processed according to the code running result, and a target code processed completely is obtained. In this way, the code processing model can actively interact with the code debugging component based on the code debugging information, obtain the code running result, and flexibly and deeply analyze the to-be-processed code based on the code running result, like an experienced human developer, debug the code logic of the to-be-processed code, and efficiently and accurately realize the processing of the to-be-processed code.

[0148] Considering that the amount of parameters involved in the code processing model is relatively large, and the operation resources of the client are limited, the code processing method proposed in the embodiments of the present specification can be applied to, but is not limited to, the code processing system as shown in Figure 2 . Figure 2 , Figure 2 An architecture diagram of a code processing system provided by one embodiment of the present specification is shown, and the code processing system can include a client 100 and a server 200;

[0149] The client 100 is configured to send a to-be-processed code to the server 200.

[0150] The server 200 is configured to obtain the to-be-processed code; call a code processing model to parse the to-be-processed code and obtain code debugging information, wherein the code debugging information is used to debug the code logic of the to-be-processed code; call a code debugging component to debug and run the to-be-processed code based on the code debugging information, and obtain a code running result; process the to-be-processed code according to the code running result, and obtain a target code processed completely; and send the target code to the client 100.

[0151] The client 100 is further configured to receive the target code sent by the server 200.

[0152] As shown in Figure 2As shown, the code processing method is deployed in server 200. Server 200 can connect to one or more clients 100 through LAN connection, WAN connection, Internet connection, or other types of data network.

[0153] Client 100 may include, but is not limited to, smartphones, tablets, laptops, PDAs, personal computers, smart home devices, and in-vehicle devices. Client 100 can also interact with the user through a graphical user interface to implement the code processing methods provided in the embodiments of this specification.

[0154] Server 200 may include servers providing various services, such as servers providing communication services to multiple clients, servers supporting backend training of models used on clients, and servers processing data sent by clients. It should be noted that server 200 can be implemented as a distributed server cluster composed of multiple servers, or as a single server. The server can also be a server in a distributed system, or a server integrated with blockchain. The server can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.

[0155] It is worth noting that the code processing methods provided in the embodiments of this specification are generally executed by the server. However, in other embodiments of this specification, if the client's runtime resources are sufficient to execute the code processing methods, the client may also have similar functionality to the server, thereby executing the code processing methods provided in the embodiments of this specification. In other embodiments, the code processing methods provided in the embodiments of this specification may also be executed jointly by the client and the server.

[0156] See Figure 3 , Figure 3 A flowchart of a code repair method provided in one embodiment of this specification is shown, which specifically includes the following steps.

[0157] Step 302: Obtain the code to be repaired.

[0158] Step 304: Call the code processing model to parse the code to be repaired and obtain code debugging information. The code debugging information is used to debug the code logic of the code to be repaired.

[0159] Step 306: Call the code debugging component, debug and run the to-be-repaired code based on the code debugging information, and obtain a code running result.

[0160] Step 308: Repair the to-be-repaired code according to the code running result, and obtain a target code after repair.

[0161] It should be noted that the to-be-repaired code refers to a code part with errors, vulnerabilities, logical defects, or poor design, which causes the program to fail to normally run as expected. Such code may cause problems such as program crash, incorrect calculation result, security vulnerability, low performance, or non-compliance with user requirements.

[0162] The target code refers to the code after the to-be-repaired code is repaired.

[0163] In actual application, the implementation manners of steps 302 to 308 can refer to the implementation manners of steps 202 to 208 described above, and the embodiments of the present specification will not be described in detail.

[0164] The above is a schematic scheme of the code repair method of the present embodiment. It should be noted that the technical scheme of the code repair method belongs to the same concept as the technical scheme of the code processing method described above, and the details of the technical scheme of the code repair method that are not described in detail can be referred to the description of the technical scheme of the code processing method.

[0165] By applying the scheme of the present embodiment, the to-be-repaired code is obtained; the code processing model is called to parse the to-be-repaired code and obtain code debugging information, wherein the code debugging information is used to debug the code logic of the to-be-repaired code; the code debugging component is called to debug and run the to-be-repaired code based on the code debugging information, and a code running result is obtained; and the to-be-repaired code is processed according to the code running result, and a target code after processing is obtained. In this way, the code processing model can actively interact with the code debugging component, flexibly and deeply analyze the to-be-repaired code like an experienced human developer, debug the code logic of the to-be-repaired code, and accurately and efficiently diagnose and repair defects in the to-be-repaired code.

[0166] Referring to Figure 4 , Figure 4 A flowchart of a request processing method based on a code processing model is shown, which is provided by one embodiment of the present specification and applied to a task platform, and specifically includes the following steps:

[0167] Step 402: Receive a model request sent by a terminal device.

[0168] Step 404: determining, based on the model request, a target code processing model from the plurality of code processing models, wherein the target code processing model is used in an execution process of the code processing method or the code repair method.

[0169] It should be noted that the plurality of code processing models can be content generation models with different model specification parameters and adapted to different scenarios. The target code processing model is a code processing model adapted to a target scenario. The target scenario can be different scenarios, such as a financial collection scenario, an insurance marketing scenario, a medical consultation scenario, and the like. The model request includes at least one of a scenario identifier of the target scenario, scenario input data of the target scenario, and a model specification parameter.

[0170] In actual applications, there are various ways to determine the target code processing model from the plurality of code processing models based on the model request, which are selected according to actual conditions, and the embodiments of the present specification do not make any limitation on this. In the first possible implementation manner of the present specification, the corresponding target code processing model can be searched from the code processing models included in the first model library based on the scenario identifier included in the model request; in the second possible implementation manner of the present specification, the target code processing model can be obtained by training based on the scenario input data included in the model request; and in the third possible implementation manner of the present specification, the corresponding target code processing model can be searched from the code processing models included in the second model library based on the model specification parameter included in the model request.

[0171] Exemplarily, at least one code processing model pre-trained can be searched from the first model library based on the scenario identifier of the target scenario, then an intermediate code processing model can be obtained by screening from the at least one code processing model based on the model specification parameter, and then the intermediate code processing model obtained by screening can be trained (training methods such as SFT, DPO, and the like) based on the scenario input data of the target scenario to obtain a target code processing model adapted to the user demand.

[0172] The scheme of the embodiments of the present specification is applied to obtain the target code processing model adapted to the user demand, realizes personalized model service, provides an efficient, flexible and easy-to-use model service method for the user, and improves the user experience.

[0173] In an optional embodiment of the present specification, the above determining, based on the model request, the target code processing model from the plurality of code processing models can include the following steps:

[0174] In the case where the model request includes the scenario identifier of the target scenario, the target code processing model adapted to the target scenario is searched from the first model library based on the scenario identifier, wherein the first model library stores a plurality of code processing models adapted to different scenarios.

[0175] In a case where the model request comprises scene input data of a target scene, a to-be-trained code processing model adaptive to the target scene is determined from the plurality of code processing models, and the to-be-trained code processing model is trained based on the scene input data to obtain a target code processing model.

[0176] In a case where the model request comprises a model specification parameter, a target code processing model corresponding to the model specification parameter is searched for from a second model library, wherein the second model library stores code processing models of different model specification parameters.

[0177] It should be noted that the scene identifier refers to a unique or specific label used to distinguish different scenes. The first model library is a database for storing and managing various pre-trained deep learning models. The plurality of code processing models adaptive to different scenes cover different application scenarios and requirements. The first model library allows users to select appropriate code processing models according to their own requirements, or directly call appropriate code processing models to perform code processing tasks through an application programming interface. The plurality of code processing models adaptive to different scenes are a plurality of models stored in the first model library, which are suitable for different scenes. Each code processing model is optimized for a specific application environment. For example, a target code processing model adaptive to a financial collection scene can be searched for from the first model library based on the scene identifier “financial collection” of the target scene.

[0178] The scenes to which the code processing models are adaptive differ, for example, code processing model one is adaptive to scene one and scene two, and code processing model two is adaptive to scene two and scene three. The to-be-trained code processing model refers to a model in the plurality of code processing models that is adaptive to the target scene but the model effect can be further optimized. If the target scene is scene one, the to-be-trained code processing model is code processing model one adaptive to scene one. The to-be-trained code processing model can not only be adaptive to the target scene, but also be adaptive to other scenes, and is a general code processing model that can be adaptive to different scenes. The to-be-trained code processing model can be used to perform a code processing task, but the effect can not be very good. At this time, the to-be-trained code processing model can be optimized based on the scene input data of the target scene, for example, the to-be-trained code processing model can be optimized based on the scene input data of the financial collection scene to obtain a target code processing model adaptive to the financial collection scene. The scene input data of the target scene can be understood as a sample set used to train the code processing model in the target scene.

[0179] Model specification parameters refer to various parameters that define the structure and behavior of a model. These parameters can be broadly classified into two categories: model parameters (learnable parameters) and hyperparameters. Model parameters refer to parameters that are automatically adjusted during the model training process through backpropagation algorithms, including but not limited to weight matrices (weights) and bias terms. For example, in a simple fully connected layer, the weight matrix is a two-dimensional tensor that connects the input layer and the output layer of neurons; the bias term is a one-dimensional vector that provides an additional offset value for each output neuron. Hyperparameters refer to parameters that are set before starting the model training process to control the learning process and architecture of the model. Hyperparameters include but are not limited to learning rate, number of neurons per layer, and are selected according to actual conditions.

[0180] By applying the scheme of the embodiments of the present specification, the target code processing model suitable for the corresponding scene is accurately found based on the scene requirements through the scene identification, so that the processing process of the code processing task is more accurate and more suitable for the target scene; based on the scene requirements, the general code processing model to be trained is further trained through the scene input data, and the target code processing model suitable for the target scene is obtained, so that the target code processing model is more suitable for the target scene, thereby improving the user experience and task processing quality; based on the model specification parameters, the corresponding target code processing model can be accurately found, ensuring the efficient and stable operation of the target code processing model, and improving the user experience.

[0181] In an optional embodiment of the present specification, after determining the target code processing model from the plurality of code processing models based on the model request, the following steps can be further included:

[0182] The target code processing model is deployed, and a code processing interface is constructed based on the target code processing model, so that the terminal device schedules the target code processing model to execute the code processing task through the code processing interface.

[0183] It should be noted that the code processing interface is an interactive programming interface for the terminal device to schedule the target code processing model for code processing task processing, which is usually provided in the form of an application programming interface. Through the code processing interface, the user can input task data of the code processing task for code processing task processing.

[0184] In actual applications, there are multiple ways to deploy the target code processing model, which are selected according to actual conditions, and the embodiments of the present specification do not make any limitation on this. In a possible implementation manner of the present specification, the target code processing model can be deployed on a cloud-side device using an infrastructure provided by a cloud service provider. In another possible implementation manner of the present specification, the target code processing model can be deployed on an edge device using a lightweight framework. For example, the target code processing model can be deployed on a distributed system, and based on the target code processing model, a code processing interface is constructed to be provided to a terminal device, so that the terminal device schedules the target code processing model to perform a code processing task.

[0185] By applying the scheme of the embodiments of the present specification, the target code processing model is deployed, and based on the target code processing model, a code processing interface is constructed, which can realize efficient calling of the target code processing model by the terminal device and improve the processing quality and response speed of the code processing task.

[0186] Referring to Figure 5 , Figure 5 FIG. 1 shows a structural schematic diagram of a task platform provided by an embodiment of the present specification. The task platform 500 includes a request interface 502 and a response unit 504.

[0187] The request interface 502 is configured to receive a model request sent by a terminal device, wherein the model request includes at least one of a scene identifier of a target scene, scene input data of the target scene, and a model specification parameter.

[0188] The response unit 504 is configured to determine a target code processing model from a plurality of code processing models based on the model request, wherein the target code processing model is used in an execution process of a code processing method or a code repair method.

[0189] In an optional embodiment of the present specification, the task platform further includes a code processing interface, which is constructed based on the target code processing model.

[0190] The code processing interface is configured to be used by the terminal device to schedule and execute a code processing task.

[0191] The above is a schematic scheme of a task platform of the present embodiment. It should be noted that the technical scheme of the task platform belongs to the same concept as the technical scheme of the above-mentioned request processing method based on the code processing model, and the details of the technical scheme of the task platform that are not described in detail can be referred to the description of the technical scheme of the above-mentioned request processing method based on the code processing model.

[0192] Referring to Figure 6 , Figure 6An embodiment of the present specification provides a schematic diagram of an intelligent coding assistance plug-in 600 of an integrated development environment, including a visual debugging suggestion display area 610, a visual debugging result display area 620, and a target code display area 630;

[0193] The visual debugging suggestion display area 610 is configured to display code debugging information, wherein the code debugging information is obtained by calling a code processing model to analyze to-be-processed code, and the code debugging information is used for debugging the code logic of the to-be-processed code.

[0194] The visual debugging result display area 620 is configured to display a code running result, wherein the code running result is obtained by calling a code debugging component to debug and run the to-be-processed code based on the code debugging information.

[0195] The target code display area 630 is configured to display a processed target code, wherein the target code is obtained by processing the to-be-processed code based on the code running result.

[0196] It should be noted that the integrated development environment is a set of application program combinations for software development, which integrates all necessary development tools in a unified graphical user interface, aiming to improve the productivity of developers. It usually includes: a code editor, a text editor specially used for writing source code; a build automation tool (compilation / interpretation), responsible for converting readable source code into computer executable machine code; a debugger, used for testing and diagnosing during program running, and finding out errors in the code.

[0197] The intelligent coding assistance plug-in is a software extension component in the integrated development environment. Based on artificial intelligence, machine learning and big data analysis technology, it provides context-aware, predictive and enhanced assistance for developers when writing, reading and maintaining code, aiming to significantly improve development efficiency and code quality.

[0198] The intelligent coding assistance plug-in is a visual tool with a displayable interface, and there are three display areas, namely the visual debugging suggestion display area, the visual debugging result display area and the target code display area, on the display interface of the intelligent coding assistance plug-in. The visual debugging suggestion display area, the visual debugging result display area and the target code display area are areas in the interface that can display specific content, and can exist in one display interface or different display interfaces.

[0199] In actual application, the visual debugging suggestion display area can display the code debugging information after formatting processing, wherein the formatting processing can be processing on the format and position of the code debugging information; the visual debugging suggestion display area can also display the code debugging information after semantic information adjustment, wherein the semantic information adjustment can be enriching, expanding or modifying the semantic content of the code debugging information, so that the code debugging information is clearer and easier to understand.

[0200] The visual debugging result display area can display the code running result after formatting processing, wherein the formatting processing can be processing on the format and position of the code running result; the visual debugging result display area can also display the code running result after semantic information adjustment, wherein the semantic information adjustment can be enriching, expanding or modifying the semantic content of the code running result, so that the code running result is clearer and easier to understand.

[0201] The target code display area can display the target code after formatting processing, wherein the formatting processing can be processing on the format and position of the target code; the target code display area can also display the target code after semantic information adjustment, wherein the semantic information adjustment can be enriching, expanding or modifying the semantic content of the target code, so that the target code is clearer and easier to understand.

[0202] The above is a schematic scheme of an intelligent coding auxiliary plug-in of the embodiment. It should be noted that the technical scheme of the intelligent coding auxiliary plug-in belongs to the same concept as the technical scheme of the request processing method based on the code processing model described above, and the details of the technical scheme of the intelligent coding auxiliary plug-in that are not described in detail can be referred to the description of the technical scheme of the request processing method based on the code processing model described above.

[0203] The following describes the code processing method in combination with the accompanying Figure 7 Taking the application of the code processing method provided in the specification in automated program repair as an example, the code processing method is further described.

[0204] In view of the lack of dynamic analysis capability of the existing LLM-based APR method and the significant advantage of human debugging in handling complex runtime errors, InspectCoder is proposed, which aims to give LLM the ability to actively interact with the debugger, so that it can perform flexible and in-depth dynamic analysis like human developers, thereby more accurately and efficiently diagnose and repair program errors. Among them, Figure 7 Fig. 1 shows a schematic diagram of a code processing system according to an embodiment of the specification. As shown in Fig. 1, the code processing system includes a code processing model 100 and an intelligent coding auxiliary plug-in 200. Figure 7As shown, the code processing system (InspectCoder) includes two agents, a debugging middleware (InspectWare, corresponding to the intermediate component in the above embodiment), and an external debugger (External Debugger Tools, corresponding to the code debugging component in the above embodiment). Among them, the two agents are a program inspector (Program Inspector, corresponding to the code processing model in the above embodiment) and a patch coder (Patch Coder, corresponding to the code processing model in the above embodiment).

[0205] The embodiment of the present specification proposes a dual-agent system named InspectCoder, which diagnoses and fixes problematic programs by actively inspecting their runtime behaviors. The InspectCoder framework consists of two specialized agents:

[0206] (1) Program Inspector Agent: This agent serves as the analytical core of the system, using the ReAct framework to autonomously inspect program states and interact with the external debugger environment through the debugging middleware, actively collecting dynamic information to diagnose the root causes of defects.

[0207] Among them, the ReAct framework is a reasoning and action coordination framework for enhancing the performance of large language models in interactive tasks. The core of the ReAct framework is to divide the task solving process into two alternating steps: Reasoning: the model performs thought chain reasoning based on the current state and the information obtained, and decides what to do next. Acting: the model performs a specific operation (such as querying a database, running code, setting breakpoints, etc.) to obtain new information or change the environment state. This process continues until the task is completed.

[0208] The main functions of the program inspector agent include:

[0209] Action Space: defines a concise and effective set of actions (action space, corresponding to the candidate debugging information in the above embodiment) for communication with InspectWare, including setting breakpoints (set_breakpoint), controlling execution (control_execution, such as continue, restart), and interactive code execution (interact_code, used to print variables or inject new logic), and proposing fault root causes (propose_repair). Among them, proposing fault root causes is to summarize the memories of multiple inspections into an explicit fault root cause.

[0210] Dynamic Analysis Strategies: Inspired by human debugging behaviors, the LLM is guided by few-shot instructions (corresponding to the analysis examples in the above embodiment) to autonomously select and combine action sequences, mimicking two human programmer debugging strategies: Breakpoint Inspection (strategically setting breakpoints to print key program states) and Runtime Modification (starting a session at the target breakpoint to incrementally run additional code and observe behavior changes). Among them, the few-shot instructions are some specific action examples added in the prompt words. These example actions use the debugging strategies in the embodiments of the present specification.

[0211] Root Cause Report Generation (corresponding to the code processing strategy in the above embodiment): When sufficient dynamic evidence is collected or the reasoning step limit is reached, the program inspector summarizes its reasoning memory and generates a structured root cause report, identifying the location, cause of the bug, and proposing a specific repair plan. Among them, the LLM itself judges, and through the guidance of the LLM in the prompt words when the context memory is judged to have collected sufficient dynamic evidence, the action "propose_repair" is executed, which will trigger the patch editor to generate a patch.

[0212] (2) Patch Encoder Agent: This agent uses the root cause analysis insights provided by the program inspector to perform specific code modifications, thus completing the InspectCoder framework, connecting dynamic analysis and program repair in two steps. Its main functions include:

[0213] Root Cause-Driven Patch Generation: Receive the root cause report from the program inspector, and combine it with the task description and defective code to generate high-quality dynamic analysis-driven patches (corresponding to the code patches in the above embodiment).

[0214] Iterative Patch Verification and Refinement: After generating the patch, the patch encoder will test it against the public test suite (corresponding to the test cases in the above embodiment). If the test fails, it will select the first failed test as the new focus and feed the failed test, the updated defective code (corresponding to the repair code in the above embodiment) and the error message back to the program inspector for new dynamic analysis, forming an iterative repair process until the test passes or the maximum number of attempts is reached.

[0215] Debugging Middleware: The key middleware that connects the LLM inference capability and the complex debugger tool operation. It solves the problem that the LLM is difficult to track the state changes of the debugger in the process of session interaction, and filters the redundant information of the debugger output. The main responsibilities of the debugging middleware include:

[0216] Stateful Session Management: Abstract the debugger state into a clear mode (such as start, runtime state, runtime error, post mortem mode, and done), and continuously analyze and track the current mode to maintain the LLM's awareness of the debugger state.

[0217] Among them, the post mortem mode is a debugging mode that many debuggers (debuggers) support natively, known as post mortem debugging. The post mortem mode here is a modeling expression of the debugger's own life cycle. When the developer operates the debugger for debugging (such as continuing execution from a breakpoint), if an error is encountered during program execution, the post mortem state will be entered before the crash exits, which freezes the program state before the crash, and the error can be checked in this state. The debugger cannot continue to execute and set breakpoints after entering the "post mortem" state, and needs to restart the debugger to return to the start (start) state. The difference between the post mortem state and the runtime error state: In the modeling, runtime error refers to the error generated when the "interact_code" action is executed. This error will occur in the interactive session and will not cause the session to crash, nor will it cause the debugger to enter the post mortem state. The runtime error state can continue to use actions to transfer states, which is different from the post mortem state which can only be restarted.

[0218] Enhanced Runtime Modification: Implement a custom interactive environment (corresponding to the code debugging environment in the above embodiment), ensure that runtime modifications update the execution context of the program immediately, thereby achieving incremental debugging verification, and compatible with multiple test frameworks.

[0219] In the debugging session (for example, a python debugger (pdb) session), the local variables and global variables of the current runtime state are first obtained. Then, through the code base, an interactive session is created in the debugging session, sharing the namespace with the above local and global variables. In this way, it is ensured that the current program state can be read in the interactive environment; the "write" operation in the interactive environment will affect the subsequent debugging execution of the original program.

[0220] Transparent Interface Design: Provide a simple terminal-style interface for LLM, while automatically handling complex backend operations such as parsing LLM actions, managing debugger states, formatting observation results, and handling edge cases, thereby standardizing debugger interaction.

[0221] Among them, the edge case refers to when the action instruction format generated by the LLM is not standardized or the state transition is illegal (such as post mortem to set_breakpoint, or in the interact_code action, an input containing "input()" code that may block input / output (io) is passed in), a prompt is returned to guide the generation of correct actions, reducing the generation of meaningless environment feedback, and preventing the debugger session from entering an uncontrollable state (such as crashing out of the debugging process, or io blocking).

[0222] In the debugging middleware, in the start state, breakpoints can be set; from the breakpoint setting, the running state can be entered, and from the running state, the breakpoint setting can also be entered; from the running state, the completion state and the post-mortem state can be entered; in the running state, it can be restarted, monitored (monitor), or interactively executed (interact); from the interactive execution, it can be interactively executed again, or it can enter the running state and the running error state; from the post-mortem state, it can enter the start state through restart.

[0223] The external debugger is responsible for debugging and running the code.

[0224] In combination with Figure 7 , the processing flow of the code processing system is as follows:

[0225] Developer submits buggy code to InspectCoder, which is tested by the Code Verification module of the Patch Encoder, and obtains a test report (testreport, corresponding to the code test result in the above embodiment). The buggy code (code) and the test report are sent to the Dynamic Analysis module of the Program Inspector.

[0226] The buggy code includes Task Description and Buggy Code Snippet. The developer submits the text code snippet to the Patch Editor, which executes the code snippet using test cases, collects error information, and then submits it to the Program Inspector.

[0227] The Dynamic Analysis module performs two debugging strategies that mimic human programmers: Breakpoint Inspection and Runtime Modification, and outputs Actions.

[0228] The debugging middleware converts the actions into commands (command) and inputs them to the external debugger. The external debugger performs debugging according to the commands and outputs the raw output content (raw output). The debugging middleware outputs the corresponding observation (Observe) to the Program Inspector.

[0229] The Program Inspector and the debugging middleware interact multiple times through "action-observation". When enough dynamic evidence is collected or the reasoning step limit is reached, the Repair Planning module in the Program Inspector summarizes its reasoning memory (memory) and generates a root cause report (root cause report). The root cause report is sent to the Patch Generation module of the Patch Encoder.

[0230] The Patch Generation module generates a patch based on the root cause report and sends it to the Code Verification module for testing. If the test passes, the patched code is sent to the developer; if the test fails, the updated buggy code and test report are sent to the Dynamic Analysis module for new dynamic analysis, forming an iterative repair process until the test passes or the maximum number of attempts is reached.

[0231] In the embodiments of the present specification, by introducing the innovative paradigm of interactive LLM-debugger collaboration, the limitations of existing automatic program repair solutions are significantly overcome:

[0232] To address the shortcomings of static debugging and static simulation debugging: the related technology relies on static understanding or limited simulation reasoning, making it difficult to capture real-time errors and deep logic defects, and even may produce false debugging "illusions". InspectCoder, through its program inspector agent and debugging middleware, gives LLM the ability to interact directly with real-time debuggers. This means that LLM is no longer passive in receiving information, but can actively set breakpoints, check real-time variable states, and execute code snippets to obtain real-time dynamic information, avoiding "illusions" and surface errors, and greatly improving the understanding of the root cause of complex logic errors.

[0233] To address the shortcomings of standard process dynamic debugging: although standard process dynamic debugging introduces real-time runtime data, its information collection method is often lengthy and lacks pertinence, making LLM easily overwhelmed by a large amount of irrelevant information, and lacking a mechanism for quickly verifying debugging assumptions. InspectCoder, through its flexible dynamic analysis strategy (including breakpoint checks and runtime modifications), allows LLM to collect key dynamic information pertinently based on reasoning, and experimentally verifies through runtime modification of program logic. This incremental debugging verification provides immediate "process feedback" signals, allowing LLM to quickly adjust and optimize its debugging assumptions, significantly improving the efficiency and accuracy of dynamic analysis, speeding up the program repair process, and reducing unnecessary full execution and redundant log analysis.

[0234] Through the above innovations, InspectCoder realizes a paradigm shift from passive information reception to active LLM-driven dynamic analysis, significantly improving the accuracy and efficiency of automated program repair. It enables LLM to deeply understand program runtime behavior like experienced human developers, accurately locate and repair complex errors.

[0235] The embodiments of the present specification propose a dynamic analysis method driven by LLM, which encapsulates the debugger into a tool available to LLM, and actively conducts program debugging, dynamic analysis, and root cause mining by LLM, and finally generates high-quality program patches. Human debugging strategies are abstracted into "breakpoint checks" and "runtime modifications", and these debugging strategies are empowered to LLM, allowing LLM to obtain high-quality inter-process feedback signals during dynamic analysis and program repair, improving the accuracy of program repair.

[0236] The embodiment of the present specification provides a method, which can enable the LLM to actively check the program runtime behavior by calling the interactive program debugger, so as to diagnose and repair the problematic program. Through the scheme of the embodiment of the present specification, the defects of the existing automatic program repair method in the aspects of insufficient understanding of runtime behavior and lack of incremental debugging verification can be well solved, and the accuracy and efficiency of program repair are significantly improved.

[0237] The scheme of the embodiment of the present specification can be applied to an intelligent coding assistant which can realize code automatic completion, unit test generation, project code modification generation and the like by deeply understanding the coding context information of the developer based on advanced artificial intelligence technology, and improve the coding efficiency of the developer. The scheme of the embodiment of the present specification can further enhance the ability of the intelligent coding assistant in code repair.

[0238] Corresponding to the method embodiment, the present specification also provides a code processing device embodiment, Figure 8 A structural schematic diagram of a code processing device provided by an embodiment of the present specification is shown. As shown in the figure, Figure 8 The device comprises:

[0239] The first acquisition module 710 is configured to acquire the to-be-processed code.

[0240] The first calling module 720 is configured to call the code processing model, parse the to-be-processed code, and obtain code debugging information, wherein the code debugging information is used for debugging the code logic of the to-be-processed code.

[0241] The second calling module 730 is configured to call the code debugging component, debug and run the to-be-processed code based on the code debugging information, and obtain a code running result.

[0242] The processing module 740 is configured to process the to-be-processed code according to the code running result, and obtain a target code processed.

[0243] Optionally, the first calling module 720 is further configured to acquire a historical code running result of the to-be-processed code, wherein the historical code running result is obtained by running the to-be-processed code based on historical code debugging information; call the code processing model, and parse the to-be-processed code based on the historical code running result to obtain the code debugging information.

[0244] Optionally, the first calling module 720 is further configured to acquire current state information of the code debugging component, wherein the current state information is used to constrain the debugging action of the to-be-processed code; call the code processing model, and parse the to-be-processed code based on the current state information and the historical code running result to obtain the code debugging information.

[0245] Optionally, the first calling module 720 is further configured to call the intermediate component to perform state monitoring on the code debugging component and obtain current state information.

[0246] Optionally, the first calling module 720 is further configured to obtain a parsing example and candidate debugging information of the to-be-processed code; input the parsing example, the candidate debugging information and the to-be-processed code into the code processing model to obtain the code debugging information.

[0247] Optionally, the second calling module 730 is further configured to call the code debugging component to debug and run the to-be-processed code based on the code debugging information in a code debugging environment to obtain a code running result, wherein the code debugging environment is created by the intermediate component based on the to-be-processed code, and the code debugging environment has the same namespace as the to-be-processed code.

[0248] Optionally, the second calling module 730 is further configured to call the intermediate component to generate code debugging instructions based on the code debugging information; and call the code debugging component to debug and run the to-be-processed code based on the code debugging instructions to obtain a code running result.

[0249] Optionally, the second calling module 730 is further configured to call the intermediate component to verify the code debugging information and obtain a verification result; in a case where the verification result indicates that the code debugging information does not meet a debugging condition, return to the step of calling the code processing model to parse the to-be-processed code and obtain the code debugging information until the code debugging information meets the debugging condition; and in a case where the code debugging information meets the debugging condition, call the code debugging component to debug and run the to-be-processed code based on the code debugging information to obtain a code running result.

[0250] Optionally, the processing module 740 is further configured to input the policy generation prompt information and the code running result into the code processing model to obtain a code processing strategy, wherein the policy generation prompt information is used to guide the code processing model to generate a code processing strategy corresponding to the code running result; and process the to-be-processed code according to the code processing strategy to obtain a target code.

[0251] Optionally, the processing module 740 is further configured to input the code processing strategy and the to-be-processed code into the code processing model to obtain a code patch; and repair the to-be-processed code according to the code patch to obtain a target code.

[0252] Optionally, the processing module 740 is further configured to repair the to-be-processed code according to the code patch to obtain a repaired code; obtain test code corresponding to the to-be-processed code, and test the repaired code by using the test code to obtain a code test result; and in a case where the code test result indicates that the repaired code meets a test condition, determine the repaired code as the target code.

[0253] Optionally, the processing module 740 is further configured to return to execute the calling code processing model, parse the to-be-processed code, and obtain the code debugging information until the repaired code meets the test condition, in a case where the repaired code does not meet the test condition.

[0254] Optionally, the first calling module 720 is further configured to obtain test code corresponding to the to-be-processed code, and test the to-be-processed code by using the test code to obtain a code test result; and in a case where the code test result indicates that the to-be-processed code does not meet the test condition, call the code processing model, parse the to-be-processed code, and obtain the code debugging information.

[0255] The above is a schematic scheme of the code processing device according to the embodiment. It should be noted that the technical scheme of the code processing device and the technical scheme of the code processing method described above belong to the same concept, and the details of the technical scheme of the code processing device that are not described in detail can be referred to the description of the technical scheme of the code processing method.

[0256] Corresponding to the method embodiments described above, the present specification also provides code repair device embodiments, Figure 9 A structural schematic diagram of a code repair device according to an embodiment of the present specification is shown. As shown in the figure, Figure 9 The device includes:

[0257] The second obtaining module 810 is configured to obtain to-be-repaired code.

[0258] The third calling module 820 is configured to call a code processing model, parse the to-be-repaired code, and obtain code debugging information, where the code debugging information is used for debugging the code logic of the to-be-repaired code.

[0259] The fourth calling module 830 is configured to call a code debugging component, debug and run the to-be-repaired code based on the code debugging information, and obtain a code running result.

[0260] The repairing module 840 is configured to repair the to-be-repaired code according to the code running result, and obtain target code after repair.

[0261] The above is a schematic scheme of the code repair device according to the embodiment. It should be noted that the technical scheme of the code repair device and the technical scheme of the code repair method described above belong to the same concept, and the details of the technical scheme of the code repair device that are not described in detail can be referred to the description of the technical scheme of the code repair method.

[0262] Corresponding to the method embodiments described above, the present specification also provides request processing device embodiments, Figure 10A structural diagram of a request processing apparatus provided by one embodiment of the present specification is shown. As shown in Figure 10 The apparatus includes:

[0263] A receiving module 910 is configured to receive a model request sent by a terminal device.

[0264] A determining module 920 is configured to determine, based on the model request, a target code processing model from a plurality of code processing models, wherein the target code processing model is used in an execution process of a code processing method.

[0265] Optionally, the determining module 920 is further configured to, in a case where the model request includes a scene identifier of a target scene, find, based on the scene identifier, a target code processing model adaptive to the target scene from a first model library, wherein the first model library stores a plurality of code processing models adaptive to different scenes; in a case where the model request includes scene input data of the target scene, determine, from the plurality of code processing models, a to-be-trained code processing model adaptive to the target scene, and train the to-be-trained code processing model based on the scene input data to obtain the target code processing model; and in a case where the model request includes a model specification parameter, find, from a second model library, a target code processing model corresponding to the model specification parameter, wherein the second model library stores a plurality of code processing models of different model specification parameters.

[0266] Optionally, the determining module 920 is further configured to deploy the target code processing model, and construct a code processing interface based on the target code processing model, so that the terminal device schedules the target code processing model to execute a code processing task through the code processing interface.

[0267] The above is a schematic scheme of the request processing apparatus of the present embodiment. It should be noted that the technical scheme of the request processing apparatus and the technical scheme of the request processing method described above belong to the same concept, and the details of the technical scheme of the request processing apparatus that are not described in detail can be referred to the description of the technical scheme of the request processing method.

[0268] Figure 11 A structural block diagram of a computing device 1000 according to one embodiment of the present specification is shown.

[0269] The computing device 1000 includes a memory 1010 and a processor 1020.

[0270] The memory 1010 is used to store computer programs / instructions, and the processor 1020 is used to execute the computer programs / instructions, which realize the steps of the above code processing method / code repair method / request processing method based on a code processing model when executed by the processor 1020.

[0271] In one or more embodiments of the present specification, the computing device can be understood as an integrated intelligent terminal, including but not limited to a server, a desktop computer, a personal computer (PC), a model integrated machine, a mobile phone, a tablet computer or other portable intelligent terminal, etc., and the computing device can be pre-installed with the model in the above embodiments of the present application.

[0272] Specifically, the computing device can be pre-installed with various types of models, including but not limited to models in the fields of natural language processing, visual processing, speech processing, code processing, multi-modal task processing, etc., to provide diversified model selection. In different product forms, the computing device can support one or more model usage modes, including but not limited to model training, model calling, model fine-tuning, model deployment, model inference and application, etc. In some product forms, the computing device also supports model management, including but not limited to multi-type model management (supporting the management of discriminative and generative models), model version control (supporting the control of different model versions), model evaluation (based on model evaluation tools, evaluating the performance and effect of the model), etc. In another product form, the computing device can also create an application based on the model, provide an application programming interface (API) calling capability, and can call the model into the created application through the API interface, while providing an application management tool to realize the management and monitoring of the application.

[0273] Further, the computing device can also include data management (supporting the creation and management of model optimization datasets), a training center (providing rich training resources to help users learn and master artificial intelligence (AI) technology), basic control capability (providing enterprise-level basic control capability to ensure the security and efficient operation of the system), through the above functions, providing a comprehensive and integrated AI development, training, deployment and application device.

[0274] The above is a schematic scheme of a computing device of the present embodiment. It should be noted that the technical scheme of the computing device belongs to the same concept as the technical scheme of the above-mentioned code processing method / code repair method / request processing method based on the code processing model, and the details of the technical scheme of the computing device which are not described in detail can be referred to the description of the technical scheme of the above-mentioned code processing method / code repair method / request processing method based on the code processing model.

[0275] Figure 12 A structural block diagram of an electronic device 1100 is shown.

[0276] The memory 1110 and the processor 1120 are connected through the bus 1130.

[0277] The memory 1110 is configured to store computer programs / instructions, and the processor 1120 is configured to execute the computer programs / instructions, which, when executed by the processor 1120, implement the steps of the code processing method / code repairing method / request processing method based on the code processing model.

[0278] Specifically, the components of the electronic device 1100 include but are not limited to the memory 1110 and the processor 1120. The processor 1120 is connected to the memory 1110 through the bus 1130, and the database 1150 is configured to store data.

[0279] The electronic device 1100 further includes an access device 1140, which enables the electronic device 1100 to communicate via one or more networks 1160. Examples of these networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 1140 can include one or more of any type of network interface (for example, a network interface card (NIC)) such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and the like.

[0280] In one embodiment of the present specification, the above-mentioned components of the electronic device 1100 and other components not shown in the Figure 12 may be connected to each other, for example, through the bus. It should be understood that Figure 12 The electronic device structure diagram shown is only for the purpose of example, and is not a limitation on the scope of the present specification. Those skilled in the art can add or replace other components as needed.

[0281] The electronic device 1100 can be any type of stationary or mobile electronic device, including a mobile computer or mobile electronic device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smartphone), a wearable electronic device (e.g., a smart watch, smart glasses, etc.), or other type of mobile device, or a stationary electronic device such as a desktop computer or personal computer. The electronic device 1100 can also be a mobile or stationary server.

[0282] The above is a schematic scheme of an electronic device according to an embodiment of the present disclosure. It should be noted that the technical scheme of the electronic device and the technical scheme of the code processing method / code repair method / request processing method based on the code processing model belong to the same concept, and the details of the technical scheme of the electronic device that are not described in detail can be referred to the description of the technical scheme of the code processing method / code repair method / request processing method based on the code processing model.

[0283] An embodiment of the present disclosure further provides a computer readable storage medium storing a computer program / instruction, which, when executed by a processor, implements the steps of the code processing method / code repair method / request processing method based on the code processing model.

[0284] The above is a schematic scheme of a computer readable storage medium according to an embodiment of the present disclosure. It should be noted that the technical scheme of the storage medium and the technical scheme of the code processing method / code repair method / request processing method based on the code processing model belong to the same concept, and the details of the technical scheme of the storage medium that are not described in detail can be referred to the description of the technical scheme of the code processing method / code repair method / request processing method based on the code processing model.

[0285] An embodiment of the present disclosure further provides a computer program product comprising a computer program / instruction, which, when executed by a processor, implements the steps of the code processing method / code repair method / request processing method based on the code processing model.

[0286] The above is a schematic scheme of a computer program product according to an embodiment of the present disclosure. It should be noted that the technical scheme of the computer program product and the technical scheme of the code processing method / code repair method / request processing method based on the code processing model belong to the same concept, and the details of the technical scheme of the computer program product that are not described in detail can be referred to the description of the technical scheme of the code processing method / code repair method / request processing method based on the code processing model.

[0287] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0288] Computer programs / instructions include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in computer-readable media can be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0289] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.

[0290] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0291] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A code processing method, comprising: Get the code to be processed; The code processing model is invoked to parse the code to be processed based on the current state information and historical code execution results of the code debugging component, thereby obtaining the code debugging information for the current debugging cycle. The code debugging information is used to debug the code logic of the code to be processed, and the historical code execution results are the code execution results of the code to be processed in the historical debugging cycle. The code debugging information includes the debugging actions corresponding to the current state information. The current state information is obtained by the intermediate component monitoring the state of the code debugging component, and the current state information is used to constrain the debugging actions of the code to be processed. The code debugging component is invoked to debug and run the code to be processed based on the code debugging information, and the code execution result of the current debugging cycle is obtained. Based on the code execution results, the code to be processed is processed to obtain the processed target code; The step of processing the code to be processed according to the code execution result to obtain the processed target code includes: processing the code to be processed according to the code processing strategy to obtain the processed target code, wherein the code processing strategy is constructed based on the fault causes obtained by summarizing the code execution results of multiple debugging cycles by the code processing model.

2. The method according to claim 1, before the invocation code processing model parses the code to be processed based on the current state information and historical code execution results of the code debugging component to obtain the code debugging information of the current debugging cycle, it further includes: Obtain the historical code execution results of the code to be processed, wherein the historical code execution results are obtained by running the code to be processed based on historical code debugging information.

3. The method according to claim 1, before the invocation code processing model parses the code to be processed based on the current state information and historical code execution results of the code debugging component to obtain the code debugging information of the current debugging cycle, it further includes: Obtain the current state information of the code debugging component.

4. The method according to any one of claims 1 to 3, wherein the code processing model parses the code to be processed based on the current state information and historical code execution results of the code debugging component to obtain code debugging information for the current debugging cycle, including: Obtain parsed samples and candidate debugging information of the code to be processed, wherein the candidate debugging information represents the debugging actions set in the code processing model; The parsing sample, the candidate debugging information, the current status information, the historical code execution results, and the code to be processed are input into the code processing model to obtain the code debugging information.

5. The method according to any one of claims 1 to 3, wherein calling the code debugging component to debug and run the code to be processed based on the code debugging information, and obtaining the code execution result of the current debugging cycle, includes: The code debugging component is invoked, and the code to be processed is debugged and run based on the code debugging information in the code debugging environment to obtain the code running result. The code debugging environment is created by the intermediate component based on the code to be processed, and the namespace of the code debugging environment is the same as the namespace of the code to be processed.

6. The method according to any one of claims 1 to 3, before invoking the code debugging component, debugging and running the code to be processed based on the code debugging information, and obtaining the code execution result of the current debugging cycle, the method further includes: The intermediate component is invoked to generate code debugging instructions based on the code debugging information; The step of invoking the code debugging component, debugging and running the code to be processed based on the code debugging information, and obtaining the code execution result of the current debugging cycle includes: The code debugging component is invoked to debug and run the code to be processed based on the code debugging instructions, and the code execution result is obtained.

7. The method according to any one of claims 1 to 3, wherein before invoking the code debugging component, debugging and running the code to be processed based on the code debugging information, and obtaining the code execution result of the current debugging cycle, the method further includes: Invoke the intermediate component to verify the code debugging information and obtain the verification result; If the verification result indicates that the code debugging information does not meet the debugging conditions, the process returns to the step of executing the calling code processing model, parsing the code to be processed based on the historical code execution results, and obtaining the code debugging information of the current debugging cycle, until the code debugging information meets the debugging conditions. The step of invoking the code debugging component, debugging and running the code to be processed based on the code debugging information, and obtaining the code execution result of the current debugging cycle includes: If the verification result indicates that the code debugging information meets the debugging conditions, the code debugging component is invoked to debug and run the code to be processed based on the code debugging information, and the code execution result is obtained.

8. The method according to any one of claims 1 to 3, wherein processing the code to be processed based on the code execution result to obtain the processed target code comprises: The strategy generation prompts and the code execution results are input into the code processing model to obtain a code processing strategy, wherein the strategy generation prompts are used to guide the code processing model to generate a code processing strategy corresponding to the code execution results; According to the code processing strategy, the code to be processed is processed to obtain the processed target code.

9. The method according to claim 8, wherein processing the code to be processed according to the code processing strategy to obtain the processed target code includes: The code processing strategy and the code to be processed are input into the code processing model to obtain a code patch; The code to be processed is repaired according to the code patch to obtain the target code.

10. The method according to claim 9, wherein repairing the code to be processed according to the code patch to obtain the target code includes: The code to be processed is repaired according to the code patch to obtain the repaired code; Obtain the test code corresponding to the code to be processed, and use the test code to test the repair code to obtain the code test results; If the code test results indicate that the repair code meets the test conditions, the repair code is identified as the target code.

11. The method of claim 10, further comprising: If the code test result indicates that the repair code does not meet the test conditions, the process returns to the execution of the calling code processing model, which parses the code to be processed based on the current state information of the code debugging component and the historical code execution results, and obtains the code debugging information of the current debugging cycle, until the repair code meets the test conditions.

12. The method according to any one of claims 1 to 3, wherein before the code processing model parses the code to be processed based on the current state information and historical code execution results of the code debugging component to obtain the code debugging information of the current debugging cycle, it further includes: Obtain the test code corresponding to the code to be processed, and use the test code to test the code to be processed to obtain the code test results; The code processing model parses the code to be processed based on the current state information and historical code execution results of the code debugging component to obtain code debugging information for the current debugging cycle, including: If the code test results indicate that the code to be processed does not meet the test conditions, the code processing model is invoked to parse the code to be processed based on the current state information and the historical code execution results to obtain the code debugging information.

13. A code fixing method, comprising: Obtain the code to be fixed; The code processing model is invoked to parse the code to be repaired based on the current state information and historical code execution results of the code debugging component, and to obtain the code debugging information of the current debugging cycle. The code debugging information is used to debug the code logic of the code to be repaired. The historical code execution results are the code execution results of the code to be repaired in the historical debugging cycle. The code debugging information includes the debugging actions corresponding to the current state information. The current state information is obtained by the intermediate component to detect the state of the code debugging component. The current state information is used to constrain the debugging actions of the code to be repaired. The code debugging component is invoked to debug and run the code to be repaired based on the code debugging information, and the code execution result of the current debugging cycle is obtained; Based on the code execution results, the code to be repaired is repaired to obtain the repaired target code; The step of repairing the code to be repaired based on the code execution results to obtain the repaired target code includes: repairing the code to be repaired according to a code processing strategy to obtain the repaired target code, wherein the code processing strategy is constructed based on the fault causes obtained by summarizing the code execution results of multiple debugging cycles by the code processing model.

14. A request processing method based on a code processing model, applied to a task platform, comprising: Receive model requests sent by terminal devices; Based on the model request, a target code processing model is determined from multiple code processing models, wherein the target code processing model is used in the execution of the method as described in any one of claims 1 to 13.

15. The method according to claim 14, wherein determining the target code processing model from multiple code processing models based on the model request comprises: If the model request includes a scene identifier of the target scene, a target code processing model suitable for the target scene is searched from the first model library based on the scene identifier. The first model library stores multiple code processing models suitable for different scenes. When the model request includes scene input data of the target scene, a code processing model to be trained that is suitable for the target scene is determined from the plurality of code processing models, and the code processing model to be trained is trained based on the scene input data to obtain the target code processing model. If the model request includes model specification parameters, the target code processing model corresponding to the model specification parameters is searched from the second model library, wherein the second model library stores multiple code processing models with different model specification parameters.

16. The method according to claim 14, further comprising, after determining the target code processing model from multiple code processing models based on the model request: Deploy the target code processing model, and build a code processing interface based on the target code processing model, so that the terminal device can schedule the target code processing model to execute code processing tasks through the code processing interface.

17. A task platform, comprising a request interface and a response unit; The request interface is used to receive model requests sent by the terminal device, wherein... The model request includes at least one of the following: the scene identifier of the target scene, the scene input data of the target scene, and the model specification parameters. The response unit is configured to determine a target code processing model from multiple code processing models based on the model request, wherein the target code processing model is used in the execution of the method as described in any one of claims 1 to 13.

18. The task platform according to claim 17, further comprising a code processing interface, wherein the code processing interface is constructed based on the target code processing model; The code processing interface is used for the terminal device to schedule and execute code processing tasks.

19. An intelligent coding assistance plugin for an integrated development environment, comprising a visual debugging suggestion display area, a visual debugging result display area, and a target code display area; The visual debugging suggestion display area is used to display code debugging information for the current debugging cycle, wherein... The code debugging information is obtained by calling the code processing model to parse the code to be processed based on the current state information and historical code execution results of the code debugging component. The code debugging information is used to debug the code logic of the code to be processed. The historical code execution results are the code execution results of the code to be processed in the historical debugging cycle. The code debugging information includes the debugging action corresponding to the current state information. The current state information is obtained by the intermediate component to monitor the state of the code debugging component. The current state information is used to constrain the debugging action of the code to be processed. The visualization debugging result display area is used to display the code execution result of the current debugging cycle, wherein the code execution result is obtained by calling the code debugging component, debugging and running the code to be processed based on the code debugging information; The target code display area is used to display the processed target code, wherein the target code is obtained by processing the code to be processed based on the code execution result; the target code is obtained by processing the code to be processed based on the code processing strategy, wherein the code processing strategy is constructed based on the fault causes obtained by summarizing the code execution results of multiple debugging cycles by the code processing model.

20. A computing device, comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 16.

21. An electronic device, comprising: A memory and a processor, the memory and the processor being connected via a bus; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 16.

22. A computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 16.

23. A computer program product comprising a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 16.

Citation Information

Patent Citations

  • Code generation optimization method and device for large language model, equipment and medium

    CN117724695A

  • Programming problem debugging method based on large language model

    CN117827672A

  • Code processing method and code repair testing method

    CN118760612A

  • Method for debugging intelligent agent through computing power of intelligent computing center

    CN120179535A

  • Code debugging method and related equipment

    CN120578574A