A code processing method, device, equipment and medium

By analyzing the association relationship between code change blocks and realizing intelligent code grouping, the problem of difficult-to-understand code change intentions caused by compound submissions is solved, and the efficiency of software development is improved.

CN113377431BActive Publication Date: 2025-03-25HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010118173.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-02-25
Publication Date
2025-03-25
Estimated Expiration
2040-02-25

AI Technical Summary

Technical Problem

Compound submissions make code change intentions difficult to understand, affecting code review, regression testing and software development efficiency.

Method used

By analyzing the association relationship between code change blocks, intelligent code grouping is implemented to reduce the number of tasks contained in the corresponding submission message of each code change group.

Benefits of technology

It improves the efficiency of code review and regression testing, reduces the difficulty of understanding the intent of code change, and improves the efficiency of software development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113377431B_ABST
    Figure CN113377431B_ABST
Patent Text Reader

Abstract

The present application provides a code change method, including: obtaining a code change file of a current version of a code file relative to a base version of a code file, analyzing multiple code change blocks included in the code change file, obtaining at least one association relationship between the multiple code change blocks, and grouping the multiple code change blocks using the association relationship to obtain N code change groups, so as to perform code submission operations respectively according to the N code change groups, thereby solving the problem that code compound submission affects subsequent code review and regression testing, thereby affecting software development efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a code processing method, apparatus, device, and computer-readable storage medium. Background Art

[0002] When developing software, developers often face multiple development tasks. For example, when developing new features, developers can also check existing code for bugs and fix them. After completing multiple tasks, developers often tend to submit all the changed code in one code commit operation, thus generating composite commits.

[0003] The commit message of a compound commit contains multiple tasks of code changes, which makes it difficult for other users to understand the intention of the code changes. This brings inconvenience to code review in the code development phase and code revert, cherry pick, and regression testing in the code maintenance phase, greatly affecting software development efficiency. Based on this, the industry urgently needs to provide a code processing method to solve the problem that compound code submission affects subsequent code review and regression testing, thereby affecting software development efficiency. Summary of the invention

[0004] The present application provides a code processing method, which performs analysis at the granularity of code change blocks, obtains the association relationship between code change blocks, and implements intelligent code grouping based on the association relationship, thereby solving the problem that code compound submission affects subsequent code review and regression testing, thereby affecting software development efficiency.

[0005] In a first aspect, the present application provides a code processing method. The method may be executed by a code processing device, and the code processing device may be deployed in a computer. The computer may be a terminal device such as a desktop computer, a laptop computer, a tablet computer, etc. In some cases, the computer may also include a server.

[0006] Specifically, the code processing device can obtain a code change file of a code file of a current version relative to a code file of a base version. The base version specifically refers to a version before the re-development in the continuous development process, and the current version specifically refers to a version after the re-development in the continuous development process. Considering that a development process may include multiple code change operations, the code change file may include multiple code change blocks.

[0007] The code processing device can analyze the multiple code change blocks from at least one dimension to obtain at least one association relationship between the multiple code change blocks, and then use the at least one association relationship to group the multiple code change blocks to obtain N (N is a positive integer) code change groups, so as to perform code submission operations respectively according to the N code change groups.

[0008] The above method uses the association between code change blocks to realize intelligent and automatic grouping of code change blocks, avoiding omissions or false positives during manual grouping and improving grouping accuracy. According to the above grouping results, code submission operations are performed separately, and the code change tasks contained in the submission message corresponding to each code change group are greatly reduced. In this way, the difficulty for other users to understand the intention of code changes is reduced, which is conducive to code review in the code development stage and code recovery, selection and regression testing in the code maintenance stage, thereby improving software development efficiency.

[0009] In some possible implementations, considering that compilation is often required before code submission, the code processing device can also compile the code change group obtained by grouping to verify the accuracy of the grouping, and adjust the grouping result based on the compilation prompt information when the grouping is inaccurate, thereby optimizing the grouping result and further improving the grouping accuracy.

[0010] In a specific implementation, for any one of the N code change groups (referred to as the first code change group in this application), the code processing device can compile the code according to the code fragment of the current version included in the code change block of the first code change group, obtain compilation prompt information, and then adjust the first code change group according to the compilation prompt information.

[0011] Of course, the code processing device may also compile the code for each of the multiple code change groups, for example, N code change groups, respectively, obtain the compilation prompt information corresponding to each code change group, and adjust the above code change groups based on the prompt information. For example, when the compilation prompt information of a code change group prompts that the code change group lacks a certain function definition, and the compilation prompt information of another code change group prompts that the code change group defines the above function but does not use the function, the code processing device may move the code change block including the above function definition from the above another code change group to the above code change group.

[0012] For the adjusted code change group, the code processing device can also re-execute the step of compiling the code according to the current version of the code snippet included in the code change block included in the code change group of the code change group. If the compilation prompt information indicates that the compilation is passed or the compilation is successful, the process of adjusting the grouping result according to the compilation prompt information can be ended. If the compilation prompt information indicates that the compilation fails, that is, there is a compilation alarm or compilation error, the code change group can be adjusted according to the alarm type (such as missing brackets, static-modified xxx function is not used) or error type (undefined function or undefined variable).

[0013] That is, the code processing device can cyclically execute the steps of "compiling code according to the current version of the code snippet included in the code change block of the first code change group to obtain compilation prompt information" and "adjusting the first code change group according to the compilation prompt information" until the current version of the code snippet included in the code change block of the first code change group is compiled successfully.

[0014] In some possible implementations, the code processing device may also provide a grouping interface so as to manually adjust the grouping results based on the grouping interface, further improve the grouping accuracy, and improve compatibility.

[0015] Specifically, the grouping interface can display the grouping results of the code change blocks by the code processing device. The grouping result can be the grouping result obtained by the code processing device based on the association relationship between the code change blocks, or it can be the grouping result obtained by adjusting the above grouping result in combination with the compilation prompt information. When the user believes that the grouping result is inaccurate, the grouping result can be adjusted through the grouping interface. The code processing device can receive the user's adjustment settings for the second code change group through the grouping interface. Among them, the second code change group can be any one of the N code change groups. The second code change group and the first code change group can be the same code change group or different code change groups. The code processing device can adjust the code change blocks of the second code change group according to the adjustment settings.

