Code file responsibility object determination method and responsibility object query method

By filtering and refining the candidate responsible parties with the highest code contribution weight in the code files, the problem of low efficiency in identifying and querying responsible parties in code files in traditional methods is solved, and the location and query of responsible parties can be fast and accurate, ensuring that the development progress is not affected.

CN115576524BActive Publication Date: 2026-04-28TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2021-07-06
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In the process of software project development, traditional methods are difficult to efficiently and accurately identify and query the responsible parties of code files without affecting the development schedule. Existing solutions rely on manual consultation, which is cumbersome and increases the workload of programmers.

Method used

By obtaining the code contribution object corresponding to each line of code in the code file under the target path, the candidate responsibility object with the largest code contribution weight is filtered out. If the weight filtering condition is not met, the path is refined layer by layer until the condition is met. The positive correlation between code contribution weight and cumulative contribution code lines is used for filtering and positioning.

Benefits of technology

It enables the quick and accurate identification and querying of responsible parties in code files without increasing the workload of programmers, avoiding redundant data processing and ensuring the accuracy of results and that development progress is not affected.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115576524B_ABST
    Figure CN115576524B_ABST
Patent Text Reader

Abstract

The application relates to a code file responsibility object determination method and a code file responsibility object query method. The code file responsibility object determination method comprises the following steps: obtaining a code contribution object corresponding to each line of code in a code file under a target path; screening a candidate responsibility object with the largest code contribution weight from the code contribution objects, wherein the code contribution weight is positively correlated with the number of accumulated contribution code lines of the code contribution object in the code file; when the code contribution weight of the candidate responsibility object does not meet a weight screening condition, refining the target path layer by layer according to a path level until the code contribution weight of a candidate responsibility object corresponding to a code file under a key target path obtained through the refinement meets the weight screening condition; and determining the candidate responsibility object meeting the weight screening condition as the responsibility object of the code file under the key target path. The responsibility object of the code file can be quickly and accurately determined without affecting the development progress of a software project.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer device and storage medium for determining the responsible party of a code file, and a method, apparatus, computer device and storage medium for querying the responsible party of a code file. Background Technology

[0002] With the development of computer technology, software project development often requires relying on information about the responsible parties to drive the delivery and processing of requirements. In actual software project version iterations, such as initiating new business requirements or delivering software defects, the process typically involves a very inefficient "person-to-person" consultation, going through multiple layers of contacts until finally finding the person responsible for addressing the needs and issues.

[0003] To address this technical issue, a solution was proposed to manually configure the ownership information of all nodes in the current code path at key nodes beforehand. However, this configuration process is cumbersome, relies heavily on the cooperation of programmers, and adds extra workload, thus impacting the overall development schedule of the software project. Without affecting the development schedule, traditional solutions struggle to efficiently and accurately identify and query responsible parties. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, computer equipment, and storage medium for determining and querying the responsibility of code files without affecting the development progress of software projects, in order to address the above-mentioned technical problems.

[0005] A method for determining the responsible party of a code file, the method comprising:

[0006] Retrieve the code contribution object corresponding to each line of code in the code file under the target path;

[0007] From the code contribution objects, the candidate responsibility object with the largest code contribution weight is selected. The code contribution weight is positively correlated with the cumulative number of lines of code contributed by the code contribution object in the code file.

[0008] When the code contribution weight of the candidate responsible object does not meet the weight screening conditions, the target path is refined layer by layer according to the path level until the code contribution weight of the candidate responsible object corresponding to the code file under the refined key target path meets the weight screening conditions.

[0009] Candidate responsible entities whose code contribution weights meet the weight screening criteria are identified as the responsible entities corresponding to the code files under the critical target path.

[0010] A device for determining the responsible party of a code file, the device comprising:

[0011] The code contribution object retrieval module is used to retrieve the code contribution object corresponding to each line of code in the code file under the target path.

[0012] The candidate responsibility object screening module is used to screen out the candidate responsibility object with the largest code contribution weight from the code contribution objects. The code contribution weight is positively correlated with the cumulative number of lines of code contributed by the code contribution object in the code file.

[0013] The target path refinement module is used to refine the target path layer by layer according to the path level when the code contribution weight of the candidate responsible object does not meet the weight screening conditions, until the code contribution weight of the candidate responsible object corresponding to the code file under the refined key target path meets the weight screening conditions.

[0014] The responsibility object determination module is used to determine the candidate responsibility objects whose code contribution weights meet the weight screening conditions as the responsibility objects of the code files under the critical target path.

[0015] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:

[0016] Retrieve the code contribution object corresponding to each line of code in the code file under the target path;

[0017] From the code contribution objects, the candidate responsibility object with the largest code contribution weight is selected. The code contribution weight is positively correlated with the cumulative number of lines of code contributed by the code contribution object in the code file.

[0018] When the code contribution weight of the candidate responsible object does not meet the weight screening conditions, the target path is refined layer by layer according to the path level until the code contribution weight of the candidate responsible object corresponding to the code file under the refined key target path meets the weight screening conditions.

[0019] Candidate responsible entities whose code contribution weights meet the weight screening criteria are identified as the responsible entities corresponding to the code files under the critical target path.

[0020] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0021] Retrieve the code contribution object corresponding to each line of code in the code file under the target path;

[0022] From the code contribution objects, the candidate responsibility object with the largest code contribution weight is selected. The code contribution weight is positively correlated with the cumulative number of lines of code contributed by the code contribution object in the code file.

[0023] When the code contribution weight of the candidate responsible object does not meet the weight screening conditions, the target path is refined layer by layer according to the path level until the code contribution weight of the candidate responsible object corresponding to the code file under the refined key target path meets the weight screening conditions.

[0024] Candidate responsible entities whose code contribution weights meet the weight screening criteria are identified as the responsible entities corresponding to the code files under the critical target path.

[0025] The aforementioned method, apparatus, computer equipment, and storage medium for determining the responsible parties of code files obtain the code contribution object corresponding to each line of code in the code file under the target path. Utilizing the positive correlation between the cumulative number of lines of code contributed by each code contribution object and its code contribution weight, candidate responsible parties with the highest code contribution weight are selected from the code contribution objects. This initial screening of responsible parties is achieved based on the code contribution objects of each line of code. When the code contribution weight of a candidate responsible party does not meet the weight screening criteria, the target path is refined layer by layer according to the path hierarchy until the code contribution weight of the candidate responsible parties corresponding to the code files under the refined key target path meets the weight screening criteria. A second screening using the weight screening criteria ensures the accuracy of the obtained responsible parties. This layer-by-layer refinement according to the path hierarchy allows for rapid location of key target paths, avoiding redundant data processing and enabling rapid determination of responsible parties. Throughout the entire data processing process, no additional workload for programmers is required, thus enabling the rapid and accurate determination of the responsible parties of code files without affecting the software project's development schedule.

[0026] A method for querying the responsibility object of a code file, the method comprising:

[0027] In response to a responsibility object query event for a target path, query the responsibility object corresponding to the code file under the target path;

[0028] When no matching target responsibility object is found for the target path, the target path is backtracked layer by layer according to the path hierarchy until a matching target responsibility object is found for the key target path obtained through backtracking.

[0029] Push the responsibility object query results containing the information corresponding to the target responsibility object;

[0030] The target responsibility object is the code contribution object with the largest code contribution weight under the key target path, and the code contribution weight meets the weight screening conditions; the code contribution weight is positively correlated with the number of lines of code contributed by the code contribution object in the code file under the key target path.

[0031] A code file responsibility object query device, the device comprising:

[0032] The responsibility object query module is used to query the responsibility objects corresponding to the code files under the target path in response to a responsibility object query event for the target path;

[0033] The path backtracking module is used to backtrack the target path layer by layer according to the path hierarchy when no matching target responsibility object is found under the target path, until a matching target responsibility object is found in the key target path obtained through backtracking.

[0034] The query result push module is used to push query results for the responsible object that contain information corresponding to the target responsible object;

[0035] The target responsibility object is the code contribution object with the largest code contribution weight under the matching target path, and the code contribution weight meets the weight screening condition; the code contribution weight is positively correlated with the number of lines of code contributed by the code contribution object in the code file under the matching target path.

[0036] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:

[0037] In response to a responsibility object query event for a target path, query the responsibility object corresponding to the code file under the target path;

[0038] When no matching target responsibility object is found for the target path, the target path is backtracked layer by layer according to the path hierarchy until a matching target responsibility object is found for the key target path obtained through backtracking.

[0039] Push the responsibility object query results containing the information corresponding to the target responsibility object;

[0040] The target responsibility object is the code contribution object with the largest code contribution weight under the key target path, and the code contribution weight meets the weight screening conditions; the code contribution weight is positively correlated with the number of lines of code contributed by the code contribution object in the code file under the key target path.

[0041] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0042] In response to a responsibility object query event for a target path, query the responsibility object corresponding to the code file under the target path;

[0043] When no matching target responsibility object is found for the target path, the target path is backtracked layer by layer according to the path hierarchy until a matching target responsibility object is found for the key target path obtained through backtracking.

[0044] Push the responsibility object query results containing the information corresponding to the target responsibility object;

[0045] The target responsibility object is the code contribution object with the largest code contribution weight under the key target path, and the code contribution weight meets the weight screening conditions; the code contribution weight is positively correlated with the number of lines of code contributed by the code contribution object in the code file under the key target path.

