Code processing methods and code repair testing methods

Through the code processing model and knowledge graph automation software code repair process, the problem of traditional manual repair efficiency is solved, and efficient and accurate code repair and maintenance is achieved.

CN118760612BActive Publication Date: 2024-12-20ALIBABA (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411239310.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2024-12-20
Estimated Expiration
2044-09-04

AI Technical Summary

Technical Problem

In traditional software development, due to code complexity, it takes time to identify and repair code defects manually, is inefficient, and ignores code structure and dependencies, resulting in poor accuracy.

Method used

The code processing model is used to automate the software code repair process, understand the code structure and dependencies through the code knowledge graph, and use the test code to verify the repair code to ensure the correctness and efficiency of the repair code.

Benefits of technology

It significantly improves software development and maintenance efficiency, reduces code maintenance costs, improves code repair quality and product iteration speed, and realizes automated bug fixes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760612B_ABST
    Figure CN118760612B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide a code processing method and a code repair test method, wherein the code processing method includes: obtaining code problems of a target project; determining the problem code of the target project based on the code problems and the code knowledge graph of the target project; inputting the code problems and the problem code into a code processing model to obtain an initial repair code; using a test code to test the initial repair code, and if the test passes, obtaining the target repair code for the code problem. The problem code is determined through the code knowledge graph, the structure and dependencies of the code of the target project are better understood, the accuracy of the problem code is improved, the code processing model is used to automatically repair the code, and efficient code processing is achieved. The initial repair code is tested using the test code to ensure the correctness of the target repair code, which reduces the code maintenance cost and improves the code processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present specification relate to the field of computer technology, and in particular to a code processing method and a code repair testing method. Background Art

[0002] In the traditional software development process, code writing is one of the core parts of the entire process. The written code may include some abnormal problems (bugs). These errors or incorrect implementations can be called code problems, code errors or code defects. Code defects can cause the program to not run as expected, so how to handle code has gradually become a research focus.

[0003] Currently, code defects are usually manually identified from written code, and the identified code defects are repaired using prior knowledge. However, manual code defect identification and code defect repair require a lot of time and human resources, resulting in extremely low code processing efficiency. Therefore, an efficient code processing solution is urgently needed. Summary of the invention

[0004] In view of this, the embodiments of this specification provide a code processing method. One or more embodiments of this specification also relate to a code repair test method, a code processing device, a code repair test device, a task platform, a code processing system, a computing device, a computer-readable storage medium and a computer program product to solve the technical defects existing in the prior art.

[0005] According to a first aspect of an embodiment of this specification, a code processing method is provided, including:

[0006] Get the code issues of the target project;

[0007] Determine the problem code of the target project according to the code problem and the code knowledge graph of the target project, wherein the code knowledge graph is used to characterize the code context relationship and code reference relationship of the target project;

[0008] Input the code problem and the problem code into the code processing model to obtain the initial repair code;

[0009] The initial repair code is tested using the test code, and when the test passes, the target repair code for the code problem is obtained, wherein the test code is obtained based on the code problem, and the test code is used to reproduce the code problem.

[0010] According to a second aspect of an embodiment of this specification, a code repair testing method is provided, including:

[0011] Obtain code problems and initial repair codes of the target project, wherein the initial repair codes are obtained by the code processing model based on code problems and problem codes, and the problem codes are obtained based on code problems and the code knowledge graph of the target project, and the code knowledge graph is used to characterize the code context relationship and code reference relationship of the target project;

[0012] The initial repair code is tested using the test code, and when the test passes, the target repair code for the code problem is obtained, wherein the test code is obtained based on the code problem, and the test code is used to reproduce the code problem.

[0013] According to a third aspect of an embodiment of this specification, a code processing method is provided, which is applied to a task platform, and includes:

[0014] The code problem of receiving the target project sent by the client;

[0015] Determine the problem code of the target project according to the code problem and the code knowledge graph of the target project, wherein the code knowledge graph is used to characterize the code context relationship and code reference relationship of the target project;

[0016] Input the code problem and the problem code into the code processing model to obtain the initial repair code;

[0017] The initial repair code is tested using the test code, and when the test passes, the target repair code for the code problem is obtained, wherein the test code is obtained based on the code problem, and the test code is used to reproduce the code problem.

[0018] According to a fourth aspect of the embodiments of this specification, there is provided a task platform, including a request interface and a response unit;

[0019] Request interface, used to receive code issues of target projects sent by clients;

[0020] The response unit is used to determine the problem code of the target project based on the code problem and the code knowledge graph of the target project, wherein the code knowledge graph is used to characterize the code context relationship and code reference relationship of the target project; input the code problem and the problem code into the code processing model to obtain the initial repair code; use the test code to test the initial repair code, and if the test passes, obtain the target repair code of the code problem, wherein the test code is obtained based on the code problem, and the test code is used to reproduce the code problem.

[0021] According to a fifth aspect of the embodiments of this specification, there is provided a code processing system, including a client and a server;

[0022] The client is used to send code issues of the target project to the server;

[0023] The server is used to determine the problem code of the target project according to the code problem and the code knowledge graph of the target project, wherein the code knowledge graph is used to characterize the code context relationship and code reference relationship of the target project; input the code problem and the problem code into the code processing model to obtain the initial repair code; use the test code to test the initial repair code, and if the test passes, obtain the target repair code of the code problem, wherein the test code is obtained based on the code problem and is used to reproduce the code problem; send the target repair code of the code problem to the client;

[0024] The client is also used to receive the target repair code for the code problem sent by the server.

[0025] According to a sixth aspect of the embodiments of this specification, a code processing device is provided, including:

[0026] A first acquisition module is configured to acquire code issues of a target project;

[0027] A first determination module is configured to determine the problem code of the target project according to the code problem and the code knowledge graph of the target project, wherein the code knowledge graph is used to characterize the code context relationship and the code reference relationship of the target project;

[0028] A first input module is configured to input the code problem and the problem code into the code processing model to obtain an initial repair code;

[0029] The first test module is configured to test the initial repair code using the test code, and obtain the target repair code of the code problem when the test passes, wherein the test code is obtained based on the code problem, and the test code is used to reproduce the code problem.

[0030] According to a seventh aspect of an embodiment of this specification, a code repair test device is provided, including:

[0031] A second acquisition module is configured to acquire code problems and initial repair codes of a target project, wherein the initial repair codes are obtained by a code processing model based on code problems and problem codes, and the problem codes are obtained based on code problems and a code knowledge graph of the target project, and the code knowledge graph is used to characterize code context relationships and code reference relationships of the target project;

[0032] The second test module is configured to test the initial repair code using the test code, and obtain the target repair code for the code problem if the test passes, wherein the test code is obtained based on the code problem and is used to reproduce the code problem.

[0033] According to an eighth aspect of the embodiments of this specification, there is provided a code processing device, which is applied to a task platform, and includes:

[0034] A receiving module, configured to receive code issues of a target project sent by a client;

[0035] A second determination module is configured to determine the problem code of the target project according to the code problem and the code knowledge graph of the target project, wherein the code knowledge graph is used to characterize the code context relationship and the code reference relationship of the target project;

[0036] A second input module is configured to input the code problem and the problem code into the code processing model to obtain an initial repair code;

[0037] The third test module is configured to test the initial repair code using the test code, and obtain the target repair code for the code problem if the test passes, wherein the test code is obtained based on the code problem, and the test code is used to reproduce the code problem.

[0038] According to a ninth aspect of the embodiments of this specification, a computing device is provided, including:

[0039] Memory and processor;

[0040] The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the method provided in the first aspect, the second aspect, or the third aspect are implemented.

[0041] According to the tenth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of the method provided in the first aspect, the second aspect, or the third aspect are implemented.

[0042] According to an eleventh aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instruction, which, when executed by a processor, implements the steps of the method provided in the first aspect, the second aspect, or the third aspect.

[0043] The code processing method provided by an embodiment of the present specification includes: obtaining code problems of a target project; determining the problem code of the target project based on the code problems and the code knowledge graph of the target project, wherein the code knowledge graph is used to characterize the code context relationship and code reference relationship of the target project; inputting the code problems and the problem code into a code processing model to obtain an initial repair code; testing the initial repair code with a test code, and obtaining a target repair code for the code problem when the test passes, wherein the test code is obtained based on the code problem, and the test code is used to reproduce the code problem. By determining the problem code through the code knowledge graph, it is possible to better understand the structure and dependency of the code of the target project, improve the accuracy of the problem code, use the code processing model to automatically repair the code, and achieve efficient code processing. In addition, by using the test code to test the initial repair code, code problems in the target repair code are avoided, the correctness of the target repair code is ensured, the code maintenance cost is reduced, and the code processing efficiency is further improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 is an architecture diagram of a code processing system provided by an embodiment of this specification;

[0045] Figure 2 is an architecture diagram of another code processing system provided by an embodiment of this specification;

[0046] Figure 3 is a flow chart of a code processing method provided by an embodiment of this specification;

[0047] Figure 4 is a processing flow chart of a code processing method provided by an embodiment of this specification;

[0048] Figure 5 is a flow chart of a code repair testing method provided by an embodiment of this specification;

[0049] Figure 6 is a flowchart of another code processing method provided by an embodiment of this specification;

[0050] Figure 7 It is a structural diagram of a task platform provided by an embodiment of this specification;

[0051] Figure 8 is a schematic diagram of the structure of a code processing device provided by an embodiment of this specification;

[0052] Fig. 9 It is a structural schematic diagram of a code repair test device provided by an embodiment of this specification;

[0053] Fig.10 is a schematic diagram of the structure of another code processing device provided by an embodiment of this specification;

[0054] Fig.11 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0055] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0056] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0057] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0058] 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 used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0059] In one or more embodiments of this specification, a large model refers to a deep learning model with large-scale model parameters, which usually contains hundreds of millions, tens of billions, hundreds of billions, trillions, or even more than 10 trillion model parameters. A large model can also be called a foundation model / foundation model. The large model is pre-trained with large-scale unlabeled corpus to produce a pre-trained model with more than 100 million parameters. This model can adapt to a wide range of downstream tasks, and the model has good generalization ability, such as a large-scale language model (LLM, Large Language Model), a multi-modal pre-training model, etc.