[0016] In some possible implementations, the code processing device can adaptively adjust other code change blocks through self-learning based on the user's adjustment settings for a certain code change block or some code change blocks in the second code change group, thereby improving adjustment efficiency and user operation convenience.

[0017] Specifically, the adjustment setting of the second code change group by the user through the grouping interface may be an adjustment setting of the target code change block in the second code change group, and the target code change block may be any one or more code change blocks in the second code change group. The code processing device may first adjust the target code change block according to the adjustment setting, and then determine the associated code change block of the target code change block from the second code change group, and adjust the associated code change block according to the adjustment setting.

[0018] In some possible implementations, the code processing device can obtain a submission template corresponding to at least one code change group, and then generate a submission message according to the at least one code change group and its corresponding submission template, so as to perform the code submission operation according to the submission message. Based on this, on the one hand, it can avoid the problem that a submission message is mixed with multiple change tasks, resulting in the change intention being difficult to understand, affecting the subsequent process of software development, and further affecting the efficiency of software development. On the other hand, it can improve the problem of low accuracy and poor generalization ability caused by using long short-term memory networks (LSTM) to generate submission messages.

[0019] In some possible implementations, at least one association relationship between code change blocks may specifically include any one or more of an element definition and usage relationship, an element indirect usage relationship, or a similar change relationship. Among them, the code change block includes a code snippet, and the code snippet includes a statement carrying an element. The so-called element is a component of a statement in a code snippet, and may specifically include variables and / or functions, etc. Therefore, the element definition and usage relationship may specifically include a variable definition and usage relationship and / or a function definition and usage relationship. The element indirect usage relationship may specifically include the relationship between code change blocks that use the same element. A similar change relationship refers to the relationship between code change blocks with similar change behaviors.

[0020] The code processing device can obtain the element definition and usage relationship and the element indirect usage relationship in the following manner. Specifically, the code processing device can obtain the code change action set of each code change block in multiple code change blocks, and then parse the code change action set to obtain the element definition set and element usage set of the current version and the basic version corresponding to each code change block, and then the code processing device obtains at least one of the element definition and usage relationship and the element indirect usage relationship between the multiple code change blocks according to the element definition set and element usage set of the current version and the basic version corresponding to each code change block.

[0021] It should be noted that the code processing device can analyze the code change blocks from multiple dimensions to obtain multiple association relationships between the code change blocks, such as element definition and usage relationship, indirect usage relationship and similar usage relationship, etc. This can provide richer and more comprehensive information for code grouping, thereby improving the accuracy of grouping.

[0022] In a second aspect, the present application provides a code processing device. The device specifically includes: a communication module, an analysis module and a grouping module. Among them, the communication module is used to obtain a code change file of the current version of the code file relative to the base version of the code file, and the code change file includes multiple code change blocks. The analysis module is used to analyze the multiple code change blocks and obtain at least one association relationship between the multiple code change blocks. The grouping module is used to group the multiple code change blocks using the at least one association relationship to obtain N code change groups, so as to perform code submission operations respectively according to the N code change groups, and N is a positive integer.

[0023] In some possible implementations, the device further includes:

[0024] The adjustment module is used to compile code according to the code fragments of the current version included in the code change block of the first code change group, obtain compilation prompt information, and adjust the first code change group according to the compilation prompt information.

[0025] In some possible implementations, the communication module is further configured to:

[0026] receiving adjustment settings of the second code change group by the user through the grouping interface;

[0027] The device also includes:

[0028] An adjustment module is used to adjust the code change block of the second code change group according to the adjustment setting.

[0029] In some possible implementations, the adjustment setting of the second code change group includes adjustment setting of the target code change block in the second code change group;

[0030] The adjustment module is specifically used for:

[0031] adjusting the target code change block according to the adjustment setting;

[0032] determining an associated code change block of the target code change block from the second code change group;

[0033] The associated code change block is adjusted according to the adjustment setting.

[0034] In some possible implementations, the communication module is further configured to:

[0035] Get a submission template corresponding to at least one code change group;

[0036] The device also includes:

[0037] The submission module is used to generate a submission message according to the at least one code change group and its corresponding submission template, so as to perform the code submission operation according to the submission message.

[0038] In some possible implementations, the analysis module is specifically used to:

[0039] Obtaining a code change action set for each code change block in the multiple code change blocks;

[0040] Parsing the code change action set to obtain an element definition set and an element usage set of the current version and the base version corresponding to each code change block;

[0041] At least one of an element definition and usage relationship and an element indirect usage relationship between the plurality of code change blocks is obtained according to the element definition set and the element usage set of the current version and the basic version corresponding to each code change block.

[0042] In a third aspect, the present application provides a computer, the computer comprising a processor and a memory. The processor and the memory communicate with each other. The processor is used to execute instructions stored in the memory, so that the computer executes the code processing method in the first aspect or any implementation of the first aspect.

[0043] In a fourth aspect, the present application provides a computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes the code processing method described in the first aspect or any one of the implementations of the first aspect.

[0044] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the code processing method described in the first aspect or any one of the implementations of the first aspect.

[0045] Based on the implementations provided in the above aspects, the present application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical method of the embodiments of the present application, the drawings required for use in the embodiments are briefly introduced below.

[0047] Figure 1 A schematic diagram of a code change file and a code change block provided in an embodiment of the present application;

[0048] Figure 2 A schematic diagram of the system architecture of a code processing method provided in an embodiment of the present application;

[0049] Figure 3 An interactive flow chart of a code processing method provided in an embodiment of the present application;

[0050] Figure 4 A schematic diagram of a grouping interface provided in an embodiment of the present application;

[0051] Figure 5 A schematic diagram of the structure of a computer provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] The scheme in the embodiments provided in this application will be described below in conjunction with the drawings in this application.