[0046] The aforementioned method, apparatus, computer device, and storage medium for querying the responsibility objects of code files, responding to a responsibility object query event for a target path, query the responsibility objects corresponding to code files under the target path. The responsibility object query process does not rely on the source code in the code file. When no matching target responsibility object is found for the target path, the target path is backtracked layer by layer according to the path hierarchy until a matching target responsibility object is found in the critical target path. The code contribution object with the highest code contribution weight under the critical target path, and whose code contribution weight meets the weight filtering criteria, is taken as the target responsibility object. Utilizing the positive correlation between code contribution weight and the number of lines of code contributed by the code contribution object in the code file under the critical target path, on the one hand, it is not necessary to determine a matching target responsibility object for each path level, effectively reducing the data processing volume in the target responsibility object determination process; on the other hand, through path backtracking, the target responsibility object corresponding to the code file can be obtained quickly and accurately, thereby achieving efficient and accurate querying of the responsibility objects of code files without affecting the software project's development progress. Attached Figure Description

[0047] Figure 1 An application environment diagram for a method of determining the responsible party of a code file in one embodiment;

[0048] Figure 2 A flowchart illustrating a method for determining the responsible party of a code file in one embodiment;

[0049] Figure 3 This is a schematic diagram of the path hierarchy of code files in a software project in one embodiment;

[0050] Figure 4 This is a schematic diagram illustrating the correspondence between code owners and code files in one embodiment;

[0051] Figure 5 This is a schematic diagram illustrating the correspondence between code owners and code files in another embodiment;

[0052] Figure 6 This is a flowchart illustrating a method for querying the responsible object of a code file in one embodiment;

[0053] Figure 7 A flowchart illustrating the method for determining the responsible party of a code file in another embodiment;

[0054] Figure 8 This is a flowchart illustrating the method for querying the responsible object of a code file in another embodiment;

[0055] Figure 9 This is an interactive diagram illustrating the method for determining the responsible object and the query method for a code file in one embodiment.

[0056] Figure 10 This is an interactive diagram illustrating the code file responsibility object query method in a code review scenario, as shown in one embodiment.

[0057] Figure 11 This is a schematic diagram of code merging request verification information received by the review object in one embodiment.

[0058] Figure 12 A structural block diagram of a device for determining the responsible party of a code file in one embodiment;

[0059] Figure 13 This is a structural block diagram of a code file responsibility object query device in one embodiment;

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

[0061] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0062] The method for determining the responsibility object of a code file and the method for querying the responsibility object of a code file provided in this application can be applied to, for example... Figure 1In the application environment shown, terminals 102 and 106 communicate with server 104 via a network. Terminal 102 can be the terminal where the programmer is located, and terminal 106 can be the terminal for querying the responsible party. During the process of determining the responsible party for code files, the programmer submits the software project's code files to server 104 through terminal 102. Server 104, based on the software project's code submission records, obtains the code contribution object corresponding to each line of code in the code files under the target path. Server 104 filters out the candidate responsible party with the highest code contribution weight from the code contribution objects. The code contribution weight is positively correlated with the cumulative number of lines of code contributed by the code contribution object in the code file. When the code contribution weight of a candidate responsible party does not meet the weight filtering criteria, the target path is refined layer by layer according to the path hierarchy until the code contribution weight of the candidate responsible party corresponding to the code file under the refined key target path meets the weight filtering criteria. The candidate responsible party whose code contribution weight meets the weight filtering criteria is determined as the responsible party corresponding to the code file under the key target path. During the code file responsibility object query process, server 104 responds to the user's query operation event for the code file responsibility object through terminal 106. Server 104 queries the responsibility objects corresponding to the code files under the target path based on the target path. When no matching target responsibility object is found in the target path, the server 104 backtracks layer by layer according to the path hierarchy until a matching target responsibility object is found in the key target path. Server 104 pushes the responsibility object query results containing the corresponding information of the target responsibility object to terminal 106. The target responsibility object is the code contribution object with the highest code contribution weight under the key target path, and whose code contribution weight meets the weight filtering criteria. The code contribution weight is positively correlated with the number of lines of code contributed by the code contribution object in the code file under the key target path. Terminals 102 and 106 can be, but are not limited to, various personal computers, laptops, smartphones, tablets, portable wearable devices, and vehicle terminals. Server 104 can be implemented using a standalone server or a server cluster composed of multiple servers.

[0063] In one embodiment, such as Figure 2 As shown, a method for determining the responsible party of a code file is provided, which is then applied to... Figure 1 Taking the server in the example, the following steps are included:

[0064] Step 202: Obtain the code contribution object corresponding to each line of code in the code file under the target path.

[0065] In this context, the target path is at least one path used to identify responsible parties within a software project. A path in a software project corresponds to an address within the project; it's a text identifier pointing to a code file or directory. Each path level is typically separated by a forward slash "\" or " / ", with the path level following the slash being a sub-item of the path level preceding it. Paths include file paths and file directories. A file path can be a highly specific path to a file directory, such as... Figure 3 The file path shown as aaa / xxx / yyy / zzz.java corresponds to the code file. File directories are divided into first-level, second-level, and multi-level directories. A multi-level directory structure is also called a tree structure. In a multi-level directory structure, the software project has a root directory, which can contain several subdirectories and code files. Subdirectories can contain not only code files but also their own subdirectories, and so on, forming a multi-level directory structure. The target path can be either a file path or a file directory. For example... Figure 3 The path hierarchy of code files in the software project shown is represented by the nth level, from the first level to the nth level, which constitutes the nth-level directory. For example, the path from the first level to the second level includes the second-level directories aaa / xxx / and aaa / xx1 / ; the path from the first level to the fifth level includes the file paths aaa / xxx / yyy / zz1 / zz2.java and aaa / xxx / yyy / zz1 / zz2.java.

[0066] In software projects, the number of target paths can be one or multiple; for example, simultaneously... Figure 3 The paths aaa / xxx / and aaa / xx1 / are used as target paths. Each of these target paths corresponds to a different granular path; for example, multiple target paths can be parallel subdirectories belonging to the same parent directory, or they can be multiple subdirectories belonging to different parent directories. The process of determining the responsible party for each of the multiple target paths is independent, and the processing of different target paths does not affect each other.

[0067] Code files are files that store program code. The code files under the target path include the code files corresponding to each of the most granular paths within the target path, where each granular path contains only one code file. For simplicity, assume the software project's code files form a five-level directory structure, with each code file belonging to a fifth-level subdirectory. When the target path corresponds to a second-level directory, the code files under the target path include the code files corresponding to each fifth-level subdirectory within that second-level directory. It's understandable that in specific application instances, different code files may actually correspond to different subdirectory levels.

[0068] A code contribution object refers to the edited object of the code in a code file that is actually used. Each line of code in a code file can be edited by a programmer, and the code file can be iteratively updated according to the version of the software project. That is to say, the code file may be the original code file that was initially edited, or it may be a modified and updated code file. The code contribution object of the code in the code file is either the initial code editing object or the code update object. The initial code editing object and the code update object can be the same programmer or different programmers. The code in the code file is measured in lines. When a programmer edits or updates each line of code in the code file through the terminal, the terminal records the code contribution object of each line of code. For example, if code file A was initially written by programmer a, the terminal will record programmer a as the code contribution object for each line of code in code file A. During the iteration of the software project, programmer b performs secondary development based on code file A and updates lines 20-50 of code file A. Then, the terminal will update the code contribution object of code file A for lines 20-50 to programmer b.

[0069] Specifically, the server retrieves the code contribution object corresponding to each line of code in the code file submitted by the terminal from the code submission record. The code submission record of the code file submitted by the terminal includes the code contribution object for each line of code in the submitted code file.

[0070] Step 204: Select the candidate responsible object with the largest code contribution weight from the code contribution objects. The code contribution weight is positively correlated with the cumulative number of lines of code contributed by the code contribution object in the code file.

[0071] The code contribution objects selected for screening include those that have contributed at least one line of code to a code file. For each code contribution object, the cumulative number of lines of code contributed to the code files under the target path is counted. For the code files under the target path, the sum of the code contribution weights of all code contribution objects is 1. The code contribution weight is positively correlated with the cumulative number of lines of code contributed; that is, the more lines of code a code contribution object has contributed cumulatively, the greater its corresponding code contribution weight. The code contribution weight represents the proportion of the cumulative number of lines of code contributed to the total number of lines of code in the code files under the target path. In a specific embodiment, the ratio of the cumulative number of lines of code contributed by each code contribution object to the total number of lines of code in the code files can be used as the code contribution weight corresponding to the code contribution object in the code files under the target path.

[0072] The server determines the code contribution weight of each code contributor based on the cumulative number of lines of code they have contributed to the code file, and then selects the candidate responsible party with the highest code contribution weight from among the code contributors. It should be noted that when there are two or more code contributors with the same highest code contribution weight, one of the multiple code contributors with the same highest code contribution weight will be selected as the candidate responsible party.

[0073] A candidate responsibility object is a candidate for a responsibility object. A candidate responsibility object is a code contribution object that meets some of the conditions for becoming a responsibility object. One of the conditions for becoming a responsibility object is having the highest code contribution weight among the code files under the target path.

[0074] Another condition for becoming a responsible object is that the code contribution weight meets the weight screening criteria. When the code contribution weight of a candidate responsible object meets the weight screening criteria, the candidate responsible object is determined as the responsible object corresponding to the code file under the target path.

[0075] Step 206: When the code contribution weight of the candidate responsible object does not meet the weight screening criteria, the target path is refined layer by layer according to the path level until the code contribution weight of the candidate responsible object corresponding to the code file under the refined key target path meets the weight screening criteria.

[0076] Weighted filtering criteria refer to the conditions for filtering based on the numerical value of code contribution weight. Specifically, weighted filtering criteria can be that the code contribution weight is greater than or equal to a set minimum weight threshold, or that the difference between the code contribution weight of a candidate responsible object and the code contribution weight of a specified object is greater than a set threshold. The specified object can be the code contribution object with the second largest code contribution weight. In other embodiments, the weighted filtering criteria can be set according to the actual needs of the scenario.