[0060] When the big model is used in practice, only a small number of samples are needed to fine-tune the pre-trained model and it can be applied to different tasks. The big model can be widely used in natural language processing (NLP), computer vision and other fields. Specifically, it can be applied to computer vision tasks such as visual question answering (VQA), image description (IC, Image Caption), image generation, as well as natural language processing tasks such as text-based sentiment classification, text summary generation, and machine translation. The main application scenarios of the big model include digital assistants, intelligent robots, search, online education, office software, e-commerce, intelligent design, etc.

[0061] First, the terms involved in one or more embodiments of this specification are explained.

[0062] Automated Software Engineering (ASE): aims to use artificial intelligence technology to automate the software development and maintenance process.

[0063] Multi-Agent: refers to a system in which multiple collaborative agents (artificial intelligence agents) work together to achieve a specific goal.

[0064] Software Engineering Benchmark (SWE-bench): refers to a benchmark test set for evaluating the performance of automated software engineering systems.

[0065] Monte Carlo Tree Search (MCTS): is a probabilistic algorithm for decision making and planning. It is suitable for environments with very large search spaces or uncertainties, such as board games (such as Go, chess, etc.), decision-making problems, etc.

[0066] Retrieval-Augmented Generation (RAG): is an artificial intelligence technology that combines information retrieval and language generation.

[0067] Spectrum-Based Fault Localization (SBFL): is a software engineering technique used to help developers quickly locate bugs in the code.

[0068] Reason and Act (ReAct) mechanism: is a method used for decision-making and reasoning in the field of artificial intelligence. The core idea of ​​this mechanism is to divide the decision-making process into two main stages: reasoning (Reason) and action (Act).

[0069] In the traditional software development process, since the code is usually complex, manual bug identification is performed on local code, ignoring the structure and dependencies of the code, resulting in poor bug identification accuracy. Further manual repair of bugs with poor accuracy requires a lot of time and human resources. This model is inefficient in a fast-iterative software development environment. With the development of artificial intelligence technology, especially the breakthrough of large models in code understanding and generation, new possibilities are provided for solving this problem.

[0070] The embodiments of this specification propose a code processing method, which uses a code processing model to automate the entire software code repair process, including multiple links such as problem understanding, bug location, code analysis and repair, and code verification, which greatly shortens the bug repair cycle, thereby greatly improving the efficiency of software development and maintenance, and achieving end-to-end automated bug repair. Specifically, the code problem of the target project is obtained; based on the code problem and the code knowledge graph of the target project, the problem code of the target project is determined, wherein the code knowledge graph is used to characterize the code context relationship and code reference relationship of the target project; the code problem and the problem code are input into the code processing model to obtain the initial repair code; the initial repair code is tested with the test code, and when the test passes, the target repair code of the code problem is obtained, wherein the test code is obtained based on the code problem, and the test code is used to reproduce the code problem.

[0071] Through the above solution, not only can the software development efficiency be significantly improved and the code maintenance cost be reduced, but also the code repair quality and product iteration speed can be improved, and key problems such as long time consumption and low efficiency in traditional methods can be solved, providing an automated solution for the software industry.

[0072] In this specification, a code processing method is provided. This specification also involves a code repair method, a code processing device, a code repair device, a task platform, a code processing system, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0073] See also Figure 1 , Figure 1 An architecture diagram of a code processing system provided by an embodiment of the present specification is shown. The code processing system may include a client 100 and a server 200;

[0074] The client 100 is used to send the code problem of the target project to the server 200;

[0075] The server 200 is used to determine the problem code of the target project according to the code problem and the code knowledge graph of the target project, wherein the code knowledge graph is used to characterize the code context relationship and the code reference relationship of the target project; input the code problem and the problem code into the code processing model to obtain the initial repair code; use the test code to test the initial repair code, and if the test passes, obtain the target repair code of the code problem, wherein the test code is obtained based on the code problem and is used to reproduce the code problem; send the target repair code of the code problem to the client 100;

[0076] The client 100 is also used to receive the target repair code of the code problem sent by the server 200.

[0077] By applying the solution of the embodiments of this specification, the problem code is determined through the code knowledge graph, so that the structure and dependencies of the code of the target project can be better understood, the accuracy of the problem code can be improved, and the code processing model can be used to automatically repair the code to achieve efficient code processing. In addition, the initial repair code is tested with the test code to avoid code problems in the target repair code, thereby ensuring the correctness of the target repair code, reducing the code maintenance cost, and further improving the code processing efficiency.

[0078] See also Figure 2 , Figure 2 The architecture diagram of another code processing system provided by an embodiment of the present specification is shown. The code processing system may include multiple clients 100 and a server 200, wherein the client 100 may include a terminal-side device, and the server 200 may include a cloud-side device. A communication connection may be established between multiple clients 100 through the server 200. In the code processing scenario, the server 200 is used to provide code processing services between multiple clients 100. Multiple clients 100 may serve as a sender or a receiver, respectively, and realize communication through the server 200.

[0079] The user can interact with the server 200 through the client 100 to receive data sent by other clients 100, or send data to other clients 100, etc. In the code processing scenario, the user can publish a data stream to the server 200 through the client 100, and the server 200 generates a target repair code based on the data stream, and pushes the target repair code to other clients that establish communication. Among them, the client 100 and the server 200 are connected through a network. The network provides a medium for the communication link between the client 100 and the server 200. The network can include various connection types, such as wired, wireless communication links or optical fiber cables, etc. The data transmitted by the client 100 may need to be encoded, transcoded, compressed, etc. before being published to the server 200.

[0080] The client 100 can be a browser, an application (APP, Application), or a web application such as HyperText Markup Language Version 5 (H5, HyperText Markup Language5) application, or a light application (also known as a mini-program, a lightweight application) or a cloud application, etc. The client 100 can be based on the software development kit (SDK, Software Development Kit) of the corresponding service provided by the server 200, such as based on the real-time communication (RTC, Real Time Communication) SDK development and acquisition. The client 100 can be deployed in an electronic device and needs to rely on the device to run or some APPs in the device to run. For example, the electronic device can have a display screen and support information browsing, such as a personal mobile terminal such as a mobile phone, a tablet computer, a personal computer, etc. Various other types of applications can also be configured in the electronic device, such as human-computer dialogue applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, mailbox clients, social platform software, etc.

[0081] The server 200 may include servers that provide various services, such as servers that provide communication services to multiple clients, servers for background training that support models used on clients, and servers that process data sent by clients. It should be noted that the server 200 can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. The server can also be a server of a distributed system, or a server combined with a blockchain. The server can also be a cloud server for basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.

[0082] It is worth noting that the code processing method provided in the embodiments of this specification is generally executed by the server, but in other embodiments of this specification, the client may also have similar functions to the server, thereby executing the code processing method provided in the embodiments of this specification. In other embodiments, the code processing method provided in the embodiments of this specification may also be jointly executed by the client and the server.

[0083] See also Figure 3 , Figure 3 A flowchart of a code processing method provided by an embodiment of this specification is shown, which specifically includes the following steps:

[0084] Step 302: Obtain code issues of the target project.

[0085] In one or more embodiments of the present specification, during code processing, code problems of the target project can be obtained, so that code processing can be performed based on the code problems. The code processing here includes problem code location, code repair, repair code testing, etc.

