Review document processing method and device, storage medium, processor, terminal

By constructing and cutting the code review relationship diagram, the complex code review is divided into sub-reviews with introverted functions, which solves the problem of reduced review adequacy caused by the large number of files or modified lines during the code review process, and improves the code quality.

CN114610372BActive Publication Date: 2024-09-10ALIBABA CLOUD COMPUTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210122953.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-09
Publication Date
2024-09-10
Estimated Expiration
2042-02-09

AI Technical Summary

Technical Problem

During the code review process, due to the large number of files or large number of changed lines, the adequacy of the review is reduced and the code quality is affected.

Method used

By obtaining the dependencies between code files, construct a review relationship graph, cut it into multiple review subgraphs, and extract the set of review documents corresponding to each subgraph, thereby realizing sub-reviews with introverted functions and ensuring that reviewers can fully review .

Benefits of technology

It improves the adequacy of code review, improves code quality, and reduces the occurrence of bugs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114610372B
    Figure CN114610372B
Patent Text Reader

Abstract

The present invention discloses a method and device for processing review files, a storage medium, a processor, and a terminal. The processing method includes: obtaining associated files that have a dependency relationship with each code file to be reviewed, constructing a review relationship graph based on the code file to be reviewed, the associated files, and the dependency relationship between the files, cutting the review relationship graph into multiple review subgraphs, and extracting a review file set corresponding to each review subgraph to obtain multiple review file sets. The present invention solves the technical problem in the related art that in the code review process, due to the large number of files to be reviewed or the large number of modified lines, the code review adequacy is easily reduced, which affects the code quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of document processing technology, and in particular to a method and device for processing review documents, a storage medium, a processor, and a terminal. Background Art

[0002] In related technologies, many projects will conduct code reviews on the project codes during operation. The purpose of code review is to improve code quality. When encountering a review with too many modified lines / files, due to the complex logic and unclear functional division, the reviewer will feel at a loss and lose patience. He will pass the review by hastily browsing the code, which goes against the original intention of code review. At the same time, for a single review with too many files or many modified lines, the reviewer's review adequacy is seriously reduced. Whether it is the review time or the actual number of file browsing, the large review has a serious decline compared to the small review, which can easily lead to reduced code quality and bugs.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiments of the present invention provide a method and device for processing review files, a storage medium, a processor, and a terminal, so as to at least solve the technical problem in the related art that, during the code review process, the code review adequacy is easily reduced due to the large number of files to be reviewed or the large number of modified lines, thereby affecting the code quality.

[0005] According to one aspect of an embodiment of the present invention, a method for processing review files is provided, comprising: obtaining associated files that have a dependency relationship with each code file to be reviewed; constructing a review relationship graph based on the code files to be reviewed, the associated files, and the dependency relationships between the files; cutting the review relationship graph into multiple review subgraphs, and extracting a review file set corresponding to each review subgraph to obtain multiple review file sets, wherein the review file set includes: at least one of the code files to be reviewed.

[0006] Optionally, the step of obtaining associated files that have a dependency relationship with each code file to be reviewed includes: obtaining a first type of associated files that the code in each code file to be reviewed needs to depend on when executing and a second type of associated files that need to reference the code file to be reviewed, to obtain multiple associated files.

[0007] Optionally, before obtaining associated files that have a dependency relationship with each code file to be reviewed, the method further includes: receiving a review request, wherein the review request carries at least one code file to be reviewed and a file parameter; responding to the review request, and when the file parameter indicates that the number of code files to be reviewed is greater than or equal to a first preset number threshold, determining that the multiple code files to be reviewed in the review request need to be split; when it is determined that the multiple code files to be reviewed in the review request need to be split, executing the step of obtaining associated files that have a dependency relationship with each code file to be reviewed.

[0008] Optionally, after receiving the review request, it also includes: extracting the file permission identifier in the review request; verifying each of the code files to be reviewed in combination with the file permission identifier; if the code files to be reviewed are verified, obtaining the code blocks with modification marks in the code files to be reviewed; counting the number of the code blocks with modification marks; if the number of the code blocks is greater than or equal to a second preset number threshold, determining that the code files to be reviewed need to be split; if it is determined that the code files to be reviewed need to be split, executing the step of obtaining associated files that have a dependency relationship with each code file to be reviewed.

[0009] Optionally, the step of constructing a review relationship graph based on the code file to be reviewed, the associated files and the dependency relationships between the files also includes: taking the code file to be reviewed as the center point of the graph, and the associated files as the reference points of the graph, and taking the dependency relationships as the graph association edges, and connecting the files with the dependency relationships with dotted lines to construct the review relationship graph.

[0010] Optionally, after constructing a review relationship graph based on the code files to be reviewed, the associated files and the dependency relationships between the files, it also includes: obtaining a code calling method, a code interface implementation type or a code reference method for the dependency relationships between the files; using the code calling method, the code interface implementation type or the code reference method to determine a weight parameter of the dependency relationship; using the weight parameter as an attribute value of the graph-related edge in the review relationship graph to adjust the review relationship graph.

[0011] Optionally, the step of cutting the review relationship graph into multiple review subgraphs includes: selecting a regularized cut algorithm as a cutting algorithm for the review relationship graph; and using the regularized cut algorithm to cut the review relationship graph to obtain multiple review subgraphs.

[0012] Optionally, the processing method also includes: obtaining files with independent attributes from multiple code files to be reviewed, wherein the independent attribute means that the current code file to be reviewed has no dependency relationship with any other code file to be reviewed; extracting the file directory and file type of the file with independent attributes; based on the file directory and file type and pre-configured code block development rules, cutting the files with independent attributes into a review file set; and displaying the review file set and review information corresponding to the files with independent attributes on a preset terminal interface.

[0013] Optionally, after extracting the review file set corresponding to each of the review subgraphs, it also includes: extracting code features of the code files to be reviewed in the review file set within a historical preset time period; obtaining behavioral features of each review object within a historical preset time period; analyzing file history features of the code files to be reviewed in the review file set within a historical preset time period; assigning review objects to the review file set based on the code features of the code files to be reviewed, behavioral features and file history features of each review object, and generating review summary information of the review file set; and determining the review information of the review file set in combination with the review objects and the review summary information.

[0014] Optionally, after extracting the review document set corresponding to each of the review subgraphs, it also includes: generating grouping information of each of the review document sets according to the review information of the review document set; and displaying the grouping information corresponding to each of the review document sets on a preset terminal interface.