[0077] The path hierarchy refers to the directory hierarchy corresponding to a software project. Based on the file paths of each code file within the software project, the corresponding directory levels can be determined, thus defining the path hierarchy within the project. Refining the target path layer by layer according to the path hierarchy involves using the target path as the original path and refining it down one level at a time, treating a subdirectory under the target path as a new target path. A critical target path refers to a refined target path where the code contribution weight of the candidate responsible party for a code file meets the weighting screening criteria. A critical target path has a corresponding responsible party who is accountable for the code files under that critical target path.

[0078] Specifically, for each path refinement, the server re-determines the code files under the refined target path, and based on the code contribution objects corresponding to each line of code in the newly determined code files, filters out the candidate responsibility objects corresponding to the newly determined code files. It then determines whether the code contribution weight of the newly filtered candidate responsibility objects meets the weight filtering conditions. If it does, the refined target path is taken as the critical target path. If it does not, it jumps to the next path level and repeats the above process based on the further refined target path until the critical target path is obtained.

[0079] like Figure 4 As shown, the target path is aaa / xxx. The code files under aaa / xxx include zzz.java, zz2.java, zz3.java, and yy2.java, involving a total of five code contribution objects A, B, C, D, and E, with corresponding code contribution weights of 0.4, 0.2, 0.3, 0.075, and 0.025, respectively. The weight selection criterion is that the weight must be greater than or equal to the set minimum weight threshold of 0.5. The code contribution object A with the highest code contribution weight in the code files corresponding to the target path aaa / xxx has a weight of 0.4 < 0.5, and therefore does not meet the weight selection criterion. Based on the layer-by-layer refinement of aaa / xxx, we obtain aaa / xxx / yyy and aaa / xxx / yy1. Following the same processing procedure as above, the code contribution object A with the highest code contribution weight in the corresponding code files zzz.java, zz2.java, and zz3.java of aaa / xxx / yyy meets the weight filtering criteria. Code contribution object A is the responsible object for each code file under aaa / xxx / yyy. Similarly, the code contribution object C with the highest code contribution weight in the corresponding code file zz2.java of aaa / xxx / yy1 meets the weight filtering criteria. Code contribution object C is the responsible object for the code file zz2.java under aaa / xxx / yy1.

[0080] Step 208: Identify the candidate responsible objects whose code contribution weights meet the weight screening criteria as the responsible objects corresponding to the code files under the critical target path.

[0081] The code files under the critical target path include the code files corresponding to the most granular paths within that critical target path. A most granular path is a file path containing only one code file. The critical target path can be an intermediate directory or root directory that includes one or more most granular paths, or it can be a file path containing only one code file. Accordingly, when the critical target path is the root directory, the candidate responsibility object is the code file responsible for each level of subdirectories under the root directory. When the critical target path is an intermediate directory, the candidate responsibility object is the code file responsible for each level of subdirectories under the intermediate directory. When the critical target path is a file path, the candidate responsibility object is the code file corresponding to that file path.

[0082] The method for determining the responsible parties for the aforementioned code files involves obtaining the code contribution object corresponding to each line of code in the code file under the target path. Utilizing the positive correlation between the cumulative number of lines of code contributed by each code contribution object and its code contribution weight, the method filters out the candidate responsible parties with the highest code contribution weight. This initial screening of responsible parties is achieved based on the code contribution object of each line of code. When the code contribution weight of a candidate responsible party does not meet the weight screening criteria, the target path is refined layer by layer according to the path hierarchy until the code contribution weight of the candidate responsible parties corresponding to the code files under the refined key target path meets the weight screening criteria. This secondary screening using the weight screening criteria ensures the accuracy of the identified responsible parties. This layer-by-layer refinement according to the path hierarchy allows for rapid location of key target paths, avoiding redundant data processing and enabling rapid determination of responsible parties. Throughout the entire data processing process, the workload of programmers is not increased, thus enabling the rapid and accurate determination of the responsible parties for code files without affecting the software project's development schedule.

[0083] In one embodiment, the method for determining the responsible object of a code file further includes: when the code contribution weights of the candidate responsible objects corresponding to the code files under each refined path obtained by refining the target path layer by layer do not meet the weight screening conditions, obtaining the most refined path corresponding to the target path; and selecting the responsible object with the most cumulative contribution lines of code in the target code file from the code contribution objects corresponding to each line of code in the target code file corresponding to the most refined path.

[0084] The refinement path is obtained by refining the target path as the original path, and then refining it down one level at a time to obtain the paths corresponding to each subdirectory. The most refined path is the file path containing only a single code file.

[0085] The processing procedure is the same for each refined path. Specifically, the server determines the code files under the refined path and, based on the code contribution objects corresponding to each line of code in the code files under the refined path, filters out the candidate responsibility objects corresponding to the code files under the refined path. It then determines whether the code contribution weight of the selected candidate responsibility objects meets the weight filtering conditions. If not, it jumps to the refined path corresponding to the next path level and repeats the above process until the code contribution weight of the selected candidate responsibility objects meets the weight filtering conditions or the refined path is the most refined path.

[0086] For the most granular path, which contains only one code file, the responsible party can be determined directly based on that code file. Specifically, the server retrieves the code contribution object corresponding to each line of code in the target code file corresponding to the most granular path, counts the cumulative number of lines of code contributed by each code contribution object in the target code file, and selects the code contribution object with the highest cumulative number of lines of code contributed as the responsible party for that target code file.

[0087] In this embodiment, if the code contribution weights of the candidate responsible parties for each code file under each refined path do not meet the weight screening criteria, the responsible party is directly determined based on the most refined path. This ensures that a corresponding responsible party is identified for each code file, achieving comprehensive coverage of responsible parties. By selecting the responsible party with the largest cumulative number of lines of code contributed in the target code file, the responsible party for the target code file can be directly and quickly determined, improving processing efficiency.

[0088] In one embodiment, the weighting selection criterion is that the code contribution weight is greater than or equal to a first weighting threshold; the method for determining the responsibility object of the code file further includes:

[0089] When the code contribution weight of the responsible object is less than the second weight threshold, the key target path is refined layer by layer according to the path hierarchy, and the responsible object corresponding to the code file under each refined key target path is determined, until the code contribution weight of the determined responsible object is greater than or equal to the second weight threshold; wherein, the second weight threshold is greater than the first weight threshold.

[0090] The specific values ​​of the first and second weight thresholds can be set according to the actual needs of the scenario. For example, the first weight threshold can be 0.5, and the second weight threshold can be 0.9.

[0091] Specifically, for each refined path, the server filters candidate responsibility objects corresponding to each line of code in the code files under that refined path, first comparing the code contribution weight of the candidate responsibility object with a first weight threshold. If the code contribution weight of the candidate responsibility object is less than the first weight threshold, it is determined that no corresponding responsibility object can be determined for that refined path, and the process jumps to the next path level of refined path. If the code contribution weight of the candidate responsibility object is equal to or greater than the first weight threshold, that refined path is determined as a critical target path. It should be noted that if the first weight threshold is 0.5, when the code contribution weight of the candidate responsibility object is equal to the first weight threshold, an additional condition can be set: the number of code contribution objects in the code files under the refined path is greater than 2, to ensure that the candidate responsibility object is the code contribution object with the largest and unique code contribution weight, further ensuring the accuracy and reliability of the responsibility object.

[0092] Each critical target path has a corresponding responsible object, which is responsible for the code files under that critical target path. Specifically, for each critical target path, the server compares the code contribution weight of the corresponding responsible object with a second weight threshold. When the code contribution weight of a candidate responsible object is less than the second weight threshold, the responsible object for that critical target path is determined, and the process jumps to the next level of refined path. Generally, if the parent path is a critical target path, its corresponding at least child paths are also critical target paths, and the code contribution weight of the candidate responsible objects in the child paths is greater than that of the candidate responsible objects in the parent paths. To avoid excessive and useless data processing when multiple path levels correspond to the same candidate responsible object, a second weight threshold is set. Using a code contribution weight greater than or equal to the second weight threshold as the termination condition for jumping to the next level of refined critical target path effectively reduces the amount of data processing required and improves data processing efficiency while ensuring the accuracy of the responsible object.

[0093] like Figure 5 As shown, the responsibility object corresponding to the code file under the critical target path aaa / xxx / yyy is A; the responsibility object corresponding to the critical target path aaa / xxx / yyy / zzzz.java, which is a refinement of the critical target path aaa / xxx / yyy, is B; and the responsibility object corresponding to the code file under the critical target path aaa / xxx / yyy / zz1, which is a refinement of the critical target path aaa / xxx / yyy, is also A.

[0094] In this embodiment, by further refining the key target paths that meet the weighting screening criteria—that is, the key target paths where the code contribution weight of the candidate responsible object is greater than or equal to the first weight threshold—the code contribution weight of the responsible object corresponding to each refined key target path can be further improved, thereby enhancing the reliability of the responsible object in the code file. To avoid unlimited refinement and excessive unnecessary data processing, a second weight threshold is set as the termination condition for jumping to the next path level corresponding to the refined key target path. This effectively reduces the amount of data processing required, improves data processing efficiency, and ensures the accuracy of the responsible object.

[0095] In one embodiment, the method for determining the responsible party of a code file further includes: determining the path levels of the software project based on the file path of each code file in the software project; filtering out the target levels that meet the level conditions from the path levels; and determining the target path corresponding to the target level.

