Code review methods and related equipment based on large language models
By compressing code files based on project metadata and change logs during code review, and utilizing a large language model for review, the problem of low accuracy in code review under large data volumes is solved, achieving efficient and accurate code review and improving the quality and security of software projects.
Patent Information
- Application Number
- CN202411955512.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-28
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2044-12-28
AI Technical Summary
Existing code review methods suffer from low accuracy due to the large amount of code to be reviewed and the performance limitations of code review tools.
By acquiring multiple code modification files, determining the score based on the project's metadata and code modification logs, compressing the files, and using a large language model to review the compressed code modification files, structural hints are generated, resource usage is optimized, interference from non-functional code modifications is reduced, and the review of important code is ensured.
It improves the accuracy and efficiency of code review, adapts to projects of different sizes and complexities, and ensures the quality and security of software projects.
Smart Images

Figure CN119883358B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, specifically to a code review method and related equipment based on a large language model. Background Technology
[0002] Code review is an essential part of the software project development process. It can effectively improve the overall code quality of the project and identify potential problems in the code in a timely manner.
[0003] The common code review method involves directly inputting the code to be reviewed into a code review tool for processing, and then obtaining the review results. However, due to factors such as the large amount of data in the code to be reviewed and the performance limitations of the code review tool, the accuracy of the review results may be low. Summary of the Invention
[0004] In view of the above, it is necessary to propose a code review method and related equipment based on a large language model to solve the technical problem of low accuracy of the review results of existing code review methods.
[0005] Firstly, this application provides a code review method based on a large language model. The method includes: acquiring multiple code modification files, wherein each of the multiple code modification files includes a code modification log; if the total number of tags in the multiple code modification files is greater than the maximum number of tags that can be received by a preset large language model, determining the score of each code modification file based on updated project metadata and the code modification log of each code modification file; compressing the multiple code modification files based on the score and the metadata to obtain compressed multiple code modification files; and reviewing the compressed multiple code modification files based on the preset large language model to obtain a code review result.
[0006] In the code review method based on a large language model described in the above embodiments, firstly, multiple code modification files are obtained, each including a code modification log; then, if the total number of tags in the multiple code modification files is greater than the maximum number of tags that can be received by a preset large language model, the score of each code modification file is determined based on the updated project metadata and the code modification log of each code modification file; then, the multiple code modification files are compressed based on the score and metadata to obtain multiple compressed code modification files; then, a structure prompt word of a preset large language model is generated based on the metadata and the multiple compressed code modification files; finally, the multiple compressed code modification files are reviewed based on the preset large language model and the structure prompt word to obtain the code review result. Based on this, when the total number of tags in the code modification files exceeds the processing capacity of the large language model, this application compresses multiple code modification files using project metadata and code modification logs. This satisfies the processing capacity of the large language model while optimizing resource usage, reducing interference from non-functional code modifications to the large language model's inference, ensuring the large language model focuses on reviewing important code, improving the accuracy and relevance of the review, adapting to projects of different sizes and complexities, and exhibiting good scalability. Reviewing the compressed multiple code modification files based on the large language model leverages its superior performance, improving the quality and efficiency of the review results. In summary, this application achieves comprehensive, efficient, and accurate review of code modifications, improving the accuracy and efficiency of code review, providing strong support for the software development process, and ensuring the quality and security of software projects.
[0007] In some embodiments of this application, compressing the plurality of code modification files based on the integral and the meta-information to obtain a plurality of compressed code modification files includes: deleting the code modification files specified for exclusion by the meta-information in the plurality of code modification files to obtain a plurality of code modification files after initial compression; if the total number of tags in the plurality of code modification files after initial compression is greater than the maximum number of tags received by the preset large language model, deleting the code modification files in the plurality of code modification files after initial compression that are lower than a preset integral threshold to obtain a plurality of code modification files after secondary compression.
[0008] In some embodiments of this application, the step of compressing the plurality of code modification files based on the integral and the meta-information to obtain a plurality of compressed code modification files further includes: if the total number of tags in the plurality of code modification files after secondary compression is greater than the maximum number of tags received by the preset large language model, deleting the code with the modification type of deletion in each of the code modification files after secondary compression, thereby obtaining a plurality of code modification files after tertiary compression.
[0009] In some embodiments of this application, the step of compressing the plurality of code modification files based on the integral and the meta-information to obtain the compressed plurality of code modification files further includes: if the total number of tags in the plurality of code modification files after three compressions is greater than the maximum number of tags received by a preset large language model, deleting the code with the modification type of "edit" in each of the three compressed code modification files to obtain the plurality of code modification files after four compressions.
[0010] In some embodiments of this application, determining the score of each code modification file based on the project's metadata and the code modification log of each code modification file includes: determining the usage percentage of each programming language in the updated project based on the metadata; determining a first score for each code modification file based on the programming language and the usage percentage of each code modification file; determining a second score for each code modification file based on the code modification log of each code modification file; and determining the score of each code modification file based on the first score and the second score.
[0011] In some embodiments of this application, the step of reviewing the compressed multiple code modification files based on a preset large language model to obtain code review results includes: generating structural prompts for the preset large language model based on the metadata and the compressed multiple code modification files; and reviewing the compressed multiple code modification files based on the preset large language model and the structural prompts to obtain code review results.
[0012] In some embodiments of this application, the step of reviewing the compressed multiple code modification files based on the preset large language model and the structural cue words to obtain the code review result includes: reviewing the compressed multiple code modification files based on the preset large language model that has been fine-tuned and trained and the structural cue words to obtain the code review result.
[0013] In some embodiments of this application, the fine-tuning training method for the pre-set large language model after fine-tuning training includes: constructing a training dataset based on the organization code and industry code corresponding to the project; and fine-tuning the parameters of the pre-set large language model based on the training dataset to obtain the pre-set large language model after fine-tuning training.
[0014] In some embodiments of this application, generating a structural prompt word for a preset large language model based on the metadata and the compressed multiple code modification files includes: determining code information related to the project from a preset plug-in knowledge base based on the metadata, wherein the preset plug-in knowledge base contains code standards and best practices for the organization and preset industry corresponding to the project; and concatenating the compressed multiple code modification files and the code information to obtain the structural prompt word.
[0015] Secondly, this application also provides a code review device based on a large language model. The device includes: an acquisition module for acquiring multiple code modification files, wherein each of the multiple code modification files includes a code modification log; a determination module for determining the score of each code modification file based on updated project metadata and the code modification log of each code modification file if the total number of tags in the multiple code modification files is greater than the maximum number of tags that can be received by a preset large language model; a compression module for compressing the multiple code modification files based on the score and the metadata to obtain compressed multiple code modification files; and a review module for reviewing the compressed multiple code modification files based on the preset large language model to obtain a code review result.
[0016] Thirdly, this application also provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the code review method based on the large language model described in the above embodiments.
[0017] Fourthly, this application also provides a computer-readable medium storing a computer program, which, when executed by a processor, implements the steps of the code review method based on a large language model described in the above embodiments.
[0018] Understandably, the code review apparatus based on the large language model in the second aspect, the electronic device in the third aspect, the computer-readable medium in the fourth aspect, and the computer program product in the fifth aspect all correspond to the code review method based on the large language model in the first aspect. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding code review method based on the large language model provided above, and will not be repeated here. Attached Figure Description
[0019] Figure 1 This is a schematic diagram illustrating an application scenario of the code review method based on a large language model provided in an embodiment of this application.
[0020] Figure 2This is a flowchart illustrating a code review method based on a large language model provided in an embodiment of this application.
[0021] Figure 3 yes Figure 2 The flowchart shown is a detailed flowchart of step S11 in the code review method based on a large language model.
[0022] Figure 4 yes Figure 2 The flowchart shown is a detailed representation of step S12 in the code review method based on a large language model.
[0023] Figure 5 yes Figure 2 The flowchart shown is a detailed flowchart of step S13 in the code review method based on a large language model.
[0024] Figure 6 yes Figure 5 The flowchart shown is a detailed flowchart of step S130 in the code review method based on a large language model.
[0025] Figure 7 This is a flowchart illustrating a method for fine-tuning a preset large language model according to an embodiment of this application.
[0026] Figure 8 This is a schematic diagram of the functional modules of a code review device based on a large language model provided in an embodiment of this application.
[0027] Component Symbol Explanation
[0028] Electronic devices 10
[0029] Memory 11
[0030] Processor 12
[0031] Speaker 20
[0032] Code review device based on large language model 100
[0033] Get Module 110
[0034] Determine module 120
[0035] Compression module 130
[0036] Review module 140
[0037] The following detailed description, in conjunction with the accompanying drawings, will further illustrate this application. Detailed Implementation
[0038] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0039] In the embodiments of this application, it should be noted that, unless otherwise expressly specified and limited, the word "for example" is used to indicate an example, illustration, or description. Any embodiment or design scheme described as "for example" in the embodiments of this application should not be construed as being better or more advantageous than other embodiments or design schemes. Specifically, the use of the word "for example" is intended to present the relevant concepts in a specific manner.
[0040] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection, an electrical connection, or a connection that allows communication between them; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication between two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0041] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. Furthermore, in the description of this application, "a plurality of" means two or more, unless otherwise expressly and specifically defined.
[0042] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0043] Please see Figure 1 This is a schematic diagram illustrating an application scenario of the code review method based on a large language model provided in an embodiment of this application.
[0044] This application provides a code review method based on a large language model, which can be applied to one or more electronic devices. An electronic device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0045] Specifically, the electronic device 10 is used to: acquire multiple code modification files, wherein each code modification file includes a code modification log; if the total number of tags in the multiple code modification files is greater than the maximum number of tags that can be received by a preset large language model, determine the score of each code modification file based on the updated project metadata and the code modification log of each code modification file; compress the multiple code modification files based on the score and metadata to obtain compressed multiple code modification files; and review the compressed multiple code modification files based on the preset large language model to obtain a code review result.
[0046] In some embodiments of this application, the electronic device 10 can be communicatively connected to devices such as desktop computers, laptops, handheld computers, and cloud servers.
[0047] In some embodiments of this application, the electronic device 10 can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control device.
[0048] In some embodiments of this application, the electronic device 10 may further include network devices and / or client devices. These network devices include, but are not limited to, a single network server, a server group consisting of multiple network servers, and a cloud server based on cloud computing, consisting of a large number of hosts or network servers.
[0049] In some embodiments of this application, the network where the electronic device 10 is located includes, but is not limited to, the Internet, wide area network, metropolitan area network, local area network, virtual private network (VPN), etc.
[0050] Please see Figure 2 This is a schematic diagram illustrating the steps of a code review method based on a large language model provided in an embodiment of this application.
[0051] Specifically, the code review method based on the large language model includes the following steps. Depending on different needs, the order of some steps in the flowchart can be changed, and some steps can be omitted.
[0052] Step S10: Obtain multiple code modification files.
[0053] Specifically, each code modification file includes a code change log between the first file and the second file. The code change log records the differences between the second file and the first file (e.g., code that has been deleted, added, or edited). Here, the first file represents the code file in the original project, and the second file represents the code file in the updated project corresponding to the first file.
[0054] It should be noted that in the field of software development, a project typically refers to a comprehensive task or product, which consists of multiple types of files, including but not limited to source code modification files, configuration files, and resource files. As the project progresses and requirements evolve, these files will change over time, including but not limited to the addition of new features, the modification or deletion of old features, and the updating of configuration files or resource files.
[0055] In some embodiments of this application, the electronic device 10 can use version control system (e.g., Git) commands to obtain multiple modified code files. Specifically, after receiving a code merge request from the version control system, the electronic device 10 pulls the merge record corresponding to the code merge request from the version control system and queries multiple modified code files based on the merge record. Git is a powerful distributed version control system that can manage the source code of large open-source software, as well as private documents and source code.
[0056] In other embodiments, multiple code modification files can be pre-stored in a preset document, which can be stored on the electronic device 10. When code review is required, the electronic device 10 directly reads the contents of the preset document to obtain the code modification files.
[0057] Step S11: If the total number of tags for multiple code modification files is greater than the maximum number of tags that can be received by the preset large language model, determine the score of each code modification file based on the updated project metadata and the code modification log of each code modification file.
[0058] In some embodiments of this application, before providing multiple code modification files to a large language model for processing, each code modification file needs to be converted into a readable text format. When we convert multiple code modification files into text format for processing by the large language model, these files are broken down into a series of basic processing units, i.e., tokens. Each token can be a word, a character, or a phrase or word group in the code. The number of tokens in each code modification file refers to the number of words, symbols, or word groups and phrases that have undergone tokenization processing contained in each code modification file after being converted into text format, i.e., the number of tokens. Therefore, the total number of tokens in multiple code modification files is the total number of tokens formed after the multiple code modification files are converted into text format.
[0059] In some embodiments of this application, the preset large language model may be the codeQwen1.5 model, which is an artificial intelligence model specifically designed for processing and analyzing code. This model takes as input code modification files and structured cue words to guide the model in code review, and outputs the code review results regarding the code modification files. The maximum number of tokens that the codeQwen1.5 model can handle may be 2048 tokens, meaning that the total number of words, symbols, or code snippets it can effectively process in a single inference iteration does not exceed 2048 tokens.
[0060] In some embodiments of this application, during software development, especially for large projects, the code changes between different versions can be enormous. This can cause the total number of tokens for the code change files in the project to far exceed the processing capacity of the large language model, thereby interfering with the inference performance of the large language model and affecting the accuracy and efficiency of code review. For example, a complex software project may have thousands of lines of code changes in a single update, which could result in over 100,000 tokens. Furthermore, changes to non-functional code, such as configuration file updates, and alterations to images and binary files, can also significantly increase the number of tokens.
[0061] To address the aforementioned issues, this application proposes a sorting algorithm and a compression algorithm. First, based on updated project metadata, such as the main programming language, functional description, project type, and a list of unimportant files, each code modification file is scored. Next, after scoring, the token count for each code modification file and the total token count for all code modification files are calculated. Based on the window requirements of the large language model, such as a limit of 2048 tokens, all code modification files are intelligently compressed to ensure that the total token count of all code modification files does not exceed the processing capacity of the large language model. Specific implementation examples are as follows:
[0062] In some embodiments of this application, the step S11 of determining the score of each code modification file based on the updated project's metadata and the code modification log of each code modification file specifically includes: determining the usage percentage of each programming language in the updated project based on the metadata; determining the first score of each code modification file based on the programming language and usage percentage of each code modification file; determining the second score of each code modification file based on the code modification log of each code modification file; and determining the score of each code modification file based on the first score and the second score, for example, using the sum of the first score and the second score as the score of each code modification file.
[0063] Meta-information refers to key information and contextual data about a project, such as programming language, functional description, project type, list of unimportant files, and coding style. This information helps in understanding and handling code changes to the project.
[0064] In the above embodiments, by determining the usage percentage of each programming language in the project, the importance of code modification files can be more accurately assessed, ensuring that changes to the main languages receive more attention. By assigning a first and second score to each code modification file, an automated scoring system is implemented, making the code review process more objective and quantifiable. Based on the score, code modification files can be prioritized, with priority given to code changes that have the greatest impact on the project. Through the scoring system, critical code changes can be quickly identified and processed, improving the efficiency of code review, reducing the workload of reviewers, and allowing for the rational allocation of review resources. This ensures that critical code receives sufficient review while reducing excessive focus on non-critical code. Combining the first and second scores allows for a more comprehensive assessment of the impact of code changes, including additions, deletions, and edits. Accurate evaluation of code changes through the scoring system helps to promptly identify and correct potential problems, improving code quality and the overall stability of the project.
[0065] It should be noted that the determination of the score for each code modification file based on the updated project metadata and the code change logs for each modified file will be discussed later. Figure 3 The steps shown are described in detail, and will not be repeated here to avoid repetition.
[0066] In other embodiments, if the total number of tags in multiple code modification files is less than or equal to the maximum number of tags that can be received by a preset large language model, there is no need to compress the code modification files, and the electronic device 10 directly executes step S13.
[0067] Step S12: Compress multiple code modification files based on integrals and metadata to obtain multiple compressed code modification files.
[0068] In some embodiments of this application, step S12, compressing multiple code modification files based on integrals and meta-information to obtain multiple compressed code modification files, specifically includes: deleting code modification files specified for exclusion by meta-information in the multiple code modification files to obtain multiple code modification files after initial compression; if the total number of tags in the multiple code modification files after initial compression is greater than the maximum number of tags received by a preset large language model, deleting code modification files in the multiple code modification files after initial compression that are lower than a preset integral threshold to obtain multiple code modification files after secondary compression.
[0069] In the above embodiments, code modification files marked as "specified exclusion" are deleted according to the instructions of the metadata. Files marked as "specified exclusion" may be because their content is duplicated with other modifications, they are no longer needed, they do not contribute substantially to the overall progress of the project, or they are external resource files. By deleting unnecessary code modification files, the multiple code modification files after the initial compression can be made more concise, while avoiding the waste of computing power of the large language model in the subsequent code review process, thereby improving the efficiency of code review. Furthermore, based on the score of the code modification files, code modification files below the preset score threshold in the multiple code modification files after the initial compression are deleted. This helps to reduce the interference of non-critical changes on the review process, enabling the large language model to process the remaining critical code modification files more efficiently, reducing the total number of tags that the large language model needs to process, thereby accelerating the inference speed of the large language model, improving the efficiency of code review and analysis, and ensuring that the large language model can prioritize processing those code modification files with high scores and greater importance. This helps to identify and solve key problems more quickly.
[0070] In some embodiments of this application, step S12, which compresses multiple code modification files based on integrals and meta-information to obtain multiple compressed code modification files, further includes: if the total number of tags in the multiple code modification files after secondary compression is greater than the maximum number of tags received by the preset large language model, deleting the code with the modification type of deletion in each code modification file after secondary compression, to obtain multiple code modification files after tertiary compression.
[0071] In the above embodiments, by deleting code with the modification type "deletion," the amount of data that the large language model needs to process is reduced. This ensures that the large language model can concentrate its computing resources on more important code changes, namely, the newly added and edited code. This allows for more efficient use of the model's computing power, enabling more in-depth analysis and review of these changes, and improving the quality and accuracy of code review. Furthermore, deleted code typically does not contain newly introduced logic or errors; therefore, removing this code from the review process helps reduce interference and allows for a more focused review process.
[0072] In some embodiments of this application, step S12, which compresses multiple code modification files based on integrals and meta-information to obtain multiple compressed code modification files, further includes: if the total number of tags in the multiple code modification files after three compressions is greater than the maximum number of tags received by the preset large language model, deleting the code with the modification type of "edit" in each of the three compressed code modification files to obtain multiple code modification files after four compressions.
[0073] In the above embodiments, by prioritizing the deletion of edit-type code, it can be ensured that more important code changes (such as new feature code) are processed first, reducing the amount of data that the large language model needs to process. This helps to improve the response speed and processing efficiency of the large language model, especially when dealing with large projects. It can also improve the accuracy of code review, particularly in the review of key functions and main logic.
[0074] It should be noted that the method for compressing multiple code modification files based on integrals and metadata, resulting in compressed code modification files, will be discussed later. Figure 4 The steps shown are described in detail, and will not be repeated here to avoid repetition.
[0075] Step S13: Review the compressed multiple code modification files based on the preset large language model to obtain the code review results.
[0076] In some embodiments of this application, step S13, reviewing multiple compressed code modification files based on a preset large language model to obtain code review results, specifically includes: generating structural prompts for the preset large language model based on metadata and multiple compressed code modification files; reviewing multiple compressed code modification files based on the preset large language model and structural prompts to obtain code review results.
[0077] Among them, structural cue words are used to indicate the review purpose of multiple code modification files.
[0078] In some embodiments of this application, structural prompts may include: role information, used to indicate the role played by the large language model; for example, role information may indicate that the large language model plays the role of a "code review assistant." Since senior software developers have good code review capabilities, having the large language model act as a "code review assistant" can improve the quality of code review. Project meta-information, used to indicate the basic information of the project; the basic information of the project may include, but is not limited to, the project language, code style, change history, etc. Modification content, used to indicate the files that have been modified in the code repository. Task information, used to indicate the review task of the large language model for code review; the review task may include, but is not limited to, code score, code quality, code modification information, code modification risks, and modification suggestions. For each review dimension, its specific content can be specified. For example, for code quality, the task information may include reviewing the structure, style, usability, etc. of the code. Review result feedback format information, used to indicate the feedback format of the large language model for the review results. Among them, different feedback formats can be designed for different review dimension information. For example, for code score, the feedback result may be specified as a value between 1 and 10, and for code quality, specific quality problems or no problems may be reported.
[0079] In the above embodiments, customized structural prompts are generated based on project metadata and compressed code modification files. This enables the large language model to better adapt to the knowledge of specific organizations and preset industry domains, improving the applicability and accuracy of the large language model in specific organizations and preset industry domains. Furthermore, by including role information, project metadata, modification content task information, and review result feedback format information in the structural prompts, accurate prompts can be provided to the large language model, improving the processing accuracy of the large language model, enhancing the accuracy of code review, and achieving comprehensive code review.
[0080] It should be noted that the details regarding how to review multiple compressed code modification files based on a pre-defined large language model, and the resulting code review results, will be discussed later. Figure 5 The steps shown are described in detail, and will not be repeated here to avoid repetition.
[0081] In some embodiments of this application, while large language models perform well in general language processing tasks, they may not be able to accurately understand and generate code that meets the needs of a specific organization or industry. For example, different companies may have their unique coding standards and best practices, while a pre-defined industry, such as the automotive industry, may have specific regulatory compliance and security requirements, all of which need to be taken into account by the large language model when reviewing the code.
[0082] To address the aforementioned issues, this application proposes a method for generating structural cue words and a method for fine-tuning a large language model. First, based on metadata, the code standards and best practices corresponding to the project's organization and industry are determined from a pre-defined external knowledge base. Second, multiple compressed code modification files are concatenated with the organization's and industry's code standards and best practices to obtain structural cue words. Next, a training dataset is constructed based on the organization's and industry's codes corresponding to the project. Then, the parameters of the pre-defined large language model are fine-tuned based on the training dataset. Finally, based on the fine-tuned pre-defined large language model and the structural cue words, the multiple compressed code modification files are reviewed. Specific embodiments are as follows:
[0083] In some embodiments of this application, generating structural prompts for a preset large language model based on metadata and multiple compressed code modification files specifically includes: determining project-related code information from a preset plug-in knowledge base based on metadata, wherein the preset plug-in knowledge base contains code standards and best practices for the project's internal organization and preset industry; and concatenating the multiple compressed code modification files and code information to obtain structural prompts.
[0084] Code style guidelines are a set of rules on how to write code, including naming conventions, code formatting, and commenting standards. For example, C++ code style guidelines might include naming rules for static variables. These guidelines help maintain code consistency and readability. Best practices refer to widely recognized and recommended practices in the software development process; they are effective methods based on experience. For example, best practices might include code review, unit testing, and continuous integration.
[0085] In the above embodiments, by retrieving project-related code standards and best practices from the external knowledge base, customized code reviews for specific organizations and industries are achieved. This allows the large language model to more accurately understand and evaluate code changes, improving the accuracy of code reviews. By generating customized structural prompts based on internal organization and preset industry code standards and best practices, background hints on private code standards and preset industry domains can be provided, helping to improve code quality and reduce potential defects and risks. The external knowledge base is designed to allow for easy addition or modification of project-related code information, offering excellent flexibility and scalability.
[0086] In some embodiments of this application, the code review results are obtained by reviewing multiple compressed code modification files based on a preset large language model and structural cue words. Specifically, the code review results are obtained by reviewing multiple compressed code modification files based on a preset large language model and structural cue words that have been fine-tuned and trained.
[0087] Specifically, after generating the structure clues, the interface of the finely tuned large language model is called, the structure clues are input, and the finely tuned large language model outputs the code review results of multiple code modification files based on the structure clues.
[0088] In the above embodiments, the fine-tuned large language model can adapt to the specific needs of the organization and industry corresponding to the project, generate code review results that are more in line with the needs of the organization and industry corresponding to the project, and improve the accuracy of code review of the project.
[0089] In some embodiments of this application, the fine-tuning training method for the preset large language model includes: constructing a training dataset based on the organization code and industry code corresponding to the project; and fine-tuning the parameters of the preset large language model based on the training dataset to obtain the fine-tuned preset large language model.
[0090] In other embodiments, after obtaining the code review results, the electronic device 10 can display them to the user through a client. The code review results may include a score. If the modified code file has defects or areas for improvement, these defects can be displayed to the user through highlighting or other means, allowing the user to evaluate the code review results. Subsequently, the code review results obtained from the large language model can be directly used, or the code review results can be manually corrected.
[0091] In the code review method based on a large language model in this application embodiment, firstly, multiple code modification files are obtained, each including a code modification log; then, if the total number of tags in the multiple code modification files is greater than the maximum number of tags that can be received by a preset large language model, the score of each code modification file is determined based on the updated meta-information of the project and the code modification log of each code modification file; then, the multiple code modification files are compressed based on the score and meta-information to obtain multiple compressed code modification files; then, based on the meta-information and the multiple compressed code modification files, a structural prompt word of a preset large language model is generated; finally, the multiple compressed code modification files are reviewed based on the preset large language model and the structural prompt word to obtain the code review result. Based on this, when the total number of tags in the code modification files exceeds the processing capacity of the large language model, this application compresses multiple code modification files using project metadata and code modification logs. This satisfies the processing capacity of the large language model while optimizing resource usage, reducing interference from non-functional code modifications to the large language model's inference, ensuring the large language model focuses on reviewing important code, improving the accuracy and relevance of the review, adapting to projects of different sizes and complexities, and exhibiting good scalability. Reviewing the compressed multiple code modification files based on the large language model leverages its superior performance, improving the quality and efficiency of the review results. In summary, this application achieves comprehensive, efficient, and accurate review of code modifications, improving the accuracy and efficiency of code review, providing strong support for the software development process, and ensuring the quality and security of software projects.
[0092] Please see Figure 3 This is a schematic diagram illustrating the specific steps of step S11 in the code review method based on a large language model provided in an embodiment of this application.
[0093] This embodiment is a detailed explanation of step S11 in the aforementioned embodiment, further illustrating how to determine the score of each code modification file based on the updated project metadata and the code modification log of each code modification file. Specifically, it includes the following steps:
[0094] Step S110: Based on the metadata, determine the usage percentage of each programming language in the updated project.
[0095] In some embodiments of this application, the usage percentage of each programming language used in the project, which file extensions in the project belong to external resources, the project type, and other necessary metadata can be specified in any configuration file of the project. For example, in project.yaml (configuration file), add main-lang:java (specifying that the main programming language of the project is Java), external:.png.svg (specifying that image file extensions in the project belong to external resources), type:server (specifying that the project type is a service project), and other necessary metadata.
[0096] Specifically, the electronic device 10 can determine the metadata of the project based on the configuration file, and determine the usage ratio of each programming language in the updated project based on the metadata.
[0097] Step S111: Determine the first integral for each code modification file based on its programming language and usage percentage.
[0098] Specifically, the priority of each programming language in the updated project is determined based on its usage percentage. For example, the programming languages used in the project are ordered from highest to lowest usage percentage as the first language, the second language, ..., the Nth language. The first language is the main language of the project, i.e., the language with the highest usage percentage in the project; the second language is the language with a usage percentage only lower than the first language; and so on, with the Nth language being the language with the lowest usage percentage in the project.
[0099] In some embodiments of this application, if the programming language of the modified code file is the same as the first language, the first score of the modified code file is determined to be 0.5 points; if the programming language of the modified code file is the same as the second language, the first score of the modified code file is determined to be 0.3 points, and so on. If the programming language of the modified code file is the same as the Nth language, the first score of the modified code file is determined to be 0.01 points. The first score is used to quantify and evaluate the consistency between the programming language of each modified code file and the programming language of the updated project. Modified code files with higher consistency may receive a higher first score and thus be given priority for review.
[0100] It should be noted that the size of the first integral mentioned above is only an example, and can be adjusted according to actual needs in practical applications. This application does not impose any restrictions on this.
[0101] Step S112: Determine the second integral for each modified code file based on the code change log for each modified code file.
[0102] Specifically, based on the code change log of each code change file, the differing code in each code file is determined, such as deleted, added, and edited code. A second score is then determined for each code change file based on the types of differing code contained in the code change log. This second score is used to quantify and evaluate the importance and impact of different types of code changes (e.g., additions, deletions, and edits) in each code change file on the updated project.
[0103] In some embodiments of this application, if the code modification file only contains added or deleted code, the second integral of the code modification file is determined to be 0.3; if the code modification file contains both added and deleted code, the second integral of the code modification file is determined to be 0.5; if the code modification file contains edited code, the second integral of the code modification file is determined to be the percentage of edited code in all code modification files * 10. For example, if the percentage of edited code in the main.java code modification file is 50% in all code modification files, then the second integral of the main.java code modification file is 50% * 10 = 0.5.
[0104] Step S113: Determine the integral of each code modification file based on the first integral and the second integral.
[0105] In some embodiments of this application, the first integral and the second integral are added together to obtain the integral for each code modification file.
[0106] In this embodiment, by determining the usage percentage of each programming language in the project, the importance of code modification files can be more accurately assessed, ensuring that changes to the main languages receive more attention. An automated scoring system is implemented by assigning a first and second score to each code modification file, making the code review process more objective and quantifiable. Based on the score, code modification files can be prioritized, with priority given to code changes that have the greatest impact on the project. The scoring system allows for the rapid identification and handling of critical code changes, improving the efficiency of code review, reducing the workload of reviewers, and enabling the rational allocation of review resources to ensure that critical code is fully reviewed while reducing excessive focus on non-critical code. Combining the first and second scores allows for a more comprehensive assessment of the impact of code changes, including additions, deletions, and edits. Accurate evaluation of code changes through the scoring system helps to promptly identify and correct potential problems, improving code quality and the overall stability of the project.
[0107] Please see Figure 4 This is a schematic diagram illustrating the specific steps of step S12 in the code review method based on a large language model provided in an embodiment of this application.
[0108] This embodiment is a detailed explanation of step S12 in the aforementioned embodiment, further illustrating how to compress multiple code modification files based on integrals and metadata to obtain compressed multiple code modification files. Specifically, it includes the following steps:
[0109] Step S120: Delete the code modification files specified for exclusion as indicated by the meta information in the multiple code modification files, and obtain multiple code modification files after initial compression.
[0110] In some embodiments of this application, the code modification files specified for exclusion as indicated by the metadata are first deleted, for example, the external resource files specified in the metadata.
[0111] In the above embodiments, code modification files marked as "specified exclusion" are deleted according to the instructions in the metadata. Files marked as "specified exclusion" may be because their content duplicates other modifications, they are no longer needed, they do not substantially contribute to the overall progress of the project, or they are external resource files. By deleting unnecessary code modification files, the multiple code modification files after the initial compression can be made more concise, while avoiding the waste of computational power of the large language model in subsequent code review processes, thereby improving the efficiency of code review.
[0112] Step S121: If the total number of tags in the multiple code modification files after the first compression is greater than the maximum number of tags that can be received by the preset large language model, delete the code modification files in the multiple code modification files after the first compression that are below the preset integration threshold, and obtain the multiple code modification files after the second compression.
[0113] In some embodiments of this application, if the score of a modified code file is lower than a preset score threshold, it indicates that the modified code file is less important to the updated project. Therefore, if the total number of tags in the multiple modified code files after the initial compression is still greater than the maximum number of tags that can be received by the preset large language model, then the modified code files in the multiple modified code files after the initial compression that are lower than the preset score threshold are directly deleted. For example, the preset score threshold can be 2.
[0114] It should be noted that the preset integration threshold can be set according to actual needs, and this application does not impose specific restrictions on it.
[0115] In the above embodiments, deleting code modification files below a preset score threshold from multiple code modification files after initial compression based on their scores helps reduce the interference of non-critical changes on the review process. This allows the large language model to process the remaining critical code modification files more efficiently, reducing the total number of tags that the large language model needs to process. This, in turn, speeds up the inference speed of the large language model, improves the efficiency of code review and analysis, and ensures that the large language model can prioritize processing code modification files with high scores and greater importance. This helps to identify and resolve key issues more quickly.
[0116] Step S122: If the total number of tags in the multiple code modification files after secondary compression is greater than the maximum number of tags that can be received by the preset large language model, delete the code with the deletion type in each code modification file after secondary compression, and obtain multiple code modification files after tertiary compression.
[0117] In some embodiments of this application, if the total number of tags in the multiple code modification files after secondary compression is still greater than the maximum number of tags that can be received by the preset large language model, the code with the modification type of deletion in each code modification file after secondary compression will continue to be deleted.
[0118] In the above embodiments, by deleting code with the modification type "deletion," the amount of data that the large language model needs to process is reduced. This ensures that the large language model can concentrate its computing resources on more important code changes, namely, the newly added and edited code. This allows for more efficient use of the model's computing power, enabling more in-depth analysis and review of these changes, and improving the quality and accuracy of code review. Furthermore, deleted code typically does not contain newly introduced logic or errors; therefore, removing this code from the review process helps reduce interference and allows for a more focused review process.
[0119] Step S123: If the total number of tags in the multiple code modification files after three compressions is still greater than the maximum number of tags that can be received by the preset large language model, delete the code with the modification type of "edit" in each of the three code modification files after three compressions, and obtain multiple code modification files after four compressions.
[0120] In some embodiments of this application, if the total number of tags in multiple code modification files after three compressions is still greater than the maximum number of tags that can be received by the preset large language model, the code with the modification type of "edit" in each code modification file after three compressions will continue to be deleted.
[0121] In the above embodiments, by prioritizing the deletion of edit-type code, it can be ensured that more important code changes (such as new feature code) are processed first, reducing the amount of data that the large language model needs to process. This helps to improve the response speed and processing efficiency of the large language model, especially when dealing with large projects. It can also improve the accuracy of code review, particularly in the review of key functions and main logic.
[0122] In other embodiments, if the total number of tags in the multiple code modification files after four compressions is still greater than the maximum number of tags that can be received by the preset large language model, the corresponding code modification files are deleted in order of increasing score of each code modification file after four compressions, until the total number of tags in the multiple code modification files after compression is less than or equal to the maximum number of tags that can be received by the preset large language model.
[0123] In this embodiment, when the total number of tags in the code modification files exceeds the processing capacity of the large language model, code modification files specified for exclusion by the meta-information (e.g., external resource files) are deleted first, reducing unnecessary data processing and optimizing the utilization of the large language model's resources. Next, code modification files below a preset integration threshold are deleted, focusing on more important code changes and improving the efficiency of the large language model's processing. Then, code with the modification type "deleted" and code with the modification type "edited" are deleted sequentially, ensuring that newly added critical code is processed first. After multiple compressions, if the total number of tags still exceeds the limit, code modification files are deleted according to the integration order, dynamically adjusting the review scope and ensuring the flexibility and adaptability of the review process. In summary, by continuously compressing until the total number of tags in the code modification files meets the maximum tag acceptance capacity of the large language model, it is ensured that the large language model can handle important code changes while avoiding exceeding its processing capacity, improving the quality of code review, helping to discover and correct critical issues, adapting to projects of different sizes and complexities, and possessing good scalability.
[0124] Please see Figure 5 This is a schematic diagram illustrating the specific steps of step S13 in a code review method based on a large language model provided in an embodiment of this application.
[0125] This embodiment is a detailed explanation of step S13 in the aforementioned embodiment, further illustrating how to review multiple compressed code modification files based on a preset large language model to obtain code review results. Specifically, it includes the following steps:
[0126] Step S130: Based on the metadata and the compressed multiple code modification files, generate the structural prompt words of the preset large language model.
[0127] Among them, structural cue words are used to indicate the review purpose of multiple code modification files.
[0128] In some embodiments of this application, structural prompts may include: role information, used to indicate the role played by the large language model; for example, role information may indicate that the large language model plays the role of a "code review assistant." Since senior software developers have good code review capabilities, having the large language model act as a "code review assistant" can improve the quality of code review. Project meta-information, used to indicate the basic information of the project; the basic information of the project may include, but is not limited to, the project language, code style, change history, etc. Modification content, used to indicate the files that have been modified in the code repository. Task information, used to indicate the review task of the large language model for code review; the review task may include, but is not limited to, code score, code quality, code modification information, code modification risks, and modification suggestions. For each review dimension, its specific content can be specified. For example, for code quality, the task information may include reviewing the structure, style, usability, etc. of the code. Review result feedback format information, used to indicate the feedback format of the large language model for the review results. Among them, different feedback formats can be designed for different review dimension information. For example, for code score, the feedback result may be specified as a value between 1 and 10, and for code quality, specific quality problems or no problems may be reported.
[0129] In some embodiments of this application, while large language models perform well in general language processing tasks, they may not be able to accurately understand and generate code that meets the needs of a specific organization or industry. For example, different companies may have their unique coding standards and best practices, while a pre-defined industry, such as the automotive industry, may have specific regulatory compliance and security requirements, all of which need to be taken into account by the large language model when reviewing the code.
[0130] To address the aforementioned issues, this application proposes a method for generating structural cue words and a method for fine-tuning a large language model. First, based on metadata, the code standards and best practices corresponding to the project's organization and industry are determined from a pre-defined external knowledge base. Second, multiple compressed code modification files are concatenated with the organization's and industry's code standards and best practices to obtain structural cue words. Next, a training dataset is constructed based on the organization's and industry's codes corresponding to the project. Then, the parameters of the pre-defined large language model are fine-tuned based on the training dataset. Finally, based on the fine-tuned pre-defined large language model and the structural cue words, the multiple compressed code modification files are reviewed. Specific embodiments are as follows:
[0131] In some embodiments of this application, step S130, generating a structure prompt word for a preset large language model based on metadata and multiple compressed code modification files, specifically includes: determining project-related code information from a preset plug-in knowledge base based on metadata, wherein the preset plug-in knowledge base contains code standards and best practices for the project's internal organization and preset industry; and concatenating the multiple compressed code modification files and code information to obtain the structure prompt word.
[0132] Code style guidelines are a set of rules on how to write code, including naming conventions, code formatting, and commenting standards. For example, C++ code style guidelines might include naming rules for static variables. These guidelines help maintain code consistency and readability. Best practices refer to widely recognized and recommended practices in the software development process; they are effective methods based on experience. For example, best practices might include code review, unit testing, and continuous integration.
[0133] In the above embodiments, by retrieving project-related code standards and best practices from the external knowledge base, customized code reviews for specific organizations and industries are achieved. This allows the large language model to more accurately understand and evaluate code changes, improving the accuracy of code reviews. By generating customized structural prompts based on internal organization and preset industry code standards and best practices, background hints on private code standards and preset industry domains can be provided, helping to improve code quality and reduce potential defects and risks. The external knowledge base is designed to allow for easy addition or modification of project-related code information, offering excellent flexibility and scalability.
[0134] It should be noted that the method for generating structural cue words for a pre-defined large language model based on metadata and multiple compressed code modification files will be explained later. Figure 6 The steps shown are described in detail, and will not be repeated here to avoid repetition.
[0135] Step S131: Based on the preset large language model and structural prompts, review the multiple compressed code modification files to obtain the code review results.
[0136] In some embodiments of this application, step S131, reviewing multiple compressed code modification files based on a preset large language model and structural cue words to obtain code review results, specifically includes: reviewing multiple compressed code modification files based on a preset large language model and structural cue words that have been fine-tuned and trained to obtain code review results.
[0137] Specifically, after generating the structure clues, the interface of the finely tuned large language model is called, the structure clues are input, and the finely tuned large language model outputs the code review results of multiple code modification files based on the structure clues.
[0138] In the above embodiments, the fine-tuned large language model can adapt to the specific needs of the organization and industry corresponding to the project, generate code review results that are more in line with the needs of the organization and industry corresponding to the project, and improve the accuracy of code review of the project.
[0139] In some embodiments of this application, the fine-tuning training method for the preset large language model includes: constructing a training dataset based on the organization code and industry code corresponding to the project; and fine-tuning the parameters of the preset large language model based on the training dataset to obtain the fine-tuned preset large language model.
[0140] It should be noted that how to fine-tune the pre-set large language model will be discussed later. Figure 7 The steps shown are described in detail, and will not be repeated here to avoid repetition.
[0141] In this embodiment, customized structural prompts are generated based on project metadata and compressed code modification files. This enables the large language model to better adapt to the knowledge of specific organizations and preset industry domains, improving its applicability and accuracy within those domains. Furthermore, by including role information, project metadata, modification task information, and review result feedback format information in the structural prompts, precise prompts can be provided to the large language model, improving its processing accuracy, enhancing code review precision, and achieving comprehensive code review.
[0142] Please see Figure 6 This is a schematic diagram illustrating the specific steps of step S130 in the code review method based on a large language model provided in an embodiment of this application.
[0143] This embodiment is a detailed explanation of step S130 in the aforementioned embodiment, further illustrating how to generate structural prompts for a preset large language model based on metadata and multiple compressed code modification files. Specifically, it includes the following steps:
[0144] Step S140: Determine the project-related code information from the preset plug-in knowledge base based on the metadata.
[0145] This involves pre-setting up an external knowledge base, which stores the coding standards and best practices of the organization and preset industry corresponding to the project. For example, the organization corresponding to the project could be the company where the project is located, and the preset industry could be the automotive industry.
[0146] In some embodiments of this application, project-related code information may include, but is not limited to, the code standards and best practices of the organization corresponding to the project and the preset industry.
[0147] Specifically, the main programming language and main logic of the project are determined based on the project's metadata. When reviewing code modification files, relevant coding standards and best practices for the current code modification files are retrieved from the external knowledge database based on the project's main programming language and main logic, ensuring that the code review takes into account the company's internal and industry-specific coding standards and best practices.
[0148] In other embodiments, code and code standards that frequently change with business requirements can also be stored in the external knowledge base, making it easy to update these codes and standards at any time to adapt to changes in business.
[0149] Step S141: Concatenate the compressed multiple code modification files and code information to obtain structural hint words.
[0150] Specifically, by incorporating the recalled internal organizational and industry-specific coding standards and best practices into the structure prompts, it is possible to provide background information on private coding standards and industry-specific domains, thereby improving the accuracy and relevance of code reviews.
[0151] In this embodiment, customized code review for specific organizations and industries is achieved by retrieving project-related code standards and best practices from an external knowledge base. This allows the large language model to more accurately understand and evaluate code changes, improving the accuracy of code review. By generating customized structural prompts based on internal organization and preset industry code standards and best practices, background hints on private code standards and preset industry domains can be provided, helping to improve code quality and reduce potential defects and risks. The external knowledge base is designed to allow for easy addition or modification of project-related code information, offering excellent flexibility and scalability.
[0152] Please see Figure 7 This is a flowchart illustrating a method for fine-tuning training a large language model according to an embodiment of this application.
[0153] In some embodiments of this application, while large language models perform well in general language processing tasks, they may not be able to accurately understand and generate code that meets the needs of a specific organization or industry. For example, different companies may have their unique coding standards and best practices, while a pre-defined industry, such as the automotive industry, may have specific regulatory compliance and security requirements, all of which need to be taken into account by the large language model when reviewing the code.
[0154] To address the aforementioned issues, this application proposes a method for fine-tuning a large language model. First, a training dataset is constructed based on the organization code and industry code corresponding to the project. Second, the parameters of a pre-defined large language model are fine-tuned based on the training dataset to obtain a fine-tuned pre-defined large language model. Then, based on the fine-tuned pre-defined large language model and structural cue words, multiple compressed code modification files are reviewed.
[0155] This embodiment further illustrates how to fine-tune the training of a large language model. Specifically, it includes the following steps:
[0156] Step S150: Construct a training dataset based on the organization code and industry code corresponding to the project.
[0157] Specifically, the organizational code corresponding to the project is collected and organized. This assembled code is usually relatively stable and does not change frequently, such as login processes and specific component code related to automobiles that do not change often within a company. Code for a predefined industry is also collected, such as data models for the automotive industry. The organizational code and industry code corresponding to the project are integrated into a training dataset for subsequent fine-tuning training of a large language model.
[0158] In some embodiments of this application, the codeQwen1.5 large language model is used for fine-tuning training.
[0159] Step S151: Fine-tune the parameters of the preset large language model based on the training dataset to obtain the preset large language model after fine-tuning training.
[0160] Specifically, the codeQwen 1.5 large language model was fine-tuned using the organization's code and industry code corresponding to the project as the training dataset. During fine-tuning, the parameters of the large language model were adjusted to better adapt to the code style and structure in the training dataset. Through fine-tuning, the large language model can learn the specific programming patterns and best practices of the organization and industry.
[0161] In this embodiment, the large language model is fine-tuned based on the organization code and industry code corresponding to the project. The fine-tuned large language model can adapt to the specific needs of the organization and industry corresponding to the project, generating code review results that better meet the needs of the organization and industry, thus improving the accuracy of code review for the project. The fine-tuned large language model can also more accurately identify potential defects and security vulnerabilities in the code, providing more specific code improvement suggestions, thereby improving code quality.
[0162] Please see Figure 8 This is a schematic diagram of the functional modules of a code review device 100 based on a large language model provided in an embodiment of this application.
[0163] In this embodiment, based on the above... Figure 2 Following the same concept as the code review method based on a large language model in the illustrated embodiments, this application also provides a code review apparatus 100 based on a large language model, which can be used to execute the aforementioned code review method based on a large language model. For ease of explanation, the schematic diagram of the embodiment of the code review apparatus 100 based on a large language model only shows the parts relevant to the embodiments of this application. Those skilled in the art will understand that the illustrated structure does not constitute a limitation on the code review apparatus 100 based on a large language model, and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0164] Specifically, the code review device 100 based on a large language model provided in this application embodiment includes an acquisition module 110, a determination module 120, a compression module 130, and a review module 140.
[0165] The acquisition module 110 is used to acquire multiple code modification files.
[0166] Specifically, each code modification file includes a code change log between the first file and the second file. The code change log records the differences between the second file and the first file (e.g., code that has been deleted, added, or edited). Here, the first file represents the code file in the original project, and the second file represents the code file in the updated project corresponding to the first file.
[0167] It should be noted that in the field of software development, a project typically refers to a comprehensive task or product, which consists of multiple types of files, including but not limited to source code modification files, configuration files, and resource files. As the project progresses and requirements evolve, these files will change over time, including but not limited to the addition of new features, the modification or deletion of old features, and the updating of configuration files or resource files.
[0168] In some embodiments of this application, the electronic device 10 can use version control system (e.g., Git) commands to obtain multiple modified code files. Specifically, after receiving a code merge request from the version control system, the electronic device 10 pulls the merge record corresponding to the code merge request from the version control system and queries multiple modified code files based on the merge record. Git is a powerful distributed version control system that can manage the source code of large open-source software, as well as private documents and source code.
[0169] In other embodiments, multiple code modification files can be pre-stored in a preset document, which can be stored on the electronic device 10. When code review is required, the electronic device 10 directly reads the contents of the preset document to obtain the code modification files.
[0170] The determination module 120 is used to determine the score of each code modification file if the total number of tags of multiple code modification files is greater than the maximum number of tags that can be received by the preset large language model, based on the updated project metadata and the code modification log of each code modification file.
[0171] In some embodiments of this application, before providing multiple code modification files to a large language model for processing, each code modification file needs to be converted into a readable text format. When we convert multiple code modification files into text format for processing by the large language model, these files are broken down into a series of basic processing units, i.e., tokens. Each token can be a word, a character, or a phrase or word group in the code. The number of tokens in each code modification file refers to the number of words, symbols, or word groups and phrases that have undergone tokenization processing contained in each code modification file after being converted into text format, i.e., the number of tokens. Therefore, the total number of tokens in multiple code modification files is the total number of tokens formed after the multiple code modification files are converted into text format.
[0172] In some embodiments of this application, the preset large language model may be the codeQwen1.5 model, which is an artificial intelligence model specifically designed for processing and analyzing code. This model takes as input code modification files and structured cue words to guide the model in code review, and outputs the code review results regarding the code modification files. The maximum number of tokens that the codeQwen1.5 model can handle may be 2048 tokens, meaning that the total number of words, symbols, or code snippets it can effectively process in a single inference iteration does not exceed 2048 tokens.
[0173] In some embodiments of this application, during software development, especially for large projects, the code changes between different versions can be enormous. This can cause the total number of tokens for the code change files in the project to far exceed the processing capacity of the large language model, thereby interfering with the inference performance of the large language model and affecting the accuracy and efficiency of code review. For example, a complex software project may have thousands of lines of code changes in a single update, which could result in over 100,000 tokens. Furthermore, changes to non-functional code, such as configuration file updates, and alterations to images and binary files, can also significantly increase the number of tokens.
[0174] To address the aforementioned issues, this application proposes a sorting algorithm and a compression algorithm. First, based on updated project metadata, such as the main programming language, functional description, project type, and a list of unimportant files, each code modification file is scored. Next, after scoring, the token count for each code modification file and the total token count for all code modification files are calculated. Based on the window requirements of the large language model, such as a limit of 2048 tokens, all code modification files are intelligently compressed to ensure that the total token count of all code modification files does not exceed the processing capacity of the large language model. Specific implementation examples are as follows:
[0175] In some embodiments of this application, determining the score of each code modification file based on the updated project's metadata and the code modification log of each code modification file specifically includes: determining the usage percentage of each programming language in the updated project based on the metadata; determining a first score for each code modification file based on the programming language and usage percentage of each code modification file; determining a second score for each code modification file based on the code modification log of each code modification file; and determining the score of each code modification file based on the first score and the second score, for example, using the sum of the first score and the second score as the score of each code modification file.
[0176] Meta-information refers to key information and contextual data about a project, such as programming language, functional description, project type, list of unimportant files, and coding style. This information helps in understanding and handling code changes to the project.
[0177] In the above embodiments, by determining the usage percentage of each programming language in the project, the importance of code modification files can be more accurately assessed, ensuring that changes to the main languages receive more attention. By assigning a first and second score to each code modification file, an automated scoring system is implemented, making the code review process more objective and quantifiable. Based on the score, code modification files can be prioritized, with priority given to code changes that have the greatest impact on the project. Through the scoring system, critical code changes can be quickly identified and processed, improving the efficiency of code review, reducing the workload of reviewers, and allowing for the rational allocation of review resources. This ensures that critical code receives sufficient review while reducing excessive focus on non-critical code. Combining the first and second scores allows for a more comprehensive assessment of the impact of code changes, including additions, deletions, and edits. Accurate evaluation of code changes through the scoring system helps to promptly identify and correct potential problems, improving code quality and the overall stability of the project.
[0178] In other embodiments, if the total number of tags in multiple code modification files is less than or equal to the maximum number of tags that can be received by the preset large language model, there is no need to compress the code modification files. The review module 140 directly reviews the compressed multiple code modification files based on the preset large language model to obtain the code review result.
[0179] Compression module 130 is used to compress multiple code modification files based on integral and metadata to obtain multiple compressed code modification files.
[0180] In some embodiments of this application, compressing multiple code modification files based on integrals and meta-information to obtain compressed multiple code modification files specifically includes: deleting code modification files specified for exclusion by meta-information in the multiple code modification files to obtain multiple code modification files after initial compression; if the total number of tags in the multiple code modification files after initial compression is greater than the maximum number of tags received by a preset large language model, deleting code modification files in the multiple code modification files after initial compression that are lower than a preset integral threshold to obtain multiple code modification files after secondary compression.
[0181] In the above embodiments, code modification files marked as "specified exclusion" are deleted according to the instructions of the metadata. Files marked as "specified exclusion" may be because their content is duplicated with other modifications, they are no longer needed, they do not contribute substantially to the overall progress of the project, or they are external resource files. By deleting unnecessary code modification files, the multiple code modification files after the initial compression can be made more concise, while avoiding the waste of computing power of the large language model in the subsequent code review process, thereby improving the efficiency of code review. Furthermore, based on the score of the code modification files, code modification files below the preset score threshold in the multiple code modification files after the initial compression are deleted. This helps to reduce the interference of non-critical changes on the review process, enabling the large language model to process the remaining critical code modification files more efficiently, reducing the total number of tags that the large language model needs to process, thereby accelerating the inference speed of the large language model, improving the efficiency of code review and analysis, and ensuring that the large language model can prioritize processing those code modification files with high scores and greater importance. This helps to identify and solve key problems more quickly.
[0182] In some embodiments of this application, the compression of multiple code modification files based on integrals and meta-information to obtain multiple compressed code modification files further includes: if the total number of tags in the multiple code modification files after secondary compression is greater than the maximum number of tags received by the preset large language model, deleting the code with the modification type of deletion in each code modification file after secondary compression, to obtain multiple code modification files after tertiary compression.
[0183] In the above embodiments, by deleting code with the modification type "deletion," the amount of data that the large language model needs to process is reduced. This ensures that the large language model can concentrate its computing resources on more important code changes, namely, the newly added and edited code. This allows for more efficient use of the model's computing power, enabling more in-depth analysis and review of these changes, and improving the quality and accuracy of code review. Furthermore, deleted code typically does not contain newly introduced logic or errors; therefore, removing this code from the review process helps reduce interference and allows for a more focused review process.
[0184] In some embodiments of this application, the compression of multiple code modification files based on integrals and meta-information to obtain multiple compressed code modification files further includes: if the total number of tags in the multiple code modification files after three compressions is greater than the maximum number of tags received by the preset large language model, deleting the code with the modification type of "edit" in each of the three compressed code modification files to obtain multiple code modification files after four compressions.
[0185] In the above embodiments, by prioritizing the deletion of edit-type code, it can be ensured that more important code changes (such as new feature code) are processed first, reducing the amount of data that the large language model needs to process. This helps to improve the response speed and processing efficiency of the large language model, especially when dealing with large projects. It can also improve the accuracy of code review, particularly in the review of key functions and main logic.
[0186] The review module 140 is used to review multiple compressed code modification files based on a preset large language model to obtain code review results.
[0187] In some embodiments of this application, reviewing multiple compressed code modification files based on a preset large language model to obtain code review results specifically includes: generating structural prompts for the preset large language model based on metadata and multiple compressed code modification files; and reviewing multiple compressed code modification files based on the preset large language model and structural prompts to obtain code review results.
[0188] Among them, structural cue words are used to indicate the review purpose of multiple code modification files.
[0189] In some embodiments of this application, structural prompts may include: role information, used to indicate the role played by the large language model; for example, role information may indicate that the large language model plays the role of a "code review assistant." Since senior software developers have good code review capabilities, having the large language model act as a "code review assistant" can improve the quality of code review. Project meta-information, used to indicate the basic information of the project; the basic information of the project may include, but is not limited to, the project language, code style, change history, etc. Modification content, used to indicate the files that have been modified in the code repository. Task information, used to indicate the review task of the large language model for code review; the review task may include, but is not limited to, code score, code quality, code modification information, code modification risks, and modification suggestions. For each review dimension, its specific content can be specified. For example, for code quality, the task information may include reviewing the structure, style, usability, etc. of the code. Review result feedback format information, used to indicate the feedback format of the large language model for the review results. Among them, different feedback formats can be designed for different review dimension information. For example, for code score, the feedback result may be specified as a value between 1 and 10, and for code quality, specific quality problems or no problems may be reported.
[0190] In the above embodiments, customized structural prompts are generated based on project metadata and compressed code modification files. This enables the large language model to better adapt to the knowledge of specific organizations and preset industry domains, improving the applicability and accuracy of the large language model in specific organizations and preset industry domains. Furthermore, by including role information, project metadata, modification content task information, and review result feedback format information in the structural prompts, accurate prompts can be provided to the large language model, improving the processing accuracy of the large language model, enhancing the accuracy of code review, and achieving comprehensive code review.
[0191] In some embodiments of this application, while large language models perform well in general language processing tasks, they may not be able to accurately understand and generate code that meets the needs of a specific organization or industry. For example, different companies may have their unique coding standards and best practices, while a pre-defined industry, such as the automotive industry, may have specific regulatory compliance and security requirements, all of which need to be taken into account by the large language model when reviewing the code.
[0192] To address the aforementioned issues, this application proposes a method for generating structural cue words and a method for fine-tuning a large language model. First, based on metadata, the code standards and best practices corresponding to the project's organization and industry are determined from a pre-defined external knowledge base. Second, multiple compressed code modification files are concatenated with the organization's and industry's code standards and best practices to obtain structural cue words. Next, a training dataset is constructed based on the organization's and industry's codes corresponding to the project. Then, the parameters of the pre-defined large language model are fine-tuned based on the training dataset. Finally, based on the fine-tuned pre-defined large language model and the structural cue words, the multiple compressed code modification files are reviewed. Specific embodiments are as follows:
[0193] In some embodiments of this application, generating structural prompts for a preset large language model based on metadata and multiple compressed code modification files specifically includes: determining project-related code information from a preset plug-in knowledge base based on metadata, wherein the preset plug-in knowledge base contains code standards and best practices for the project's internal organization and preset industry; and concatenating the multiple compressed code modification files and code information to obtain structural prompts.
[0194] Code style guidelines are a set of rules on how to write code, including naming conventions, code formatting, and commenting standards. For example, C++ code style guidelines might include naming rules for static variables. These guidelines help maintain code consistency and readability. Best practices refer to widely recognized and recommended practices in the software development process; they are effective methods based on experience. For example, best practices might include code review, unit testing, and continuous integration.
[0195] In the above embodiments, by retrieving project-related code standards and best practices from the external knowledge base, customized code reviews for specific organizations and industries are achieved. This allows the large language model to more accurately understand and evaluate code changes, improving the accuracy of code reviews. By generating customized structural prompts based on internal organization and preset industry code standards and best practices, background hints on private code standards and preset industry domains can be provided, helping to improve code quality and reduce potential defects and risks. The external knowledge base is designed to allow for easy addition or modification of project-related code information, offering excellent flexibility and scalability.
[0196] In some embodiments of this application, the code review results are obtained by reviewing multiple compressed code modification files based on a preset large language model and structural cue words. Specifically, the code review results are obtained by reviewing multiple compressed code modification files based on a preset large language model and structural cue words that have been fine-tuned and trained.
[0197] Specifically, after generating the structure clues, the interface of the finely tuned large language model is called, the structure clues are input, and the finely tuned large language model outputs the code review results of multiple code modification files based on the structure clues.
[0198] In the above embodiments, the fine-tuned large language model can adapt to the specific needs of the organization and industry corresponding to the project, generate code review results that are more in line with the needs of the organization and industry corresponding to the project, and improve the accuracy of code review of the project.
[0199] In some embodiments of this application, the fine-tuning training method for the preset large language model includes: constructing a training dataset based on the organization code and industry code corresponding to the project; and fine-tuning the parameters of the preset large language model based on the training dataset to obtain the fine-tuned preset large language model.
[0200] In other embodiments, after obtaining the code review results, the electronic device 10 can display them to the user through a client. The code review results may include a score. If the modified code file has defects or areas for improvement, these defects can be displayed to the user through highlighting or other means, allowing the user to evaluate the code review results. Subsequently, the code review results obtained from the large language model can be directly used, or the code review results can be manually corrected.
[0201] In the code review device 100 based on a large language model in the above embodiment, the acquisition module 110 acquires multiple code modification files, wherein each code modification file includes a code modification log; if the total number of tags in the multiple code modification files is greater than the maximum number of tags that can be received by the preset large language model, the determination module 120 determines the score of each code modification file based on the updated meta-information of the project and the code modification log of each code modification file; the compression module 130 compresses the multiple code modification files based on the score and meta-information to obtain multiple compressed code modification files; the review module 140 generates structural prompt words of the preset large language model based on the meta-information and the multiple compressed code modification files. Based on this, when the total number of tags in the code modification files exceeds the processing capacity of the large language model, this application compresses multiple code modification files using project metadata and code modification logs. This satisfies the processing capacity of the large language model while optimizing resource usage, reducing interference from non-functional code modifications to the large language model's inference, ensuring the large language model focuses on reviewing important code, improving the accuracy and relevance of the review, adapting to projects of different sizes and complexities, and exhibiting good scalability. Reviewing the compressed multiple code modification files based on the large language model leverages its superior performance, improving the quality and efficiency of the review results. In summary, this application achieves comprehensive, efficient, and accurate review of code modifications, improving the accuracy and efficiency of code review, providing strong support for the software development process, and ensuring the quality and security of software projects.
[0202] Combination Figure 1 As shown, in some embodiments of this application, the electronic device 10 includes, but is not limited to, a memory 11, a processor 12, and a computer program stored in the memory 11 and executable on the processor 12, such as a code review program. When the computer program is executed by the processor, it implements the code review method based on the large language model as described in the above embodiments.
[0203] Figure 1 Only the electronic device 10 with memory 11 and processor 12 is shown. It will be understood by those skilled in the art that... Figure 1 The structure shown does not constitute a limitation on the electronic device 10, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0204] The memory 11 in the electronic device 10 stores multiple computer-readable instructions to implement a code review method based on a large language model. The processor 12 can execute multiple instructions to achieve the following: acquiring multiple code modification files, wherein each code modification file includes a code modification log; if the total number of tags in the multiple code modification files is greater than the maximum number of tags that can be received by the preset large language model, determining the score of each code modification file based on the updated meta-information of the project and the code modification log of each code modification file; compressing the multiple code modification files based on the score and meta-information to obtain compressed multiple code modification files; and reviewing the compressed multiple code modification files based on the preset large language model to obtain the code review result.
[0205] Specifically, the processor 12's implementation method for the above instructions can be found in [reference needed]. Figure 2 The descriptions of the relevant steps in the corresponding embodiments are not repeated here.
[0206] Those skilled in the art will understand that the schematic diagram is merely an example of the electronic device 10 and does not constitute a limitation on the electronic device 10. The electronic device 10 can be a bus topology or a star topology. The electronic device 10 may also include more or fewer other hardware or software than shown in the diagram, or different component arrangements. For example, the electronic device 10 may also include input / output devices, network access devices, etc.
[0207] It should be noted that electronic device 10 is only an example. Other existing or future electronic products that are suitable for this application should also be included within the scope of protection of this application and are incorporated herein by reference.
[0208] The memory 11 includes at least one type of computer-readable medium, which can be non-volatile or volatile. Computer-readable media include flash memory, portable hard drives, multimedia cards, card-type memory (e.g., SD memory, DX memory, etc.), magnetic memory, magnetic disks, optical disks, etc. In some embodiments, the memory 11 can be an internal storage unit of the electronic device 10, such as a portable hard drive of the electronic device 10. In other embodiments, the memory 11 can also be an external storage device of the electronic device 10, such as a plug-in portable hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 10. The memory 11 can be used not only to store application software and various types of data installed on the electronic device 10, such as the code of a code review program, but also to temporarily store data that has been output or will be output.
[0209] In some embodiments, the processor 12 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits packaged with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 12 is the control unit of the electronic device 10, connecting various components of the electronic device 10 via various interfaces and lines. It performs various functions and processes data by running or executing programs or modules stored in the memory 11 (e.g., executing a code review program) and calling data stored in the memory 11.
[0210] Processor 12 executes the operating system of electronic device 10 and various installed applications. Processor 12 executes these applications to implement the steps described in the above-described embodiment of a code review method based on a large language model, for example... Figures 2-7 The steps are shown.
[0211] For example, a computer program may be divided into one or more modules / units, one or more of which are stored in memory 11 and executed by processor 12 to complete this application. One or more modules / units may be a series of computer-readable instruction segments capable of performing a specific function, which describe the execution process of the computer program in electronic device 10. For example, the computer program may be divided into an acquisition module 110, a determination module 120, a compression module 130, and an examination module 140.
[0212] This application also provides a computer-readable medium storing computer-readable instructions, which are executed by a processor in an electronic device 10 to implement a code review method based on a large language model according to any of the above embodiments.
[0213] The integrated unit implemented as a software functional module described above can be stored in a computer-readable storage medium. This software functional module, stored in a computer-readable medium, includes several instructions to cause a computer device (which may be a personal computer, computer equipment, or network device, etc.) or processor 12 to execute portions of a code review method based on a large language model according to various embodiments of this application.
[0214] If the modules / units integrated in the electronic device 10 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware devices. The computer program can be stored in a computer-readable medium, and when executed by the processor 12, it can implement the steps of the various method embodiments described above.
[0215] Computer programs include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory, and other types of memory.
[0216] Furthermore, the computer-readable medium may primarily include a stored program area and a stored data area, wherein the stored program area may store the operating system, an application program required for at least one function, etc.; and the stored data area may store data created based on the use of blockchain nodes, etc.
[0217] The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, in... Figure 1 The symbol is represented by only one arrow, but this does not mean that there is only one bus or one type of bus. The bus is configured to implement communication between memory 11 and at least one processor 12, etc.
[0218] It should be noted that the computer-readable medium in the embodiments of this application may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof.
[0219] In some embodiments of this application, a computer-readable medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In embodiments of this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device.
[0220] In the several embodiments provided in this application, it should be understood that the disclosed methods and related devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.
[0221] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0222] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.
[0223] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices described in the specification may also be implemented by a single unit or device through software or hardware. Terms such as "first," "second," etc., are used to indicate names and do not indicate any specific order.
[0224] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit it. Although this application has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of this application without departing from the spirit and scope of the technical solutions of this application.
Claims
1. A code review method based on a large language model, characterized in that, The method comprises: acquiring a plurality of code change files, wherein each code change file in the plurality of code change files comprises a code change log; if the total number of tokens of the plurality of code change files is greater than the maximum number of token receptions of a preset large language model, determining the score of each code change file based on the meta information of the updated project and the code change log of each code change file, comprising: determining the usage proportion of each programming language of the updated project according to the meta information; determining the first score of each code change file according to the programming language of each code change file and the usage proportion; determining the second score of each code change file according to the code change log of each code change file; and determining the score of each code change file according to the first score and the second score; compressing the plurality of code change files based on the score and the meta information to obtain a plurality of compressed code change files, comprising: deleting the code change files indicated by the meta information to obtain a plurality of code change files after the first compression; and if the total number of tokens of the plurality of code change files after the first compression is greater than the maximum number of token receptions of the preset large language model, deleting the code change files below the preset score threshold in the plurality of code change files after the first compression to obtain a plurality of code change files after the second compression; reviewing the plurality of compressed code change files based on a preset large language model to obtain a code review result. 2.The large language model-based code review method of claim 1, wherein, The method further comprises: if the total number of tokens of the plurality of code change files after the second compression is greater than the maximum number of token receptions of the preset large language model, deleting the code with a deletion type in each code change file after the second compression to obtain a plurality of code change files after the third compression. 3.The large language model-based code review method of claim 2, wherein, The method further comprises: if the total number of tokens of the plurality of code change files after the third compression is greater than the maximum number of token receptions of the preset large language model, deleting the code with an editing type in each code change file after the third compression to obtain a plurality of code change files after the fourth compression. 4.The large language model-based code review method of claim 1, wherein, The method further comprises: generating a structure prompt word of the preset large language model according to the meta information and the plurality of compressed code change files; reviewing the plurality of compressed code change files based on the preset large language model and the structure prompt word to obtain a code review result. 5.The large language model-based code review method of claim 4, wherein, The method further comprises: generating a structure prompt word of the preset large language model according to the meta information and the plurality of compressed code change files; reviewing the plurality of compressed code change files based on the preset large language model and the structure prompt word to obtain a code review result. The compressed multiple code change files are reviewed based on the preset large language model trained through fine-tuning and the structural prompt word, to obtain the code review result. 6.The large language model-based code review method of claim 5, wherein, The fine-tuning method of the preset large language model trained through fine-tuning comprises: A training data set is constructed according to the organizational code and the industry code corresponding to the project; The preset large language model trained through fine-tuning is obtained by fine-tuning the parameters of the preset large language model based on the training data set. 7.The large language model-based code review method of claim 4, wherein, The structural prompt word of the preset large language model is generated according to the meta information and the compressed multiple code change files, comprising: The code information related to the project is determined from a preset external knowledge base according to the meta information, wherein the preset external knowledge base contains the code specifications and best practices of the organization internally and the preset industry corresponding to the project; The compressed multiple code change files and the code information are spliced to obtain the structural prompt word. 8.A code review device based on a large language model, characterized in that, The device comprises: An acquisition module is configured to acquire multiple code change files, wherein each code change file in the multiple code change files comprises a code change log; A determination module is configured to determine the score of each code change file based on the meta information of an updated project and the code change log of each code change file if the total number of tokens of the multiple code change files is greater than the maximum number of token receptions of a preset large language model, comprising: determining the usage proportion of each programming language of the updated project according to the meta information; determining the first score of each code change file according to the programming language of each code change file and the usage proportion; determining the second score of each code change file according to the code change log of each code change file; and determining the score of each code change file according to the first score and the second score; A compression module is configured to compress the multiple code change files based on the score and the meta information to obtain compressed multiple code change files, comprising: deleting the code change files specified to be excluded indicated by the meta information in the multiple code change files to obtain the multiple code change files compressed for the first time; and if the total number of tokens of the multiple code change files compressed for the first time is greater than the maximum number of token receptions of the preset large language model, deleting the code change files below a preset score threshold in the multiple code change files compressed for the first time to obtain the multiple code change files compressed for the second time. A review module is configured to review the compressed multiple code change files based on a preset large language model to obtain a code review result.
9. An electronic device, comprising: The electronic device comprises a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program, when executed by the processor, implements the steps of the code review method based on the large language model according to any one of claims 1 to 7.
10. A computer readable medium characterized by The computer readable medium stores a computer program, and the computer program is executed by the processor to implement the steps of the code review method based on the large language model in any one of claims 1 to 7.
Citation Information
Patent Citations
Code review method and device, electronic equipment and medium
CN117648931A
Code review method and system
CN118349454A