[0053] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances. This is just a way of distinguishing objects with the same attributes when describing the embodiments of this application.

[0054] In order to facilitate understanding of the technical solution of the present application, some technical terms involved in the present application are introduced below.

[0055] A code file refers to a text file written in accordance with certain programming language specifications. In this application, a code file generally refers to a source code file. A code file includes a series of human-readable computer language instructions, which can be compiled into binary instructions that can be executed by a computer by a compiler. When the binary instructions are executed, the functions corresponding to the binary instructions can be implemented.

[0056] The software development process is often sustainable. Developers can redevelop based on a certain version of the code file to obtain a new version of the code file. For example, developers can modify the code defects (bugs) in a version of the code file, or add new functions (new functions) or new features (new features), etc., to obtain a new version of the code file. For the convenience of description, the version before redevelopment can be called the base version (base version), and the new version obtained by redevelopment can be called the current version (current version).

[0057] The difference between the current version of the code file and the base version of the code file can form a code change file. Figure 1 As shown, the code change file includes multiple code change blocks, each of which includes a code snippet before the change and a code snippet after the change, that is, a code snippet of the base version and a code snippet of the current version corresponding to the above difference part.

[0058] For ease of understanding, this application also provides an example of a code change block. Figure 1 As shown in the figure, the code snippets before and after the modification in the code change block are loop statements. For the code snippet before the modification, it uses while for looping, which is easy to produce an infinite loop, thus causing a code defect. For the code snippet after the modification, it uses for looping. Since int is a 32-bit integer, the variable sum will overflow when it increases to the maximum value. At this time, the variable sum becomes a negative value, thereby ending the loop and fixing the above code defect.

[0059] When a developer is developing software, he or she can develop for multiple tasks, thus generating multiple code change blocks. When a developer submits the above multiple code change blocks through a single code submission operation, composite commits are generated. Since the submission message of a composite submission contains multiple tasks of code changes, it is more difficult for other users to understand the intention of the code changes, which brings inconvenience to code review in the code development stage and code revert, cherry pick, regression testing, etc. in the code maintenance stage, affecting software development efficiency.

[0060] Based on this, the present application provides a code processing method. The method analyzes multiple code change blocks in a code change file from the code change block level, obtains at least one association relationship between multiple code change blocks, and then uses at least one association relationship to group multiple code change blocks, thereby obtaining N code change groups. Since the association relationship between code change blocks is considered at the code change block granularity, the omission or false positive when grouping code change blocks is reduced, and the grouping accuracy is improved. According to the above-mentioned N code change groups, the code submission operation is performed separately, and the code change tasks contained in the submission message corresponding to each code change group are greatly reduced. In this way, the difficulty for other users to understand the intention of the code change is reduced, which is conducive to code review in the code development stage and code recovery, selection and regression testing in the code maintenance stage, thereby improving software development efficiency.

[0061] Furthermore, the method also supports code compilation of the current version of the code snippet included in the code change block of at least one code change group among the N code change groups, and adjusts the code change group based on the compilation result, so that the current version of the code snippet included in the code change block in the adjusted code change group is compiled. Since the correctness of code compilation after grouping is taken into consideration, the grouping accuracy is further improved, and the software development efficiency is improved. In addition, the method also supports users to manually adjust the code change group, and can adaptively adjust the adjustment settings of the code change group based on the user to optimize the grouping results, so that the submission message corresponding to each code change group is easy to understand, which provides convenience for subsequent code development and code maintenance.

[0062] It can be understood that the code processing method provided in this application can be applied to, but is not limited to, Figure 2 In the application environment shown.

[0063] like Figure 2 As shown, the code processing device 200 includes a communication module 202, an analysis module 204 and a grouping module 206. The communication module 202 is used to obtain a code change file of a current version of a code file relative to a base version of a code file, and the code change file includes multiple code change blocks. The analysis module 204 can analyze the multiple code change blocks to obtain at least one association relationship between the multiple code change blocks. The grouping module 206 uses the at least one association relationship to group the multiple code change blocks to obtain N code change groups. Wherein, N is a positive integer.

[0064] Furthermore, the code processing device 200 may also include an adjustment module 208. The adjustment module 208 may include a compiler. The adjustment module 208 may use a compiler to compile the code according to the code snippet of the current version included in the code change block of the first code change group (any one of the N code change groups) to obtain compilation prompt information. Then, the adjustment module 208 may parse the compilation prompt information and adjust the first code change group according to the parsing result. For example, when the compilation prompt information indicates that the function definition is missing in the first code change group, the code change block including the function definition in other code change groups may be moved to the first code change group.

[0065] The adjustment module 208 can also provide a grouping interface, through which the user can adjust the code change group. Specifically, the communication module 202 is also used to receive the adjustment settings of the second code change group (any one of the N code change groups, which can be the same code change group as the first code change group, or a different code change group) by the user through the grouping interface, and the adjustment module 208 adjusts the code change block of the second code change group in response to the adjustment settings. In actual application, the adjustment module 208 can adjust the target code change block based on the adjustment settings of the target code change block in the second code change group by the user through the grouping interface, and determine the associated code change block of the target code change block from the second code change group, and adjust the associated code change block according to the above adjustment settings. In this way, the optimization of the grouping results is achieved through at least one round of user interaction and adaptive adjustment, and the accuracy of grouping is improved.

[0066] In some implementations, the code processing device 200 also includes a submission module 210. The submission module 210 is used to generate a submission message based on at least one code change group and a submission template corresponding to the code change group, and perform a code submission operation based on the submission message. For example, the code processing device 200 can send a code grouping result to the classification device 100, specifically N code change groups. The communication module 102 of the classification device 100 receives the above-mentioned N code change groups, and then the preprocessing module 104 of the classification device 100 generates corresponding feature vectors according to the N code change groups, and the classification module 106 of the classification device 100 can call a submission type predictor to predict the submission type of each code change group. Among them, the submission type predictor takes the feature vector as input and the submission type as output. The submission type predictor can be obtained by training with training samples generated by a large number of submission instances.