[0086] It should be noted that the target project can be a software development project in different scenarios, such as a shopping software development project in an e-commerce scenario, an office software development project in an office scenario, etc. Coding Issues refer to various code-related problems or errors encountered during the software development process. Coding issues include logical errors, compatibility issues, syntax errors, security vulnerabilities, etc.

[0087] In practical applications, there are many ways to obtain the code problems of the target project, which are selected according to the actual situation, and the embodiments of this specification do not limit this. In one possible implementation of this specification, the code problems of the target project sent by the user through the client can be received. In another possible implementation of this specification, the code problems of the target project can be read from other data acquisition devices or databases.

[0088] Step 304: Determine the problem code of the target project based on the code problem and the code knowledge graph of the target project, wherein the code knowledge graph is used to characterize the code context relationship and code reference relationship of the target project.

[0089] In one or more embodiments of the present specification, after obtaining the code problem of the target project, the problem code of the target project can be determined based on the code problem and the code knowledge graph of the target project.

[0090] It should be noted that the code knowledge graph of the target project refers to a data structure that represents the information of the target project code base in a graphical manner. The code knowledge graph usually contains multiple code entities in the code context and the relationship between multiple code entities. Code entities can be called nodes in the code knowledge graph, such as classes, functions, variables, etc. The relationship between code entities can be called code reference relationships, which can be represented in the code knowledge graph using the edges in the knowledge graph. The relationship between code entities includes call relationships, inheritance relationships, inclusion relationships, etc. Problematic code refers to code snippets in the project program that have defects, errors, or do not meet the expected effects. These defects and errors can be understood as code problems.

[0091] In practical applications, there are many ways to determine the problem code of the target project based on the code problem and the code knowledge graph of the target project. The specific selection is based on the actual situation, and the embodiments of this specification do not limit this. In one possible implementation of this specification, according to the code problem, the target processing path can be screened out from all processing paths in the code knowledge graph, and according to the target processing path, the problem code of the target project can be screened out from the project code of the target project.

[0092] In another possible implementation of the present specification, since the code knowledge graph includes information of a complex code base, in order to improve the efficiency of locating the problem code, a code processing subgraph may be constructed according to the code problem and the code knowledge graph, thereby narrowing the search space when locating the problem code. That is, the above-mentioned determination of the problem code of the target project according to the code problem and the code knowledge graph of the target project may include the following steps:

[0093] According to the code problem and the code knowledge graph of the target project, a code processing subgraph is constructed, wherein the code processing subgraph includes multiple processing paths;

[0094] According to the code problem, select the target processing path from multiple processing paths;

[0095] According to the target processing path, the problem code of the target project is filtered out from the project code of the target project.

[0096] It should be noted that the code processing subgraph refers to the knowledge graph composed of nodes in the code knowledge graph that have an association relationship with the code problem. The target processing path refers to the processing path in the code processing subgraph that has a high similarity with the code problem. The processing path includes the nodes and edges passed from the root node to the leaf node.

[0097] In practical applications, there are many ways to construct a code processing subgraph based on the code problem and the code knowledge graph of the target project. The specific selection is based on the actual situation, and the embodiments of this specification do not impose any restrictions on this. In one possible implementation of this specification, an upper confidence interval algorithm (UCT, Upper Confidence bounds applied to Trees) can be used to select nodes from the code knowledge graph according to the code problem to construct a code processing subgraph. In another possible implementation of this specification, nodes with high similarity to the code problem can be determined from multiple nodes in the code knowledge graph, and nodes that have edges with nodes with high similarity are used as nodes of the code processing subgraph to obtain the code processing subgraph.

[0098] Furthermore, according to the code problem, there are many ways to filter out the target processing path from multiple processing paths, and the specific selection is based on the actual situation. The embodiments of this specification do not impose any restrictions on this. In one possible implementation of this specification, keyword matching and semantic matching algorithms can be used to evaluate the similarity between multiple processing paths and code problems, and the target processing path is selected based on the similarity, wherein a processing path with a higher similarity refers to a processing path with a similarity greater than a similarity threshold, such as 0.8, which is set specifically according to the actual situation. The embodiments of this specification do not impose any restrictions on this. In another possible implementation of this specification, a code processing model can be used to generate similarity indicators between leaf nodes corresponding to multiple processing paths and code problems, and the target processing path is filtered out based on the similarity indicators.

[0099] According to the target processing path, there are many ways to filter out the problem code of the target project from the project code of the target project. The specific selection depends on the actual situation, and the embodiments of this specification do not impose any restrictions on this. In one possible implementation of this specification, code retrieval information can be generated according to the code problem and the target processing path; based on the code retrieval information, candidate code snippets are retrieved from the project code of the target project, and the candidate code snippets are determined as the problem code of the target project. In another possible implementation of this specification, since the candidate code snippets may include correct code content, after obtaining the candidate code snippets, the code location model can be further used to determine the problem code location information of the problem code; based on the problem code location information, the problem code is extracted from the project code.

[0100] By applying the solution of the embodiments of this specification, the problem code is determined through the code knowledge graph, so that the structure and dependencies of the code of the target project can be better understood and the accuracy of the problem code can be improved.

[0101] In an optional embodiment of the present specification, the above-mentioned screening out a target processing path from multiple processing paths according to the code problem may include the following steps:

[0102] In the code knowledge graph, search for leaf nodes corresponding to multiple processing paths respectively;

[0103] Calculate similarity metrics between leaf nodes and code issues;

[0104] A target processing path is screened out from multiple processing paths based on similar indicators.

[0105] It should be noted that the similarity index is used to describe the degree of correlation between the leaf node and the code problem. There are many ways to calculate the similarity index between the leaf node and the code problem, which are selected according to the actual situation. The embodiments of this specification do not limit this. In one possible implementation of this specification, the similarity index between the leaf node and the code problem can be calculated using keyword matching and / or semantic matching algorithms. In another possible implementation of this specification, the indicator generation prompt information, the leaf node and the code problem can be input into the code processing model to obtain the similarity index output by the code processing model.

[0106] In practical applications, when a target processing path is selected from multiple processing paths based on a similarity index, in one possible implementation, K processing paths with higher similarity can be used as target processing paths, where K is a positive integer and is selected based on actual conditions. In another possible implementation, a processing path with a similarity index greater than a similarity index threshold can be determined as a target processing path, and the similarity index threshold is set based on actual conditions, and this specification embodiment will not be repeated.

[0107] By applying the solution of the embodiment of this specification, the target processing path is determined based on the similarity index between the leaf node and the code problem, thereby ensuring that each node in the target processing path has a high degree of correlation with the code problem, and further improving the accuracy of screening out the problem code of the target project from the project code of the target project based on the target processing path.

[0108] In an optional embodiment of the present specification, the above-mentioned filtering out the problem code of the target project from the project code of the target project according to the target processing path may include the following steps:

[0109] Generate code retrieval information based on code problems and target processing paths;

[0110] Retrieve candidate code snippets from the project code of the target project according to the code retrieval information;

[0111] Input the code problem and the candidate code snippet into the code location model to obtain the problem code location information;

[0112] Extract the problem code from the project code according to the problem code location information.

[0113] It should be noted that the code retrieval information is used to retrieve candidate code snippets from the project code of the target project. The code retrieval information is such as the code retrieval formula. The candidate code snippet refers to the candidate code snippet in the project code that meets the code retrieval information. The problem code location information is used to describe the location of the problem code in the project code. The code location model is used to generate the problem code location information based on the code problem and the candidate code snippet. The code location model can be a pre-trained large model, or it can be a neural network model trained based on sample problems, sample code snippets and sample location information.

[0114] In practical applications, there are many ways to generate code retrieval information based on the code problem and the target processing path, and the specific selection is based on the actual situation. The embodiments of this specification do not limit this. In one possible implementation of this specification, the code problem and the target processing path can be input into the code processing model to obtain code retrieval information. In another possible implementation of this specification, a retrieval information template corresponding to the code problem can be obtained, and the nodes in the target processing path can be added to the retrieval information template to obtain code retrieval information.

[0115] Furthermore, there are multiple ways to retrieve candidate code snippets from the project code of the target project based on the code retrieval information, and the specific selection is based on the actual situation. The embodiments of this specification do not impose any restrictions on this. In one possible implementation of this specification, the code retrieval information can be directly used to retrieve candidate code snippets from the complete project code. In another possible implementation of this specification, the retrieval file or function code corresponding to the code retrieval information can be first determined, and the candidate code snippet can be retrieved from the retrieval file or function code.

[0116] By applying the scheme of the embodiments of this specification, since the code retrieval information is obtained based on the code problem and the target processing path, the code retrieval information can accurately retrieve the candidate code fragments, and further use the code position information obtained from the candidate code fragments to locate the problem code, thereby ensuring the accuracy of the problem code.