[0096] Software projects, designed to meet the growing needs of people's lives and work, require software developers to gather user requirements through various means. These requirements are then analyzed, and appropriate methods are employed, following certain development principles, to ultimately produce the software the user desires. A software project comprises multiple code files. During the project's file creation process, the file paths of each code file are determined—the finest path within the software project. Based on the combination of file paths corresponding to each code file, a multi-level directory structure corresponding to the software project is formed, thus defining the various path levels of the software project.

[0097] Hierarchical criteria are the conditions set to filter path levels. The target level that meets these criteria can be fixed, such as the root directory of a software project. Alternatively, the criteria can be that the number of path levels exceeds a set threshold. Paths with a number of levels greater than or equal to the threshold are then selected as target levels. For example, with a threshold of 3, the process starts from the root directory and refines down to the target level with 3 levels, defining the path corresponding to that level as the target path.

[0098] In this embodiment, the target path is determined based on hierarchical conditions, enabling the selection of target scenarios for different situations. For example, for scenarios where the responsibility object requires high precision, the hierarchical threshold corresponding to the hierarchical conditions can be set to a larger value; for scenarios where the responsibility object requires a wide range of responsibilities, the hierarchical threshold corresponding to the hierarchical conditions can be set to a smaller value.

[0099] In one embodiment, obtaining the code contribution object corresponding to each line of code in the code file under the target path includes: filtering out the target code submission records corresponding to the code files under the target path from the code submission records corresponding to each code file; traversing the target code submission records to obtain the code contribution object corresponding to each line of code in the code file.

[0100] Code commit records are data generated during the code file submission process of a software project, including the code contribution object for each line of code in the submitted code file. Each code file has a corresponding code commit record. By filtering the target code commit records corresponding to code files under the target path, targeted code contribution objects can be obtained, avoiding the acquisition of useless data. By traversing the target code commit records, the code contribution object corresponding to each line of code in the code file can be obtained accurately and quickly.

[0101] It is understandable that when identifying the responsible parties for code files with the root directory as the target path, if the root directory includes all code files, then the code commit records corresponding to all code files can be traversed directly to obtain the code contribution object corresponding to each line of code in all code files.

[0102] In this embodiment, the code responsibility object for each line of code is obtained by traversing the code commit records. On the one hand, this enables the rapid acquisition of the code responsibility object; on the other hand, it does not depend on the actual code file and can be widely applied to scenarios where it is inconvenient to directly disclose part of the source code (such as cross-project or cross-company collaboration).

[0103] In one embodiment, the target code commit history is traversed to obtain the code contribution object corresponding to each line of code in the code file, including:

[0104] Iterate through the target code commit history to obtain the code update data for each line of code in the code file under the target path; when a code update object exists in the code update data, the latest code update object is determined as the code contribution object for the corresponding line of code; when no code update object exists in the code update data, the initial code edit object is determined as the code contribution object for the corresponding line of code.

[0105] The code update data records the update history of each line of code. For example, for a line of code that has not been updated, the code update data includes the initial code and the initial code editing object. For a line of code that has been updated twice, the code update data includes the initial code, the initial code editing object, the first updated code, the first updated code editing object, the second updated code, and the second updated code editing object. The updated code and its editing object are arranged in ascending order of update time to ensure that the latest code and its editing object can be directly obtained. When a code update object exists in the code update data, the latest code update object is identified as the code contribution object for the corresponding line of code; when no code update object exists in the code update data, the initial code editing object is identified as the code contribution object for the corresponding line of code.

[0106] In this embodiment, by using the edit object of the updated code as the code contribution object of the corresponding code line, we can consider the actual code being used and ensure the accuracy of the code contribution object for each line of code.

[0107] In one embodiment, the code files under the target path are a combination of code files with a number greater than 1; the method for determining the responsible object of the code files further includes: for each code contribution object, based on the number of lines of code contributed by the corresponding code contribution object in each code file in the code file combination, to accumulate the cumulative number of lines of code contributed by each code contribution object in the code file combination.

[0108] In this context, a code file combination refers to a group of all code files located under the same target path. When the target path is a directory, it may contain multiple code files or a combination of code files and subdirectories. The target path contains more than one code file. Therefore, when determining the code files under the target path, it is necessary to consider all code files under that path and process the entire code file combination as a whole.

[0109] In this embodiment, by considering all code files under the same target path as a whole and processing them accordingly, the accurate matching relationship between the target path and the responsible object can be ensured, so that the responsible object can be responsible for all code files under the target path.

[0110] In one embodiment, the method for determining the responsibility object of a code file further includes:

[0111] Based on the responsibility object corresponding to the file code under each critical target path, establish a matching relationship between the corresponding responsibility object and the corresponding critical target path.

[0112] Specifically, the server establishes a matching relationship between the responsible object and the critical target path for the responsible object corresponding to the file code under the critical target path, and adds the matching relationship to the database used to provide the responsible object query service, so as to find the responsible object corresponding to the code file based on the critical target path.

[0113] Matching relationships are used to characterize the correspondence between responsible objects and key target paths. By matching the corresponding responsible objects with the corresponding key target paths, and by utilizing the relationship between the file paths of code files and key target paths, the responsible objects corresponding to the code files can be found based on the file paths of the code files, thus achieving fast and accurate retrieval of responsible objects.

[0114] In one embodiment, such as Figure 6 As shown, a method for querying the responsibility object of a code file is provided, which can be applied to... Figure 1 Taking the server in the example, the following steps are included:

[0115] Step 602: In response to the responsibility object query event for the target path, query the responsibility object corresponding to the code file under the target path.

[0116] The responsibility object query event can be an event proactively triggered according to the data processing flow, such as an event triggered based on code review in a code review scenario, or it can be a responsibility object query operation proactively triggered by the user through a displayed query page. The responsibility object query operation refers to the operation of querying a responsibility object to obtain the corresponding information of the target responsibility object. The target path can be a path entered by the user on the terminal. Specifically, the target path can be the file path corresponding to the code file, or a directory corresponding to a path level in the software project. For example, aaa / xxx / yyy / zzz.java is the file path corresponding to the code file, and aaa / xxx / and aaa / xxx / yyy / are directories in the software project.

[0117] Specifically, the terminal responds to the target path entered by the user and triggers the corresponding operation control for querying the responsible object. It sends the responsible object query request carrying the target path to the server. The server receives and responds to the terminal's responsible object query operation and queries the responsible object corresponding to the code file under the target path based on the target path corresponding to the responsible object query operation.

[0118] Step 604: When no matching target responsibility object is found for the target path, backtrack the target path layer by layer according to the path hierarchy until a matching target responsibility object is found for the key target path obtained through backtracking.

[0119] Layer-by-layer backtracking refers to the process of removing the last path level at each step to obtain a new path. For example, backtracking layer by layer for the target path aaa / xxx / yyy / zzz.java yields backtracking paths aaa / xxx / yyy / , aaa / xxx / , and aaa / . A critical target path is a backtracking path that has a matching target responsibility object. For example, if the backtracking path aaa / xxx / has a matching target responsibility object, then aaa / xxx / is a critical target path.

[0120] Step 606: Push the responsibility object query results containing the information corresponding to the target responsibility object. The target responsibility object is the code contribution object with the largest code contribution weight under the key target path and whose code contribution weight meets the weight filtering conditions. The code contribution weight is positively correlated with the number of lines of code contributed by the code contribution object in the code file under the key target path.

[0121] The target responsibility object corresponding information is information that corresponds to the target responsibility object and is used to deliver the corresponding code issues to the target responsibility object. Specifically, the information corresponding to the target responsibility object can be at least one of the following: the target responsibility object's name, department, contact information (such as email).

[0122] A code contribution object refers to the editable code within a code file that is actually used in the code. Each line of code in a code file can be edited by a programmer. The code file can be iteratively updated according to the software project version; that is, the code file may be the original, initially edited code file or an updated code file after modification. The code contribution object in a code file is either the initial code editing object or the code update object. The initial code editing object and the code update object can be the same programmer or different programmers. Code in a code file is measured in lines. When a programmer edits or updates each line of code in a code file through a terminal, the terminal records the code contribution object for each line of code. Code contribution objects include those that have contributed at least one line of code to the code file. For each code contribution object, the cumulative number of lines of code contributed to the code files under the target path is counted. For the code files under the target path, the sum of the code contribution weights of all code contribution objects is 1. The code contribution weight is positively correlated with the cumulative number of lines of code contributed; that is, the more lines of code a code contribution object has contributed cumulatively, the greater its corresponding code contribution weight. The code contribution weight can represent the proportion of the cumulative number of lines of code contributed to the total number of lines of code in the code files under the target path. In a specific embodiment, the ratio of the cumulative number of lines of code contributed by each code contributor to the total number of lines of code in the code file can be used as the code contribution weight of the code contributor corresponding to the code file under the target path.

[0123] The server determines the code contribution weight of each code contributor based on the cumulative number of lines of code they have contributed to the code file, and then selects the candidate responsible party with the highest code contribution weight from among the code contributors. It should be noted that when there are two or more code contributors with the same highest code contribution weight, one of the multiple code contributors with the same highest code contribution weight will be selected as the candidate responsible party.

[0124] A candidate responsibility object is a candidate for a responsibility object. A candidate responsibility object is a code contribution object that meets some of the conditions to become a responsibility object. The first condition is that it has the highest code contribution weight in the code files under the target path. The second condition is that its code contribution weight meets the weight screening criteria. When a candidate responsibility object's code contribution weight meets the weight screening criteria, it is determined as the responsibility object corresponding to the code file under the target path. The weight screening criteria refer to the conditions for filtering based on the numerical value of the code contribution weight.

[0125] The specific weighting criteria can be that the code contribution weight is greater than or equal to the set minimum weight threshold, or that the difference between the code contribution weight of the candidate responsible object and the code contribution weight of the specified object is greater than the set threshold. The specified object can be the code contribution object with the second largest code contribution weight. The specific weighting criteria can be set according to the actual needs of the scenario.