[0067] The classification module 106 may also obtain a submission template corresponding to the submission type from the template library 108 according to the predicted submission type. Accordingly, the communication module 102 may also send the submission template corresponding to each of the at least one code change group to the code processing device 200, so that the code processing device 200 generates a submission message according to the at least one code change group and its corresponding submission template, and implements intelligent code submission based on the submission message.

[0068] Among them, the code processing device 200 can be deployed locally, for example, in a local terminal device. The terminal device includes but is not limited to a desktop computer, a laptop computer, and the like. In some possible implementations, the code processing device 200 can also be deployed in the cloud, for example, in a cloud server. Users can implement the code processing method provided in this application by accessing the cloud server through a browser. The classification device 100 can be deployed in a terminal device or a server. It should be noted that the code processing device 200 and the classification device 100 can be deployed on different devices, which can reduce the demand for system resources of the code processing device 200 and improve availability. Of course, the code processing device 200 and the classification device 100 can also be deployed on the same device, which can improve the efficiency of code processing.

[0069] In order to make the technical solution of the present application clearer and easier to understand, the code processing method of the present application is introduced in conjunction with an embodiment. This embodiment is described by taking the code processing device 200 and the classification device 100 as examples deployed on different devices.

[0070] See also Figure 3 The flowchart of the code processing method shown in FIG. 1 comprises:

[0071] S302: The code processing apparatus 200 obtains a code change file of the current version of the code file relative to the base version of the code file.

[0072] Specifically, when a user develops software based on the code processing device 200, he can make changes to the code file of the base version, such as modifying code defects in the code file of the base version, adding codes corresponding to new functions or new features based on the code file of the base version, or deleting codes corresponding to existing functions or existing features based on the code file of the base version, to obtain the code file of the current version. The code processing device 200 can receive the code changed by each change behavior and obtain the code change file.

[0073] The code change file includes a code change block corresponding to each change behavior. Considering that users usually make multiple changes when developing software, specifically multiple changes for different tasks, the code change file may include multiple code change blocks. Each code change block includes a code snippet of the current version and a code snippet of the base version.

[0074] S304: The code processing device 200 analyzes the multiple code change blocks to obtain at least one association relationship between the multiple code change blocks.

[0075] The code change block includes a code snippet, and the code snippet includes a statement carrying an element. In this embodiment, an element is a component of a statement in the code snippet, which can be a variable and / or a function, etc. When using a variable and / or a function, the variable and / or the function needs to be defined.

[0076] Based on this, the code processing device 200 can analyze from the perspective of element definition and use to obtain the association relationship between multiple code change blocks. Specifically, the code processing device 200 can analyze from the perspective of variable definition and use to obtain the variable definition and use relationship between multiple code change blocks. Of course, the code processing device 200 can analyze from the perspective of function definition and use to obtain the function definition and use relationship between multiple code change blocks.

[0077] Among them, the above definition and usage relationship belong to a direct usage relationship. In some possible implementations, the code processing device 200 can also analyze multiple code change blocks to obtain an indirect usage relationship. The so-called indirect usage relationship refers to the relationship between different code change blocks that use the same element such as the same variable or the same function. For example, if code change block 1 and code change block 2 both use function A, it is said that there is an indirect usage relationship between code change block 1 and code change block 2.

[0078] When analyzing from the perspective of element definition and use, the code processing device 200 can first obtain the code change action set of each code change block in the multiple code change blocks. Specifically, the code processing device 200 can determine the code change action set of each code change block through a syntax parse tree difference differentiation algorithm such as a gumtree algorithm, a change distillation algorithm, etc. The code change action set includes a set of all change actions included in the code change block. The change action includes any one or more of add, delete, change, and move.

[0079] Then, the code processing device 200 parses the code change action set to obtain the element definition set and element usage set of the current version and the base version corresponding to each code change block. Next, the code processing device 200 obtains at least one of the element definition and usage relationships and element indirect usage relationships between the multiple code change blocks based on the element definition set and element usage set of the current version and the base version corresponding to each code change block.

[0080] Considering that the change intentions of similar code change behaviors are similar, in some possible implementations, the code processing device 200 can also analyze the code change blocks from the dimension of similarity of the change behaviors to obtain the association relationship between the code change blocks.

[0081] Specifically, the code processing device 200 can determine the change object and change operation of each code change block, determine the similarity of the code change behavior based on the similarity of the change object and the similarity of the change operation, and determine the code change block with a similarity of the code change behavior greater than a preset threshold as a code change block with a similar change relationship. The change object refers to the object on which the change operation is performed, and the change object can be a variable, function, etc. The change operation can include adding, deleting, modifying, or moving, etc.

[0082] In actual application, the code processing device 200 may also respectively calculate the similarity of the code snippets of the current version and the similarity of the code snippets of the base version in the multiple code change blocks, and determine a group of similar code change blocks based on the similarity of the code snippets of the current version, and determine another group of similar code change blocks based on the similarity of the code snippets of the base version. When the above two groups of similar code change blocks are the same code change blocks, the group of code change blocks is determined to be code change blocks with similar change relationships.

[0083] The code processing device 200 can analyze the code change blocks from multiple dimensions to obtain various association relationships between multiple code change blocks, such as obtaining direct usage relationships (including function definition and usage relationships and variable definition and usage relationships), indirect usage relationships, and similar change relationships between multiple code blocks, thereby improving grouping accuracy.

[0084] S306: The code processing apparatus 200 groups the plurality of code change blocks by using the association relationship to obtain N code change groups.

[0085] In a specific implementation, the code processing device 200 can use the association relationship to classify the code change blocks with element definition and use relationship into the same code change group. Specifically, the code processing device 200 classifies the code change blocks with function definition and use relationship into the same code change group, and classifies the code change blocks with variable definition and use relationship into the same code change group.

[0086] For example, code change block 1 defines variable A and function A, code change block 2 uses variable A, code change block 3 uses function A, and code change block 4 uses function B. The code processing device 200 can divide code change block 1, code change block 2, and code change block 3 into the same code change group, and divide code change block 4 into a different code change group.