[0117] In an optional embodiment of the present specification, before determining the problem code of the target project based on the code problem and the code knowledge graph of the target project, the following steps may also be included:

[0118] Get the project code of the target project;

[0119] Parse the project code and identify multiple code entities;

[0120] Construct a code hierarchy structure tree based on the contextual relationships of multiple code entities;

[0121] According to the reference relationship between multiple code entities, directed edges are added to the code hierarchy structure tree to obtain the code knowledge graph of the target project.

[0122] It should be noted that the code hierarchy tree is a tree structure diagram composed of code entities, including files, classes and functions. The code hierarchy tree can clearly describe the context and scope of the code. The hierarchy tree has the following characteristics: Single root node: The tree has a unique root node, which is the starting point of the tree. Branching structure: Each non-root node has exactly one parent node, and each node can have zero or more child nodes. Acyclic: There is no loop (loop) in the tree, which means that it is impossible to return to itself through a series of continuous edges from any node. Hierarchical: The relationship between nodes constitutes a hierarchical structure, and each node is in some sense above its child nodes. Through the hierarchy tree, the overall architecture of the project and the relationship between each code module can be clearly seen. According to the reference relationship between multiple code entities, directed edges are added to the code hierarchy tree, and a reference graph (ReferenceGraph) is added to the code hierarchy tree. Directed edges are used to indicate the relationship from one node to another. Through the reference graph, the call relationship and dependency path between project functions can be clearly seen. Optionally, because functions are the basic units of program execution, the calling relationships between functions directly affect the behavior and execution logic of the program, and too many reference relationships will increase the complexity of the graph structure, so the reference relationship may only involve functions in the code entity.

[0123] In practical applications, we can recursively traverse each code file of the project code, use the abstract syntax tree to parse the corresponding files separately, and obtain basic units such as classes and functions, including their names, code snippets, paths, and locations in the files. Then, we add these basic units as nodes to the code hierarchy tree from top to bottom. Finally, we analyze the reference relationship between functions and add corresponding directed edges to the graph to obtain the code knowledge graph of the target project. For example, if function a references function b, we add a directed edge from function a to function b in the graph.

[0124] The solution of the embodiment of this specification is applied, through a structured code knowledge graph, which not only improves the efficiency of locating problem codes, but also ensures the consistency and reliability of automated code processing.

[0125] Step 306: Input the code problem and the problem code into the code processing model to obtain an initial repair code.

[0126] In one or more embodiments of the present specification, after obtaining the code problems of the target project and locating the problem code corresponding to the code problems using the code knowledge graph, the code processing model can be further used to repair the problem code based on the code problems to obtain the initial repair code.

[0127] It should be noted that the code processing model refers to a deep learning model with code generation capabilities. The code processing model can be a pre-trained large model or a neural network model trained using multiple sample code problems, sample problem codes corresponding to multiple sample code problems, and sample repair codes. The initial repair code refers to the code obtained by repairing the code problems in the problem code. Ideally, the initial repair code will not have code problems.

[0128] In actual applications, there are many ways to input code problems and problem codes into the code processing model to obtain the initial repair code, which can be selected according to the actual situation. The embodiments of this specification do not impose any restrictions on this. In one possible implementation of this specification, the repair code generation prompt information, code problems and problem codes can be input into the code processing model to obtain the initial repair code output by the code processing model, wherein the repair code generation prompt information is set according to the actual situation, such as "You are a professional programmer, please fix the code problems in the problem code and output the initial repair code". In another possible implementation of this specification, a before-after mode can be adopted, in which the code processing model first repeatedly generates a part of the problem code to assist the code processing model in locating the code to be patched in the problem code, and then uses the code processing model to repair the code to be patched in the problem code to obtain the patch code, and finally generates the initial repair code according to the code to be patched obtained in the before stage and the patch code obtained in the after stage.

[0129] In an optional embodiment of the present specification, the above-mentioned inputting the code problem and the problem code into the code processing model to obtain the initial repair code may include the following steps:

[0130] Input the positioning prompt information, the code problem and the problem code into the code processing model to obtain the code to be repaired in the problem code;

[0131] Input the patch prompt information and the code to be patched into the code processing model to obtain the patch code;

[0132] The patch code is used to replace the code to be patched in the problem code to obtain the initial repair code.

[0133] It should be noted that the positioning prompt information is used to prompt the code processing model to locate the code to be patched in the problem code based on the code problem. The positioning prompt information is set according to the actual situation, such as "You are a professional code developer, please locate the code corresponding to the code problem in the problem code, and output the located code as the code to be patched." The patch prompt information is used to prompt the code processing model to generate patch code for the code to be patched. The code to be patched refers to the code snippet in the problem code that needs to be corrected or improved. Patch code refers to the code snippet written to repair or improve the code to be patched. The goal of the patch code is to solve the problem of the code to be patched and restore the code to a normal or better working state. The patch code can be as small as a change in one line of code, or it can be a complex refactoring code.

[0134] Exemplarily, it is assumed that the problem code includes three code fragments, which are code fragment 1, code fragment 2 and code fragment 3. The positioning prompt information, the code problem and the problem code are input into the code processing model, and the code to be patched in the problem code is obtained as code fragment 2. The patch prompt information and the code to be patched are input into the code processing model, and the patch codes are obtained as patch code 4 and patch code 5. The patch codes are used to replace the code to be patched in the problem code, and the initial repair code includes four code fragments, which are code fragment 1, patch code 4, patch code 5 and code fragment 3.

[0135] By applying the solution of the embodiments of this specification, the code processing model is used to first determine the code to be repaired in the problem code, and then the code processing model is used to generate accurate patch code corresponding to the code to be repaired, so as to repair the problem code more accurately and improve the accuracy of the initial repair code.

[0136] Step 308: Use the test code to test the initial repair code. If the test passes, obtain the target repair code for the code problem, wherein the test code is obtained based on the code problem and is used to reproduce the code problem.

[0137] In one or more embodiments of the present specification, code problems of the target project are obtained, problem codes corresponding to the code problems are determined, and the problem codes are repaired using a code processing model to obtain initial repair codes. Then, in order to ensure the accuracy of the initial repair codes, the initial repair codes can be tested for problems using test codes, and it is determined whether to use the initial repair codes as the final target repair codes based on the test results.

[0138] It should be noted that since the test code can reproduce the code problem, the test code can be called the reproduction code, that is, the code used to reproduce the code problem. The target repair code refers to the accurate code obtained after solving the code problem in the problem code. The code problem will not appear after the target repair code is run.

[0139] By applying the solution of the embodiments of this specification, the problem code is determined through the code knowledge graph, so that the structure and dependencies of the code of the target project can be better understood, the accuracy of the problem code can be improved, and the code processing model can be used to automatically repair the code to achieve efficient code processing. In addition, the initial repair code is tested with the test code to avoid code problems in the target repair code, thereby ensuring the correctness of the target repair code, reducing the code maintenance cost, and further improving the code processing efficiency.

[0140] In practical applications, there are many ways to test the initial repair code using the test code, which can be selected according to the actual situation, and the embodiments of this specification do not limit this. In one possible implementation of this specification, the similarity between the test code and the initial repair code can be calculated, and when the similarity is less than a similarity threshold, it is determined that the initial repair code test has passed.

[0141] In another possible implementation of the present specification, it can be determined whether the initial repair code has passed the test according to the test running log of the test code and the initial running log of the initial repair code. That is, the above-mentioned testing of the initial repair code by using the test code can include the following steps:

[0142] Run the test code to obtain a test run log of the test code, and run the initial repair code to obtain an initial run log of the initial repair code, wherein the test run log includes test code problems of the test code;

[0143] In the case that no test code problem appears in the initial operation log, the test result of the initial repair code is determined to be a test pass.

[0144] It should be noted that the test run log refers to the record file generated during the test code running process. The initial run log refers to the record file generated during the initial repair code running process. The record file records the status and activities of the code when it is running, which can be used for code problem diagnosis, exception tracking, etc.

[0145] In actual applications, after obtaining the test run log of the test code and the initial run log of the initial repair code, since the test code can reproduce the code problems of the target project, if the initial run log includes the test code problem, it means that the initial repair code still has a code problem, and the test result of the initial repair code is a test failure. At this time, you can return to re-process the code. Optionally, when the test result is a test failure, it means that the code repair capability of the code processing model is poor, and the model parameters of the code processing model can be adjusted to make the code processing model more accurate. If there is no test code problem in the initial run log, it means that the initial repair code does not have a code problem, and the test result of the initial repair code is a test pass. The initial repair code can be directly determined as the target repair code.

