Image-based code reviewer recommendation method and code reviewer image system

By constructing a reviewer profiling system based on knowledge graphs, the problem of inaccurate reviewer profiling in existing technologies has been solved, enabling rapid recommendation of the most suitable reviewer and improving project progress and work efficiency.

CN114564672BActive Publication Date: 2025-10-24NANJING KUANGJI INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210177357.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-24
Publication Date
2025-10-24
Estimated Expiration
2042-02-24

AI Technical Summary

Technical Problem

Existing code reviewer profiling systems fail to comprehensively analyze the connections between reviewers and the community structure of project teams, resulting in inaccurate reviewer profiling analysis, excessively long merge request cycles, and impacting project progress.

Method used

A knowledge graph-based reviewer profiling system is constructed, including modules for data processing, knowledge graph construction, graph query, indicator calculation, and graph visualization. By extracting entities, attributes, and relationships, the system calculates reviewer review processes and relationship indicators, establishes reviewer profiles, and recommends the most suitable reviewers based on these profiles.

Benefits of technology

It improved the accuracy of reviewer profiles, shortened the merging cycle of merge requests, and improved project progress and the work efficiency of reviewers and developers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114564672B_ABST
    Figure CN114564672B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of code reviewer recommendation method based on portrait, and the present application belongs to information processing technical field, specifically related to the establishment of review field knowledge graph, and establish reviewer portrait based on it, including: according to the attribute information of merging request, historical review data, the attribute data of user and the attribute data of warehouse etc., extract entity, attribute and the relationship between entities, build review field knowledge graph;Based on the review knowledge graph established, the review process index measurement and review relationship index measurement of reviewer are calculated and analyzed;Reviewer portrait is shown using visualization technology, including the basic information of reviewer, multidimensional index and review relationship diagram.Reviewer portrait and review knowledge graph constructed are used to distribute recommended reviewer to unreviewed merging request, speed up the speed of merging request being reviewed, which is conducive to promoting project progress.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of information processing, and particularly relates to a code reviewer recommendation method based on a portrait and a code reviewer portrait system. BACKGROUND

[0002] Code review is an important means to guarantee code quality and is one of the best practices of software development. In recent years, code review has been widely used by software development companies and organizations at home and abroad, and has changed from an optional item to a mandatory item. Contributors of a project can modify the code to a certain extent and submit it to the community in the form of a merge request. Reviewers can review the merge request and leave their opinions. Project integrators then decide whether to merge the request or give up merging it.

[0003] Researchers have found that lax code review affects software quality, and active participation in the code review process has a positive impact on software quality. Factors such as review cycle, review interval, and review frequency in code review affect the quality and progress of the project. A reviewer portrait system can intuitively show the review relationship, work situation, and work characteristics of the reviewer, enabling managers to quickly understand the characteristics and structure of the project team.

[0004] Existing reviewer portraits usually focus on review process metrics, i.e., describing the relationship between reviewers and merge requests, while ignoring the connection between reviewers and the community structure of the project team, resulting in incomplete and inaccurate reviewer portrait analysis. On the other hand, the merging period of merge requests that have not been assigned to appropriate reviewers is much longer than that of other merge requests, which will lead to a lag in project progress. Unlike the mainstream application scenario of item recommendation, the project team has a large flow of personnel, and historical review data is time-sensitive. At the same time, code reviewers are expected to respond to merge requests as soon as possible, and when the reviewer's response time exceeds a threshold, other reviewers should be recommended. Therefore, special consideration needs to be given to the impact of time factors on code reviewer recommendation. SUMMARY

[0005] The present application aims to provide a code reviewer portrait system that comprehensively analyzes and displays the work characteristics and work relationships of code reviewers, addressing the shortcomings of existing methods. Another objective of the present application is to provide a code reviewer recommendation method based on the above-mentioned system.

[0006] To achieve the above-mentioned objectives, the technical solutions of the present application are as follows: a reviewer portrait system based on a knowledge graph, the system comprising a data processing module, a knowledge graph construction module, a graph query module, an index calculation module, and a graph visualization module.

[0007] The data processing module is configured to obtain relevant data of the merge request using a crawler, and process records with null values to obtain data for constructing a knowledge graph.

[0008] The knowledge graph construction module is configured to extract required entities, relationships and attributes from the data, and store them in a Neo4j graph database to construct a review knowledge graph.