[0087] In some possible implementations, the code processing device 200 may also use the association relationship to classify code change blocks with similar change relationships into the same code change group. For example, code change block 1 modifies the expression of function A, and code change block 5 also modifies the expression of function A. The change objects are both function A, and the change operations are both modifications. The code processing device 200 determines that code change block 1 and code change block 5 are code change blocks with similar change relationships, so code change block 1 and code change block 5 are classified into the same code change group.

[0088] In a specific implementation, the code processing device 200 can use the association relationship to construct a change block relationship graph for the multiple code change blocks, and then cluster the nodes in the change block relationship graph through a clustering algorithm, thereby realizing the grouping of code change blocks. Among them, the code processing device 200 constructs the change block relationship graph specifically with the code change blocks as nodes, and constructs the edges of the change block relationship graph according to the association relationship of the code change blocks. Furthermore, the code processing device 200 can assign a corresponding weight to each edge according to the degree of association, so that the change block relationship graph can more accurately express the association relationship between the code change blocks. When clustering the change block relationship graph, the nodes in the change block relationship graph can be clustered by a K-means clustering algorithm, a mean shift clustering algorithm, or a hierarchical clustering algorithm, thereby obtaining N code change groups.

[0089] It should be noted that when the code change blocks are grouped, each code change block belongs to a code change group. When a code change block has an association relationship with code change blocks of different code change groups, the code processing device 200 can determine the code change group to which the code change block finally belongs based on the weights of different association relationships.

[0090] S308: The code processing apparatus 200 compiles the code according to the code snippets of the current version included in the code change block of the first code change group to obtain compilation prompt information.

[0091] Taking into account the correctness of code compilation, the code processing device 200 can first compile the code snippets of the current version included in the code change block of the code change group. For example, the code snippets of the current version included in the code change block of any code change group among the N code change groups (i.e., the first code change group) are compiled to detect the code change group with compilation problems in advance, and adjust the code change group with compilation problems to avoid the submitted code change group containing compilation problems, thereby further improving the grouping accuracy.

[0092] For ease of description, the following is an example of compiling the current version of the code snippets included in the code change blocks of N code change groups. In specific implementation, the code processing device 200 can select the corresponding compiler according to the programming language of the code snippets to compile the current version of the code snippets included in the code change blocks in the N code change groups. For example, for the code snippets using the Java programming language, the code processing device 200 can use Gradle or MVN for compilation. The compiler can output compilation prompt information after the compilation is completed.

[0093] The compilation prompt information may specifically include multiple types such as compiling errors or compiling warnings. Among them, a compiling error indicates that there is an error in the code snippet and it cannot be converted into an executable program. A compiling warning indicates that there is a risk point in the code snippet, and the risk point may cause an exception in the executable program converted from the code snippet during execution.

[0094] For ease of understanding, the present application also provides some specific examples of compilation errors and compilation warnings. In one example, a compilation error can be an undefined function or an undefined variable, etc., and a compilation warning can be a lack of brackets, a static-modified xxx function that is not used, etc.

[0095] It should be noted that the compilation prompt information also includes the location where the compilation error or compilation warning occurs. The location can be specifically represented by the line number in the code file.

[0096] S310: The code processing device 200 adjusts the first code change group according to the compilation hint information.

[0097] The code processing device 200 can parse the compilation hint information and adjust the first code change group according to the parsing result. Specifically, the code processing device 200 parses the compilation hint information, and if the parsing result indicates that the first code change group lacks a variable definition, then the code change block containing the variable definition is added to the first code change group; if the parsing result indicates that the first code change group lacks a function definition, then the code change block containing the function definition is added to the first code change group.

[0098] Furthermore, the code processing device 200 can re-execute the code compilation step after adjusting the first code change group according to the compilation prompt information. If the compiler still outputs a compilation error or a compilation alarm, the first code change group can be adjusted until the code snippets of the current version included in the code change block in the adjusted first code change group are all compiled. If the compiler outputs a compilation success, the subsequent steps can be executed. That is, the code processing device 200 can also loop through the above S308 to S310 until the code snippets of the current version included in the code change block in the adjusted code change group are all compiled.

[0099] S312: The code processing apparatus 200 receives the adjustment settings of the target code change block in the second code change group by the user through the grouping interface.

[0100] In some possible implementations, the code processing device 200 also supports the user to group the code or adjust the existing grouping results. When the user believes that the grouping of one or some code change blocks is inaccurate, the grouping result can also be adjusted through the grouping interface.

[0101] Specifically, the code processing device 200 provides a grouping interface, which can display N code change groups obtained by grouping multiple code change blocks by the code processing device 200. The user can adjust any one of the N code change groups (i.e., the second code change group) through the grouping interface, and specifically adjust any one or more code change blocks (i.e., the target code change blocks) in the second code change group. For example, the user can move a code change block in one code change group to another code change group through the grouping interface, thereby adjusting the two code change groups.

[0102] The code processing device 200 receives the user's adjustment settings for the target code change block in the second code change group through the grouping interface, so as to implement manual adjustment of the second code change group. The second code change group and the first code change group can be the same code change group or different code change groups.

[0103] Figure 4 A schematic diagram showing the adjustment of the code change group through the grouping interface is shown, such as Figure 4As shown, the form of the grouping interface includes N subforms, each of which is used to display a code change block in a code change group, and the N subforms are used to display the code change blocks in the N code change groups obtained by the code processing device 200. When the user clicks on any code change block, the two forms above the N subforms respectively display the code snippet of the base version and the code snippet of the current version included in the code change block, that is, the code snippet before modification and the code snippet after modification. In this way, the difference between the code snippet of the base version and the code snippet of the current version in the code change block can be easily viewed.

[0104] In this example, N is specifically 5. The first code change group includes 3 code change blocks, and the second to fifth code change groups each include 6 code change blocks. The user can move the code change blocks included in the code change group by dragging or the like.