[0126] It should be noted that the matching relationship between the critical target path and the responsible object can be constructed by using the responsible object determination method of the code file under the critical target path, which will not be elaborated here.

[0127] The aforementioned method for querying the responsibility objects of code files responds to a responsibility object query event for a target path and queries the responsibility objects corresponding to the code files under the target path. This query process does not rely on the source code in the code files. When no matching responsibility object is found for the target path, the method backtracks layer by layer along the path hierarchy until a matching responsibility object is found in the critical target path. The code contribution object with the highest contribution weight under the critical target path, and whose contribution weight meets the weight filtering criteria, is selected as the target responsibility object. This method leverages the positive correlation between code contribution weight and the number of lines of code contributed by the code contribution object in the code files under the critical target path. On one hand, it eliminates the need to determine a matching responsibility object for each path level, effectively reducing the data processing volume in the target responsibility object determination process. On the other hand, the path backtracking method enables quick and accurate retrieval of the target responsibility object corresponding to the code file, thus achieving efficient and accurate querying of the responsibility objects for the code files without affecting the software project's development progress.

[0128] In one embodiment, the code file responsibility object query method further includes: sending a code file processing request corresponding to the code file to the target responsibility object based on the target responsibility object's corresponding information; receiving a matching relationship update request from the target responsibility object based on the code file processing request; and updating the matching relationship between the key target path and the responsibility object based on the update data carried in the matching relationship update request.

[0129] Specifically, when the server receives a code file processing request submitted by a user, corresponding to a code file, it sends the request to the target responsible object based on the information corresponding to the target responsible object. If the target responsible object is the actual responsible object for the code file processing request, it can directly perform the corresponding processing based on the request. If the target responsible object discovers that the code file processing request is actually for the next level directory, it can request an update to the matching relationship. After setting the update data, it sends a matching relationship update request carrying the update data to the server. The server updates the matching relationship between the critical target path and the responsible object based on the update data carried in the matching relationship update request.

[0130] In this embodiment, since the number of responsible parties actually requiring code file processing is very small compared to the total number of responsible parties, sending code file processing requests corresponding to the code files to the target responsible parties provides a feedback entry point for those receiving such requests. This enables targeted and refined update processing without requiring all responsible parties to confirm their scope of responsibility. Furthermore, based on the feedback from the responsible parties, updating the matching relationship between key target paths and responsible parties yields a more accurate and reliable matching relationship.

[0131] In one embodiment, the matching relationship between the key target path and the responsible object is updated based on the update data carried by the matching relationship update request, including: when the update data is the target path, a new matching relationship is added between the target responsible object and the target path; when the update data is both the updated responsible object and the target path, a new matching relationship is added between the updated responsible object and the target path.

[0132] Specifically, when the target responsible object finds that the responsible object for processing the code file is correct, it finds that the dispatch basis for the code file processing request is the target path, that is, the refined path of the key target path. It can add a matching relationship between the target responsible object and the target path based on the target path to clarify the part of the code file it is actually responsible for, so as to facilitate a more accurate search for the responsible object based on the target path in the future.

[0133] When the target responsible object discovers that the responsible object for processing code files is incorrect, and finds that the dispatch of code files processing requests is based on the target path, but it does not have the best responsible object for code files under the target path, then it updates the responsible object based on the best responsible object for code files under the target path, adds a matching relationship between the updated responsible object and the target path, so as to clarify the actual responsible object for code files under the target path, and facilitates a more accurate search for the responsible object based on the target path in the future.

[0134] In one embodiment, the code file responsibility object query method further includes: in response to a code merge request, determining the code file where the updated code corresponding to the code merge request is located; triggering a responsibility object query event for the target path based on the target path corresponding to the code file; sending a code review request to the target responsibility object of the code file where the updated code is located based on the responsibility object query result, so that the responsibility object can perform code review on the updated code based on the updated code information carried in the code review request; and performing code merge processing on the updated code that passes the review.

[0135] A code merging request refers to a request to replace the existing code in a software project with the updated code after a code update operation. Code update operations include adding, deleting, and modifying code. Updated code is the code obtained after the update operation, such as the code after addition, the code before deletion, and the code before and after modification. The target path corresponding to the code file is the storage path of the code file in the software project. A responsibility object query event is generated by triggering a query targeting the target path. Updated code information can include the code file and line number of the code to be reviewed (e.g., the code after addition, the code before deletion, and the code before and after modification).

[0136] Furthermore, the responsible party for the code file is the best candidate for review. In application scenarios involving code review of code to be merged, the specific data processing flow includes the following: The server determines the updated code information based on the changes to the code to be merged. This updated information can be specific to the modified lines of code within the code file. Based on the target path corresponding to the code file, the server triggers a responsible party query event for that target path. In response to this event, the server queries the responsible parties corresponding to the code files under that target path. When no matching responsible party is found for the target path, the server backtracks along the path hierarchy until a matching responsible party is found in the key target path. The server pushes the responsible party query results containing the corresponding information, thereby obtaining a list of review parties based on these results. This triggers an invitation for review parties from the list to participate in the code review of the code to be merged. The server sends the modification information of the merged code to be reviewed by each review party to the corresponding review party's terminal and receives the review opinions from the review parties. The server then feeds back the review opinions to the code submission party that submitted the code to be merged.

[0137] In a specific application, the code management platform on the server receives a code merging request from the terminal where the code to be modified resides. It calculates the updated code information for the code to be merged and, based on the code file corresponding to the updated code information, triggers a responsibility object query event for the target path. In response to this event, the server queries the responsibility objects corresponding to the code files under the target path. If no matching responsibility object is found for the target path, the server backtracks along the path hierarchy until a matching responsibility object is found in the critical target path. The server then pushes the responsibility object query results, containing information about the corresponding responsibility objects. Based on these results, a list of review objects is generated, and these review objects are invited to review the corresponding code to be merged, obtaining their review opinions.

[0138] In one embodiment, based on the responsibility object query results, a code review request is sent to the target responsibility object of the code file containing the updated code. This includes: obtaining the code contribution weight of the target responsibility object of the code file containing the updated code based on the responsibility object query results; when the code contribution weight meets the weight conditions, sending a code review request to the target responsibility object; and when the code contribution weight does not meet the weight conditions, pushing a prompt message to manually invite the responsibility object to the terminal of the backend administrator.

[0139] Meeting the weighting criteria can be achieved by reaching a code contribution weight threshold, such as a code contribution weight greater than 90%, or other set thresholds. In some cases, the submitted code for review is too scattered, resulting in an overly long list of reviewers matched based on updated code information. Inviting too many reviewers simultaneously is inefficient and impractical. Therefore, by setting weighting criteria, such as an appropriate code contribution weight threshold, only reviewers whose code contribution weight reaches the threshold are invited to participate in the review. If the code contribution weight does not reach the threshold, a prompt is made indicating that a reviewer needs to be manually invited. If the invited reviewer does not provide review comments within the specified time, it is assumed that the reviewer has passed the review of the corresponding code. In a specific embodiment, it can also be set that only the number of reviewers who complete the review of the corresponding code meets the requirement; that is, it can be considered that all the code to be merged in this code modification request has passed the review, thereby improving review efficiency. In addition, when inviting reviewers to participate in code reviews, besides automatically providing the corresponding modified code to the reviewers, static code analysis results can also be provided for the responsible parties to refer to, which can effectively filter out low-level code errors and further improve the overall efficiency of code reviews.

[0140] In this embodiment, by conducting code review based on the responsible party, the best responsible party can be automatically identified as the code review target through updated modification information, avoiding overly subjective and cumbersome communication processes. Furthermore, the corresponding code modification information can be automatically provided, facilitating code review by the review target and effectively improving code review efficiency.

[0141] In a specific application, a user inputs the target path "aaa / xxx / yyy / zzz.java" into a terminal. The terminal submits this target path to the server for responsibility object lookup. If the server cannot find a corresponding responsible object based on the target path "aaa / xxx / yyy / zzz.java", it backtracks along that path and matches the responsible object A at the backtracked path "aaa / xxx / yyy". This record is then used as the delivery basis. The problem existing in aaa / xxx / yyy / zzz.java is delivered to responsible object A for handling. If A discovers that the problem has been mistakenly assigned to it, it checks the assignment basis and finds that "aaa / xxx / yyy" matched it. Then, it adds a more accurate record to the database that records the matching relationship between responsible objects and paths: the responsible object for the target path "aaa / xxx / yyy / zzz.java" is B. The server will reassign the issues in aaa / xxx / yyy / zzz.java to the responsible party B, and all subsequent issues related to aaa / xxx / yyy / zzz.java will be directly assigned to the responsible party B.

[0142] In this embodiment, by adding new processing to the matching relationship between the path and the responsible object according to the target path or the best responsible object of the target path, more accurate and reliable matching relationships can be obtained.

[0143] In one embodiment, such as Figure 7 As shown, a method for determining the responsible party of a code file is provided. Specifically, it includes the following steps:

[0144] Step 702: Determine the path hierarchy of the software project based on the file path of each code file in the software project.

[0145] Step 704: Filter out target levels that meet the level conditions from the path levels, and determine the target path corresponding to the target level.

[0146] Step 706: From the code commit records corresponding to each code file, filter out the target code commit records corresponding to the code files under the target path.

[0147] Step 708: Traverse the target code commit records and obtain the code update data for each line of code in the code file under the target path.

[0148] Step 710: When a code update object exists in the code update data, the latest code update object is identified as the code contribution object of the corresponding line of code.