[0015] According to another aspect of an embodiment of the present invention, a method for processing review files is also provided, comprising: receiving a review request, wherein the review request carries at least one code file to be reviewed; in response to the review request, obtaining associated files that have a dependency relationship with each code file to be reviewed in a cloud server; constructing a review relationship graph based on the code files to be reviewed, the associated files, and the dependency relationships between the files; cutting the review relationship graph into multiple review subgraphs, and extracting a review file set corresponding to each review subgraph, to obtain multiple review file sets and review information corresponding to the review file sets, wherein the review file set includes: at least one code file to be reviewed, and returning each review file set and the review information corresponding to the review file set to a terminal.

[0016] According to another aspect of an embodiment of the present invention, a review file processing device is also provided, including: an acquisition unit, used to acquire associated files that have a dependency relationship with each code file to be reviewed; a construction unit, used to construct a review relationship graph based on the code files to be reviewed, the associated files and the dependency relationships between the files; a cutting unit, used to cut the review relationship graph into multiple review sub-graphs, and extract a review file set corresponding to each review sub-graph to obtain multiple review file sets, wherein the review file set includes: at least one of the code files to be reviewed.

[0017] Optionally, the acquisition unit includes: a first acquisition module, used to acquire first-type associated files that the code in each code file to be reviewed needs to rely on when executing and second-type associated files that need to reference the code file to be reviewed, to obtain multiple associated files.

[0018] Optionally, the processing device also includes: a first receiving module, used to receive a review request before obtaining associated files that have a dependency relationship with each code file to be reviewed, wherein the review request carries at least one code file to be reviewed and a file parameter; a first responding module, used to respond to the review request and, when the file parameter indicates that the number of code files to be reviewed is greater than or equal to a first preset number threshold, determine that the multiple code files to be reviewed in the review request need to be split; and a first executing module, used to execute the step of obtaining associated files that have a dependency relationship with each code file to be reviewed when it is determined that the multiple code files to be reviewed in the review request need to be split.

[0019] Optionally, the processing device also includes: a first extraction module, used to extract the file permission identifier in the review request after receiving the review request; a first verification module, used to verify each of the code files to be reviewed in combination with the file permission identifier; a second acquisition module, used to obtain the code blocks with modification marks in the code files to be reviewed when the code files to be reviewed are verified; a first statistics module, used to count the number of code blocks with modification marks; a first determination module, used to determine that the code files to be reviewed need to be split when the number of code blocks is greater than or equal to a second preset number threshold; a second execution module, used to execute the step of obtaining associated files that have a dependency relationship with each code file to be reviewed when it is determined that the code files to be reviewed need to be split.

[0020] Optionally, the construction unit also includes: a first construction module, used to take the code file to be reviewed as the center point of the graph, and the associated file as the reference point of the graph, and the dependency relationship as the graph association edge, and connect the files with the dependency relationship with dotted lines to construct the review relationship graph.

[0021] Optionally, the processing device also includes: a third acquisition module, which is used to acquire the code calling method, code interface implementation type or code reference method of the dependency relationship between files after constructing a review relationship diagram based on the code files to be reviewed, the related files and the dependency relationship between files; a second determination module, which is used to determine the weight parameter of the dependency relationship by adopting the code calling method, code interface implementation type or code reference method; and a first adjustment module, which is used to adjust the review relationship diagram by using the weight parameter as the attribute value of the graph-related edge in the review relationship diagram.

[0022] Optionally, the cutting unit includes: a first selection module, used to select a regularized cut algorithm as the cutting algorithm of the review relationship graph; and a first cutting module, used to use the regularized cut algorithm to cut the review relationship graph to obtain multiple review subgraphs.

[0023] Optionally, the processing device also includes: a fourth acquisition module, used to obtain files with independent attributes from multiple code files to be reviewed, wherein the independent attribute means that the current code file to be reviewed has no dependency relationship with any other code file to be reviewed; a second extraction module, used to extract the file directory and file type of the file with independent attributes; a second cutting module, used to cut the file with independent attributes into a review file set based on the file directory and file type and pre-configured code block development rules; a first display module, used to display the review file set and review information corresponding to the file with independent attributes on a preset terminal interface.

[0024] Optionally, the processing device also includes: a third extraction module, which is used to extract the code features of the code files to be reviewed in the review file set within a historical preset time period after extracting the review file set corresponding to each of the review subgraphs; a fifth acquisition module, which is used to acquire the behavioral features of each review object within a historical preset time period; a first analysis module, which is used to analyze the file history features of the code files to be reviewed in the review file set within a historical preset time period; a first generation module, which is used to assign review objects to the review file set based on the code features of the code files to be reviewed, the behavioral features and the file history features of each review object, and generate review summary information of the review file set; and a third determination module, which is used to determine the review information of the review file set in combination with the review objects and the review summary information.

[0025] Optionally, the processing device also includes: a second generation module, which is used to generate grouping information of each review document set according to the review information of the review document set after extracting the review document set corresponding to each review sub-graph; and a second display module, which is used to display the grouping information corresponding to each review document set on a preset terminal interface.

[0026] According to another aspect of an embodiment of the present invention, a review file processing device is also provided, including: a receiving unit, used to receive a review request, wherein the review request carries at least one code file to be reviewed; a responding unit, used to respond to the review request, and obtain associated files that have a dependency relationship with each code file to be reviewed in a cloud server; construct a review relationship graph based on the code files to be reviewed, the associated files, and the dependency relationships between the files; cut the review relationship graph into multiple review subgraphs, and extract a review file set corresponding to each review subgraph to obtain multiple review file sets and review information corresponding to the review file sets, wherein the review file set includes: at least one code file to be reviewed; and a returning unit, used to return each review file set and the review information corresponding to the review file set to a terminal.

[0027] According to another aspect of an embodiment of the present invention, a storage medium is further provided, the storage medium including a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute any one of the above-mentioned methods for processing review documents.

[0028] According to another aspect of an embodiment of the present invention, a processor is provided, wherein the processor is used to run a program, wherein the program executes any one of the above-mentioned methods for processing review documents when running.

[0029] According to another aspect of an embodiment of the present invention, a terminal is also provided, comprising: a first device; a second device; a third device; and a fourth device; a processor, wherein the processor runs a program, wherein when the program is running, the following processing steps are performed on the data output from the first device, the second device, and the third device: a first step, obtaining associated files that have a dependency relationship with each code file to be reviewed; a second step, constructing a review relationship graph based on the code files to be reviewed, the associated files, and the dependency relationships between the files; a third step, cutting the review relationship graph into multiple review subgraphs, and extracting a review file set corresponding to each review subgraph, to obtain multiple review file sets, wherein the review file set includes: at least one of the code files to be reviewed.