[0105] In some possible implementations, such as Figure 4 As shown, the grouping interface can also provide a navigation bar, which displays a list of code files, and users can quickly switch to a specified file through the navigation bar. Of course, the grouping interface can also provide a change intention display bar. When the user clicks on any code change block, the change intention display bar can display the change intention corresponding to the code change block, which is convenient for users to quickly view the change intention and improve adjustment efficiency. It should be noted that the change intention display bar can also provide an editing control to support users to modify the change intention through the editing control. When the user believes that the change intention is incorrect, it can be modified through the above-mentioned editing control.

[0106] It should be noted that the N code change groups displayed on the grouping interface may be N code change groups obtained after compilation and adjustment. Of course, when the above S308 to S310 are not executed, the N code change groups displayed on the grouping interface may also be N code change groups divided by the code processing device 200 according to at least one association relationship between multiple code change blocks.

[0107] S314: The code processing apparatus 200 adjusts the target code change block according to the adjustment setting.

[0108] The code processing device 200 may adjust the target code change block of the second code change group according to the received adjustment setting. For example, the code processing device 200 may move the target code change block from the second code change group to another code change group, or delete the target code change block from the second code change group according to the adjustment setting.

[0109] S316: The code processing apparatus 200 determines the associated code change block of the target code change block from the second code change group, and adjusts the associated code change block according to the adjustment setting.

[0110] In some possible implementations, the code processing device 200 records the change information of the code change block that performs the adjustment operation. The change information may specifically include the source group and the destination group to which the code change block belongs, that is, the code change group to which the code change block belongs before the adjustment and the code change group to which the code change block belongs after the adjustment. The code processing device 200 analyzes the reason why the user adjusts the above-mentioned code change block, combines at least one association relationship between multiple code change blocks, determines the associated code change block that needs to be adjusted accordingly, and adjusts the associated code change block based on the above-mentioned adjustment setting.

[0111] It should be noted that, in some possible implementations, the code processing device 200 may not perform the above steps, and the user may manually adjust the associated code change blocks.

[0112] S318: The code processing device 200 sends a classification request message to the classification device 100.

[0113] The classification request message includes at least one code change group among the N code change groups. The classification request message is specifically used to classify at least one code change group among the N code change groups to obtain a submission type of the at least one code change group.

[0114] The so-called submission type specifically refers to the type of the submission message. In actual application, the submission type may include at least one of bug fix, refactor, feature, and reformat. The code processing device 200 sends a classification request message to the classification device 100 to obtain the submission type of at least one code change group among the N code change groups, and then generates a submission message for at least one code change group.

[0115] S320: The classification device 100 generates a feature vector according to at least one code change group.

[0116] The classification device 100 extracts the feature vector corresponding to each code change group according to the code snippets included in the code change block in each code change group. Specifically, the classification device 100 can extract the code change action set according to the code snippets included in the code change block in the code change group, and then generate the feature vector corresponding to the code change group according to the code change action set.

[0117] In actual application, the classification device 100 can vectorize the code change action set to generate a feature vector corresponding to the code change group. Each code change action in the code change action set can be identified by a change operation and a change object. Among them, the change operation includes add, delete, change or move, and the change object can be a variable or function, etc., specifically including variable declaration and function definition. Among them, the above variable declaration and function definition correspond to an AST node type in the abstract syntax tree (AST).

[0118] The classification device 100 can correspond each of the four change operations to n AST node types, and flatten them into a one-dimensional vector in order. If a certain AST node type is added in this submission, the element value of the corresponding element in the one-dimensional vector is increased by 1. For AST node types that do not appear in any of the four operations, the element value of the corresponding element in the one-dimensional vector is set to 0. In this way, the feature vector corresponding to the code change group can be obtained.

[0119] In some possible implementations, the classification device 100 can not only consider fine-grained code change actions from a micro perspective when extracting feature vectors, but also consider the statistical characteristics of code changes from a macro perspective, such as the number of code change blocks in a code change group, the number of code change blocks involving definition and usage relationships in a code change group, the number of code change blocks involving similar change relationships in a code change group, etc. Specifically, the classification device 100 can add several elements on the basis of the above one-dimensional vector, and assign the above statistical values ​​to these elements. In this way, a more comprehensive feature vector can be extracted, providing more information to the classification model, and improving the classification accuracy of the classification model.

[0120] S322: The classification device 100 predicts the submission type of the at least one code change group according to the feature vector.

[0121] In actual application, the classification device 100 can use the submission type predictor to predict the submission type of at least one code change group. The submission type predictor takes the feature vector as input and takes the submission type of the code change group as output. Therefore, the classification device 100 inputs the feature vector of at least one code change group into the submission type predictor, and the submission type predictor can predict the submission type of at least one code change group and output the prediction result.

[0122] Among them, the submission type predictor can be based on the pre-collected training samples, using machine learning methods to perform model training and generation. A training sample includes a feature vector extracted from a code snippet included in a historical submission message and a submission type label. The specific implementation of extracting feature vectors from code snippets included in historical submission messages can refer to the description of S320 related content, which will not be repeated here. The submission type label can be determined based on the submission log.

[0123] Specifically, the keywords of the submission log include the submission type. The classification device 100 automatically generates a submission type label by analyzing the submission log. The submission type label can be identified by different numbers. For example, bug fix can be identified by the number 00, and refactor can be identified by the number 01. The classification device 100 can generate a training sample by splicing the above feature vector and the submission type label.

[0124] Since the vector dimension of the training samples is large, multiple training samples form a sparse matrix, so the classification device 100 can use a dimensionality reduction algorithm to remove the sparsity of the matrix. Finally, the classification device 100 uses a machine learning algorithm, such as xgboost, to perform model training on the matrix with sparsity removed to obtain a submission type predictor.

[0125] S324: The classification device 100 obtains a submission template corresponding to at least one code change group from the template library.

[0126] The classification device 100 can mine historical submission messages of various submission types stored in the code repository, so as to obtain a common template for submission messages of various submission types, and the common template can be used as a submission template corresponding to the submission type.

[0127] Table 1 shows an example of a submission template:

[0128] Table 1 Submission template example

[0129] Bug fix: fix an XXX issue refactor:change XXX new feature:add / Wrap XXX for XXX reformat:change XXX(eg.spaces)

[0130] Among them, XXX in Table 1 is the content to be filled in the submission template, which can be determined by the code features extracted from the code change group.

[0131] The classification device 100 may query the template library, and obtain a submission template that matches the submission type of at least one code change group from the template library as the submission template corresponding to the code change group.

[0132] S326: The classification device 100 sends a classification response message to the code processing device 200.

[0133] The classification response message includes a submission template corresponding to at least one code change group.

[0134] S328: The code processing apparatus 200 generates a submission message according to at least one code change group and its corresponding submission template, so as to perform a code submission operation based on the submission message.

[0135] Specifically, the code processing device 200 can extract code features for at least one code change group, determine keywords based on the code features, fill the keywords into the submission template corresponding to the code change group, and generate a submission message. Based on the submission message, a code submission operation can be triggered.

[0136] In some possible implementations, the code processing device 200 may also display the submission message so that the user can confirm the correctness of the submission message. When the user confirms that the submission message is incorrect, the code processing device 200 supports the user to modify the submission message, such as keywords in the submission message, so as to ensure the correctness of the submission message through user interaction.

[0137] The above steps S308 to S316 are optional steps implemented in the embodiment of the present application to further improve the accuracy of grouping. In some possible implementations, the above steps may not be performed. The above steps S318 to S328 are optional steps implemented in the embodiment of the present application to generate a submission message. In some possible implementations, other methods may also be used to implement the steps.

[0138] Based on the above description, an embodiment of the present application provides a code processing method. The method uses code change blocks as the grouping granularity for grouping, rather than grouping from the changes at the file level with a relatively coarse granularity, nor from the transformation of each code feature with a fine granularity, thereby avoiding the problem of inaccurate grouping due to excessive granularity and too many groups due to excessive granularity. The method can also comprehensively consider various associations between code feature blocks, such as variable definition and usage relationship, function definition and call relationship, indirect usage relationship, or similar change relationship, providing richer and more comprehensive information for code grouping, thereby improving the accuracy of grouping.

[0139] Furthermore, the method also dynamically adjusts the grouping results in combination with the compilation prompt information to ensure that the adjusted code change group is compiled successfully, further improving the accuracy of the code grouping. In addition, the method also supports adjusting the grouping results through user interaction, and adaptively adjusts the grouping results according to the user's adjustment settings, thereby obtaining an optimized grouping result.

[0140] The method also supports determining the submission type based on the above grouping results, and automatically generates a submission message in combination with the submission template corresponding to the submission type. On the one hand, corresponding submission messages are generated for different code change groups, avoiding the problem that one submission message is mixed with multiple change tasks, resulting in the change intention being difficult to understand, affecting the subsequent process of software development, and further affecting the efficiency of software development. On the other hand, it can improve the problem of low accuracy and poor generalization ability caused by using long short-term memory networks (LSTM) to generate submission messages.

[0141] Combined with the above Figures 1 to 4 , describes in detail the code processing method provided by the present application, and will now describe the apparatus and device provided by the present application in conjunction with the accompanying drawings.

[0142] See also Figure 2 The code processing device 200 shown in FIG. 1 includes a communication module 202 , an analysis module 204 and a grouping module 206 .

[0143] The communication module 202 is used to obtain a code change file of a current version of a code file relative to a base version of a code file, wherein the code change file includes a plurality of code change blocks.

[0144] The analysis module 204 is configured to analyze the multiple code change blocks to obtain at least one association relationship between the multiple code change blocks.

[0145] The grouping module 206 is configured to group the multiple code change blocks using the at least one association relationship to obtain N code change groups, so as to perform code submission operations respectively according to the N code change groups, where N is a positive integer.

[0146] In some possible implementations, the apparatus 200 further includes:

[0147] The adjustment module 208 is configured to compile code according to the code snippets of the current version included in the code change block of the first code change group, obtain compilation prompt information, and adjust the first code change group according to the compilation prompt information.

[0148] In some possible implementations, the communication module 202 is further configured to:

[0149] receiving adjustment settings of the second code change group by the user through the grouping interface;

[0150] The device 200 further includes:

[0151] The adjustment module 208 is configured to adjust the code change blocks of the second code change group according to the adjustment setting.

[0152] In some possible implementations, the adjustment setting of the second code change group includes adjustment setting of the target code change block in the second code change group;

[0153] The adjustment module 208 is specifically used for:

[0154] adjusting the target code change block according to the adjustment setting;

[0155] determining an associated code change block of the target code change block from the second code change group;

[0156] The associated code change block is adjusted according to the adjustment setting.

[0157] In some possible implementations, the communication module 202 is further configured to:

[0158] Get a submission template corresponding to at least one code change group;

[0159] The device 200 further includes:

[0160] The submission module 210 is used to generate a submission message according to the at least one code change group and its corresponding submission template, so as to perform the code submission operation according to the submission message.

[0161] In some possible implementations, the analysis module 204 is specifically configured to:

[0162] Obtaining a code change action set for each code change block in the multiple code change blocks;

[0163] Parsing the code change action set to obtain an element definition set and an element usage set of the current version and the base version corresponding to each code change block;

[0164] At least one of an element definition and usage relationship and an element indirect usage relationship between the plurality of code change blocks is obtained according to the element definition set and the element usage set of the current version and the basic version corresponding to each code change block.

[0165] According to the embodiment of the present application, the code processing device 200 may correspond to executing the method described in the embodiment of the present application, and the above and other operations and / or functions of each module of the code processing device 200 are respectively to implement Figure 3 For the sake of brevity, the corresponding processes of each method in are not repeated here.