[0149] Step 712: When there is no code update object in the code update data, the initial code editing object is determined as the code contribution object of the corresponding line of code.

[0150] Step 714: Select the candidate responsible object with the largest code contribution weight from the code contribution objects. The code contribution weight is positively correlated with the cumulative number of lines of code contributed by the code contribution object in the code file.

[0151] Step 716: When the code contribution weight of the candidate responsible object is less than the first weight threshold, the target path is refined layer by layer according to the path level until the code contribution weight of the candidate responsible object corresponding to the code file under the refined key target path is greater than or equal to the first weight threshold.

[0152] Step 718: Identify the candidate responsible objects whose code contribution weight is greater than or equal to the first weight threshold as the responsible objects corresponding to the code files under the critical target path.

[0153] Step 720: When the code contribution weight of a candidate responsible object is greater than or equal to the first weight threshold, the candidate responsible object with the code contribution weight greater than or equal to the first weight threshold is determined as the responsible object corresponding to the code file under the target path.

[0154] Step 722: When the code contribution weight of the responsible object is less than the second weight threshold, the key target path is refined layer by layer according to the path hierarchy, and the responsible object corresponding to the code file under each refined key target path is determined until the code contribution weight of the determined responsible object is greater than or equal to the second weight threshold.

[0155] Step 724: When the code contribution weights of the candidate responsible objects corresponding to the code files under each refined path obtained by refining the target path layer by layer are all less than the first weight threshold, the most refined path corresponding to the target path is obtained.

[0156] Step 726: From the code contribution objects corresponding to each line of code in the target code file corresponding to the most refined path, select the responsible object that has accumulated the most lines of code contribution in the target code file.

[0157] Step 728: Based on the responsibility object corresponding to the file code under each critical target path, establish the matching relationship between the corresponding responsibility object and the corresponding critical target path.

[0158] In one embodiment, such as Figure 8As shown, a method for querying the responsibility object of a code file is provided. Specifically, it includes the following steps:

[0159] Step 802: In response to the responsibility object query event for the target path, query the responsibility object corresponding to the code file under the target path.

[0160] Step 804: When no matching target responsibility object is found for the target path, backtrack the target path layer by layer according to the path hierarchy until a matching target responsibility object is found for the key target path obtained through backtracking.

[0161] Step 806: Push the responsibility object query results containing the information corresponding to the target responsibility object. The target responsibility object is the code contribution object with the highest code contribution weight under the critical target path, and whose code contribution weight meets the weight filtering criteria; the code contribution weight is positively correlated with the number of lines of code contributed by the code contribution object in the code files under the critical target path.

[0162] Step 808: Based on the information corresponding to the target responsible object, send a code file processing request corresponding to the code file to the target responsible object.

[0163] Step 810: Receive the matching relationship update request from the target responsible object based on the code file processing request feedback.

[0164] Step 812: When the update data carried in the matching relationship update request is the target path, a new matching relationship is added between the target responsible object and the target path.

[0165] Step 814: When the update data carried by the matching relationship update request is the update responsibility object and the target path, a new matching relationship is added between the update responsibility object and the target path.

[0166] This application also provides an application scenario, such as Figure 9 As shown, this application scenario utilizes the aforementioned methods for determining and querying the responsibility objects of code files. Specifically, the application of these methods in this scenario is as follows:

[0167] The server retrieves the contribution object information for all lines of each code file based on the code commit records of the software project. Then, based on the contribution number of each code contribution object, it calculates the weight (i.e. the proportion of the contribution amount of the code lines) of all code contribution objects under each critical path.

[0168] For a critical path, if the path is a file path, its code contribution weight is the proportion of the code file's contribution based on its lines of code; if the path is a directory, its code contribution weight is the proportion of the contribution of all files (including subdirectories) in that directory based on their lines of code.

[0169] Specifically, the server determines whether a path is critical from shallow to deep according to the path hierarchy of the software project to simplify data and improve processing efficiency. If the calculated maximum code contribution weight of the corresponding level is less than the minimum weight threshold, the determination of the "code responsible person" for that level is discarded, and the process jumps to the next level. If the maximum code contribution weight is greater than the minimum weight threshold but less than the maximum weight threshold, the contributor corresponding to the maximum code contribution weight is determined as the code responsible person, and the process jumps to the next level. If the maximum code contribution weight is greater than the maximum weight threshold, the contributor corresponding to the maximum code contribution weight is determined as the code responsible person, and the process stops jumping.

[0170] After scanning the code commit records, the correspondence between critical paths and responsible parties is determined, resulting in a database that records the code contribution weights of each code contributor under a path or a database that records the matching relationship between the code responsible parties for a path.

[0171] When a user enters a file path or path fragment in the terminal, the database is queried to obtain the code contribution weight information under that path. If no match is found, the directory of the file is matched, and the search continues backward along the code path until a weight information record is found.

[0172] After finding the code responsible party, if an error is discovered, it's necessary to manually update the corresponding code responsible party to a more accurate status. For example, manually adding a specific code path and its responsible party to the database will ensure that the manually entered matching path, calculated based on code commit records, is more specific and will be prioritized in the code responsible party search, resulting in a more accurate matching result.

[0173] In a specific application, a user inputs the target path "aaa / xxx / yyy / zzz.java" into a terminal. The terminal submits this target path to the server for responsibility object lookup. If the server cannot find a corresponding responsible object based on the target path "aaa / xxx / yyy / zzz.java", it backtracks along that path and matches the responsible object A at the backtracked path "aaa / xxx / yyy". This record is then used as the delivery basis. The problem existing in aaa / xxx / yyy / zzz.java is delivered to responsible object A for handling. If A discovers that the problem has been mistakenly assigned to it, it checks the assignment basis and finds that "aaa / xxx / yyy" matched it. Then, it adds a more accurate record to the database that records the matching relationships between responsible objects and paths: the responsible object for the target path "aaa / xxx / yyy / zzz.java" is B. The server will reassign the issues in aaa / xxx / yyy / zzz.java to the responsible party B, and all subsequent issues related to aaa / xxx / yyy / zzz.java will be directly assigned to the responsible party B.

[0174] The method for querying the responsible party for the aforementioned code files can be applied to code review scenarios. Code review refers to the systematic review of computer source code, often conducted through peer review. Its purpose is to identify and correct errors missed in the early stages of software development, thereby improving software quality and the developers' technical skills. Code reviews are often conducted in different forms, such as pair programming, informal reviews of the entire codebase, or formal software inspections. The code review discussed in this application primarily refers to the code review work conducted before the code is merged into the project's main branch, and is often used to identify defects, vulnerabilities, or other compliance issues.

[0175] Traditional code reviews mainly involve notifying pre-agreed reviewers to review code that is about to be merged into the main branch, or temporarily finding other developers to conduct cross-reviews.

[0176] However, these review methods are too "subjective" in determining the review targets. The review targets are often the code submitter's direct superiors, but often the superiors are not the people most familiar with the code that needs to be reviewed. Furthermore, the process of notifying the review targets to participate in code review often needs to be done manually, which is not conducive to the automation of software engineering.

[0177] Based on the process of querying the responsible party for code files, the responsible party is the best candidate for review. Therefore, the key to determining the review target lies in how to obtain the responsible party's information. In this application scenario, the code review process is automated by combining the above-mentioned responsible party query. The code review specifically includes the following data processing flow:

[0178] (1) The server determines the updated code information based on the code changes to be merged into the trunk, where the updated code information can be specific to the line of code in the code file;

[0179] (2) Based on the updated code information obtained in (1), the server queries the responsible party of the code file where the corresponding code line of the main branch is located and lists the review objects.

[0180] (3) When the code modification object submits a code merging request, the server automatically invites the review object obtained in (2) to participate in the code review of the code that needs to be merged into the main branch. The server sends the modification information of the merged code that each review object needs to review to the corresponding review object, and receives the review object's review comments on the reviewed code.

[0181] (4) The server will provide feedback on the review comments of the reviewed object to the code submission object that needs to be merged into the main branch code.

[0182] Specifically, such as Figure 10 As shown, the code management platform on the server receives a code merging request from the terminal where the code modification object is located, calculates the updated code information of the code to be merged, and, based on the code file corresponding to the updated code information, triggers a responsibility object query event for the target path based on the target path corresponding to the code file. In response to the responsibility object query event for the target path, the server queries the responsibility objects corresponding to the code files under the target path. When no matching target responsibility object is found for the target path, the server backtracks layer by layer according to the path hierarchy until a matching target responsibility object is found in the key target path obtained through backtracking. The server pushes the responsibility object query results containing the corresponding information of the target responsibility object, thereby obtaining a list of review objects based on the responsibility object query results, and inviting the review objects in the review object list to review the corresponding code to be merged, obtaining review opinions. The server can push code merging request verification information to the terminal where the review object is located. The code merging request verification information is as follows: Figure 11 As shown, the information includes the push time of the code merging request verification information, the review target identifier, and the specific content to be reviewed. The content to be reviewed includes the code file and line number of the code to be reviewed (such as the code after addition, the code before deletion, and the code before and after modification). In addition, an entry point for viewing and modifying the responsible object matching data is provided, which facilitates feedback and modification when the review target finds that they are not the reviewer of the code to be reviewed.