[0030] In the present disclosure, associated files that have dependencies with each code file to be reviewed are obtained, and a review relationship graph is constructed based on the code file to be reviewed, the associated files, and the dependencies between the files. The review relationship graph is cut into multiple review subgraphs, and the review file set corresponding to each review subgraph is extracted to obtain multiple review file sets. In the present invention, the dependency relationship between the code files can be analyzed to construct a review relationship graph, and the review relationship graph can be cut into multiple review subgraphs to split the complex code review into a review file set with introverted functions (as a sub-review), so that the reviewer can fully review the review file set corresponding to the review subgraph, which is conducive to improving the code quality and reducing the occurrence of bugs, thereby solving the technical problem in the related art that in the code review process, due to the large number of files to be reviewed or the large number of modified lines, the code review sufficiency is easily reduced, affecting the code quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0032] Figure 1 It is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for processing review documents according to an embodiment of the present invention;

[0033] Figure 2 is a schematic diagram of an implementation environment of an optional method for processing review documents according to an embodiment of the present invention;

[0034] Figure 3 is a flow chart of an optional method for processing review documents according to an embodiment of the present invention;

[0035] Figure 4 is a schematic diagram of an optional dependency classification according to an embodiment of the present invention;

[0036] Figure 5 is a schematic diagram of an optional cutting review relationship diagram according to an embodiment of the present invention;

[0037] Figure 6 is a schematic diagram of optional grouping information according to an embodiment of the present invention;

[0038] Figure 7 is a schematic diagram of an optional intelligent review splitting process according to an embodiment of the present invention;

[0039] Figure 8 is a flowchart of another optional method for processing review documents according to an embodiment of the present invention;

[0040] Fig. 9 is a schematic diagram of an optional review document processing device according to an embodiment of the present invention;

[0041] Fig.10 is a schematic diagram of another optional review document processing device according to an embodiment of the present invention;

[0042] Fig.11 It is a structural block diagram of a computer terminal according to an embodiment of the present invention. DETAILED DESCRIPTION

[0043] In order to make the objects in this technical field better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technical objects in this field without creative work should fall within the scope of protection of the present invention.

[0044] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0045] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:

[0046] Code review: The review object or reviewer reviews the newly submitted code to improve the code quality.

[0047] Large review: A code review in which the number of reviewed files exceeds a preset number (for example, 10) or the number of reviewed modified lines exceeds a preset number (for example, 500 lines).

[0048] Diff block: The part of the code file where the code is changed.

[0049] Subgraph cutting: Through intelligent cutting algorithm, the graph is cut into multiple subgraphs with restrained functions.

[0050] In this application, an intelligent review method is used to implement code review. Intelligent review splitting can solve the problem of a large number of review files or excessive review changes in code review. Dependent files are obtained through code file dependency parsing, and dependent files are divided into sub-graphs through sub-graph cutting. Free file rules are classified, and finally reviewers are assigned to sub-reviews and information summaries are generated, splitting complex code reviews into sub-reviews with restrained functions.

[0051] The present invention is described in detail below in conjunction with various embodiments.

[0052] Example 1

[0053] According to an embodiment of the present invention, an embodiment of a method for processing review documents is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0054] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal (or mobile device) for implementing the review document processing method is shown. Figure 1 As shown, the computer terminal 10 (or mobile device 10) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. A person of ordinary skill in the art can understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0055] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device).

[0056] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method for processing review documents in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the method for processing review documents described above is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0057] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0058] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0059] Figure 1 The hardware structure block diagram shown can be used not only as an exemplary block diagram of the above-mentioned computer terminal 10 (or mobile device), but also as an exemplary block diagram of the above-mentioned server. In an optional embodiment, Figure 2 is a schematic diagram of an implementation environment of an optional method for processing review documents according to an embodiment of the present invention, such as Figure 2As shown, the computer terminal 10 (or mobile device) can be connected to one or more servers (e.g., security servers, resource servers, game servers, etc.) via a data network connection or electronic connection. In an optional embodiment, the above-mentioned computer terminal 10 (or mobile device) can be any mobile computing device. The data network connection can be a local area network connection, a wide area network connection, an Internet connection, or other types of data network connections. The computer terminal 10 (or mobile device) can be executed to connect to a network service performed by a server 110 (e.g., a security server) or a group of servers 108. A network server is a network-based user service, such as a social network, cloud resources, email, online payment or other online applications.

[0060] Under the above operating environment, this application provides Figure 3 The processing method of the review documents shown. Figure 3 is a flowchart of an optional method for processing review documents according to an embodiment of the present invention, such as Figure 3 As shown, the method comprises the following steps:

[0061] Step S302, obtaining associated files that have a dependency relationship with each code file to be reviewed.

[0062] Step S304, constructing a review relationship diagram based on the code files to be reviewed, associated files, and dependencies between files.

[0063] Step S306, cutting the review relationship graph into multiple review subgraphs, and extracting the review file set corresponding to each review subgraph to obtain multiple review file sets, wherein the review file set includes: at least one code file to be reviewed.

[0064] Through the above steps, the associated files that have a dependency relationship with each code file to be reviewed can be obtained, and based on the code files to be reviewed, the associated files and the dependency relationship between the files, a review relationship graph is constructed, the review relationship graph is cut into multiple review subgraphs, and the review file set corresponding to each review subgraph is extracted to obtain multiple review file sets. In an embodiment of the present invention, the dependency relationship between code files can be analyzed to construct a review relationship graph, and the review relationship graph can be cut into multiple review subgraphs to split the complex code review into functionally restrained sub-reviews, so that the reviewer can fully review the review file set corresponding to the review subgraph, which is conducive to improving the code quality and reducing the occurrence of bugs, thereby solving the technical problem in the related technology that in the code review process, due to the large number of files to be reviewed or the large number of modified lines, the code review sufficiency is easily reduced, affecting the code quality.

[0065] The embodiment of the present invention is described in detail below in combination with the above steps.

[0066] In an embodiment of the present invention, before obtaining associated files that have a dependency relationship with each code file to be reviewed, it also includes: receiving a review request, wherein the review request carries at least one code file to be reviewed and a file parameter; responding to the review request, and when the file parameter indicates that the number of code files to be reviewed is greater than or equal to a first preset number threshold, determining that the multiple code files to be reviewed in the review request need to be split; when it is determined that the multiple code files to be reviewed in the review request need to be split, executing the step of obtaining associated files that have a dependency relationship with each code file to be reviewed.

[0067] In this embodiment, a review request initiated by a user is received, and the review request carries at least one code file to be reviewed and a file parameter, where the file parameter is used to indicate the number of code files to be reviewed. After the permission verification of the code files to be reviewed in the review request is passed, the review request is responded to, the code files to be reviewed in the review request are obtained, and it is determined whether the code files need to be split. When the file parameter of the code file indicates that the number of files of the code file is greater than or equal to a first preset number threshold (the number threshold can be set according to the specific situation, for example, 10), it is determined that the multiple code files to be reviewed in the review request need to be split, and subsequent steps are executed to complete the splitting of the code files to be reviewed.