[0166] The above-mentioned code processing device 200 can be implemented by a computer. Figure 5 A schematic diagram of the structure of a computer is provided, such as Figure 5As shown, the computer can be specifically used to implement the above Figure 2 The functions of the code processing device 200 in the illustrated embodiment. The computer 500 includes a bus 501, a processor 502, a communication interface 503 and a memory 504. The processor 502, the memory 504 and the communication interface 503 communicate via the bus 501. The bus 501 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus and the like. For ease of representation, Figure 5 The communication interface 503 is used for external communication. For example, the communication interface 503 can be used to obtain a code change file of the current version of the code file relative to the base version of the code file.

[0167] The processor 502 may be a central processing unit (CPU). The memory 504 may include a volatile memory, such as a random access memory (RAM). The memory 504 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a HDD or a SSD.

[0168] The memory 504 stores executable codes, and the processor 502 executes the executable codes to perform the aforementioned code processing method.

[0169] Specifically, in implementing Figure 2 In the case of the embodiment shown, and Figure 2 When each module of the code processing device 200 described in the embodiment is implemented by software, Figure 2 The software or program codes required for the functions of the analysis module 204, the grouping module 206, the adjustment module 208 and the submission module 210 are stored in the memory 504. The function of the communication module 202 can be realized through the communication interface 503. The communication interface 503 obtains the code change file and transmits it to the processor 502 through the bus 501. The processor 502 executes the program code corresponding to each module stored in the memory 504, executes the code processing method, and realizes intelligent grouping of multiple code change blocks in the code change file.

[0170] The embodiment of the present application further provides a computer-readable storage medium, which includes instructions. When the computer-readable storage medium is executed on a computer, the computer executes the above-mentioned code processing method applied to the code processing device 200.

[0171] The embodiment of the present application also provides a computer program product, and when the computer program product is executed by a computer, the computer executes any of the aforementioned code processing methods. The computer program product may be a software installation package, and when any of the aforementioned code processing methods is required, the computer program product may be downloaded and executed on a computer.

[0172] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.

[0173] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0174] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0175] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

Claims

1. A code processing method, characterized in that: The method comprises: Obtain a code change file of a current version of a code file relative to a base version of a code file, wherein the code change file includes a plurality of code change blocks; Analyze the multiple code change blocks to obtain at least one association relationship between the multiple code change blocks; The plurality of code change blocks are grouped using the at least one association relationship to obtain N code change groups, so that code submission operations are performed respectively according to the N code change groups, where N is a positive integer.

2. The method according to claim 1, characterized in that The method further comprises: Compile the code according to the code snippet of the current version included in the code change block of the first code change group to obtain compilation prompt information; The first code change group is adjusted according to the compilation hint information.

3. The method according to claim 1, characterized in that The method further comprises: receiving adjustment settings of the second code change group by the user through the grouping interface; The code change blocks of the second code change group are adjusted according to the adjustment setting.

4. The method according to claim 3, characterized in that The adjustment setting of the second code change group includes adjustment setting of the target code change block in the second code change group; The step of adjusting the code change block of the second code change group according to the adjustment setting includes: adjusting the target code change block according to the adjustment setting; determining an associated code change block of the target code change block from the second code change group; The associated code change block is adjusted according to the adjustment setting.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Get a submission template corresponding to at least one code change group; A submission message is generated according to the at least one code change group and its corresponding submission template, so as to perform the code submission operation according to the submission message.

6. The method according to any one of claims 1 to 4, characterized in that: The analyzing the multiple code change blocks to obtain at least one association relationship between the multiple code change blocks includes: Obtaining a code change action set for each code change block in the multiple code change blocks; Parsing the code change action set to obtain an element definition set and an element usage set of the current version and the base version corresponding to each code change block; At least one of an element definition and usage relationship and an element indirect usage relationship between the plurality of code change blocks is obtained according to the element definition set and the element usage set of the current version and the basic version corresponding to each code change block.

7. A code processing device, characterized in that: The device comprises: A communication module, used to obtain a code change file of a current version of a code file relative to a base version of a code file, wherein the code change file includes a plurality of code change blocks; An analysis module, configured to analyze the plurality of code change blocks to obtain at least one association relationship between the plurality of code change blocks; The grouping module is used to group the multiple code change blocks by using the at least one association relationship to obtain N code change groups, so as to perform code submission operations respectively according to the N code change groups, where N is a positive integer.

8. The device according to claim 7, characterized in that The device also includes: The adjustment module is used to compile code according to the code fragments of the current version included in the code change block of the first code change group, obtain compilation prompt information, and adjust the first code change group according to the compilation prompt information.

9. The device according to claim 7, characterized in that The communication module is also used for: receiving adjustment settings of the second code change group by the user through the grouping interface; The device also includes: An adjustment module is used to adjust the code change block of the second code change group according to the adjustment setting.

10. The device according to claim 9, characterized in that The adjustment setting of the second code change group includes adjustment setting of the target code change block in the second code change group; The adjustment module is specifically used for: adjusting the target code change block according to the adjustment setting; determining an associated code change block of the target code change block from the second code change group; The associated code change block is adjusted according to the adjustment setting.

11. The device according to any one of claims 7 to 10, characterized in that The communication module is also used for: Get a submission template corresponding to at least one code change group; The device also includes: The submission module is used to generate a submission message according to the at least one code change group and its corresponding submission template, so as to perform the code submission operation according to the submission message.

12. The device according to any one of claims 7 to 10, characterized in that The analysis module is specifically used for: Obtaining a code change action set for each code change block in the multiple code change blocks; Parsing the code change action set to obtain an element definition set and an element usage set of the current version and the base version corresponding to each code change block; At least one of an element definition and usage relationship and an element indirect usage relationship between the plurality of code change blocks is obtained according to the element definition set and the element usage set of the current version and the basic version corresponding to each code change block.

13. A computer, characterized in that: The computer includes a processor and a memory; The processor of the computer is used to execute the instructions stored in the memory, so that the computer executes the code processing method according to any one of claims 1 to 6.

14. A computer-readable storage medium comprising instructions, which, when executed on a computer, enables the computer to execute the code processing method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Python code change reminding method on basis of abstract syntax tree node change extraction

    CN105159715A

  • Coverage information acquisition method and device

    CN110262966A