[0183] Because the submitted code for review is sometimes too scattered, the list of reviewers matched based on updated code information becomes excessively long. Inviting too many reviewers to conduct code reviews simultaneously is inefficient and impractical. To address this, by setting an appropriate code contribution weight threshold, only reviewers whose contribution weight reaches the threshold are invited to participate in the review. Once the set number of reviewers completes their respective code reviews, the code to be merged for that modification is considered approved. If the contribution weight does not reach the threshold, a manual invitation to reviewers is prompted. If an invited reviewer does not provide feedback within the specified time, their review of the corresponding code is assumed to have passed. Furthermore, when inviting reviewers, in addition to automatically providing the modified code, static code analysis results can also be provided for their reference, effectively filtering out low-level code errors and further improving the overall efficiency of code reviews. By using the above methods for code review, the best responsible party can be automatically identified as the review target by updating code information, avoiding overly subjective and cumbersome communication processes. Furthermore, it can automatically provide relevant code modification information, making it easier for the review target to conduct code review, and effectively improving code review efficiency.

[0184] It should be understood that, although Figure 2 , 6 The steps in flowchart -8 are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order requirement for the execution of these steps, and they can be executed in other orders. Furthermore, Figure 2 , 6 At least some of the steps in -8 may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.

[0185] In one embodiment, such as Figure 12 As shown, a device 1200 for determining the responsibility object of a code file is provided. This device can be a software module, a hardware module, or a combination of both as part of a computer device. Specifically, the device includes: a code contribution object acquisition module 1202, a candidate responsibility object screening module 1204, a target path refinement module 1206, and a responsibility object determination module 1208, wherein:

[0186] The code contribution object acquisition module 1202 is used to obtain the code contribution object corresponding to each line of code in the code file under the target path.

[0187] The candidate responsibility object screening module 1204 is used to screen out the candidate responsibility object with the largest code contribution weight from the code contribution objects. The code contribution weight is positively correlated with the cumulative number of lines of code contributed by the code contribution object in the code file.

[0188] The target path refinement module 1206 is used to refine the target path layer by layer according to the path level when the code contribution weight of the candidate responsibility object does not meet the weight screening conditions, until the code contribution weight of the candidate responsibility object corresponding to the code file under the refined key target path meets the weight screening conditions.

[0189] The responsibility object determination module 1208 is used to determine the candidate responsibility objects whose code contribution weights meet the weight screening conditions as the responsibility objects of the code files under the critical target path.

[0190] In one embodiment, the device for determining the responsible party of the code file further includes a finest path processing module, which includes a finest path acquisition unit and a responsible party filtering unit.

[0191] The finest path acquisition unit is used to acquire the finest path corresponding to the target path when the code contribution weights of the candidate responsible objects corresponding to the code files under each finest path obtained by refining the target path layer by layer do not meet the weight screening conditions.

[0192] The responsibility object filtering unit is used to filter out the responsibility object with the most cumulative number of lines of code contribution in the target code file from the code contribution objects corresponding to each line of code in the target code file corresponding to the most refined path.

[0193] In one embodiment, the weighting screening condition is that the code contribution weight is greater than or equal to a first weight threshold; the code file responsibility object determination device further includes a key target path refinement module, used to refine the key target path layer by layer according to the path hierarchy when the code contribution weight of the responsibility object is less than a second weight threshold, and determine the responsibility object corresponding to the code file under each refined key target path, until the code contribution weight of the determined responsibility object is greater than or equal to the second weight threshold; wherein, the second weight threshold is greater than the first weight threshold.

[0194] In one embodiment, the device for determining the responsible object of the code file further includes a target path determination module, which includes a path hierarchy determination unit and a target path determination unit.

[0195] The path hierarchy determination unit is used to determine each path hierarchy of the software project based on the file path of each code file in the software project.

[0196] The target path determination unit is used to filter out target levels that meet the level conditions from the path levels and determine the target path corresponding to the target level.

[0197] In one embodiment, the code contribution object acquisition module includes a target code submission record filtering unit and a code contribution object determination unit;

[0198] The target code submission record filtering unit is used to filter out the target code submission records corresponding to the code files under the target path from the code submission records corresponding to each code file.

[0199] The code contribution object determination unit is used to traverse the target code submission record to obtain the code contribution object corresponding to each line of code in the code file.

[0200] In one embodiment, the code contribution object determination unit includes a code update data unit, a first code contribution object determination unit, and a second code contribution object determination unit;

[0201] The code update data unit is used to traverse the target code commit record and obtain the code update data of each line of code in the code file under the target path.

[0202] The first code contribution object determination unit is used to determine the latest code update object as the code contribution object of the corresponding line of code when there is a code update object in the code update data;

[0203] The second code contribution object determination unit is used to determine the initial code editing object as the code contribution object of the corresponding line of code when there is no code update object in the code update data.

[0204] In one embodiment, the code files under the target path are a combination of code files with a number greater than 1; the device for determining the responsible object of the code files further includes a cumulative contribution code line count determination module, which is used to accumulate the cumulative contribution code lines of each code contribution object in the code file combination based on the number of code lines contributed by the corresponding code contribution object in each code file in the code file combination.

[0205] In one embodiment, the code file responsibility object determination device further includes a matching relationship establishment module, which is used to establish a matching relationship between the corresponding responsibility object and the corresponding key target path based on the responsibility object corresponding to the file code under each key target path.

[0206] In one embodiment, such as Figure 13 As shown, a code file responsibility object query device 1300 is provided. This device can be a software module, a hardware module, or a combination of both as part of a computer device. Specifically, the device includes: a responsibility object query module 1302, a path backtracking module 1304, and a query result push module 1306, wherein:

[0207] The responsibility object query module 1302 is used to query the responsibility objects corresponding to the code files under the target path in response to a responsibility object query event for the target path;

[0208] The path backtracking module 1304 is used to backtrack the target path layer by layer according to the path hierarchy when no matching target responsibility object is found under the target path, until a matching target responsibility object is found in the key target path obtained by backtracking.

[0209] The query result push module 1306 is used to push query results of the responsible object containing information corresponding to the target responsible object;

[0210] The target responsibility object is the code contribution object with the largest code contribution weight under the matching target path, and the code contribution weight meets the weight screening condition; the code contribution weight is positively correlated with the number of lines of code contributed by the code contribution object in the code file under the matching target path.

[0211] In one embodiment, the code file responsibility object query device further includes a code file processing request discovery module, a matching relationship update request receiving module, and a matching relationship update module;

[0212] The code file processing request discovery module is used to send a code file processing request corresponding to the code file to the target responsible object based on the target responsible object's corresponding information;

[0213] The matching relationship update request receiving module is used to receive the matching relationship update request fed back by the target responsible object based on the code file processing request;

[0214] The matching relationship update module is used to update the matching relationship between the key target path and the responsible object based on the update data carried in the matching relationship update request.

[0215] In one embodiment, the matching relationship update module includes a first update unit and a second update unit;

[0216] The first update unit is used to add a matching relationship between the target responsibility object and the target path when the updated data is the target path;

[0217] The second update unit is used to add a matching relationship between the update responsibility object and the target path when the update data is the update responsibility object and the target path.

[0218] In one embodiment, the code file responsibility object query device further includes a code review module, configured to, in response to a code merge request, determine the code file containing the updated code corresponding to the code merge request; trigger the responsibility object query event for the target path based on the target path corresponding to the code file; send a code review request to the target responsibility object of the code file containing the updated code based on the responsibility object query result, so that the responsibility object can perform code review on the updated code based on the updated code information carried in the code review request; and perform code merge processing on the updated code that passes the review.

[0219] In one embodiment, the code review module is further configured to obtain the code contribution weight of the target responsible object in the code file where the updated code is located based on the query results of the responsible object; and when the code contribution weight meets the weight conditions, send a code review request to the target responsible object.

[0220] Specific embodiments of the device for determining the responsible party of a code file and the device for querying the responsible party of a code file can be found in the embodiments of the method for determining the responsible party of a code file and the method for querying the responsible party of a code file described above, and will not be repeated here. Each module in the above-mentioned device for determining the responsible party of a code file and the device for querying the responsible party of a code file can be implemented entirely or partially through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in a computer device in hardware form, or it can be stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0221] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 14As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores the matching relationships between responsibility objects and paths. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a method for determining responsibility objects in a code file and a method for querying responsibility objects in a code file.

[0222] Those skilled in the art will understand that Figure 14 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0223] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

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

[0225] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, causing the computer device to perform the steps in the above method embodiments.

[0226] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

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

[0228] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for determining the responsible party of a code file, characterized in that, The method includes: Retrieve the code contribution object corresponding to each line of code in the code file under the target path; From the code contribution objects, the candidate responsibility object with the largest code contribution weight is selected. The code contribution weight is positively correlated with the cumulative number of lines of code contributed by the code contribution object in the code file. When the code contribution weight of the candidate responsible object does not meet the weight screening conditions, the target path is refined layer by layer according to the path level until the code contribution weight of the candidate responsible object corresponding to the code file under the refined key target path meets the weight screening conditions. Candidate responsibility objects whose code contribution weights meet the weight screening criteria are identified as the responsibility objects corresponding to the code files under the critical target path; the responsibility objects corresponding to the code files under each critical target path are used to establish a matching relationship between the corresponding responsibility objects and the corresponding critical target paths.

2. The method according to claim 1, characterized in that, The method further includes: When the code contribution weights of the candidate responsible objects corresponding to the code files under each refined path obtained by refining the target path layer by layer do not meet the weight screening conditions, the most refined path corresponding to the target path is obtained. From the code contribution objects corresponding to each line of code in the target code file corresponding to the most refined path, select the responsible object with the most cumulative contribution lines of code in the target code file.

3. The method according to claim 1, characterized in that, The weighting selection criterion is that the code contribution weight is greater than or equal to a first weight threshold; the method further includes: When the code contribution weight of the responsible object is less than the second weight threshold, the key target path is refined layer by layer according to the path hierarchy, and the responsible object corresponding to the code file under each refined key target path is determined until the code contribution weight of the determined responsible object is greater than or equal to the second weight threshold. Wherein, the second weight threshold is greater than the first weight threshold.