[0009] The graph query module is configured to query a knowledge graph subgraph containing a reviewer node in the Neo4j graph database based on the established review knowledge graph.

[0010] The index calculation module is configured to calculate review process indexes of the reviewer and review relationship indexes of the reviewer based on the knowledge graph subgraph obtained by the graph query module, to measure the review process and review relationship of the reviewer.

[0011] The graph visualization module is configured to visualize the reviewer basic information obtained by the data processing module, the subgraph containing the reviewer node obtained by the graph query module, and the review process indexes and review relationship indexes calculated by the index calculation module, to display a multi-dimensional portrait of the reviewer.

[0012] A code reviewer recommendation method based on a portrait includes the following steps:

[0013] S1: According to the attribute data of the merge request, the historical review data, the attribute data of the user and the attribute data of the warehouse, etc., extract entities, attributes and relationships between entities, and construct a review knowledge graph.

[0014] S2: Based on the established review knowledge graph, construct a reviewer evaluation index system including reviewer review relationship indexes and reviewer review process indexes.

[0015] S3: Based on the established review knowledge graph, query a knowledge graph subgraph containing a reviewer node, calculate reviewer review relationship indexes and reviewer review process indexes, and establish a reviewer portrait.

[0016] S4: When a new merge request is submitted, calculate the matching degree of each reviewer with the merge request, select the most matched reviewer and notify.

[0017] Preferably, before establishing the review knowledge graph, the following steps are further included:

[0018] Obtain attribute information of all merge requests used to construct the graph, including but not limited to: merge request ID, creation time, update time, closing time, merge time, status, author ID, reviewer ID;

[0019] Obtain attribute information of all users for constructing the graph, including but not limited to: username, user ID, user type;

[0020] Obtain attribute information of all repositories for constructing the graph, including but not limited to: repository name, repository ID, owner ID, creation time, update time;

[0021] Preferably, before establishing the review knowledge graph, the following steps are further included:

[0022] Process missing or abnormal data in the data;

[0023] Preferably, the specific steps of establishing the review knowledge graph using the knowledge graph construction method include:

[0024] S1-1: Obtain data, i.e., obtain the required data from the data source;

[0025] S1-2: Extract knowledge. After obtaining the data, the entities, attributes, and mutual relationships between the entities need to be extracted from the data, and on this basis, the ontological knowledge representation is formed;

[0026] S1-3: Write the entities and relationships into the database, construct and store the knowledge graph;

[0027] Preferably, based on the established review knowledge graph, the specific steps of querying the knowledge graph subgraph containing the reviewer node, calculating the review relationship index and review process index of the reviewer, and establishing the reviewer portrait include:

[0028] S3-1: Query the knowledge graph subgraph containing the reviewer node, including the merge request reviewed by the reviewer, the merge request merged by the reviewer, the reviewer who reviewed the above merge request, the author of the above merge request, etc.

[0029] S3-2: Calculate the importance of the reviewer using the centrality algorithm;

[0030] S3-3: Query the merge request information related to the reviewer, including the merge request reviewed by the reviewer and the merge request merged by the reviewer;

[0031] S3-4: Calculate the review process index of the reviewer according to the merge request information related to the reviewer;

[0032] Preferably, when a new merge request is submitted, the specific steps of calculating the matching degree of each reviewer with the merge request, selecting the most matched reviewer and notifying include:

[0033] S4-1: Obtain attribute information of the merge request, including author ID, creation time, etc.

[0034] S4-2: Query the established review knowledge graph to obtain the historical reviewer set of the merge request created by the user;

[0035] S4-3: Calculate the score of each candidate reviewer, considering the similarity with the historical reviewer of the user, the review process index and the review relationship index of the reviewer, and weightedly adding to obtain the score;

[0036] S4-4: Sort the candidate reviewers according to the final score, and select one or more persons with the highest score as the result of reviewer recommendation;

[0037] S4-5: If the reviewer response time is too long, the next person is recommended as the reviewer in turn.