[0146] By applying the solution of the embodiment of this specification, the correctness of the initial repair code is ensured by using the test code to verify whether there is a code problem in the initial repair code.

[0147] In an optional embodiment of the present specification, after the code problem and the problem code are input into the code processing model to obtain the initial repair code, the following steps may also be included:

[0148] Perform functional testing on the initial repair code to obtain functional testing results;

[0149] The initial repair code is tested using the test code. If the test passes, the target repair code for the code problem is obtained, which may include the following steps:

[0150] When the function test result is that the function test has passed, the initial repair code is tested using the test code, and when the test has passed, the target repair code for the code problem is obtained.

[0151] It should be noted that when repairing the problem code, on the one hand, the test code can be used to test the initial repair code to ensure that the problem code no longer has code problems. On the other hand, it can also ensure that the initial repair code obtained after the repair has the same function as the problem code. Therefore, after obtaining the initial repair code, the initial repair code can be functionally tested. The main goal of functional testing is to ensure that the function of the initial repair code is the same as the problem code and can operate normally. Functional testing methods include but are not limited to regression testing, unit testing, and integration testing. The specific selection is based on actual conditions, and the embodiments of this specification do not impose any restrictions on this. The results of functional testing include functional testing passed and functional testing failed. The passing of the functional testing indicates that the code function of the initial repair code is the same as the code function of the problem code. The failure of the functional testing indicates that the code function of the initial repair code is different from the code function of the problem code.

[0152] In actual applications, the initial repair code can be functionally tested before the initial repair code is tested with the test code. The initial repair code can also be functionally tested after the initial repair code is tested with the test code, that is, the code problem and the problem code are input into the code processing model to obtain the initial repair code, and the initial repair code is tested with the test code. If the test passes, the initial repair code is functionally tested to obtain the functional test result. If the functional test result is that the functional test passes, the initial repair code is determined as the target repair code.

[0153] By applying the solution of the embodiments of this specification, the initial repair code is subjected to functional detection and problem testing, and it is ensured that the repaired code has the same function as the code before the repair and no code problems occur, thereby improving the accuracy of code repair and the stability of the code.

[0154] In an optional embodiment of the present specification, before using the test code to test the initial repair code, the test code can be obtained first. There are many ways to obtain the test code, and the specific selection is based on the actual situation. The embodiments of this specification do not impose any restrictions on this. In a possible implementation method of the present specification, a candidate test code with a problem label that is the same as the code problem can be selected from the test code library, and the candidate test code is determined as the test code, wherein the test code library includes multiple candidate test codes, and each candidate test code carries a problem label.

[0155] In another possible implementation of the present specification, the code processing model may be used to generate test code, that is, the above-mentioned test code is used to test the initial repair code. If the test passes, before obtaining the target repair code of the code problem, the following steps may be further included:

[0156] Input the test generation prompt information and code problems into the code processing model to obtain the initial test code;

[0157] Running the initial test code to obtain an initial running log of the initial test code, wherein the initial running log includes initial code problems of the initial test code;

[0158] In the event that the initial code problem and the code problem are the same, the initial test code is determined as the test code.

[0159] It should be noted that the test generation prompt information is used to prompt the code processing model to generate initial test code with code problems. The test generation prompt information is set according to the actual situation, such as "You are a professional code developer, please write an initial test code with the above code problems."

[0160] In actual applications, after the code processing model outputs the initial test code, in order to ensure that the initial test code can successfully reproduce the code problem of the target project, the initial test code can be run, the running log of the initial test code can be obtained, and it can be determined whether the initial code problem in the initial running log is the same as the code problem of the target project. If they are the same, it means that the initial test code can successfully reproduce the code problem of the target project. At this time, the initial test code can be directly determined as the test code. If they are not the same, it means that the initial test code cannot successfully reproduce the code problem of the target project. At this time, the initial test code can be regenerated, or the test code can be adjusted based on the initial running log to obtain the initial test code that can successfully reproduce the code problem.

[0161] By applying the solution of the embodiments of this specification, since the initial test code is generated by the code processing model based on the code problem, the efficiency of obtaining the initial test code is improved, and whether the initial code problem of the initial test code is the same as the code problem is determined, which ensures that the test code can successfully reproduce the code problem, and further ensures the accuracy of the target repair code.

[0162] In an optional embodiment of the present specification, after the above-mentioned running of the initial test code and obtaining the initial running log of the initial test code, the following steps may also be included:

[0163] When the initial code problem and the code problem are different, the initial test code is adjusted according to the initial operation log until the initial code problem and the code problem of the adjusted initial test code are the same, and the adjusted initial test code is determined as the test code.

[0164] It should be noted that if the initial code problem of the initial test code is different from the code problem, it means that the initial test code cannot successfully reproduce the code problem of the target project, and the initial test code at this time cannot be used as the test code to test the repaired code. Therefore, the initial test code can be adjusted according to the initial operation log until the initial code problem of the adjusted initial test code is the same as the code problem, and the adjusted initial test code is determined as the test code.

[0165] In actual applications, there are many ways to adjust the initial test code based on the initial operation log, such as adding or deleting specific code paths, changing conditional judgment statements in the initial test code, adjusting variable values, etc. The specific selection depends on the actual situation, and the embodiments of this specification do not impose any limitations on this.

[0166] By applying the solution of the embodiments of this specification, the initial test code is adjusted based on the code problem and the initial code problem, ensuring that the final test code can successfully reproduce the code problem, further ensuring the accuracy of the target repair code.

[0167] See also Figure 4 , Figure 4 A flowchart of a processing process of a code processing method provided by an embodiment of the present specification is shown. The code processing process may include three stages: code knowledge graph construction, code knowledge understanding, and code processing. The above three stages are described in detail below.

[0168] Code knowledge graph construction: compress the complex code base information in the target project's code base into a hierarchical structure tree and reference graph to obtain a code knowledge graph (such as Figure 4 The code knowledge graph shown in the figure, in which circles represent nodes, solid arrows connect circles to form a hierarchical structure tree, and dotted arrows represent reference relationships between nodes), specifically, the project code is parsed to determine multiple code entities; according to the contextual relationships between the multiple code entities, a code hierarchical structure tree is constructed; according to the reference relationships between the multiple code entities, directed edges are added to the code hierarchical structure tree to obtain the code knowledge graph of the target project;

[0169] Code base knowledge understanding: Using the MCTS-based code base exploration strategy, we narrow the search scope of the code knowledge graph and explore the target processing paths that are more important for solving code problems from the code knowledge graph. Specifically, the MCTS process starts from the root node representing the code base and unfolds through four iterative stages: selection, association expansion, simulation and evaluation, and backpropagation and reference expansion. The selection stage starts from the root node and recursively selects child nodes until the leaf node is reached, thereby constructing a code processing subgraph; in the association expansion stage, the leaf nodes in the code processing subgraph are expanded to merge new nodes in the code knowledge graph. For example, the child nodes of the current leaf node are determined in the code knowledge graph, and the child nodes with higher similarity to the code problem are selected in the substage as new expansion nodes of the leaf nodes of the code processing subgraph. After the expansion is completed, the simulation and evaluation stage is entered. In the simulation and evaluation stage, starting from the newly expanded node, simulation is performed along possible processing paths to evaluate the effectiveness of these paths in solving code problems and obtain similarity indicators. After the simulation and evaluation phases, the back-propagation reference expansion phase begins. Specifically, similar indicators are propagated from leaf nodes to root nodes from the bottom up to fully capture the correlation between the processing path and the code problem and obtain the target processing path.

[0170] Code processing: The code processing stage can be divided into the problem code location stage, the patch generation stage, and the code testing stage. These stages are explained below. In the problem code location stage, the code processing model is used to analyze and summarize the target processing path and code problems, generate a code base summary (including plans and analysis results) to solve the code problems, and dynamically obtain code retrieval information from the code base by calling the search interface through the ReAct mechanism. RAG technology is used to search the code base, and software engineering tools such as SBFL are combined to assist in locating the problem code. In the patch generation stage, the before-after mode is adopted, the patch code is generated using the code processing model, and the syntax detection tool is used to perform syntax checking and automatic correction on the patch code to obtain the initial repair code. In the code testing stage, the code processing model is used to automatically extract the test code corresponding to the code problem and run the test code. The code problem, test code, and test code test run log are used to determine whether the code problem is successfully reproduced. In the case of successful reproduction of the code problem, integration testing and test code verification are used to ensure that the generated initial repair code is correct and does not destroy the original code function, and the target repair code is obtained.