4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Based on the file path of each code file in the software project, determine the path hierarchy of the software project; Target levels that meet the level conditions are selected from the path levels, and the target paths corresponding to the target levels are determined.

5. The method according to any one of claims 1 to 3, characterized in that, The process of obtaining the code contribution object corresponding to each line of code in the code file under the target path includes: From the code commit records corresponding to each code file, filter out the target code commit records corresponding to the code files under the target path; Traverse the target code commit records to obtain the code contribution object corresponding to each line of code in the code file.

6. The method according to claim 5, characterized in that, The process of traversing the target code commit records to obtain the code contribution object corresponding to each line of code in the code file includes: Iterate through the target code commit records and obtain the code update data for each line of code in the code file under the target path; When a code update object exists in the code update data, the latest code update object is identified as the code contribution object of the corresponding line of code; When there is no code update object in the code update data, the initial code editing object is determined as the code contribution object of the corresponding line of code.

7. The method according to any one of claims 1 to 3, characterized in that, The code files under the target path are a combination of code files with more than one file; the method further includes: For each code contribution object, the cumulative number of lines of code contributed by each code contribution object in the code file combination is accumulated based on the number of lines of code contributed by the corresponding code contribution object in each code file in the code file combination.

8. A method for querying the responsibility object of a code file, characterized in that, The method includes: In response to a responsibility object query event for a target path, a query is performed on the responsibility object corresponding to the code file under the target path; When no matching target responsibility object is found for the target path, the target path is backtracked layer by layer according to the path hierarchy until a matching target responsibility object is found for the key target path obtained through backtracking; the matching relationship between the key target path and the responsibility object is obtained by the method for determining the responsibility object of the code file as described in any one of claims 1 to 7; Push the responsibility object query results containing the information corresponding to the target responsibility object; The target responsibility object is the code contribution object that contributes the most code under the critical target path and whose code contribution weight meets the weight screening conditions; the code contribution weight is positively correlated with the number of lines of code contributed by the code contribution object in the code file under the critical target path.

9. The method according to claim 8, characterized in that, The method further includes: Based on the information corresponding to the target responsibility object, a code file processing request corresponding to the code file is sent to the target responsibility object; Receive the matching relationship update request fed back by the target responsible object based on the code file processing request; Based on the update data carried in the matching relationship update request, the matching relationship between the key target path and the responsible object is updated.

10. The method according to claim 9, characterized in that, The process of updating the matching relationship between the key target path and the responsible object based on the update data carried in the matching relationship update request includes: When the updated data is the target path, a new matching relationship is added between the target responsibility object and the target path; When the updated data consists of an updated responsibility object and the target path, a new matching relationship is added between the updated responsibility object and the target path.

11. The method according to claim 8, characterized in that, The method further includes: In response to a code merge request, determine the code file containing the updated code corresponding to the code merge request; Based on the target path corresponding to the code file, the responsibility object query event for the target path is triggered; Based on the query results of the responsible object, a code review request is sent to the target responsible object of the code file where the updated code is located, so that the responsible object can conduct a code review of the updated code based on the updated code information carried in the code review request; The updated code that has passed the review will be merged into the code.

12. The method according to claim 11, characterized in that, The step of sending a code review request to the target responsible party of the code file containing the updated code, based on the query results of the responsible party, includes: Based on the query results of the responsible object, obtain the code contribution weight of the target responsible object in the code file where the updated code is located; When the code contribution weight meets the weight condition, a code review request is sent to the target responsible party.

13. A device for determining the responsible party of a code file, characterized in that, The device includes: The code contribution object retrieval module is used to retrieve the code contribution object corresponding to each line of code in the code file under the target path. The candidate responsibility object filtering module is used to filter out the candidate responsibility object with the largest code contribution weight from the code contribution objects. The code contribution weight is positively correlated with the cumulative number of lines of code contributed by the code contribution object in the code file. The target path refinement module is used to refine the target path layer by layer according to the path level when the code contribution weight of the candidate responsible object does not meet the weight screening conditions, until the code contribution weight of the candidate responsible object corresponding to the code file under the refined key target path meets the weight screening conditions. The responsibility object determination module is used to determine the candidate responsibility objects whose code contribution weight meets the weight screening conditions as the responsibility objects of the code files under the key target path; the responsibility objects corresponding to the file code under each key target path are used to establish the matching relationship between the corresponding responsibility objects and the corresponding key target paths.

14. The apparatus according to claim 13, characterized in that, The device for determining the responsible party of the code file further includes a finest path processing module, which includes a finest path acquisition unit and a responsible party filtering unit. The finest path acquisition unit is used to acquire the finest path corresponding to the target path when the code contribution weights of the candidate responsible objects corresponding to the code files under each finest path obtained by refining the target path layer by layer do not meet the weight screening conditions. The responsibility object filtering unit is used to filter out the responsibility object with the most cumulative number of lines of code contribution in the target code file from the code contribution objects corresponding to each line of code in the target code file corresponding to the most refined path.

15. The apparatus according to claim 13, characterized in that, The weighting selection condition is that the code contribution weight is greater than or equal to the first weight threshold; the code file responsibility object determination device further includes a key target path refinement module, which is used to refine the key target path layer by layer according to the path level when the code contribution weight of the responsibility object is less than the second weight threshold, and determine the responsibility object corresponding to the code file under each refined key target path, until the code contribution weight of the determined responsibility object is greater than or equal to the second weight threshold; wherein, the second weight threshold is greater than the first weight threshold.

16. The apparatus according to any one of claims 13 to 15, characterized in that, The device for determining the responsible party of the code file further includes a target path determination module, which includes a path hierarchy determination unit and a target path determination unit. The path hierarchy determination unit is used to determine each path hierarchy of the software project based on the file path of each code file in the software project. The target path determination unit is used to filter out target levels that meet the level conditions from the path levels and determine the target path corresponding to the target level.

17. The apparatus according to any one of claims 13 to 15, characterized in that, The code contribution object acquisition module includes a target code submission record filtering unit and a code contribution object determination unit; The target code submission record filtering unit is used to filter out the target code submission records corresponding to the code files under the target path from the code submission records corresponding to each code file. The code contribution object determination unit is used to traverse the target code submission record to obtain the code contribution object corresponding to each line of code in the code file.

18. The apparatus according to claim 17, characterized in that, The code contribution object determination unit includes a code update data unit, a first code contribution object determination unit, and a second code contribution object determination unit. The code update data unit is used to traverse the target code commit record and obtain the code update data of each line of code in the code file under the target path. The first code contribution object determination unit is used to determine the latest code update object as the code contribution object of the corresponding line of code when there is a code update object in the code update data; The second code contribution object determination unit is used to determine the initial code editing object as the code contribution object of the corresponding line of code when there is no code update object in the code update data.

19. The apparatus according to any one of claims 13 to 15, characterized in that, The code files under the target path are a combination of code files with a number greater than 1; the device for determining the responsible object of the code files further includes a cumulative contribution code line count determination module, which is used to accumulate the cumulative contribution code lines of each code contribution object in the code file combination based on the number of code lines contributed by the corresponding code contribution object in each code file in the code file combination.

20. A device for querying the responsibility object of a code file, characterized in that, The device includes: The responsibility object query module is used to query the responsibility objects corresponding to the code files under the target path in response to a responsibility object query event for the target path; The path backtracking module is used to backtrack the target path layer by layer according to the path hierarchy when no matching target responsibility object is found under the target path, until a matching target responsibility object exists in the backtracked key target path; the matching relationship between the key target path and the responsibility object is obtained by the code file responsibility object determination device according to any one of claims 13 to 19. The query result push module is used to push query results for the responsible object that contain information corresponding to the target responsible object; The target responsibility object is the code contribution object with the largest code contribution weight under the matching target path, and the code contribution weight meets the weight screening conditions; the code contribution weight is positively correlated with the number of lines of code contributed by the code contribution object in the code file under the matching target path.

21. The apparatus according to claim 20, characterized in that, The code file responsibility object query device further includes a code file processing request discovery module, a matching relationship update request receiving module, and a matching relationship update module; The code file processing request discovery module is used to send a code file processing request corresponding to the code file to the target responsible object based on the target responsible object's corresponding information; The matching relationship update request receiving module is used to receive the matching relationship update request fed back by the target responsible object based on the code file processing request; The matching relationship update module is used to update the matching relationship between the key target path and the responsible object based on the update data carried in the matching relationship update request.

22. The apparatus according to claim 21, characterized in that, The matching relationship update module includes a first update unit and a second update unit; The first update unit is used to add a matching relationship between the target responsibility object and the target path when the updated data is the target path; The second update unit is used to add a matching relationship between the update responsibility object and the target path when the update data is the update responsibility object and the target path.

23. The apparatus according to claim 20, characterized in that, The code file responsibility object query device further includes a code review module, used to determine the code file where the updated code corresponding to the code merge request is located in response to the code merge request; Based on the target path corresponding to the code file, the responsibility object query event for the target path is triggered; Based on the query results of the responsible object, a code review request is sent to the target responsible object of the code file where the updated code is located, so that the responsible object can conduct a code review of the updated code based on the updated code information carried in the code review request; The updated code that has passed the review will be merged into the code.

24. The apparatus according to claim 23, characterized in that, The code review module is also used to obtain the code contribution weight of the target responsible object in the code file where the updated code is located based on the query results of the responsible object; when the code contribution weight meets the weight conditions, a code review request is sent to the target responsible object.

25. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 12.

26. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 12.

27. A computer program product comprising computer instructions stored in a computer-readable storage medium, wherein a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions such that the computer device performs the steps of the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Malicious code detection method and system

    CN101984450A

  • Code contribution statistical method and device

    CN111367529A