[0038] The beneficial effects of the present application are: according to the attribute information of the merge request, the historical review data, the attribute data of the user and the attribute data of the warehouse, the entities, attributes and relationships between entities are extracted, and the review field knowledge graph is constructed; based on the established review knowledge graph, the review process index and the review relationship index of the reviewer are calculated and analyzed; the visual technology is used to display the reviewer portrait, including the basic information of the reviewer, the multi-dimensional index and the review relationship graph; using the constructed reviewer portrait and the review knowledge graph, the recommended reviewer is allocated to the unreviewed merge request. The reviewer portrait is beneficial to the manager to understand the project organization structure and the recent work status of the reviewer, to adjust the development plan of the team and to allocate and arrange the subsequent work. The reviewer recommendation can speed up the review of the merge request, avoid the situation that the merge request is not reviewed for a long time, reduce the switching between the development work and the review work, and is beneficial to improve the work efficiency of the reviewer and the developer, and to promote the project progress. BRIEF DESCRIPTION OF DRAWINGS

[0039] Figure 1 is a flowchart of a code reviewer recommendation method based on portrait in embodiment 1 of the present application.

[0040] Figure 2 is a system structure schematic diagram of a reviewer portrait provided in embodiment 2 of the present application based on knowledge graph. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below with reference to the drawings. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.

[0042] Embodiment 1

[0043] Figure 1For the flowchart of the image-based code reviewer recommendation method in Example 1, the scheme specifically includes the following steps:

[0044] Step S1, according to the attribute data of the merge request, the historical review data, the attribute data of the user and the attribute data of the warehouse, etc., extract entities, attributes and relationships between entities, and construct a review knowledge graph.

[0045] In constructing the review knowledge graph, the data information of the merge request, the user and the warehouse is first collected, and then the entities, attributes and relationships therein are extracted, stored and constructed into a review knowledge graph. The specific steps are as follows:

[0046] Step S1-1, collect the valid information of the merge request.

[0047] When collecting the merge request information, valid data information is obtained from the code warehouse as the data source. First, all the warehouse information needed is obtained, and then all the merge request information of a certain warehouse is obtained. The required data is crawled in layers.

[0048] Step S1-2, extract entities, attributes and relationships, and construct a review knowledge graph.

[0049] The entity types in this embodiment are:

[0050] The merge request (PullRequest) contains 11 attributes, including author name (author_name), author ID (author_id), author identity (author_identity), whether merged (merged), creation time (created_at), update time (updated_at), closing time (closed_at), title (title), merge request number (number), merge request content (merge request_body), state (state), and node ID (node_id).

[0051] The warehouse (Repo) contains 10 attributes, including warehouse name (node_name), warehouse ID (node_id), owner ID (owner_id), description (description), creation time (created_at), update time (updated_at), star count (stargazers_count), observation count (watchers_count), fork count (forks_count), and language (language).

[0052] User, contains 12 attributes: username, node_name, node_id, type, public_gists, followers, following, location, company, avatar_url, created_at, updated_at.

[0053] Integrator, no attribute. Represents the user as an Integrator with the right to merge.

[0054] The relationship types in this embodiment are:

[0055] Create_PullRequest, contains create_time and updated_time. The starting node type is User entity type, pointing to PullRequest entity type. Used to describe the information of the author creating the merge request.

[0056] Review_PullRequest, contains review_id, comment_body, review_at, review_state. The starting node type is User entity type, pointing to PullRequest entity type. Used to describe the information of the reviewer reviewing the merge request.

[0057] Merge_PullRequest, contains merged_at. The starting node type is User entity type, pointing to PullRequest entity type. Used to describe the information of the reviewer merging the merge request.

[0058] Request, no attribute. The starting node type is PullRequest entity type, pointing to Repo entity type. Used to describe the ownership relationship between the merge request and the repository.

[0059] MERGEONES, contains weight. The starting node type is User entity type, pointing to User entity type. Used to describe the relationship between the reviewer and the reviewed.

[0060] ReviewOne, contains a weight attribute. The start node type is the User entity type, and points to the User entity type. It is used to describe the review relationship between the reviewer and the reviewed.

[0061] The required entities, attributes and relationships are extracted from the data obtained in step S1-2.

[0062] In step S1-3, the entities and relationships are written into the database to build and store the knowledge graph.

[0063] After extracting and merging the request entities and related relationships, the entities and relationships are written into the database. If there is a relationship related to an existing entity (such as a new merge request associated with a new reviewer), the information of the entity is obtained first, and then the node is established and the related relationship is established.

[0064] Step S2, based on the established review knowledge graph, build a reviewer evaluation index system including two parts of reviewer review relationship index and reviewer review process index.