[0171] By applying the solution of the embodiment of this specification, by constructing a code knowledge graph and using the MCTS exploration strategy, the structure and dependencies of the entire code base can be better understood, and the global understanding of complex project codes can be improved. Combining RAG technology and SBFL method, the location of the bug can be more accurately located, and the problem code can be accurately located. From problem code location to patch generation to code testing stage, end-to-end automated software engineering is achieved, and code processing models are introduced at multiple stages, so that the code processing system is a multi-agent system, which improves code processing efficiency. In addition, the solution proposed in the embodiment of this specification can achieve 33.0% SOTA performance in the SWE-bench Lite benchmark test, greatly shortening the bug repair cycle.

[0172] It is worth noting that the solution provided in the embodiments of this specification can improve the degree of automation of software repair. When dealing with extremely complex problems or problems that require deep domain knowledge, it can also accept expert manual intervention (such as manual review of code repair effects) to ensure that the generated patch code meets the quality standards and security requirements of the project.

[0173] See also Figure 5 , Figure 5 A flowchart of a code repair test method provided by an embodiment of this specification is shown, which specifically includes the following steps:

[0174] Step 502: Obtain code problems and initial repair codes of the target project, wherein the initial repair code is obtained by processing the code processing model based on code problems and problem codes, and the problem code is obtained based on the code problems and the code knowledge graph of the target project, and the code knowledge graph is used to characterize the code context relationship and code reference relationship of the target project.

[0175] Step 504: Use the test code to test the initial repair code. If the test passes, obtain the target repair code for the code problem, wherein the test code is obtained based on the code problem and is used to reproduce the code problem.

[0176] It should be noted that the implementation method of step 504 is the same as the implementation method of the above step 308, and will not be described in detail in this embodiment of the specification.

[0177] In actual applications, there are many ways to obtain the code problems and initial repair codes of the target project, which can be selected according to the actual situation. The embodiments of this specification do not impose any restrictions on this. In one possible implementation of this specification, the code problems of the target project sent by the client can be received, and the problem code of the target project can be determined based on the code problems and the code knowledge graph of the target project. The code problems and the problem codes are input into the code processing model to obtain the initial repair code. In another possible implementation of this specification, the code problems and initial repair codes of the target project can be read from other data acquisition devices or databases. Optionally, the initial repair code can be obtained by manual repair based on the code problems.

[0178] By applying the solution of the embodiments of the present specification, since the test code is obtained based on the code problem, the code problem can be reproduced. Therefore, by using the test code to test the initial repair code, it is possible to accurately determine whether the code problem of the initial repair code has been repaired, avoid code problems in the target repair code, ensure the correctness of the target repair code, reduce code maintenance costs, and further improve code processing efficiency.

[0179] See also Figure 6 , Figure 6 A flowchart of another code processing method provided by an embodiment of the present specification is shown. The code processing method is applied to a task platform and specifically includes the following steps:

[0180] Step 602: Receive the code problem of the target project sent by the client.

[0181] Step 604: Determine the problem code of the target project based on the code problem and the code knowledge graph of the target project, wherein the code knowledge graph is used to characterize the code context relationship and code reference relationship of the target project.

[0182] Step 606: Input the code problem and the problem code into the code processing model to obtain an initial repair code.

[0183] Step 608: Use the test code to test the initial repair code. If the test passes, obtain the target repair code for the code problem, wherein the test code is obtained based on the code problem and is used to reproduce the code problem.

[0184] It should be noted that the implementation of step 602 to step 608 is the same as the implementation of step 302 to step 308, and this specification embodiment will not be repeated. The task platform can be deployed on the terminal side device or on the cloud side device, and it is set according to the actual situation. This specification embodiment does not make any limitation on this.

[0185] By applying the solution of the embodiments of this specification, the task platform determines the problem code through the code knowledge graph, so as to better understand the structure and dependencies of the code of the target project, improve the accuracy of the problem code, and use the code processing model to automatically repair the code to achieve efficient code processing. In addition, the initial repair code is tested with the test code to avoid code problems in the target repair code, thereby ensuring the correctness of the target repair code, reducing the code maintenance cost, and further improving the code processing efficiency.

[0186] In an optional embodiment of the present specification, before inputting the code problem and the problem code into the code processing model to obtain the initial repair code, the following steps may also be included:

[0187] Based on a model request, a code processing model is determined from a plurality of processing models, wherein the model request includes a scene identifier of a target scene, scene input data of the target scene, and at least one of a model specification parameter.

[0188] It should be noted that the model request can be a request sent by the user to the task platform through the client to determine the code processing model. Based on the model request, there are multiple ways to determine the code processing model from multiple processing models, and the specific selection is based on the actual situation. The embodiments of this specification do not impose any restrictions on this. In one possible implementation of this specification, based on the model request, the corresponding code processing model can be searched from at least one processing model included in the model library; in another possible implementation of this specification, based on the model request, the code processing model can be trained and obtained; in another optional method of this specification, the code processing model can be constructed based on the model request.

[0189] Exemplarily, based on the scenario identification of the target scenario, at least one pre-trained processing model can be searched from the model library, and then based on the model specification parameters, an initial processing model can be screened from at least one processing model. Then, based on the scenario input data of the target scenario, the screened initial processing model can be trained to obtain a code processing model suitable for user needs.

[0190] The solution of the embodiment of this specification is applied to obtain the code processing model according to user needs, realize personalized model service, and provide users with an efficient, flexible and easy-to-use code service method based on the code processing model, thereby improving the user experience.

[0191] In an optional embodiment of the present specification, the model request includes a scene identifier of a target scene; and determining the code processing model from a plurality of processing models based on the model request may include the following steps:

[0192] Based on the scenario identifier of the target scenario, a code processing model suitable for the target scenario is searched from a model library, wherein the model library stores a plurality of processing models suitable for different task scenarios.

[0193] It should be noted that the scenario identifier refers to a unique or specific label used to distinguish different task scenarios. The model library is a database for storing and managing various pre-trained deep learning models. Multiple processing models adapted to different task scenarios cover different application scenarios and requirements. Each model is optimized for a specific application environment. The model library allows users to select the appropriate model according to their needs, or directly use the model for code task processing through the application programming interface.

[0194] By applying the solution of the embodiments of this specification, based on scenario requirements, the code processing model suitable for the scenario is accurately found through scenario identification, so that the code processing is more accurate and more in line with the scenario, thereby improving the user experience and code processing quality.

[0195] In an optional embodiment of the present specification, the model request includes scene input data of the target scene; and the above-mentioned determining the code processing model from multiple processing models based on the model request may include the following steps:

[0196] Determine an initial processing model suitable for the target scenario from among multiple processing models;

[0197] Based on the scenario input data of the target scenario, the initial processing model is trained to obtain the code processing model.

[0198] It should be noted that the initial processing model refers to the model that is applicable to the target scenario among multiple processing models. The initial processing model may not only be applicable to the target scenario, but also to other scenarios. It is a general processing model that can be applied to different scenarios. Code processing can be performed using the initial processing model, but the effect may not be very good. At this time, the initial processing model can be optimized based on the scenario input data of the target scenario. The scenario input data of the target scenario can be understood as the sample data of the sample code task in the target scenario (including sample code problems, sample problem codes, and sample repair codes).

[0199] By applying the solution of the embodiments of this specification, based on scenario requirements, a general initial processing model is further trained through scenario input data to obtain a code processing model adapted to the scenario, so that the code processing model is more in line with the scenario, thereby improving the user experience and the processing quality of code tasks.

[0200] In an optional embodiment of the present specification, the model request includes model specification parameters; and determining the code processing model from the plurality of processing models based on the model request may include the following steps:

[0201] Based on the model specification parameters, a corresponding code processing model is searched from a model library, wherein the model library stores a plurality of processing models with different model specification parameters.

[0202] It should be noted that model specification parameters refer to various parameters that define the structure and behavior of the model. These parameters can be roughly divided into two categories: model parameters (learnable parameters) and hyperparameters. Model parameters refer to parameters that are automatically adjusted by the back-propagation algorithm during model training, including but not limited to weight matrices (weights) and biases (biases). For example, in a simple fully connected layer, the weight matrix is ​​a two-dimensional tensor that connects the neurons in the input layer and the output layer; the bias term is a one-dimensional vector that provides an additional offset value for each output neuron. Hyperparameters refer to parameters set before starting model training to control the learning process and architecture of the model. Hyperparameters include but are not limited to learning rate and the number of neurons per layer (Number of Neurons per Layer), which should be selected according to actual conditions.

[0203] By applying the solution of the embodiments of this specification, the corresponding code processing model can be accurately found based on the model specification parameters, thereby ensuring the efficient and stable operation of the code processing model and improving the user experience.

[0204] See also Figure 7 , Figure 7 A schematic diagram of the structure of a task platform provided by an embodiment of the present specification is shown, and the task platform includes a request interface 702 and a response unit 704;

[0205] Request interface 702, used to receive the code problem of the target project sent by the client;