[0068] Optionally, after receiving the review request, the file permission identifier in the review request may be extracted; each code file to be reviewed may be verified in combination with the file permission identifier; if the code file to be reviewed passes the verification, the code block with modification mark in the code file to be reviewed may be obtained; the number of code blocks with modification mark may be counted; if the number of code blocks is greater than or equal to a second preset number threshold, it may be determined that the code file to be reviewed needs to be split; if it is determined that the code file to be reviewed needs to be split, the step of obtaining associated files that have a dependency relationship with each code file to be reviewed may be executed.

[0069] In an embodiment of the present invention, after receiving a review request, the permission verification of the code file to be reviewed in the review request specifically includes: first extracting the file permission identifier in the review request, and verifying the corresponding code file to be reviewed based on the file permission identifier; if the code file to be reviewed passes the verification, obtaining the code block (i.e., diff block) with modification marks in the code file to be reviewed, and counting the number of code blocks with modification marks; if the number of code blocks with modification marks in the code file to be reviewed is greater than or equal to a second preset number threshold (the number threshold can be set according to the specific situation), determining that the code file to be reviewed needs to be split, and executing subsequent steps to complete the splitting of the code file to be reviewed.

[0070] Step S302, obtaining associated files that have a dependency relationship with each code file to be reviewed.

[0071] Optionally, the step of obtaining associated files that have a dependency relationship with each code file to be reviewed includes: obtaining first-category associated files that the code in each code file to be reviewed needs to depend on when executing and second-category associated files that need to reference the code file to be reviewed, to obtain multiple associated files.

[0072] In an embodiment of the present invention, the code in the code file to be reviewed may need to rely on certain files when executing, or need to be referenced by the code in certain files when executing, wherein the first type of associated files are files that the code in the code file to be reviewed depends on when executing, and the second type of associated files are files that need to reference the code file to be reviewed. In this embodiment, multiple associated files that have a dependency relationship with each code file to be reviewed can be obtained by obtaining the first type of associated files and the second type of associated files, and the dependency relationship in this embodiment can refer to the reference and referenced relationship between files.

[0073] Step S304, constructing a review relationship diagram based on the code files to be reviewed, associated files, and dependencies between files.

[0074] Optionally, the step of constructing a review relationship graph based on the code file to be reviewed, associated files, and dependencies between files also includes: taking the code file to be reviewed as the center point of the graph, and the associated files as the reference points of the graph, and taking the dependencies as the associated edges of the graph, and connecting the files with dependencies with dotted lines to construct a review relationship graph.

[0075] In an embodiment of the present invention, after obtaining associated files that have a dependency relationship with each code file to be reviewed, the code file to be reviewed can be used as the center point of the graph, and the associated files can be used as the reference points of the graph. The dependency relationship between the files can be used as the graph association edge, and dotted lines can be used to connect the files that have a dependency relationship, thereby constructing a review relationship graph.

[0076] Optionally, after constructing a review relationship graph based on the code files to be reviewed, associated files, and dependencies between files, it also includes: obtaining the code calling method, code interface implementation type, or code reference method between the dependencies between files; using the code calling method, code interface implementation type, or code reference method to determine the weight parameters of the dependencies; using the weight parameters as the attribute values ​​of the graph-related edges in the review relationship graph to adjust the review relationship graph.

[0077] In an embodiment of the present invention, Figure 4 is a schematic diagram of an optional dependency classification according to an embodiment of the present invention, such as Figure 4As shown, dependency relationships may include: method call relationships and reference relationships, etc., wherein method call relationships include: static method calls (static method calls), ordinary method calls, interface implementation methods, etc., and reference relationships include: reference entity classes, reference enumerations, etc.

[0078] In this embodiment, the code calling method (for example, static method calling or ordinary method calling, etc.), code interface implementation type or code reference method (for example, reference to entity class or reference to enumeration, etc.) between the dependencies between the files can be obtained, and based on the specific dependencies between the files (the specific code calling method, code interface implementation type or code reference method, etc.), the weight parameter of the dependency is determined (wherein the weight represents the strength of the table dependency between the files connected by the dotted line, and the stronger the dependency, the larger the weight parameter), and the weight parameter is used as the attribute value of the graph association edge in the review relationship graph to adjust the review relationship graph.

[0079] Alternatively, in this embodiment, the weight parameter of the dependency relationship between files is also related to the modified content, for example, the weight of the newly added content is generally higher than the weight of the deleted content. In addition, the dependency relationship between files can also be obtained based on the historical submission characteristics of the code review.

[0080] Step S306, cutting the review relationship graph into multiple review subgraphs, and extracting the review file set corresponding to each review subgraph to obtain multiple review file sets, wherein the review file set includes: at least one code file to be reviewed.

[0081] In an embodiment of the present invention, after obtaining the review relationship diagram, the review relationship diagram can be cut into multiple functionally introverted review sub-graphs, and then the review file set corresponding to each review sub-graph is extracted to obtain multiple review file sets, and the review file set includes at least one code file to be reviewed. After assigning reviewers to each review file set, the reviewers can review the code files to be reviewed in the corresponding review file set.

[0082] Optionally, the step of cutting the review relationship graph into multiple review subgraphs includes: selecting a regular cut algorithm as a cutting algorithm for the review relationship graph; and using the regular cut algorithm to cut the review relationship graph to obtain multiple review subgraphs.

[0083] In an embodiment of the present invention, the cutting algorithm (for example, label propagation cutting algorithm, minimum cut algorithm, regularized cutting algorithm) is considered from four aspects, namely stability, time, cutting effect and disadvantages, so that it is concluded that the regularized cutting algorithm has the advantages of stable effect and good cutting effect. In the present application, for the regularized cutting algorithm, due to the introduction of k-mean (K-means clustering algorithm), the problem of unstable effect occurs. Canopy (a clustering algorithm) and k-mean can be combined to ensure the stability of the splitting result. Therefore, this embodiment selects the regularized cutting algorithm as the cutting algorithm for the review relationship graph, and uses the regularized cutting algorithm to cut the review relationship graph to obtain multiple review subgraphs.

[0084] In this embodiment, there are many language rules in code development. For example, in Java development, the interface class and its specific implementation class cannot be split in principle. Therefore, the rule of not splitting the interface class and its specific implementation class can be added to the subgraph cutting.

[0085] Figure 5 It is a schematic diagram of an optional cutting review relationship diagram according to an embodiment of the present invention. The nodes represent specific code files (including: LinguistSearchService file, LinguistSearchServiclmp file, LinguistSearchResponse file, LinguistUtill file, LinguistController file, Authenticator file, DefaultAuthenticator file, UnauthorizedException file, RangeScope file, Range file, LinguistTest file, EssearchClient file, etc.), the edge weight represents the strength of the dependency relationship between files, and implements represents that the files are interface implementation relationships and cannot be cut. Figure 5 It can be seen that the minimum cut only considers the weight of the cut edge, and the result is poor, while the regular cut is more in line with intuitive expectations. At the same time, the LinguistSearchService file is closely related to the two subgraphs. For this type of situation, it is possible to allow no more than a preset number of file duplications.