[0065] The complete cycle of a merge request starts from creation, repeatedly receives review opinions, modifies and waits for review opinions again, until the merge request is merged into the repository or rejected. The time interval from the creation of the merge request to the receipt of the first review is regarded as the "review waiting" state, and the time interval from the receipt of the first review to the merging or closing of the merge request is regarded as the "review pending" state.

[0066] Specifically, the present embodiment considers that the merge request should be reviewed as soon as possible to speed up the project progress, and determines six review process indexes, including average waiting time, average pending time, average review cycle, average review interval, average review times and review approval rate, as the reviewer process index part in the reviewer evaluation index system.

[0067] Specifically, the present embodiment considers that the core project team members should be responsible for more people's merge request review tasks, and determines the reviewer importance as the reviewer relationship index part in the reviewer evaluation index system.

[0068] Step S2, based on the established review knowledge graph, query the knowledge graph subgraph containing the reviewer node, calculate the review relationship index and review process index of the reviewer, and establish the reviewer portrait.

[0069] The specific steps are as follows:

[0070] Step S3-1, query the knowledge graph subgraph containing the reviewer node, including the merge request reviewed by the reviewer, the merge request merged by the reviewer, the reviewer who reviewed the above merge request, the author of the above merge request, and the like.

[0071] Step S3-2, calculate the importance of the reviewer using the centrality algorithm.

[0072] Considering the relationship between the reviewer and other users, the importance of the reviewer is calculated to determine whether the reviewer is a core member of the project.

[0073] Specifically, the embodiment uses the centrality algorithm PageRank to measure the importance of the reviewer. The PageRank value of the reviewer is calculated as a measure of the importance of the reviewer. The review relationship of the reviewer with others can reflect the importance of the reviewer. The more merge requests created by the reviewer, the more important the reviewer is. The calculated PageRank value is stored or updated as an attribute of the reviewer.

[0074] Step S3-3, query the merge request information related to the reviewer, including the merge request reviewed by the reviewer and the merge request merged by the reviewer.

[0075] Step S3-4, according to the merge request information related to the reviewer, calculate the average waiting time, the average suspension time, the average review period, the average review interval, the average review times, the review approval rate and other review process indicators of the reviewer.

[0076] In this embodiment, the average waiting time, the average suspension time, the average review period, the average review interval, the average review times, and the review approval rate of the reviewer are studied based on the review knowledge graph. Query all review relationships of the reviewer to obtain the creation time, update time, current state, merging situation, closing time, and review time list of each merge request.

[0077] Specifically, the average waiting time calculation method is to subtract the creation time from the minimum value in the review time list of the merge request to obtain the waiting time. Divide the waiting time by the total number of merge requests to obtain the average waiting time.

[0078] The average suspension time calculation method is to subtract the minimum value in the review time list from the merging time of the merge request to obtain the suspension time. Divide the suspension time by the total number of merge requests to obtain the average suspension time.

[0079] The average review period calculation method is to subtract the creation time of the merge request from the closing time of the merge request to obtain the review period. Here, only the merge requests in the closed state are calculated. Divide the total review period by the number of merge requests in the closed state to obtain the average review period.

[0080] The average review interval calculation method is to subtract the minimum value from the maximum value in the merged request review time list to obtain the iteration duration. Divide by the number of reviews - 1 to obtain the average review interval. If the period ends after one review, i.e. the merged request is closed, the review interval is 0.

[0081] The average review number calculation method is to add the length of the review time list of each merged request to obtain the total number of reviews.

[0082] The review agreement rate metric calculation method is to calculate the number of merged requests whose update time is after the minimum value of the review time list to obtain the total number of review agreements. Divide by the number of all merged requests reviewed by the reviewer to obtain the review agreement rate.

[0083] The above six review process metrics of each reviewer are calculated and stored or updated as the attributes of the reviewer.

[0084] Step S4, when a new merged request is submitted, the matching degree of each reviewer with the merged request is calculated, and the most matched reviewer is selected and notified.

[0085] The specific steps are as follows:

[0086] Step S4-1, obtain the attribute information of the merged request, including the creation time, author ID, etc.

[0087] In this embodiment, the recommendation is mainly combined with the historical review relationship in the review knowledge graph and the constructed reviewer portrait, and the time effectiveness is considered as a factor for adjusting the weight.