[0206] The response unit 704 is used to determine the problem code of the target project based on the code problem and the code knowledge graph of the target project, wherein the code knowledge graph is used to characterize the code context relationship and code reference relationship of the target project; input the code problem and the problem code into the code processing model to obtain the initial repair code; use the test code to test the initial repair code, and if the test passes, obtain the target repair code of the code problem, wherein the test code is obtained based on the code problem, and the test code is used to reproduce the code problem.

[0207] By applying the solution of the embodiments of this specification, the task platform adapts to user needs to obtain code processing models, realizes personalized model services, provides users with an efficient, flexible and easy-to-use code service platform, and improves user experience.

[0208] The above is a schematic scheme of a task platform of this embodiment. It should be noted that the technical scheme of the task platform and the technical scheme of the above code processing method belong to the same concept, and the details not described in detail in the technical scheme of the task platform can be found in the description of the technical scheme of the above code processing method.

[0209] Corresponding to the above-mentioned code processing method embodiment, this specification also provides a code processing device embodiment, Figure 8 FIG. 1 shows a schematic diagram of the structure of a code processing device provided by an embodiment of the present specification. Figure 8 As shown, the device comprises:

[0210] A first acquisition module 802 is configured to acquire code issues of a target project;

[0211] A first determination module 804 is configured to determine the problem code of the target project according to the code problem and the code knowledge graph of the target project, wherein the code knowledge graph is used to characterize the code context relationship and the code reference relationship of the target project;

[0212] A first input module 806 is configured to input the code problem and the problem code into the code processing model to obtain an initial repair code;

[0213] The first test module 808 is configured to test the initial repair code using the test code, and obtain the target repair code for the code problem if the test passes, wherein the test code is obtained based on the code problem and is used to reproduce the code problem.

[0214] Optionally, the device also includes: a running module, configured to input test generation prompt information and code problems into a code processing model to obtain initial test code; run the initial test code to obtain an initial running log of the initial test code, wherein the initial running log includes initial code problems of the initial test code; when the initial code problem and the code problem are the same, determine the initial test code as the test code.

[0215] Optionally, the device also includes: an adjustment module, configured to adjust the initial test code according to the initial operation log when the initial code problem and the code problem are different, until the initial code problem of the adjusted initial test code is the same as the code problem, and determine the adjusted initial test code as the test code.

[0216] Optionally, the device also includes: a third test module, configured to perform a functional test on the initial repair code to obtain a functional test result; the first test module 808 is further configured to test the initial repair code using the test code when the functional test result is that the functional test passes, and obtain the target repair code for the code problem when the test passes.

[0217] Optionally, the first test module 808 is further configured to run the test code, obtain a test running log of the test code, and run the initial repair code to obtain an initial running log of the initial repair code, wherein the test running log includes test code problems of the test code; if no test code problems appear in the initial running log, the test result of the initial repair code is determined to be a passed test.

[0218] Optionally, the first input module 806 is further configured to input the positioning prompt information, code problem and problem code into the code processing model to obtain the code to be patched in the problem code; input the patch prompt information and the code to be patched into the code processing model to obtain the patch code; and use the patch code to replace the code to be patched in the problem code to obtain the initial repair code.

[0219] Optionally, the first determination module 804 is further configured to construct a code processing subgraph based on the code problem and the code knowledge graph of the target project, wherein the code processing subgraph includes multiple processing paths; based on the code problem, filter out a target processing path from the multiple processing paths; based on the target processing path, filter out the problem code of the target project from the project code of the target project.

[0220] Optionally, the first determination module 804 is further configured to search for leaf nodes corresponding to multiple processing paths in the code knowledge graph respectively; calculate similarity indicators between the leaf nodes and the code problems; and filter out a target processing path from the multiple processing paths based on the similarity indicators.

[0221] Optionally, the first determination module 804 is further configured to generate code retrieval information based on the code problem and the target processing path; retrieve candidate code snippets from the project code of the target project based on the code retrieval information; input the code problem and the candidate code snippets into the code location model to obtain problem code location information; and extract the problem code from the project code based on the problem code location information.

[0222] Optionally, the device also includes: a construction module configured to obtain the project code of the target project; perform grammatical parsing on the project code to determine multiple code entities; construct a code hierarchy structure tree based on the contextual relationship between the multiple code entities; add directed edges to the code hierarchy structure tree based on the reference relationship between the multiple code entities to obtain a code knowledge graph for the target project.

[0223] By applying the solution of the embodiments of this specification, the problem code is determined through the code knowledge graph, so that the structure and dependencies of the code of the target project can be better understood, the accuracy of the problem code can be improved, and the code processing model can be used to automatically repair the code to achieve efficient code processing. In addition, the initial repair code is tested with the test code to avoid code problems in the target repair code, thereby ensuring the correctness of the target repair code, reducing the code maintenance cost, and further improving the code processing efficiency.

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

[0225] Corresponding to the above-mentioned code repair test method embodiment, this specification also provides a code repair test device embodiment, Fig. 9 FIG. 1 is a schematic diagram showing the structure of a code repair test device provided by an embodiment of the present specification. Fig. 9 As shown, the device comprises:

[0226] The second acquisition module 902 is configured to acquire code problems and initial repair codes of the target project, wherein the initial repair codes are obtained by the code processing model based on code problems and problem codes, and the problem codes are obtained based on code problems and a code knowledge graph of the target project, and the code knowledge graph is used to characterize code context relationships and code reference relationships of the target project;

[0227] The second test module 904 is configured to test the initial repair code using the test code, and obtain the target repair code for the code problem when the test passes, wherein the test code is obtained based on the code problem and is used to reproduce the code problem.

[0228] By applying the solution of the embodiments of the present specification, since the test code is obtained based on the code problem, the code problem can be reproduced. Therefore, by using the test code to test the initial repair code, it is possible to accurately determine whether the code problem of the initial repair code has been repaired, avoid code problems in the target repair code, ensure the correctness of the target repair code, reduce code maintenance costs, and further improve code processing efficiency.

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

[0230] Corresponding to the above-mentioned code processing method embodiment applied to the task platform, this specification also provides a code processing device embodiment applied to the task platform, Fig.10 FIG. 2 shows a schematic diagram of the structure of another code processing device provided by an embodiment of the present specification. Fig.10 As shown, the device comprises:

[0231] The receiving module 1002 is configured to receive a code problem of a target project sent by a client;

[0232] The second determination module 1004 is configured to determine the problem code of the target project according to the code problem and the code knowledge graph of the target project, wherein the code knowledge graph is used to characterize the code context relationship and the code reference relationship of the target project;

[0233] The second input module 1006 is configured to input the code problem and the problem code into the code processing model to obtain an initial repair code;

[0234] The third test module 1008 is configured to test the initial repair code using the test code, and obtain the target repair code for the code problem when the test passes, wherein the test code is obtained based on the code problem and is used to reproduce the code problem.

[0235] By applying the solution of the embodiments of this specification, the task platform determines the problem code through the code knowledge graph, so as to better understand the structure and dependencies of the code of the target project, improve the accuracy of the problem code, and use the code processing model to automatically repair the code to achieve efficient code processing. In addition, the initial repair code is tested with the test code to avoid code problems in the target repair code, thereby ensuring the correctness of the target repair code, reducing the code maintenance cost, and further improving the code processing efficiency.

[0236] The above is a schematic scheme of a code processing device of this embodiment. It should be noted that the technical scheme of the code processing device and the technical scheme of the code processing method applied to the task platform mentioned above belong to the same concept, and the details not described in detail in the technical scheme of the code processing device can be found in the description of the technical scheme of the code processing method applied to the task platform mentioned above.

[0237] Fig.11The structure block diagram of a computing device provided by an embodiment of the present specification is shown. The components of the computing device 1100 include but are not limited to a memory 1110 and a processor 1120. The processor 1120 is connected to the memory 1110 via a bus 1130, and the database 1150 is used to store data.

[0238] The computing device 1100 also includes an access device 1140 that enables the computing device 1100 to communicate via one or more networks 1160. Examples of these networks include a 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 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world microwave interconnection 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.

[0239] In one embodiment of the present specification, the above components of the computing device 1100 and Fig.11 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.11 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0240] The computing device 1100 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing 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 smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 1100 may also be a mobile or stationary server.

[0241] The processor 1120 is used to execute a computer program / instruction, which implements the steps of the above-mentioned code processing method or code repair testing method when executed by the processor.

[0242] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned code processing method and code repair test method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned code processing method or code repair test method.

[0243] An embodiment of the present specification also provides a computer-readable storage medium storing a computer program / instruction, which implements the steps of the above-mentioned code processing method or code repair testing method when executed by a processor.

[0244] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned code processing method and code repair test method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned code processing method or code repair test method.