[0086] Optionally, after extracting the review file set corresponding to each review subgraph, it also includes: extracting code features of the code files to be reviewed in the review file set within a historical preset time period; obtaining the behavioral features of each review object within the historical preset time period; analyzing the file history features of the code files to be reviewed in the review file set within the historical preset time period; assigning review objects to the review file set based on the code features of the code files to be reviewed, the behavioral features and file history features of each review object, and generating review brief information of the review file set; and determining the review information of the review file set in combination with the review objects and the review brief information.

[0087] In an embodiment of the present invention, after extracting the review file set corresponding to each review subgraph, the code features of the code files to be reviewed in the review file set within a preset historical time period (for example, within the past year) can be obtained (for example, features used to indicate the functions that the code in the code file can achieve), and the behavioral features of each review object (i.e., reviewer) within the preset historical time period can be obtained (for example, features used to indicate the functions of the code file that each review object is good at reviewing), and the file history features of the code files to be reviewed in the review file set within the preset historical time period are analyzed (for example, how such files are reviewed), and based on the above-mentioned code features, behavioral features of each review object and file history features, review objects can be assigned to the review file set, and review brief information of the review file set can be generated (for example, including the functions and types of the review file set), and then the review information of the review file set can be determined in combination with the assigned review objects and the corresponding review brief information (for example, which code files to be reviewed, dependencies between files, reviewers, implemented functions, etc.).

[0088] Optionally, after extracting the review document set corresponding to each review subgraph, it also includes: generating grouping information of each review document set according to the review information of the review document set; and displaying the grouping information corresponding to each review document set on a preset terminal interface.

[0089] In an embodiment of the present invention, grouping information of each review file set can be generated according to the review information of the review file set. The grouping information may include: group name, file information within the group, etc., and the grouping information corresponding to each review file set can be displayed on a preset terminal interface.

[0090] Figure 6 is a schematic diagram of optional grouping information according to an embodiment of the present invention, such as Figure 6As shown, including group names (Group 1, Group 2, Group 3, ..., Group N, etc.), file information within the group (including: code file name, code file name that has a dependency relationship with the code file, for example, EasConfig.java file, and EasOnlineModelServicelmpl.javawenjian with an interface implementation relationship therewith), this embodiment can add a smart grouping button to the code review system. After clicking it, a smart group split after smart review can be generated and displayed on the preset terminal interface.

[0091] Optionally, in this embodiment, after obtaining the review document set, each review document set and the review information corresponding to the review document set may be displayed on a preset terminal interface.

[0092] In an embodiment of the present invention, each review file set and the review information corresponding to the review file set can be displayed on a preset terminal interface, so that the review object and review results corresponding to the review file set can be viewed, and codes with poor quality can be modified in time.

[0093] Optionally, the processing method also includes: obtaining files with independent attributes from multiple code files to be reviewed, wherein the independent attribute means that the current code file to be reviewed has no dependency relationship with any other code file to be reviewed; extracting the file directory and file type of the file with independent attributes; based on the file directory and file type and pre-configured code block development rules, cutting the files with independent attributes into a review file set; and displaying the review file set and review information corresponding to the files with independent attributes on a preset terminal interface.

[0094] In an embodiment of the present invention, after constructing the review relationship diagram, it is inevitable that free files will appear (i.e., files with independent attributes in the code files to be reviewed, and the independent attribute means that the current code files to be reviewed have no dependency relationship with any other code files to be reviewed). After obtaining the free files, the file directory and file type of the free files can be extracted first (for example, the free files can be distinguished into Java files and non-Java files, or classified according to the file suffix, or classified according to the file directory as the basic unit, according to the number of files and the distance from the directory). After that, based on the pre-configured code block development rules (for example, in Maven development, the resources folder is mostly resource configuration files, and the resources folder can be classified separately), combined with the obtained file directory and file type, the files with independent attributes are cut into a review file set, and then the review file set and review information corresponding to the files with independent attributes can be displayed on the preset terminal interface.

[0095] Based on the above steps, a schematic diagram of an optional intelligent review splitting process of an embodiment of the present invention can be obtained, such as Figure 7 As shown, it can be divided into four modules: (1) Obtaining code change blocks: After the user initiates a code review, the authority verification is automatically performed, and the Diff block is obtained to determine whether to split. If not, the process ends. If split, the dependency and reference relationships between Java files are extracted to build a dependency graph; (2) Extracting the dependency and reference relationships between Java files and building a dependency graph: Through dependency parsing, dependent files and free files are obtained. For free files, they are classified according to rules and split into sub-reviews, and then reviewers are assigned and summary information is generated; for dependent files, determine whether to cut. If not, they are directly split into sub-reviews, and then reviewers are assigned and summary information is generated. If cut, the dependent files are cut into sub-graphs with introverted functions; (3) Cutting dependent files into sub-graphs with introverted functions: Cutting the sub-graphs to split them into sub-reviews, and then reviewers are assigned and summary information is generated; (4) Assigning reviewers and generating summary information: Assign reviewers to sub-reviews and generate summaries.

[0096] In the embodiment of the present invention, splitting by file dimension can be realized, which is more in line with the experience and needs of actual code review, and in addition to considering the dependency relationship of the file itself, language rules and historical features are added, and free files can be classified according to preset rules. Based on dependency parsing, this embodiment performs graph cutting for the situation where there are too many dependent files, converting them into sub-reviews with restrained functions. After splitting into sub-reviews, reviewers are assigned to the sub-reviews and information summaries are generated, which enables reviewers to fully review the sub-reviews, which is conducive to improving code quality and reducing bugs. At the same time, the method in this embodiment can be extended to multiple languages.

[0097] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but the technical object in this field should know that the present invention is not limited by the described action sequence, because according to the present invention, some steps can be performed in other sequences or simultaneously. Secondly, the technical object in this field should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0098] Through the description of the above implementation methods, the technical object in this field can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of various embodiments of the present invention.

[0099] Example 2

[0100] This application provides another Figure 8 The review file processing method shown is applied in the cloud / cloud server, with the cloud server as the implementation entity. After receiving the review request, it can implement code review processing and return the corresponding processing result. Figure 8 is a flowchart of another optional method for processing review documents according to an embodiment of the present invention. Figure 8 As shown, the method comprises the following steps:

[0101] Step S802: receiving a review request, wherein the review request carries at least one code file to be reviewed.