[0088] Step S4-2, query the established review knowledge graph to obtain the historical reviewer set of other merged requests of the author of the merged request.

[0089] Query the reviewer set that has reviewed the merged request created by the user, to prepare for the next similarity calculation.

[0090] Step S4-3, calculate the score of each candidate reviewer, considering the similarity with the historical reviewer of the user, the review process index and the review relationship index of the reviewer, and weightedly adding to obtain the score.

[0091] Specifically, the score is composed of two parts: similarity-based score and portrait-based score. Since there may be personnel flow in the project, the range of candidate reviewers is limited to reviewers who have review behavior in the past two weeks.

[0092] Specifically, the similarity algorithm Jaccard is used in this embodiment to measure the similarity between reviewers. The specific calculation process of the reviewer similarity is as follows:

[0093] (1) Get the set of Reviewers (r i ) who reviewed the same merge request as the reviewer to be detected;

[0094] (2) Get the set of Reviewers (r j ) who reviewed the same merge request as another reviewer;

[0095] (3) Calculate the Jaccard similarity between the two sets as the similarity between the two reviewers. The formula for calculating the Jaccard similarity coefficient is as follows:

[0096]

[0097] where A, B are two sets to be calculated, J(A, B) is the Jaccard similarity coefficient between the two sets. In particular, when both sets are empty sets, the value of J(A, B) is 1.

[0098] Get the set of historical Reviewers (Reviewers (author)) of the author of the merge request, calculate the similarity between the candidate reviewer and each historical reviewer, and add the results weightedly. The weight weight is the total number of times the historical reviewer reviews the user, that is, the weight attribute value of the REVIEWONES relationship in the knowledge graph.

[0099]

[0100] Normalize the result to get the similarity-based score NormSimilarityScore(r i , author).

[0101] If the user who submits the merge request has no historical review data, it will cause the cold start problem, and only using the review relationship for recommendation is not comprehensive. Therefore, the review process indicators and review relationship indicators in the reviewer portrait are weightedly added to get the score based on the reviewer portrait. In the reviewer indicators, importance and review agreement rate are positively correlated with reviewer score, and the weight is positive; other indicators are negatively correlated with the score, and the weight is set to negative. Normalize the result to get the portrait-based score NormPortraitScore(r i ).

[0102] The similarity-based score NormSimilarityScore(r i , author) and the portrait-based score NormPortraitScore(r i) weighted addition, get the final score. As the time interval between the creation time of the merge request and the current time increases, the score weight based on the portrait should be improved to increase the proportion of the reviewer response time factor in the final recommended result, so the weight should change with time, and the final score calculation formula is as follows. Where Δt is the time interval between the current time and the creation time of the merge request, the unit is day.

[0103]

[0104] Step S4-4, sort the candidate reviewers according to the final score, and select one or more people with the highest score as the recommended result of the reviewer.

[0105] One merge request can be reviewed by multiple people. On the one hand, multiple reviews can avoid long waiting time of the merge request due to individual reviewer's review not timely; on the other hand, multiple reviews can find more problems. In this embodiment, the top three reviewers with the highest score are selected as the recommended result.

[0106] Optionally, the reviewer is notified in the code review tool used by the project to review the merge request in time, and the notification is sent through a third-party platform such as email.

[0107] Step S4-5, if the reviewer response time is too long, the next person is recommended as the reviewer.

[0108] The technical scheme of the embodiment of the application extracts entities, attributes and relationships between entities through the attribute information of the merge request, historical review data, attribute data of the user and attribute data of the warehouse, and constructs a review domain knowledge graph; based on the established review knowledge graph, a reviewer evaluation index system including two parts of reviewer review relationship indexes and reviewer review process indexes is constructed; based on the established review knowledge graph, a knowledge graph subgraph containing a reviewer node is queried, the reviewer review relationship indexes and the reviewer review process indexes are calculated, and the reviewer portrait is comprehensively described; based on the constructed reviewer portrait and the review knowledge graph, the reviewer's review relationship and review work characteristics are considered, and the reviewer recommendation for the newly submitted merge request is realized.

[0109] Embodiment 2

[0110] Figure 2 A structural schematic diagram of a reviewer portrait system based on a knowledge graph provided by the embodiment 2 of the application, the reviewer portrait system comprises: a data processing module 210, a knowledge graph construction module 220, a graph query module 230, an index calculation module 240 and a graph visualization module 250.