[0245] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned code processing method or code repair testing method when executed by a processor.

[0246] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the above-mentioned code processing method and code repair test method belong to the same concept, and the details not described in detail in the technical scheme of the computer program product can be referred to the description of the technical scheme of the above-mentioned code processing method or code repair test method.

[0247] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0248] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0249] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0250] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0251] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can understand and use this specification well. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A code processing method, comprising: Get the code issues of the target project; Determine the problem code of the target project according to the code problem and the code knowledge graph of the target project, wherein the code knowledge graph is used to characterize the code context relationship and code reference relationship of the target project, and the problem code is screened from the project code of the target project based on a target processing path, and the target processing path is a processing path in the code knowledge graph that has a high similarity to the code problem; Inputting the code problem and the problem code into a code processing model to obtain an initial repair code output by the code processing model; The initial repair code is tested using the test code, and when the test passes, a target repair code for the code problem is obtained, wherein the test code is obtained based on the code problem, the test code is used to reproduce the code problem, and the target repair code does not have the code problem.

2. The method according to claim 1, wherein the initial repair code is tested using the test code, and if the test passes, before obtaining the target repair code for the code problem, the method further comprises: Inputting the test generation prompt information and the code problem into the code processing model to obtain an initial test code; Run the initial test code to obtain an initial running log of the initial test code, wherein the initial running log includes initial code problems of the initial test code; In a case where the initial code problem and the code problem are the same, the initial test code is determined as a test code.

3. The method according to claim 2, after running the initial test code and obtaining the initial running log of the initial test code, further comprises: In the case where the initial code problem and the code problem are different, the initial test code is adjusted according to the initial operation log until the initial code problem of the adjusted initial test code is the same as the code problem, and the adjusted initial test code is determined as the test code.

4. The method according to claim 1, after inputting the code problem and the problem code into a code processing model to obtain an initial repair code, further comprising: Performing a function test on the initial repair code to obtain a function test result; The step of testing the initial repair code with the test code and obtaining the target repair code for the code problem when the test passes includes: When the function test result is that the function test has passed, the initial repair code is tested using the test code, and when the test has passed, the target repair code for the code problem is obtained.

5. The method according to claim 1 or 4, wherein the testing of the initial repair code by using the test code comprises: Run the test code to obtain a test run log of the test code, and run the initial repair code to obtain an initial run log of the initial repair code, wherein the test run log includes test code problems of the test code; In a case where the test code problem does not appear in the initial operation log, the test result of the initial repair code is determined to be a test pass.

6. The method according to claim 1, wherein the step of inputting the code problem and the problem code into a code processing model to obtain an initial repair code comprises: Inputting the positioning prompt information, the code problem and the problem code into the code processing model to obtain the code to be repaired in the problem code; Inputting the patch prompt information and the code to be patched into the code processing model to obtain the patch code; The patch code is used to replace the code to be repaired in the problem code to obtain an initial repair code.

7. The method according to claim 1, wherein determining the problem code of the target project according to the code problem and the code knowledge graph of the target project comprises: Constructing a code processing subgraph according to the code problem and the code knowledge graph of the target project, wherein the code processing subgraph includes multiple processing paths; According to the code problem, screening out a target processing path from the multiple processing paths; According to the target processing path, the problem code of the target project is screened out from the project code of the target project.

8. The method according to claim 7, wherein the step of selecting a target processing path from the plurality of processing paths according to the code problem comprises: In the code knowledge graph, searching for leaf nodes corresponding to the multiple processing paths respectively; Calculating a similarity index between the leaf node and the code problem; A target processing path is screened out from the multiple processing paths according to the similarity index.

9. The method according to claim 7, wherein the step of filtering out the problem code of the target project from the project code of the target project according to the target processing path comprises: Generate code retrieval information according to the code problem and the target processing path; Retrieving candidate code snippets from the project code of the target project according to the code retrieval information; Input the code problem and the candidate code snippet into a code location model to obtain problem code location information; Extract the problem code from the project code according to the problem code location information.

10. The method according to claim 1, before determining the problem code of the target project according to the code problem and the code knowledge graph of the target project, further comprising: Obtaining the project code of the target project; Performing syntax analysis on the project code to determine multiple code entities; Constructing a code hierarchy structure tree according to the contextual relationship of the plurality of code entities; According to the reference relationship between the multiple code entities, directed edges are added to the code hierarchy structure tree to obtain the code knowledge graph of the target project.

11. A code repair testing method, comprising: Obtain code problems and initial repair codes for a target project, wherein the initial repair codes are obtained by a code processing model based on the code problems and the problem codes, the problem codes are obtained based on the code problems and the code knowledge graph of the target project, the code knowledge graph is used to characterize the code context relationship and code reference relationship of the target project, the problem codes are screened from the project code of the target project based on a target processing path, and the target processing path is a processing path in the code knowledge graph that has a high similarity to the code problem; The initial repair code is tested using the test code, and when the test passes, a target repair code for the code problem is obtained, wherein the test code is obtained based on the code problem, the test code is used to reproduce the code problem, and the target repair code does not have the code problem.

12. A code processing method, applied to a task platform, comprising: The code problem of receiving the target project sent by the client; Determine the problem code of the target project according to the code problem and the code knowledge graph of the target project, wherein the code knowledge graph is used to characterize the code context relationship and code reference relationship of the target project, and the problem code is screened from the project code of the target project based on a target processing path, and the target processing path is a processing path in the code knowledge graph that has a high similarity to the code problem; Inputting the code problem and the problem code into a code processing model to obtain an initial repair code output by the code processing model; The initial repair code is tested using the test code, and when the test passes, a target repair code for the code problem is obtained, wherein the test code is obtained based on the code problem, the test code is used to reproduce the code problem, and the target repair code does not have the code problem.

13. The method according to claim 12, before inputting the code problem and the problem code into a code processing model to obtain an initial repair code, further comprising: Based on a model request, a code processing model is determined from a plurality of processing models, wherein the model request includes a scene identifier of a target scene, scene input data of the target scene, and at least one of a model specification parameter.

14. The method according to claim 13, wherein the model request includes a scene identifier of a target scene; The step of determining a code processing model from a plurality of processing models based on the model request includes: Based on the scenario identifier of the target scenario, a code processing model suitable for the target scenario is searched from a model library, wherein the model library stores a plurality of processing models suitable for different task scenarios.

15. The method according to claim 13, wherein the model request includes scene input data of the target scene; The step of determining a code processing model from a plurality of processing models based on the model request includes: Determining an initial processing model adapted to the target scenario from a plurality of processing models; Based on the scene input data of the target scene, the initial processing model is trained to obtain a code processing model.

16. The method of claim 13, wherein the model request comprises model specification parameters; The step of determining a code processing model from a plurality of processing models based on the model request includes: Based on the model specification parameters, a corresponding code processing model is searched from a model library, wherein the model library stores a plurality of processing models with different model specification parameters.

17. A task platform, comprising a request interface and a response unit; The request interface is used to receive the code problem of the target project sent by the client; The response unit is used to determine the problem code of the target project based on the code problem and the code knowledge graph of the target project, wherein the code knowledge graph is used to characterize the code context relationship and the code reference relationship of the target project, and the problem code is screened from the project code of the target project based on a target processing path, and the target processing path is a processing path in the code knowledge graph that has a high similarity with the code problem; input the code problem and the problem code into a code processing model to obtain an initial repair code output by the code processing model; use a test code to test the initial repair code, and if the test passes, obtain a target repair code for the code problem, wherein the test code is obtained based on the code problem, the test code is used to reproduce the code problem, and the target repair code does not have the code problem.

18. A code processing system, comprising a client and a server; The client is used to send the code problem of the target project to the server; The server is used to determine the problem code of the target project according to the code problem and the code knowledge graph of the target project, wherein: The code knowledge graph is used to characterize the code context relationship and code reference relationship of the target project, and the problem code is screened from the project code of the target project based on the target processing path, and the target processing path is a processing path in the code knowledge graph that has a high similarity with the code problem; Inputting the code problem and the problem code into a code processing model to obtain an initial repair code output by the code processing model; Testing the initial repair code with a test code, and obtaining a target repair code for the code problem if the test passes, wherein the test code is obtained based on the code problem and is used to reproduce the code problem; Sending a target repair code for the code problem to the client, wherein the target repair code does not have the code problem; The client is also used to receive the target repair code of the code problem sent by the server.

19. 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. When the computer programs / instructions are executed by the processor, the steps of the method described in any one of claims 1 to 16 are implemented.

20. A computer-readable storage medium storing a computer program / instruction, wherein the computer program / instruction, when executed by a processor, implements the steps of the method according to any one of claims 1 to 16.

21. A computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 16.