[0102] Step S804, in response to the review request, obtain the associated files that have a dependency relationship with each code file to be reviewed in the cloud server; construct a review relationship graph based on the code file to be reviewed, the associated files, and the dependency relationship between the files; cut the review relationship graph into multiple review subgraphs, and extract the review file set corresponding to each review subgraph, to obtain multiple review file sets and review information corresponding to the review file sets, wherein the review file set includes: at least one code file to be reviewed.

[0103] Step S806: Return each review document set and the review information corresponding to the review document set to the terminal.

[0104] Through the above steps, after receiving the review request, the review request can be responded to, and the associated files with dependencies on each code file to be reviewed can be obtained in the cloud server. Based on the code file to be reviewed, the associated files and the dependencies between the files, a review relationship graph is constructed, the review relationship graph is cut into multiple review subgraphs, and the review file set corresponding to each review subgraph is extracted to obtain multiple review file sets and review information corresponding to the review file set, and each review file set and the review information corresponding to the review file set are returned to the terminal, so that the review file set and the review information corresponding to the review file set are displayed on the preset terminal interface. In an embodiment of the present invention, a review relationship graph can be constructed by parsing the dependency relationship between code files, and the review relationship graph can be cut into multiple review subgraphs to split the complex code review into sub-reviews with introverted functions, so that the reviewer can fully review the review file set corresponding to the review subgraph, which is conducive to improving the code quality and reducing the occurrence of bugs, thereby solving the technical problem in the related technology that in the code review process, due to the large number of files to be reviewed or the large number of modified lines, the code review sufficiency is easily reduced, which affects the code quality.

[0105] In an embodiment of the present invention, the processing entity can be set in a cloud server to interact with various implementation terminals. After receiving a review request, the code files in the request before the review can be split or a large number of code files can be cut. The review with complex functions can be converted into sub-reviews through intelligent means, thereby realizing the identification and precise splitting of complex reviews. After the intelligent review splitting, the reviewers can be directly assigned to the sub-reviews, and a summary description of the sub-review can be generated through review code features, reviewer behavior features, historical features, etc., which can enable the reviewer to fully review the sub-review, which is conducive to improving code quality and reducing the occurrence of bugs.

[0106] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but the technical object in this field should know that the present invention is not limited by the described action sequence, because according to the present invention, some steps can be performed in other sequences or simultaneously. Secondly, the technical object in this field should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0107] Example 3

[0108] According to an embodiment of the present invention, a processing device for implementing the method for processing review documents in the above embodiment 1 is also provided. Fig. 9 As shown, the device comprises:

[0109] An acquisition unit 90 is used to acquire associated files that have a dependency relationship with each code file to be reviewed;

[0110] A construction unit 92, used to construct a review relationship diagram based on the code files to be reviewed, the associated files, and the dependencies between the files;

[0111] The cutting unit 94 is used to cut the review relationship diagram into multiple review sub-diagrams, and extract the review file set corresponding to each review sub-diagram to obtain multiple review file sets, wherein the review file set includes: at least one code file to be reviewed.

[0112] The above-mentioned processing device can obtain the associated files that have a dependency relationship with each code file to be reviewed through the acquisition unit 90, construct a review relationship graph based on the code file to be reviewed, the associated files and the dependency relationship between the files through the construction unit 92, cut the review relationship graph into multiple review subgraphs through the cutting unit 94, and extract the review file set corresponding to each review subgraph to obtain multiple review file sets. In an embodiment of the present invention, the review relationship graph can be constructed by analyzing the dependency relationship between code files, and the review relationship graph can be cut into multiple review subgraphs to split the complex code review into sub-reviews with introverted functions, so that the reviewer can fully review the review file set corresponding to the review subgraph, which is conducive to improving the code quality and reducing the occurrence of bugs, thereby solving the technical problem in the related art that in the code review process, due to the large number of files to be reviewed or the large number of modified lines, the code review sufficiency is easily reduced, which affects the code quality.

[0113] Optionally, the acquisition unit includes: a first acquisition module, used to acquire first-category associated files that the code in each code file to be reviewed needs to rely on when executing and second-category associated files that need to reference the code file to be reviewed, to obtain multiple associated files.

[0114] Optionally, the processing device also includes: a first receiving module, used to receive a review request before obtaining associated files that have a dependency relationship with each code file to be reviewed, wherein the review request carries at least one code file to be reviewed and a file parameter; a first responding module, used to respond to the review request, and when the file parameter indicates that the number of code files to be reviewed is greater than or equal to a first preset number threshold, determine that multiple code files to be reviewed in the review request need to be split; a first execution module, used to execute the step of obtaining associated files that have a dependency relationship with each code file to be reviewed when it is determined that multiple code files to be reviewed in the review request need to be split.

[0115] Optionally, the processing device also includes: a first extraction module, used to extract the file permission identifier in the review request after receiving the review request; a first verification module, used to verify each code file to be reviewed in combination with the file permission identifier; a second acquisition module, used to obtain the code block with modification mark in the code file to be reviewed when the code file to be reviewed is verified; a first statistics module, used to count the number of code blocks with modification mark; a first determination module, used to determine that the code file to be reviewed needs to be split when the number of code blocks is greater than or equal to a second preset number threshold; a second execution module, used to execute the step of obtaining associated files that have a dependency relationship with each code file to be reviewed when it is determined that the code file to be reviewed needs to be split.

[0116] Optionally, the construction unit also includes: a first construction module, which is used to take the code file to be reviewed as the center point of the graph, and the related files as the reference points of the graph, and the dependency relationship as the graph association edge, and connect the files with dependency relationships with dotted lines to construct a review relationship graph.

[0117] Optionally, the processing device also includes: a third acquisition module, which is used to obtain the code calling method, code interface implementation type or code reference method between the dependencies between files after constructing the review relationship diagram based on the code files to be reviewed, related files and the dependencies between the files; a second determination module, which is used to determine the weight parameters of the dependency by adopting the code calling method, code interface implementation type or code reference method; and a first adjustment module, which is used to adjust the review relationship diagram by using the weight parameters as the attribute values ​​of the graph-related edges in the review relationship diagram.

[0118] Optionally, the cutting unit includes: a first selection module, used to select a regular cut algorithm as a cutting algorithm for the review relationship graph; and a first cutting module, used to use the regular cut algorithm to cut the review relationship graph to obtain multiple review subgraphs.

[0119] Optionally, the processing device also includes: a fourth acquisition module, used to acquire files with independent attributes from multiple code files to be reviewed, wherein the independent attribute means that the current code file to be reviewed has no dependency relationship with any other code file to be reviewed; a second extraction module, used to extract the file directory and file type of the file with independent attributes; a second cutting module, used to cut the file with independent attributes into a review file set based on the file directory and file type and pre-configured code block development rules; and a first display module, used to display the review file set and review information corresponding to the file with independent attributes on a preset terminal interface.