[0111] The data processing module 210 is configured to obtain relevant data of the merging request by using a crawler, and process records with null values to obtain data for constructing the knowledge graph, which includes:

[0112] The data crawling unit is configured to obtain attribute data of the merging request, historical review data, attribute data of the user, and attribute data of the warehouse by using a crawler.

[0113] The data cleaning unit is configured to process records with null values, and in this embodiment, the records with null values are deleted and are not used as data for constructing the knowledge graph.

[0114] The knowledge graph construction module 220 extracts required entities, relationships, and attributes from the data, and stores them in a Neo4j graph database to construct the review knowledge graph, which includes:

[0115] The data extraction unit is configured to extract entities, attributes, and relationships from the cleaned data.

[0116] The database interaction unit is configured to interact with the Neo4j graph database to construct the required review knowledge graph.

[0117] The graph query module 230 queries a knowledge graph subgraph containing a reviewer node in the Neo4j graph database based on the established review knowledge graph, which includes:

[0118] The subcommunity query unit queries reviewers in the same community as the queried reviewer, and returns nodes and relationships.

[0119] The subgraph query unit queries merging requests, reviewer nodes, and relationships related to the queried reviewer.

[0120] The index calculation module 240 calculates review process indexes of the reviewer and review relationship indexes of the reviewer to measure the review process and review relationship of the reviewer, which includes:

[0121] The review process index calculation unit calculates the review process indexes listed in Embodiment One based on the reviewer-merging request subgraph obtained, and stores the indexes as attributes of the nodes.

[0122] The review relationship index calculation unit calculates the review relationship indexes in Embodiment One based on the reviewer-related reviewer subgraph obtained, and stores the indexes as attributes of the nodes.

[0123] The graph visualization module 250 is configured to visualize the reviewer basic information obtained by the data processing module, the subgraph containing the reviewer node obtained by the graph query module, and the review process indexes and review relationship indexes calculated by the index calculation module, to display a multi-dimensional portrait of the reviewer.

[0124] Specifically, the basic information of the reviewer, the index conditions of the reviewer, the comparison with other reviewers, the community subgraph to which the reviewer belongs and the related reviewer relationship graph are displayed.

[0125] The technical solution of the embodiment of the present application extracts entities, attributes and relationships between entities by merging attribute information of the request, historical review data, attribute data of the user and attribute data of the warehouse, and constructs a review domain knowledge graph; based on the established review knowledge graph, a knowledge graph subgraph containing a reviewer node is queried, the review relationship index and the review process index of the reviewer are calculated, and the reviewer portrait is comprehensively described; based on the established review knowledge graph, the review process index measurement and the review relationship index measurement of the reviewer are calculated and analyzed; the reviewer portrait is displayed using a visualization technology, including the basic information of the reviewer, the multi-dimensional index and the review relationship graph.

[0126] The above description is exemplary and not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes are obvious to those skilled in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications or improvements to the technology in the market, or to enable other ordinary skilled persons in the art to understand the embodiments disclosed herein. The scope of the present application is defined by the appended claims

[0127] It should be noted that the above embodiments are not intended to limit the scope of the present application, and equivalent transformations or substitutions made on the basis of the above technical solutions all fall within the scope of the claims of the present application.

Claims

1. An image-based code reviewer recommendation method characterized by, The method comprises the following steps: S1: According to the attribute data of the merging request, the historical review data, the attribute data of the user and the attribute data of the warehouse, entities, attributes and relationships between entities are extracted, and a review knowledge graph is constructed; S2: Based on the established review knowledge graph, a reviewer evaluation index system including two parts of reviewer review relationship indexes and reviewer review process indexes is constructed; S3: Based on the established review knowledge graph, a knowledge graph subgraph containing a reviewer node is queried, the reviewer review relationship indexes and the reviewer review process indexes are calculated, and a reviewer portrait is established; S4: When a new merging request is submitted, the matching degree of each reviewer with the merging request is calculated, the most matched reviewer is selected and notified; In step S3, the following steps are specifically performed: S3-1: Query the knowledge graph subgraph containing the reviewer node, including the merging request reviewed by the reviewer, the merging request merged by the reviewer, the reviewer who reviewed the above merging request, and the author of the above merging request; S3-2: The importance of the reviewer is calculated using the centrality algorithm; S3-3: Query the merging request information related to the reviewer, including the merging request reviewed by the reviewer and the merging request merged by the reviewer; S3-4: According to the merging request information related to the reviewer, the reviewer review process index is calculated.

2. The image-based code reviewer recommendation method according to claim 1, characterized in that, Before establishing the review knowledge graph, the following steps are further included: Merging request ID, creation time, update time, closing time, merging time, state, author ID, reviewer ID; Obtain the attribute information of all users for constructing the graph, including username, user ID, user type; Obtain the attribute information of all warehouses for constructing the graph, including warehouse name, warehouse ID, owner ID, creation time, update time. 3.The image-based code reviewer recommendation method of claim 2, wherein, Before constructing the review knowledge graph, the following steps are further included: Processing missing or abnormal data in the merging request information; Processing missing or abnormal data in the merging request information includes: processing missing values and abnormal values, when the attribute information of the merging request is missing or abnormal, discarding the merging request information, and not using it as data for constructing the graph.

4. The method according to claim 3, wherein, In step S1, the specific steps of establishing the review knowledge graph using the knowledge graph construction method are as follows: S1-1: Obtain data, i.e. obtain the required data from the data source; S1-2: Extract knowledge, after obtaining the data, the entities, attributes and relationships between entities need to be extracted from the data, and on this basis, the knowledge is formed into an ontological knowledge expression; S1-3: Write the entities and relationships into the database, construct and store the knowledge graph.

5. The image-based code reviewer recommendation method according to claim 4, characterized in that, Step S4 is specifically as follows: S4-1: Obtain the attribute information of the merging request, including author ID and creation time; S4-2: Query the established review knowledge graph to obtain the historical reviewer set of the merging request created by the user; S4-3: Calculate the score of each candidate reviewer, considering the similarity with the historical reviewer of the user, the review process index and the review relationship index of the reviewer, and weighting and adding to obtain the score; S4-4: Sort the candidate reviewers according to the final score, and select one or more with the highest score as the result of reviewer recommendation; S4-5: If the reviewer's response time is too long, the next person is recommended as a reviewer.

6. A knowledge graph based reviewer profiling system, characterized in that, The system is used to implement the method of any one of claims 1-5, and the system comprises a data processing module, a knowledge graph construction module, a graph query module, an index calculation module, and a graph visualization module; The data processing module is used to extract, clean, and preprocess data; The knowledge graph construction module is used to extract required entities, relationships, and attributes from data and store them in a graph database to construct an evaluation knowledge graph; The graph query module is used to query a subgraph containing a specific reviewer node and calculate evaluation relationship index metrics of the reviewer; The index calculation module is used to calculate various evaluation indexes of the reviewer and measure the evaluation process of the reviewer; The graph visualization module is used to visualize the reviewer's basic information obtained by the data processing module, the subgraph obtained by the graph query module, the calculated evaluation relationship indexes, and the calculated evaluation process indexes.

7. The reviewer profiling system based on knowledge graph according to claim 6, wherein, The data processing module comprises: a data crawling unit responsible for obtaining attribute data of a merge request, historical evaluation data, attribute data of a user, and attribute data of a warehouse; a data cleaning unit responsible for processing records with null values, in this embodiment, deleting records with null values and not using them as data for constructing a knowledge graph; The knowledge graph construction module comprises: a data extraction unit responsible for extracting entities, attributes, and relationships from cleaned data; a database interaction unit responsible for interacting with a graph database to construct a required evaluation knowledge graph; The graph query module comprises: a subcommunity query unit querying evaluators in the same community as a queried evaluator and returning nodes and relationships; a subgraph query unit querying a merge request, an evaluator node, and relationships related to a queried evaluator; The index calculation module comprises: an evaluation process index calculation unit calculating various evaluation process indexes based on an obtained evaluator-merge request subgraph and storing the indexes as attributes of a node; an evaluation relationship index calculation unit calculating various evaluation relationship indexes based on an obtained evaluator-related evaluator subgraph and storing the indexes as attributes of a node; The graph visualization module is used to display the reviewer's basic information, various indexes of the reviewer, comparison with other evaluators, a community subgraph to which the reviewer belongs, and a related evaluator relationship graph.

Citation Information

Patent Citations

  • PullRequest reviewer recommend method of GitHub open source community

    CN105913323A

  • Code reviewer recommendation method based on collaborative filtering

    CN107807978A