[0120] Optionally, the processing device also includes: a third extraction module, which is used to extract the code features of the code files to be reviewed in the review file set within the historical preset time period after extracting the review file set corresponding to each review sub-graph; a fifth acquisition module, which is used to obtain the behavioral features of each review object within the historical preset time period; a first analysis module, which is used to analyze the file history features of the code files to be reviewed in the review file set within the historical preset time period; a first generation module, which is used to assign review objects to the review file set based on the code features of the code files to be reviewed, the behavioral features and file history features of each review object, and generate review summary information of the review file set; a third determination module, which is used to determine the review information of the review file set in combination with the review objects and the review summary information.

[0121] Optionally, the processing device also includes: a second generation module, which is used to generate grouping information of each review document set according to the review information of the review document set after extracting the review document set corresponding to each review sub-graph; and a second display module, which is used to display the grouping information corresponding to each review document set on a preset terminal interface.

[0122] In the embodiment of the present invention, the splitting can be realized by the file dimension, which is more in line with the experience and needs of actual code review, and in addition to considering the dependency relationship of the file itself, language rules and historical features are added, and free files can be classified according to preset rules. Based on dependency analysis, this embodiment performs graph cutting for the situation where there are too many dependent files, converting them into sub-reviews with restrained functions. After splitting into sub-reviews, the reviewers of the sub-reviews are assigned and the information summary is generated, which enables the reviewers to fully review each sub-review, which is conducive to improving the quality of code and reducing the occurrence of bugs.

[0123] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment 1. It should be noted that the above modules as part of the device can be run in the computer terminal 10 provided in embodiment 1.

[0124] Example 4

[0125] According to an embodiment of the present invention, another processing device for implementing the processing method of the review document in the above embodiment 2 is also provided. Fig.10 As shown, the device comprises:

[0126] The receiving unit 100 is used to receive a review request, wherein the review request carries at least one code file to be reviewed;

[0127] The response unit 102 is used to respond to the review request, obtain the associated files that have a dependency relationship with each code file to be reviewed in the cloud server; construct a review relationship graph based on the code file to be reviewed, the associated files and the dependency relationship between the files; cut the review relationship graph into multiple review subgraphs, and extract the review file set corresponding to each review subgraph, to obtain multiple review file sets and review information corresponding to the review file sets, wherein the review file set includes: at least one code file to be reviewed,

[0128] The returning unit 104 is used to return each review document set and the review information corresponding to the review document set to the terminal.

[0129] The above-mentioned processing device can receive the review request through the receiving unit 100, respond to the review request through the responding unit 102, obtain the associated files that have a dependency relationship with each code file to be reviewed in the cloud server, construct a review relationship graph based on the code file to be reviewed, the associated files and the dependency relationship between the files, cut the review relationship graph into multiple review subgraphs, and extract the review file set corresponding to each review subgraph, obtain multiple review file sets and review information corresponding to the review file set, and return each review file set and the review information corresponding to the review file set to the terminal through the returning unit 104, so that the review file set and the review information corresponding to the review file set are displayed on the preset terminal interface. In an embodiment of the present invention, the review relationship graph can be constructed by parsing the dependency relationship between the code files, and the review relationship graph can be cut into multiple review subgraphs to split the complex code review into sub-reviews with introverted functions, so that the reviewer can fully review the review file set corresponding to the review subgraph, which is conducive to improving the code quality and reducing the occurrence of bugs, thereby solving the technical problem that in the code review process in the related technology, due to the large number of files to be reviewed or the large number of modified lines, the code review sufficiency is easily reduced, which affects the code quality.

[0130] In the embodiment of the present invention, complex reviews are converted into sub-reviews through intelligent means, which enables the identification and precise splitting of complex reviews. After the intelligent review splitting, reviewers can be directly assigned to the sub-reviews, and a summary description of the sub-review can be generated through review code features, reviewer behavior features, historical features, etc., which enables reviewers to fully review the sub-reviews, which is beneficial to improving code quality and reducing the occurrence of bugs.

[0131] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment 2. It should be noted that the above modules, as part of the device, can be run in the hardware environment shown in the above embodiment, and can be implemented by software or hardware.

[0132] Example 5

[0133] The embodiment of the present invention can provide a computer terminal, which can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal can also be replaced by a terminal device such as a mobile terminal.

[0134] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of the computer network.

[0135] In this embodiment, the computer terminal can execute the program codes of the following steps in the review document processing method to display each review document set and the review information corresponding to the review document set on a preset terminal interface.

[0136] Optional, Fig.11 is a structural block diagram of a computer terminal according to an embodiment of the present invention. Fig.11 As shown, the computer terminal 10 may include: one or more ( Fig.11 (only one is shown) processor 102 and memory 104.

[0137] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the method and device for processing review documents in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned method for processing review documents. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory may further include a memory remotely arranged relative to the processor, and these remote memories can be connected to the computer terminal A via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0138] The processor can call the information and application programs stored in the memory through the transmission device to execute the following steps: the first step is to obtain the associated files that have a dependency relationship with each code file to be reviewed; the second step is to construct a review relationship graph based on the code files to be reviewed, the associated files and the dependency relationships between the files; the third step is to cut the review relationship graph into multiple review subgraphs, and extract the review file set corresponding to each review subgraph to obtain multiple review file sets, wherein the review file set includes: at least one code file to be reviewed.

[0139] A person skilled in the art can understand that Fig.11The structure shown is for illustration only, and the computer terminal may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Fig.11 The structure of the electronic device is not limited. For example, the computer terminal 10 may also include Fig.11 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Fig.11 Different configurations shown.

[0140] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0141] The embodiment of the present invention further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the review document processing method provided in the above embodiment.

[0142] Optionally, in this embodiment, the above-mentioned storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0143] The embodiment of the present invention further provides a processor. Optionally, in this embodiment, the processor can be used to execute the review document processing method provided in the above embodiment.

[0144] Optionally, in this embodiment, the processor may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0145] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

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

[0147] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the cutting of the units is only a logical function cutting. There may be other cutting methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0148] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0149] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0150] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0151] The above is only a preferred embodiment of the present invention. It should be pointed out that for common technical objects in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for processing review documents, characterized in that: include: Get the associated files that have dependencies with each code file to be reviewed; Constructing a review relationship diagram based on the code file to be reviewed, the associated files, and the dependency relationships between the files; The step of constructing a review relationship graph based on the code file to be reviewed, the associated files and the dependency relationship between the files comprises: taking the code file to be reviewed as the center point of the graph, taking the associated files as the reference points of the graph, taking the dependency relationship as the associated edge of the graph, and connecting the files with the dependency relationship with dotted lines to construct the review relationship graph; The review relationship graph is cut into a plurality of review subgraphs, and a review file set corresponding to each of the review subgraphs is extracted to obtain a plurality of review file sets, wherein the review file set includes: at least one of the code files to be reviewed; The step of cutting the review relationship graph into multiple review subgraphs includes: selecting a regularized cut algorithm as a cutting algorithm for the review relationship graph; and using the regularized cut algorithm to cut the review relationship graph to obtain multiple review subgraphs.

2. The processing method according to claim 1, characterized in that: The steps for obtaining the associated files that have dependencies with each code file to be reviewed include: A first type of associated file that the code in each of the code files to be reviewed needs to rely on when executing and a second type of associated file that needs to reference the code file to be reviewed are obtained to obtain a plurality of associated files.

3. The processing method according to claim 1, characterized in that: Before obtaining the associated files that have dependencies with each code file to be reviewed, it also includes: Receiving a review request, wherein the review request carries at least one code file to be reviewed and file parameters; In response to the review request, and when the file parameter indicates that the number of the code files to be reviewed is greater than or equal to a first preset number threshold, determining that the multiple code files to be reviewed in the review request need to be split; When it is determined that the multiple code files to be reviewed in the review request need to be split, a step of obtaining associated files having a dependency relationship with each code file to be reviewed is performed.

4. The processing method according to claim 3, characterized in that: After receiving a review request, this also includes: Extracting the file permission identifier in the review request; Verify each of the code files to be reviewed in combination with the file permission identifier; When the code file to be reviewed passes the verification, obtaining a code block with a modification mark in the code file to be reviewed; Counting the number of the code blocks having modification marks; When the number of the code blocks is greater than or equal to a second preset number threshold, determining that the code file to be reviewed needs to be split; When it is determined that the code files to be reviewed need to be split, a step of obtaining associated files having a dependency relationship with each code file to be reviewed is performed.

5. The processing method according to claim 1, characterized in that: After constructing a review relationship diagram based on the code file to be reviewed, the associated files, and the dependency relationship between the files, the method further includes: Acquire a code calling method, a code interface implementation type, or a code referencing method having the dependency relationship between files; Determine the weight parameter of the dependency relationship by using the code calling method, code interface implementation type or code referencing method; The weight parameter is used as the attribute value of the graph-associated edge in the review relationship graph to adjust the review relationship graph.

6. A method for processing review documents, characterized in that: include: Receiving a review request, wherein the review request carries at least one code file to be reviewed; In response to the review request, the associated files that have dependency relationships with each code file to be reviewed are obtained in the cloud server; based on the code file to be reviewed, the associated files and the dependency relationships between the files, a review relationship graph is constructed; the review relationship graph is cut into multiple review subgraphs, and a review file set corresponding to each review subgraph is extracted to obtain multiple review file sets and review information corresponding to the review file sets, wherein the review file set includes: at least one code file to be reviewed, based on the code file to be reviewed, the associated files and the dependency relationships between the files, the step of constructing a review relationship graph includes: taking the code file to be reviewed as the center point of the graph, and taking the associated files as the reference point of the graph, taking the dependency relationships as the associated edges of the graph, and connecting the files with the dependency relationships with dotted lines to construct the review relationship graph; the step of cutting the review relationship graph into multiple review subgraphs includes: selecting a regular cut algorithm as a cutting algorithm for the review relationship graph; using the regular cut algorithm to cut the review relationship graph to obtain multiple review subgraphs; Each review document set and the review information corresponding to the review document set are returned to the terminal.

7. A device for processing review documents, characterized in that: include: An acquisition unit, used for acquiring associated files that have a dependency relationship with each code file to be reviewed; A construction unit, configured to construct a review relationship diagram based on the code file to be reviewed, the associated files, and the dependency relationship between the files; The construction unit further includes: a first construction module, which is used to use the code file to be reviewed as the center point of the graph, and the associated files as the reference points of the graph, and the dependency relationship as the associated edge of the graph, and to connect the files with the dependency relationship with dotted lines to construct a review relationship graph; A cutting unit is used to cut the review relationship graph into multiple review sub-graphs, and extract a review file set corresponding to each review sub-graph to obtain multiple review file sets, wherein the review file set includes: at least one code file to be reviewed; the cutting unit is also used to select a regular cut algorithm as a cutting algorithm for the review relationship graph; the review relationship graph is cut using the regular cut algorithm to obtain multiple review sub-graphs.

8. A device for processing review documents, characterized in that: include: A receiving unit, configured to receive a review request, wherein the review request carries at least one code file to be reviewed; A response unit is used to respond to the review request, obtain associated files that have a dependency relationship with each code file to be reviewed in the cloud server; construct a review relationship graph based on the code file to be reviewed, the associated files and the dependency relationship between the files; cut the review relationship graph into multiple review subgraphs, and extract the review file set corresponding to each review subgraph, to obtain multiple review file sets and review information corresponding to the review file sets, wherein the review file set includes: at least one code file to be reviewed, wherein the response unit is also used to use the code file to be reviewed as the center point of the graph, and the associated files as the reference point of the graph, and the dependency relationship as the graph association edge, and connect the files with the dependency relationship with dotted lines to construct the review relationship graph; The response unit is further used to select a regular cut algorithm as a cutting algorithm for the review relationship graph; the regular cut algorithm is used to cut the review relationship graph to obtain multiple review subgraphs; The returning unit is used to return each of the review document sets and the review information corresponding to the review document sets to the terminal.

9. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the method for processing review documents according to any one of claims 1 to 5.

10. A processor, characterized in that: The processor is used to run a program, wherein the program executes the method for processing review documents according to any one of claims 1 to 5 when running.

11. A terminal, characterized in that: include: first device; Second device; The third device A processor, wherein the processor runs a program, wherein when the program is run, the following processing steps are performed on the data output from the first device, the second device, and the third device: The first step is to obtain the associated files that have a dependency relationship with each code file to be reviewed; The second step is to construct a review relationship graph based on the code file to be reviewed, the associated files and the dependency relationships between the files; the step of constructing the review relationship graph based on the code file to be reviewed, the associated files and the dependency relationships between the files includes: taking the code file to be reviewed as the center point of the graph, taking the associated files as the reference points of the graph, taking the dependency relationships as the associated edges of the graph, and connecting the files with the dependency relationships with dotted lines to construct the review relationship graph; The third step is to cut the review relationship graph into multiple review sub-graphs, and extract the review file set corresponding to each review sub-graph to obtain multiple review file sets, wherein the review file set includes: at least one code file to be reviewed; the step of cutting the review relationship graph into multiple review sub-graphs includes: selecting a regular cut algorithm as a cutting algorithm for the review relationship graph; using the regular cut algorithm to cut the review relationship graph to obtain multiple review sub-graphs.