Code review method and device based on artificial intelligence

By using an AI-based code review method, code data sources are automatically retrieved and reviewed, solving the problem of low efficiency in traditional manual review. This enables efficient and intelligent review of navigation business code, reducing the cost of manual intervention and interaction.

CN121387698APending Publication Date: 2026-01-23NEUSOFT CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511579719.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-30
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

Traditional manual code review methods are inefficient, time-consuming, and difficult to guarantee timeliness. In addition, reviewers have a heavy workload, with problems such as time allocation, project complexity, the dual burden of business understanding and technical review, and differences in communication and understanding.

Method used

An AI-based code review method is adopted, which automatically retrieves the data source of the code to be reviewed through a code retrieval service. By utilizing the review prompts and review check items in the code review guidelines of the navigation business, automated code review is achieved, and intelligent review is carried out for map, search, guidance and route calculation functions.

Benefits of technology

Save on code review interaction costs, improve review efficiency, reduce the burden of manual review, and ensure the timeliness and accuracy of reviews.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121387698A_ABST
    Figure CN121387698A_ABST
Patent Text Reader

Abstract

The invention discloses a code review method and device based on artificial intelligence. The method comprises the following steps: in response to a code merging request of a navigation service, pulling a to-be-reviewed code data source; and based on the declaration or definition of the review elements in the review prompt words in the code review protocol of the navigation service and the review check items in the review prompt words, reviewing the to-be-reviewed code data source to obtain an artificial intelligence review result of the to-be-reviewed code data source. The code review specification comprises review prompt words for a map function, a retrieval function, a guide function or a path calculation function of the navigation service. The review elements and the review check items in the review prompt words are determined based on the reviewed corresponding functions, and the code review work of the navigation service can be automatically realized by applying the review prompt words aiming at the corresponding functions of the navigation service through an artificial intelligence technology. The interaction cost of navigation service code review is saved, the review efficiency is improved, and the burden of manual code review is relieved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of code quality management, in particular to a code review method and device based on artificial intelligence. BACKGROUND

[0002] Code review is a key link to guarantee code quality in the software development process. The code that passes the review can better realize the business function. In addition, through code review, code that does not meet the quality requirements can be returned to the adjustment, thereby avoiding the impact on the normal execution of the business after the unqualified code is put into use. The traditional code review workflow takes manual operation as the core, including code submission, review request, allocation of reviewers, preliminary review, in-depth analysis, problem identification, feedback and discussion, understanding of review opinions, modification of review opinions, re-review, review approval and code merging. Such manual code review method has many disadvantages. Human review is affected by human limitations such as fatigue, lack of time, subjective bias and cognitive limitations, resulting in low time efficiency in the review process. Generally speaking, the time consumption of a complete manual code review process is between 33 and 65 minutes. The specific pain points are as follows:

[0003] Time allocation challenge: Reviewers generally also undertake R&D tasks, making it difficult to review immediately after code submission, which leads to the inability to carry out review work in a timely manner.

[0004] Project complexity impact: Large project code bases are large and business logic is complex, so even experienced reviewers need to invest a lot of time to understand the business and analyze the technical implementation.

[0005] Dual burden of business understanding and technical review: Reviewers not only need to check the reasonableness of the code, but also need to deeply understand the business logic and conduct technical analysis, which is time-consuming and complex.

[0006] Review task sharing demand: To reduce the time burden of specific personnel, more team members are expected to participate in the review work, but there are difficulties in actual operation.

[0007] Communication and understanding differences: In the review process, differences in understanding of coding conventions and different expression methods between reviewers and coders may lead to differences of opinion.

[0008] From the above analysis, it is not difficult to see that there are many difficulties in manual code review work, the code review efficiency is low, and a lot of time is spent on communication and consultation. For reviewers, the task is arduous and complex, and the timeliness of the review cannot be guaranteed. SUMMARY

[0009] Based on the above problems, the application provides a code review method and device based on artificial intelligence, aiming to save the interaction cost of code review, improve the code review efficiency, and reduce the burden of manually reviewing the code.

[0010] The application embodiment discloses the following technical solutions:

[0011] The first aspect of the application provides a code review method based on artificial intelligence, comprising:

[0012] In response to a code merging request of a navigation service, a code data source to be reviewed is pulled;

[0013] Based on the declaration or definition of the review elements in the review prompt words in the code review specification of the navigation service and the review check items in the review prompt words, the code data source to be reviewed is reviewed, and an artificial intelligence review result of the code data source to be reviewed is obtained;

[0014] Among them, the code review specification of the navigation service at least contains review prompt words for map function, search function, guide function or route calculation function of the navigation service, and the review elements and review check items in the review prompt words are determined based on the corresponding functions to be reviewed.

[0015] The second aspect of the application provides a code review device based on artificial intelligence, comprising:

[0016] A data source pulling module is configured to pull a code data source to be reviewed in response to a code merging request of a navigation service;

[0017] A code review module is configured to review the code data source to be reviewed based on the declaration or definition of the review elements in the review prompt words in the code review specification of the navigation service and the review check items in the review prompt words, and obtain an artificial intelligence review result of the code data source to be reviewed;

[0018] Among them, the code review specification of the navigation service at least contains review prompt words for map function, search function, guide function or route calculation function of the navigation service, and the review elements and review check items in the review prompt words are determined based on the corresponding functions to be reviewed.

[0019] The third aspect of the application provides a code review device based on artificial intelligence, which comprises a processor and a memory in communication with each other;

[0020] The memory stores a computer program;

[0021] The processor is configured to run the computer program to implement the AI-based code review method as described in any implementation of the first aspect.

[0022] The fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when processed, implements the steps of the AI-based code review method as described in any implementation of the first aspect.

[0023] Compared with the prior art, this application has the following beneficial effects:

[0024] This application proposes an AI-based code review method that, in response to a code merging request for a navigation service, retrieves the code data source to be reviewed. Based on the declarations or definitions of review elements in the review prompts within the navigation service's code review specifications, and the review check items within those prompts, the method reviews the code data source to obtain the AI ​​review result. The navigation service's code review specifications include at least review prompts for the navigation service's map, search, guidance, or route calculation functions. Since the review elements and check items in the review prompts are determined based on the corresponding functions being reviewed, this application's technical solution utilizes review prompts specific to the navigation service's functions, enabling automated code review of the navigation service using AI technology. This saves on the interaction costs of navigation service code review, improves review efficiency, and reduces the burden of manual code review. Attached Figure Description

[0025] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 A flowchart of an artificial intelligence-based code review method provided in this application embodiment;

[0027] Figure 2 This is an example diagram illustrating the application of a code scoring rule.

[0028] Figure 3 A schematic diagram illustrating the creation process of code review guidelines for navigation services;

[0029] Figure 4 Example diagram of code-level review guidelines for the map module of navigation services;

[0030] Figure 5 Example diagram of code-level review guidelines for the retrieval module of navigation services;

[0031] Figure 6A A code-level example diagram for reviewing lane line functionality using sequence diagrams in navigation operations;

[0032] Figure 6B for Figure 6A The sequence diagram shown is a visualization of the code.

[0033] Figure 6C A diagram illustrating code style review prompts in the code review guidelines for navigation services;

[0034] Figure 7 Example diagram of log output specifications in the framework of navigation services;

[0035] Figure 8 Example diagram describing code structure optimization suggestions in the code review guidelines;

[0036] Figure 9 A schematic diagram of a message interface for AI-based code review;

[0037] Figure 10 A schematic diagram of another message interface for AI-based code review;

[0038] Figure 11 This is a schematic diagram of the structure of an AI-based code review system;

[0039] Figure 12 This is a schematic diagram of the structure of an artificial intelligence-based code review device provided in an embodiment of this application. Detailed Implementation

[0040] As described earlier, code reviews are currently generally conducted manually. The workflow for manual code review involves multiple stages, including code submission, review request, assignment of reviewers, initial review, in-depth analysis, issue identification, feedback and discussion, understanding of review comments, revision based on review comments, second review, approval, and code merging. Code reviews are inefficient and require significant time for communication and negotiation, resulting in high interaction costs. For reviewers, the task is arduous and complex, and the timeliness of reviews cannot be guaranteed.

[0041] The inventors have proposed an AI-based code review method and apparatus, primarily addressing the difficulties and pain points of relying on manual code review in navigation services. Throughout the implementation, AI technology dominates the review process. Specifically, upon receiving a code merging request from a navigation service, the system first retrieves the corresponding code data source to be reviewed. Using this data source as the review object, and based on pre-created code review specifications for the navigation service, including declarations or definitions of review elements in the review prompts and review check items, automated code reviews of functions such as map, search, guidance, and route calculation can be performed. Building upon the review prompts, AI technology is used to complete the review, ultimately obtaining the AI ​​review results for the code data source. This technical solution reduces interaction costs during code review and significantly improves review efficiency compared to manual review, while also reducing the burden on manual reviewers.

[0042] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0043] See Figure 1 The figure is a flowchart of an artificial intelligence-based code review method provided in an embodiment of this application. Figure 1 As shown, AI-based code review methods include:

[0044] S101. In response to the code merging request for the navigation business, pull the code data source to be reviewed.

[0045] Receiving a code merge request means that there is currently code in the code repository that needs to be merged (referred to as "committed code"). The committed code can be the first commit, or code that was previously submitted but failed the review and has been revised before being resubmitted.

[0046] In practical applications, to ensure timely and efficient code reviews, it's crucial to respond to code merge requests as quickly as possible. This can be achieved by monitoring the code repository to capture the dynamic generation of merge requests. When a merge request is detected in the repository, a code retrieval service can be invoked to retrieve the corresponding commit code, and then differentiated code analysis can be performed on the submitted code. The technical implementation of the code retrieval service is described below.

[0047] The code retrieval service, also known as the code retrieval MCP service, is based on the Model Context Protocol (MCP). As an open standard, the MCP aims to unify the communication protocol between large models and external data sources and tools. The MCP enables Artificial Intelligence (AI) applications to securely access and manipulate local and remote data, providing an interface for AI to connect to everything. In this application, the code retrieval service is built on the MCP protocol. In practical applications, a code repository interface conforming to the MCP protocol can be pre-written, providing AI tools that the intelligent agent can recognize. After recognizing a code merge request, the AI ​​tool automatically calls the code repository interface to retrieve the submitted code. Besides retrieving code, the code retrieval service can also monitor code merge requests and perform further differential code analysis on the retrieved submitted code. This differential code analysis can also be achieved by calling the aforementioned code repository interface.

[0048] The primary purpose of code differential analysis is to determine whether the submitted code is newly added or modified. If differential analysis determines the submitted code is newly added, it can be directly identified as the data source for the code to be reviewed. If differential analysis determines the submitted code is modified, the original code and change point information of the modified code are obtained. The modified code, original code, and change point information can be considered as a comprehensive data source related to the submitted code. The existence of the original code and change point information allows for a more accurate understanding of the background information and details of the changes, thus providing a more comprehensive and accurate understanding of the code content to be reviewed. Therefore, the modified code, original code, and change point information can be used together as the data source for the code to be reviewed.

[0049] In the past, the code submission process required two people—the code submitter and the reviewer (also known as the reviewer)—to complete three manual steps: submitting the review request, pulling the code, and comparing differences. This application automates these three steps using a code retrieval service, eliminating the need for manual intervention. This significantly reduces the amount of human involvement in the overall code review process and effectively improves the efficiency and accuracy of code retrieval.

[0050] S102. Based on the declarations or definitions of review elements in the review prompts of the code review specifications for navigation services, and the review check items in the review prompts, review the code data source to be reviewed and obtain the artificial intelligence review results of the code data source to be reviewed.

[0051] In this embodiment, code review for different business operations is intelligently implemented using code review guidelines specific to those business operations. For different business operations, their code review guidelines may contain identical or corresponding parts, or they may contain unique parts. For example, a code review guideline typically includes review prompts for multiple review dimensions, used for automated review of the code according to those dimensions. As an example, the code review guideline for the first business operation includes review prompts for each of the four review dimensions; the code review guideline for the second business operation includes review prompts for each of the three review dimensions. Furthermore, the review prompts for the business framework specification review dimension included in the code review guideline for the first business operation are applicable to reviewing whether the business framework of the first business is compliant; the review prompts for the business framework specification review dimension included in the code review guideline for the second business operation are applicable to reviewing whether the business framework of the second business is compliant.

[0052] To ensure that subsequent automated reviews of the code data source to be reviewed are adapted to and aligned with business characteristics, automated and intelligent code reviews are conducted based on the business context of the code data source, such as navigation business. One possible implementation is that the code data source to be reviewed contains business fields related to navigation business, and then the code review specifications for navigation business are applied based on these business fields. Another possible implementation is that the code data source to be reviewed is marked with a business identifier for navigation business, and the code review specifications for navigation business are applied based on this identifier.

[0053] The code review guidelines include review prompts, which form the basis for automated code review of navigation services using artificial intelligence. These prompts include declarations or definitions of review elements and review checklists. In practical applications, navigation services can perform functions such as mapping, retrieval, guidance, and route calculation. The review of specific functions within the navigation service relies on the corresponding review prompts. In this application's implementation, the review elements and checklists in the review prompts are determined based on the specific function being reviewed. For example, review elements and checklists are set for map functions; for retrieval functions; for guidance functions; and for route calculation functions. The following section describes the role and specific manifestations of review prompts for different functions within the navigation service.

[0054] Map function:

[0055] The review prompts for map functionality include those based on the mutual exclusion principle of map interfaces and / or the unique response principle of map animations. Specifically, the review prompts based on the mutual exclusion principle of map interfaces are used to check whether map interfaces with mutually exclusive display perspectives are called within the same lifecycle; the review prompts based on the unique response principle of map animations are used to check whether map animations that are prohibited from being displayed simultaneously are called in combination within the same lifecycle.

[0056] In the implementation of the map module for navigation services, the panoramic view and the following view are mutually exclusive, as are the map scrolling view and the following view. During the review, it is necessary to be able to identify whether multiple mutually exclusive map interfaces are called simultaneously, and then check whether there are conflicts or unreasonable business logic in the code related to the map display view.

[0057] Therefore, the review prompt based on the map interface mutual exclusion principle declares the following interface function and the mutually exclusive interface function. For example, the following interface function is declared as `setFollowCar`, and the mutually exclusive interface functions are declared as `setOverView`, `mapDrag`, and `mapFlic`. The following interface is the map interface that displays the view from the car's perspective, and the mutually exclusive interface is the map interface whose display view is mutually exclusive with the following view. `setOverView`, `mapDrag`, and `mapFlic` are three map interface functions that display views mutually exclusive with the following view. As an example, display views mutually exclusive with the following view include the panoramic view and the map scrolling view. The review check item in the review prompt based on the map interface mutual exclusion principle is: check whether the following interface function and the mutually exclusive interface function are called in the same lifecycle. If there is a map interface function mutually exclusive with the following view (i.e., the mutually exclusive interface function) that is called in the same lifecycle as the following interface function, it means that there is a display view conflict in the map display aspect of the code, which needs to be identified by the reviewer in order to form an accurate artificial intelligence review result for this navigation business.

[0058] In the implementation of the map module for navigation services, a variety of map animations can be displayed. These include animations such as centering map markers, zooming, rotating, and scrolling. However, some animations are prohibited from being displayed simultaneously. For example, centering map markers, rotating, and scrolling animations cannot be presented concurrently with zooming. If they are presented together, it conflicts with business logic, interferes with functionality, and negatively impacts the user's visual experience. During reviews, it is necessary to be able to identify and determine whether prohibited simultaneous display map animations are being used in combination.

[0059] Therefore, the review prompt based on the principle of unique response for map animations declares a list of map animation interfaces. Within this list, no two map animation interfaces are allowed to be combined and called within the same lifecycle to display an animation. The review checks in the prompt based on this principle include: checking for combined calls to map animation interfaces, and checking whether these combined calls occur within the same lifecycle. If map animation interfaces are combined and called within the same lifecycle, it indicates a conflict in map animation display within the code (e.g., requiring both map rotation and zoom simultaneously). This needs to be identified by the reviewer to form an accurate AI review result for this navigation service.

[0060] Search function:

[0061] The navigation search module supports diverse search methods, such as keyword search, nearby search, detailed information search, and route-based search. Users can trigger this function multiple times using the same search method or multiple times using different search methods. Search requests return results asynchronously. However, the implementation of the search function needs to ensure accurate source tracking. The correspondence between search requests and search results guarantees the accuracy of the search function and improves the user experience.

[0062] In this embodiment, the review prompts for the search function include review prompts based on the asynchronous search tracing principle. These review prompts are used to check whether asynchronous searches in the navigation service support tracing.

[0063] Therefore, a list of search interfaces (doKeywordsSearch, doNearbySearch, doDetailSearch, doAlongRouteSearch, etc.) is defined in the review prompts based on the asynchronous search tracing principle. The review checks in these prompts include: whether the call to the search interface function creates a unique search request identifier (requestID), whether the returned search results carry the unique search request identifier (requestID), and whether the unique search request identifier (requestID) is printed. During the review, by checking the requestID, it is possible to intelligently analyze whether asynchronous search in the navigation business supports tracing.

[0064] Guided function:

[0065] In the implementation of the navigation service's search module, starting navigation and canceling navigation must be paired; for example, navigation cannot be started twice consecutively. Furthermore, creating navigation data and canceling data must be paired. These requirements follow the pairing principle of the guidance interface. The review prompts for the guidance function in this application are also implemented based on the pairing principle of the guidance interface.

[0066] Specifically, the review prompts for the guidance function include review prompts based on the pairing principle of guidance interfaces. These review prompts are used to check whether the triggering and cancellation of navigation occur in pairs. Here, triggering can refer to the start of the navigation function or the creation of navigation data; similarly, cancellation can refer to the cancellation of the navigation function or the cancellation of navigation data creation. In the review prompts based on the pairing principle of guidance interfaces, this application defines the associated interfaces of the navigation, explicitly specifying the navigation interfaces that need to be paired, such as startGuidance and stopGuidance. The review check items in the review prompts based on the pairing principle of guidance interfaces include: checking whether the call relationship of the associated interfaces of the navigation remains paired throughout the action lifecycle, based on the call sequence of the interfaces. Automated review of the code related to the guidance function using review prompts based on the pairing principle of guidance interfaces can identify whether the associated guidance interfaces are called in pairs, thereby checking for code problems such as consecutive start navigation, consecutive cancellation navigation, consecutive navigation data creation, or consecutive cancellation of navigation data creation.

[0067] Route calculation function:

[0068] In the implementation of the retrieval module for navigation services, the accurate implementation of the route calculation function is a crucial guarantee for navigation effectiveness. The accurate implementation of the route calculation function relies on effective state control and precise route calculation.

[0069] The review prompts for the route calculation function include those based on state control principles and / or those based on route accuracy principles. The state control-based prompts are used to check whether the state of critical interfaces has been interrupted during route calculation. The route accuracy-based prompts are used to check whether the route calculation parameters are accurate.

[0070] The review prompts based on state control principles define a state list and a list of interfaces that should not be interrupted (such as setRouteOption, setSearchCenter, etc.). Review checks in these prompts include: checking if state verification conditions exist for the interface functions in the list of interfaces that should not be interrupted, and using these conditions to check whether the state of the corresponding interface has been interrupted. For example, if changing route preferences during route calculation is prohibited, and a state change is detected using state verification conditions, then the code is found to have violated state control principles and has a problem.

[0071] The review prompts based on the principle of route accuracy define a list of routing-related interfaces (such as startRoute, startRouteWithWayPointy, reRoute, etc.). The review checklist for these prompts includes: checking whether the routing-related interface functions have a parameter validation for the unique location identifier (locationID). The location identifier (locationID) is a unique identifier generated based on the location's latitude, longitude, and location attributes. Compared to latitude and longitude, locationID provides a more specific location indication on a map. For example, different exits of the same building can be distinguished by different locationIDs.

[0072] The above examples demonstrate that applying review prompts for the corresponding functions can automate code reviews of navigation functions without human intervention.

[0073] The above embodiments describe an AI-based code review method proposed in this application. This method responds to code merging requests from navigation services by retrieving the code data source to be reviewed. Based on the declarations or definitions of review elements in the review prompts within the navigation service's code review specifications, and the review check items within those prompts, the method reviews the code data source to obtain the AI ​​review results. The navigation service's code review specifications include at least review prompts for map, search, guidance, or route calculation functions within the navigation service. Since the review elements and check items in the review prompts are determined based on the corresponding functions being reviewed, this application's technical solution utilizes review prompts for the corresponding navigation service functions to automate the code review process using AI technology. This saves on the interaction costs of navigation service code review, improves review efficiency, and reduces the burden of manual code review.

[0074] In practical applications, AI-based code review can encompass multiple review dimensions (such as business rationality review, API call sequence review, code style review, and business framework style review). During code review, review prompts corresponding to each review dimension in the code review guidelines are used. These prompts are applied to the code data source to be reviewed, performing automated reviews for the corresponding dimensions to obtain review results for each dimension. Based on these results, a comprehensive AI review result is ultimately formed. The aforementioned reviews of map, search, guidance, or route calculation functions for navigation services fall under the business rationality review dimension.

[0075] The AI ​​review results from the obtained code data source can reflect the review results from different review dimensions. For example, the review results can show the deductions and identified code issues for each review dimension. Additionally, the deductions from different review dimensions can be summarized to reflect the total review score in the review results. In this embodiment, the presentation format and specific content of the review results are not limited.

[0076] In one optional implementation, the code review guidelines for the navigation business include review prompts for multiple review dimensions, as well as code scoring rules. These rules include the correspondence between code deduction items, code problem severity levels, and deduction values. The review results of the code data source to be reviewed in each of the business rationality review dimension, API call sequence review dimension, code guideline review dimension, and business framework specification review dimension include: the code deduction items corresponding to each of these dimensions. The AI ​​review result of the code data source to be reviewed, obtained based on the review results for each of these dimensions, can be implemented in the following ways:

[0077] Based on the corresponding relationships and the code deduction items corresponding to the code data source to be reviewed in the business rationality review dimension, interface call sequence review dimension, code convention review dimension, and business framework specification review dimension, the AI ​​review result of the code data source to be reviewed is obtained; the AI ​​review result includes the review score, and also includes at least one of the following: code deduction items, code problems corresponding to the deduction items, and code modification plans.

[0078] In one optional implementation, the code scoring rules involve three severity levels of code issues: critical code issues, intermediate code issues, and suggestion issues. Critical code issues have the highest severity level and correspondingly the highest penalty; intermediate code issues have the next highest severity level and the next lowest penalty; and suggestion issues have the lowest severity level and the lowest penalty. For example, critical code issues identified during review, such as those causing program crashes or data loss, incur a penalty of 10 points; intermediate code issues, such as those affecting program performance or containing potential logical errors, incur a penalty of 5 points; and suggestion issues, such as those with non-standard code formatting or unclear variable naming, incur a penalty of 1 point.

[0079] For code scoring rules, the correspondence between code deduction items and code problem severity levels can be established independently. For example, a first correspondence table can be constructed, showing the code deduction items and their corresponding code problem severity levels. Similarly, the correspondence between code problem severity levels and code deduction values ​​can also be established independently, such as a second correspondence table, showing the code problem severity levels and their corresponding deduction values. Furthermore, the correspondence between code deduction items, code problem severity levels, and deduction values ​​in the code scoring rules can also be displayed in a single table, for example, with three columns representing code deduction items, code problem severity levels, and deduction values. In this embodiment, code scoring rules are applied to achieve quantitative review of the code data source to be reviewed. Clear code scoring rules greatly enhance the operability of AI-based code review.

[0080] Figure 2 This is an example diagram illustrating the application of a code scoring rule. Figure 2 The application of the scoring criteria mentioned at the bottom indicates the analysis of issues and deductions made to the code data source to be reviewed using the code scoring rules in the code review guidelines for the navigation business. For example... Figure 2 In the example shown, two issues were identified during the review: a partial missing null pointer check was found, which is a serious code problem, therefore 10 points were deducted; the logging level coding style did not meet the requirements, which is a suggestion issue, therefore 1 point was deducted. Combined with... Figure 2 It can trigger a summary of merged code within a single interface, displaying the review results. Additionally, it can provide feedback on issues found in the code. Figure 2 The upper part shows a detailed description, modification suggestions, and a corrected code example. It is evident that applying the AI-based code review method provided in this application not only allows code writers to understand code problems and deductions, but also provides modification suggestions, facilitating the rapid improvement and correction of problematic code, thereby contributing to an overall improvement in code merging efficiency.

[0081] In this application, the review score not only represents the number and severity of problems in the reviewed code data source, but also determines whether the reviewed code data source can be exempted from manual review before the actual code merging is performed. The following example illustrates this.

[0082] In one optional implementation, the AI-based code review method further includes: when the review score is determined to be higher than or equal to a preset scoring threshold, the code can be merged without manual review based on the review score; when the review score is determined to be lower than the preset scoring threshold, the code can be merged only after manual review is passed based on the review score.

[0083] For example, the base score for review is 100 points, and the preset scoring threshold is 98 points. If the review score is higher than or equal to 98, it indicates that the code quality is high and meets the condition for direct merging without manual review. However, if the review score is lower than 98 points, manual review is required before merging can be allowed. In the example above, the deduction for intermediate code issues is 5 points. Therefore, if the code data source to be reviewed contains intermediate code issues, it cannot reach 98 points or higher and requires manual review to determine whether merging is possible. Thus, the above method effectively ensures the quality of code that can be merged. It should be noted that the preset scoring threshold and deduction value can be set according to actual quality requirements, and the preset scoring threshold can be set with reference to the deduction values ​​corresponding to different severity levels of code issues.

[0084] As mentioned earlier, the code review guidelines for navigation services utilize review prompts corresponding to multiple review dimensions to conduct reviews of the code data source to be reviewed based on those dimensions. For ease of understanding, the basic creation process of the code review guidelines is described below. Figure 3 A diagram illustrating the creation process of code review guidelines for navigation services. Figure 3 The example code review guidelines require the following steps: first, organizing the business modules and functions of the navigation service; second, organizing the code architecture and sequence of the navigation service; third, adding basic coding standards; fourth, defining the business-specific framework and processes for the navigation service; fifth, requiring the provision of code structure optimization suggestions after the AI ​​review; and sixth, establishing scoring rules for the AI-reviewed code. These will be described in detail below:

[0085] (1) Organize the business modules and functions of the navigation service.

[0086] Taking navigation services as an example, it is necessary to comprehensively analyze the navigation business and clarify its unique business modules. These include modules such as map, search, guidance, and route calculation.

[0087] Taking the map module as an example, the sub-functions of this module are further refined. For instance, in the map marking function, when drawing custom overlays on the map, the map mode needs to be adjusted to a view mode that does not follow vehicle movement. The code review guidelines must clearly define the functional dependencies. Common constant values ​​for map viewpoints should be encapsulated; custom creation is prohibited. Map drawing consumes performance; if drawing can be done in one operation, multiple calls to the drawing interface should be prohibited. Based on the requirements for these sub-functions, review elements and review check items are defined, forming review prompts for map functions based on business rationality. These review prompts are then displayed in the code review guidelines for the map module. Figure 4 Example diagram illustrating code-level review guidelines for the map module in navigation services. From... Figure 4 The review prompts provide guidance on API call restrictions for AI, tailored to specific business needs. For example, the map marker function involves drawing bubbles on the map. When a user draws a bubble, the map view should not follow the vehicle; therefore, before calling the `showLocations` API, `setFollowCar` must be set to `false` (false indicates disabling). Furthermore, examples of the review prompts are provided. Figure 4 For example, the review prompts provide a correct example, demonstrating the correct calling order: first disable the map view following function, then call the map marker function interface (also known as the map drawing interface). Following this order avoids issues related to business logic. Furthermore, the map marker function interface is a high-performance interface; it requires data aggregation before rendering, and should not be called multiple times in a for loop for high-frequency rendering. Figure 4 The review prompt provided includes a counterexample, namely an incorrect example. As this incorrect example shows, when using artificial intelligence technology to review business rationality using review prompts, it can be determined from this example that the code being reviewed should not call the showLocations interface within a for loop.

[0088] Taking the search module as an example, the search module includes keyword search and surrounding area search functions. The keyword search function handles the search logic and result matching after the user enters keywords; the surrounding area search function involves algorithms and data queries to obtain relevant information about the surrounding area based on the user's location. Figure 5 This is an example diagram illustrating the code-level review guidelines for the search module in navigation services. From... Figure 5The review prompts, combined with business constraints, specify the limitations for API calls to artificial intelligence. For example, the retrieval API must return a unique retrieval identifier; the API definition must be validated to prevent void values; the maximum length for a route-following search is 3000 kilometers, and the value of the `setEndOffset` parameter cannot exceed 3,000,000. Regarding the `setEndOffset` parameter value, the review prompts also provide correct and incorrect examples. The incorrect example shows a `setEndOffset` parameter value reaching 5,000,000, exceeding the numerical limit specified in the review prompts. Based on these review prompts, when applying AI technology to code review, issues can be accurately identified, allowing for a precise review of that specific dimension.

[0089] By organizing the business modules and functions as described above, the navigation business is presented in a structured form, enabling artificial intelligence to understand the objects and requirements of code review from a business perspective. The organization of these business requirements can be summarized into requirements for business rationality, which can then be used to construct review prompts in the code review guidelines for the navigation business, assisting in AI-based reviews of business rationality. In general, the review prompts for business rationality are constructed based on the business constraints of the navigation business. They can specifically include business module relationships, interface call requirements, and business parameter requirements related to these constraints. These relationships, requirements, and parameters can each be presented through correct and / or incorrect examples in the relevant review prompts, facilitating AI's reading and understanding during code review and achieving effective and accurate code review.

[0090] In one optional implementation, the code data source to be reviewed is reviewed based on the review prompts corresponding to the business rationality review dimension in the code review specification of the navigation business. This includes: determining whether there is a coupling relationship that violates rationality between different business modules in the code data source to be reviewed, and determining whether there are cross calls that violate business logic between different business modules in the code data source to be reviewed, based on the business-related review prompts in the code review specification of the navigation business.

[0091] (2) Organize the code architecture sequence of the navigation business.

[0092] In practical applications, the PlantUML format can be used to organize the code architecture sequence of navigation services. PlantUML is an open-source tool for creating UML diagrams. By writing specific text descriptions, it can generate clear and intuitive sequence diagrams. During the organization process, detailed information such as the call order, call logic, call parameters, and return results between various interfaces of the navigation service can be recorded to form a complete code architecture sequence diagram. The code architecture sequence diagram is used to generate sequence review prompts and is recorded in the code review specifications of the navigation service.

[0093] In one optional implementation, based on the review prompts corresponding to the interface call sequence review dimension in the code review guidelines for the navigation business, the code data source to be reviewed is evaluated according to the interface call sequence review dimension. This includes: checking whether the code data source to be reviewed calls the interfaces according to the call order and call logic in the code architecture sequence diagram, whether the call parameters are passed correctly, and whether the return results between the interfaces meet the design requirements in the code architecture sequence diagram, based on the sequence review prompts in the code review guidelines for the navigation business. For example, regarding the call order, it is determined whether interfaces A, B, and C are called in the order ABC; regarding the call logic, if the code architecture sequence diagram calls AB, it is determined whether only A or only B is called.

[0094] Figure 6A This is a code-level example diagram for reviewing lane line functionality using sequence diagrams in navigation operations, showing the sequence review prompts. Figure 6B for Figure 6A The sequence diagram shown is a visualization of the code. The PlantUML code in the sequence diagram serves as a timing review cue, aiding AI in identifying interface call relationships when reviewing related functions. AI can... Figure 6A The code shown identifies whether the specific implementation code is executed according to the sequence diagram of the navigation business architecture design. Figure 6A In the code shown, arrows indicate API call relationships. Figure 6A and Figure 6B The same number represents the same action. It should be noted that... Figure 6A This shows a portion of the code. Figure 6B This shows a partial time series diagram. Figure 6A and Figure 6B For comparison purposes, the completeness of the two images is not the focus of their use.

[0095] If the lane line function code is identified during code review, combined with Figure 6A and Figure 6BAs shown, lane line timing verification is required for the relevant code. For example, after creating and transmitting requests, BusHandler, AheadLaneHandler, LeftAndRightFrontHandler, etc., should be checked sequentially. As an example, BusHandler mainly checks whether it is a bus lane. Timing review prompts can help artificial intelligence understand the call order, call logic, call parameters, and return results of various interfaces in the navigation business under the interface call timing review dimension. In this way, by conducting artificial intelligence review based on the code architecture timing diagram and timing review prompts of the navigation business, the code implementation can be effectively and orderly reviewed from the interface call timing review dimension according to the correct timing of the navigation business.

[0096] (3) Add basic coding standards.

[0097] Establish and add basic coding standards covering aspects such as pointer safety, array safety, code formatting, and variable naming. For example, regarding pointer safety, specify the correct methods for pointer initialization, assignment, and deallocation to avoid issues like dangling pointers; regarding array safety, require boundary checks to prevent out-of-bounds access. Furthermore, based on the added coding standards, corresponding review prompts can be constructed for each dimension of code style review, enabling the review of code to be evaluated using AI-driven code style review principles.

[0098] In one optional implementation, based on the review prompts corresponding to the code style review dimensions in the code review guidelines for the navigation business, the code data source to be reviewed is evaluated according to the code style review dimensions. This includes checking whether the code data source to be reviewed complies with pointer safety requirements, array safety requirements, thread safety requirements, mathematical formula usage standards, loop structure standards, and naming conventions, based on the code style review prompts in the code review guidelines for the navigation business. Artificial intelligence, based on the coding standards reflected by these review prompts, can detect static problems in the code, such as syntax errors and potential security vulnerabilities, thus completing the automated code review from a standardization and security perspective and improving the quality of the review.

[0099] Figure 6C This is a diagram illustrating code style review prompts in the code review guidelines for navigation services. These prompts explain the dimensions requiring AI review, including the types of code to be focused on and code examples, instructing the AI ​​on how to perform the review. Figure 6C The example code style review prompts include check items and examples such as null pointer checks, array safety checks, memory overflow checks, and coding style checks.

[0100] In addition, the review prompts corresponding to the code style review dimensions include those based on debugging code principles. These prompts specify the test data format, such as introducing temporary variables or JSON data in function parameters, and require that the submitted code include comments on the original code, as well as details on newly added temporary variables. By adding these prompts to the function entry point, debugging code checks are added to prevent accidental submission of test data.

[0101] (4) Develop a business-specific framework and process description for navigation services.

[0102] Taking navigation services as an example, a unified process is used and explained in detail for the specific framework of navigation services. In the navigation software, for functions such as log output and data caching, it is explicitly stipulated that a custom-encapsulated framework must be used, rather than the system framework. This is mainly because a custom framework can better meet the specific needs of navigation services, such as requirements for log format and output level, as well as performance optimization and consistency guarantees for data caching. Furthermore, review prompts are used to explain the integration method of the business framework and the usage methods of components, enabling artificial intelligence to understand the restrictive requirements for framework usage in the software. This allows for accurate judgment of whether the code complies with the regulations regarding framework usage, ensuring that the code conforms to the navigation-specific style and requirements.

[0103] In one optional implementation, the code data source to be reviewed is reviewed based on the review prompts corresponding to the business framework specification review dimension in the code review guidelines for the navigation business. This includes checking whether the code data source to be reviewed performs utility class calls, framework integration operations, and component usage in accordance with the prescribed methods when using the framework of the navigation business, based on the review prompts in the code review guidelines for the navigation business.

[0104] For ease of understanding, Figure 7 Example of a log output specification. Figure 7 This is an example diagram illustrating the log output specifications for the navigation business framework. The review prompts corresponding to the business framework specification review dimensions clearly define the limitations on tool usage. For example... Figure 7 As shown, the documentation describes that regular output uses level i logs, not level d logs, while exception-type outputs must use level E logs. Furthermore, it explicitly specifies prohibited information in the printed information. For example, outputting private information such as names and phone numbers is prohibited, as is outputting latitude and longitude information. Since the review prompts corresponding to the business framework specification review dimensions are constructed based on the specific business framework of this navigation service, it is possible to accurately review whether the code meets the requirements at the business framework level from the perspective of specific business requirements.

[0105] (5) Suggestions for optimizing code structure.

[0106] The code review guidelines describe how artificial intelligence (AI) will not only check for code problems during the review process, but also provide optimization and refactoring suggestions based on the code structure. For example, when duplicate code segments are found, it is recommended to extract them as common functions; when the code has low modularity, it is recommended to divide it into modules to improve maintainability and scalability. Code structure optimization mainly relies on the coding capabilities of the coding model to examine the reviewed code and provide refactoring optimization suggestions, without adding additional limitations on the scope of code optimization. However, due to the uncertainty and randomness of AI's responses, an optional implementation method is to supplement the optimization rules in the review prompts to ensure that code structure optimization checks are performed in every review. In addition, background information, such as information about in-vehicle systems or the Android field, can be added to allow AI to provide the best code optimization suggestions based on specific contexts.

[0107] Figure 8 This document presents an example diagram illustrating code structure optimization suggestions within a code review specification. These suggestions leverage the coding capabilities of the coding model. This application provides such explanations to aid understanding of code structure optimization suggestions for problematic code during the review phase. Figure 8 The examples provided include three specific cases: The first case involves an incomplete null pointer exception handling; the example not only describes the problematic code but also provides a modified code example. Comments are added to explain the modification point, "a !=...". The second case demonstrates a performance issue, offering suggested modifications and the expected improvements in memory and CPU usage. The third case highlights excessive nesting in the code's logical checks, providing suggestions for logical decomposition.

[0108] (6) Scoring rules for AI-reviewed codes.

[0109] The code scoring rules have been described in the previous examples. In practical applications, the code scoring rules include the correspondence between code deduction items, the severity level of code issues, and deduction values. Refer to the previous examples for details; they will not be repeated here.

[0110] Leveraging code scoring rules, points can be deducted for all dimensions, including business rationality review, API call sequence review, code style review, and business framework style review, according to the scoring mechanism within the code scoring rules. This comprehensive and systematic review process significantly reduces reliance on the technical skills and business experience of reviewers, saving the time of senior technical personnel. Furthermore, AI-powered review is 8 to 10 times faster than human resource review, significantly improving code review efficiency and meeting the rapid iteration needs of business software development.

[0111] The key points for creating the review guidelines introduced above demonstrate the following: First, it outlines the unique business modules and sub-functions of navigation services, such as maps, route calculation, and retrieval. Second, it uses PlantUML format to organize the code architecture sequence, adds basic coding standards, explains the specific framework usage and process limitations of navigation services, empowers artificial intelligence to provide suggestions for code structure optimization and refactoring, and pre-sets a scoring mechanism that includes different deduction standards for different issues and code merging conditions. This enables artificial intelligence to understand and execute code reviews from multiple dimensions, including business, architecture, and standards.

[0112] Furthermore, the code review of navigation services also considers the performance of the vehicle's infotainment system. Therefore, the code review guidelines can further include review prompts based on the hardware performance principles of the vehicle's infotainment system. The aim is to prohibit continuous layer rendering calls (GPU), high-frequency data creation (CPU), and references to large objects (memory), thereby ensuring the hardware performance of the vehicle's infotainment system. The review prompts based on the hardware performance principles of the vehicle's infotainment system define a list of rendering-related interfaces and a list of data creation interfaces; review check items include: checking for compound calls and combined calls, and whether common methods can be extracted and reduced to a single call.

[0113] In this embodiment, the code review specifications for navigation services are not static but can be modified and adjusted based on the results of the review process, thereby better serving subsequent AI-based code review work. In an optional implementation, the AI-based code review method proposed in this embodiment further includes:

[0114] The results of the review issue coverage analysis, review issue accuracy analysis, and scoring rule rationality analysis were obtained. Among them, the review issue coverage analysis, review issue accuracy analysis, and scoring rule rationality analysis were all obtained by analyzing the code review specifications of the navigation business based on the review results.

[0115] If the review issue coverage analysis results indicate that the code review specifications for the navigation service have insufficient coverage, then review prompts related to the uncovered content found in the analysis will be added to the code review specifications for the navigation service based on the review issue coverage analysis results.

[0116] Specifically, you can check whether the code review guidelines for the navigation business cover all possible code issues. If any gaps are found, such as special code issues caused by new business requirements, update the code review guidelines for the navigation business in a timely manner, add corresponding review rules and requirements, and improve the guidelines to ensure that the code review guidelines for the navigation business can comprehensively cover all kinds of code issues that may arise in the navigation business.

[0117] If the accuracy analysis results indicate that the code review specifications for the navigation service have insufficient accuracy, then the review prompts related to the insufficient accuracy issues will be adjusted in the code review specifications for the navigation service based on the accuracy analysis results.

[0118] Specifically, the accuracy of AI's code review results can be assessed to determine if there are any misjudgments or omissions. If the AI ​​review is found to be unreasonable, such as misjudging normal code as problematic or omitting actual problems, the reasons can be analyzed, and the review prompts in the review guidelines can be adjusted to optimize the AI's review logic and improve the accuracy of the review results.

[0119] If the results of the rationality analysis of the scoring rules indicate that the scoring rules in the code review specifications for the navigation business are not rational enough, then the scoring rules will be adjusted according to the results of the rationality analysis of the scoring rules.

[0120] Specifically, the scoring mechanism can be checked to see if it is reasonable and whether the deductions for different types of problems are appropriate. If the scoring is found to be unreasonable, such as the severity of a problem not matching the deduction, the scoring mechanism should be adjusted so that the scoring can more accurately reflect the quality of the code.

[0121] The above three aspects of analysis can be completed by reviewers, who can combine their technical and business experience to conduct the analysis and evaluation. In some possible implementations, intelligent means (such as models) can also be used to perform review issue coverage analysis, review issue accuracy analysis, and scoring rule rationality analysis.

[0122] The AI-based code review method provided in this application embodiment can also achieve information synchronization. Specifically, the method further includes:

[0123] The system invokes the MCP information synchronization service to synchronize review results with the code repository and with the code submitter and their technical team leader in the code data source to be reviewed. Upon confirmation of completion by both the code submitter and the technical team leader, the system triggers the code merge operation in the code data source to be reviewed.

[0124] As an example, a specific method for synchronizing review results with the code submitter and their technical team leader from the code data source to be reviewed can be through instant messaging software. Generally, the technical team leader is the reviewer (or review representative). Synchronizing review results with the code repository facilitates issue tracing, while synchronizing results through instant messaging software aims to reduce human intervention, allowing all parties to view review results promptly and address code issues in a timely manner. After the code submitter and review representative complete code confirmation, the review representative can directly trigger the code merge operation through an instant messaging bot configured with a long-connection server. This process eliminates the cumbersome procedures of code review result application, review, personnel coordination, and notification of relevant parties, which were entirely manually driven before system integration. This significantly improves communication efficiency, reduces time consumption, and makes the code review and merge process more convenient and efficient.

[0125] Figure 9 This is a schematic diagram of a message interface for AI-based code review. For example... Figure 9 As shown, artificial intelligence technology can be used to remind the reviewer "Zhao XX" of the code merge request from code submitter "Liu XX," relevant business module information, and the address of the merge request. After the AI ​​reviews the code submitted by "Liu XX," it automatically outputs the review results, provides feedback scores, points out code problems, and offers specific modification suggestions.

[0126] Figure 10 This is an illustration of another message interface for AI-based code review. (Example) Figure 10 As shown, artificial intelligence technology can be used to notify the code submitter "Bao XX" that the code has been merged, and simultaneously remind them of the changes made in this merge. For instant messaging software used by multiple working groups, it can notify different members of the review team of merge requests, review results, or merge results. This reduces frequent interactions between people and improves communication and code review efficiency.

[0127] The AI-based code review method described above can be implemented through a system. This system includes a review specification creation module, a code retrieval module, a code review module, a review notification module, and a specification adjustment module. Figure 11 This is a schematic diagram of the structure of an AI-based code review system.

[0128] The core of the review specification creation module is the prompt word project. The review specification creation module is used to execute the steps of creating basic review specifications, including business module and function organization, code architecture sequence organization, adding basic coding standards, navigation business-specific framework and process descriptions, code structure optimization suggestions, and preset scoring mechanisms.

[0129] The core of the code retrieval module is the inference model and code service. The code retrieval module is used to build the code retrieval service, monitor the merge request, call the code retrieval MCP service to perform code retrieval and differential code analysis, and obtain the code data source required for review.

[0130] The core of the code review module is the coding model. The code review module combines code review guidelines and code data sources to review the code according to steps such as business rationality review, interface call sequence review, code style review, and navigation business framework style review, and then calculates the score.

[0131] The core of the review notification module is the inference model and the instant messaging robot. After the code review is completed, the review notification module uses the inference model to identify the review completion action, calls the information synchronization MCP service to realize information synchronization between the code repository and the instant messaging software, notifies the code submitter and the reviewer, and supports the reviewer to trigger the code merge operation through the instant messaging software.

[0132] The core of the specification adjustment module is the prompt word project. Based on the code scoring after review, the specification adjustment module reviews the coverage of review issues, the accuracy of review issues, and the reasonableness of the scoring. If problems are found, the review specification is updated and the review prompt words are adjusted in a timely manner to improve the review specification.

[0133] In summary, the technical solution proposed in this application significantly improves the efficiency and accuracy of code review, specifically in the following aspects:

[0134] (1) Improve review efficiency: Through automated code retrieval, AI review, and review notification processes, the manual operation steps are greatly reduced. Compared with traditional manual review, the review speed is increased by 8 to 10 times, which can meet the needs of rapid iteration in navigation business software development. For example, the development and iteration speed of navigation software is relatively fast, requiring frequent code reviews.

[0135] (2) Reduced labor costs: It reduces the reliance on code submitters, reviewers and other human resources, eliminates the need for manual participation in tedious processes such as code retrieval and comparison of differences, and reduces the requirements for reviewers' technical skills and business experience, saving the time of senior technical personnel and reducing the labor costs of software development.

[0136] (3) Ensuring Review Quality: Through detailed organization of business modules and functions, code architecture sequence, formulation of basic coding standards, and explanation of business-specific frameworks and processes, a comprehensive and accurate review specification was constructed, enabling artificial intelligence to review the code from multiple dimensions such as business, architecture, and standards. The pre-set scoring mechanism and manual review mechanism further ensured code quality, ensuring that only high-quality code could be merged.

[0137] (4) Continuously optimize review capabilities: By regularly adjusting the review guidelines, continuously improving the coverage of review issues, increasing the accuracy of review issues, and optimizing the rationality of scoring based on the review results, the system's code review capabilities can be continuously improved to adapt to the ever-evolving needs of navigation services.

[0138] Based on the AI-based code review method described in the foregoing embodiments, this application provides an AI-based code review device. Figure 12 This is a schematic diagram of the structure of an artificial intelligence-based code review device provided in an embodiment of this application.

[0139] like Figure 12 As shown, the device includes:

[0140] The data source retrieval module 1201 is used to retrieve the code data source to be reviewed in response to the code merging request of the navigation business.

[0141] The code review module 1202 is used to review the code data source to be reviewed based on the declarations or definitions of review elements in the review prompts in the code review specifications for navigation business, as well as the review check items in the review prompts, and to obtain the artificial intelligence review results of the code data source to be reviewed.

[0142] The code review specifications for navigation services must include review prompts for the map, search, guidance, or route calculation functions of the navigation service, and the review elements and review check items in the review prompts must be determined based on the corresponding functions being reviewed.

[0143] Code review module 1202 is specifically used for:

[0144] Based on the review prompts corresponding to the business rationality review dimension, interface call sequence review dimension, code specification review dimension, and business framework specification review dimension in the code review guidelines for navigation business, the code data source to be reviewed is reviewed in the business rationality review dimension, interface call sequence review dimension, code specification review dimension, and business framework specification review dimension.

[0145] Based on the review results of the code data source to be reviewed in the dimensions of business rationality review, interface call sequence review, code convention review, and business framework specification review, the artificial intelligence review result of the code data source to be reviewed is obtained.

[0146] The review of map functions, search functions, guidance functions, or route calculation functions for navigation services falls under the review dimension of business rationality.

[0147] Optionally, the code review guidelines for the navigation business also include code scoring rules, which include the correspondence between code deduction items, code problem severity levels, and deduction values; the review results of the code data source to be reviewed in the business rationality review dimension, interface call sequence review dimension, code guideline review dimension, and business framework specification review dimension respectively include: the code deduction items corresponding to the code data source to be reviewed in the business rationality review dimension, interface call sequence review dimension, code guideline review dimension, and business framework specification review dimension respectively;

[0148] Code review module 1202 is specifically used for:

[0149] Based on the corresponding relationships and the code deduction items corresponding to the business rationality review dimension, interface call sequence review dimension, code style review dimension, and business framework specification review dimension of the code data source to be reviewed, the AI ​​review result of the code data source to be reviewed is obtained; the AI ​​review result includes the review score, and also includes at least one of the following:

[0150] Code deduction items, corresponding code problems, and code modification solutions.

[0151] Optionally, the device further includes:

[0152] The exemption determination module is used to determine whether the merging can be done without manual re-inspection when the evaluation score is higher than or equal to the preset scoring threshold; and to determine whether the merging can be done only after manual re-inspection is passed when the evaluation score is lower than the preset scoring threshold.

[0153] Optionally, the code review module 1202 is specifically used for:

[0154] Based on the business-related review prompts in the code review guidelines for the navigation business, determine whether there are any unreasonable coupling relationships between different business modules in the code data source to be reviewed, and determine whether there are any cross-calls between different business modules in the code data source to be reviewed that violate business logic.

[0155] Optionally, the code review module 1202 is specifically used for:

[0156] Based on the timing review prompts in the code review guidelines for the navigation business, check whether the data source of the code to be reviewed calls the interfaces according to the calling order and calling logic of the code architecture timing diagram, whether the calling parameters are passed correctly, and whether the return results between the interfaces meet the design requirements of the code architecture timing diagram.

[0157] Optionally, the device further includes: a review specification creation module, used to organize the correct calling order, calling logic, calling parameters and return results between the interfaces of the navigation service, and generate a code architecture sequence diagram; generate timing review prompts based on the code architecture sequence diagram; and record the timing review prompts in the code review specification of the navigation service.

[0158] Optionally, the code review module 1202 is specifically used for:

[0159] Based on the code review guidelines for navigation services, check whether the code data source to be reviewed meets the requirements for pointer safety, array safety, thread safety, mathematical formula usage, loop structure, and naming conventions.

[0160] Optionally, the code review module 1202 is specifically used for:

[0161] Based on the business framework specification review prompts in the code review guidelines for the navigation business, check whether the code data source to be reviewed, when using the framework of the navigation business, performs utility class calls, framework integration operations, and component usage in accordance with the prescribed methods.

[0162] Optionally, the device further includes: a synchronization module, used to call the information synchronization MCP service to synchronize the AI ​​review results to the code repository, and to synchronize the AI ​​review results to the code submitter and the code submitter's technical team leader of the code data source to be reviewed; in response to the dual confirmation of completion by the code submitter and the technical team leader, the code data source to be reviewed is triggered to perform a code merging operation.

[0163] Optionally, the device further includes: a specification adjustment module, used to obtain the review issue coverage analysis results, review issue accuracy analysis results, and scoring rule rationality analysis results; wherein, the review issue coverage analysis results, review issue accuracy analysis results, and scoring rule rationality analysis results are all obtained after analyzing the code review specifications of the navigation business based on the artificial intelligence review results; if the review issue coverage analysis results indicate that the code review specifications of the navigation business have insufficient coverage, then review prompt words related to the uncovered content found in the analysis are added to the code review specifications of the navigation business according to the review issue coverage analysis results; if the review issue accuracy analysis results indicate that the code review specifications of the navigation business have insufficient accuracy, then review prompt words related to the insufficient accuracy are adjusted in the code review specifications of the navigation business according to the review issue accuracy analysis results; if the scoring rule rationality analysis results indicate that the scoring rules in the code review specifications of the navigation business have insufficient rationality, then the scoring rules are adjusted according to the scoring rule rationality analysis results.

[0164] Optionally, the data source retrieval module 1201 is specifically used for:

[0165] Monitor code merge requests for navigation services in the code repository;

[0166] When a code merge request is detected in the code repository, the code retrieval service is invoked to retrieve the commit code corresponding to the code merge request, and differential code analysis is performed on the commit code.

[0167] If the submitted code is determined to be new code through differential code analysis, then the new code will be identified as the code data source to be reviewed.

[0168] If the submitted code is determined to be modified code through differential code analysis, the original code and change point information of the modified code are obtained, and the modified code, original code, and change point information are used together as the data source for the code to be reviewed.

[0169] Based on the methods and apparatus described in the foregoing embodiments, this application also provides an artificial intelligence-based code review device. The device includes: a processor and a memory communicatively connected to each other; the memory stores a computer program; and the processor is used to run the computer program to implement the artificial intelligence-based code review method as described in any implementation of the method embodiments.

[0170] In addition, this application also provides a computer-readable storage medium storing a computer program, which, when processed, implements the steps of the AI-based code review method as described in any implementation of the method embodiments.

[0171] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device and equipment embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The device and equipment embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components indicated as units 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 the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0172] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A code review method based on artificial intelligence, characterized in that, The method includes: In response to the code merging request from the navigation business, pull the code data source to be reviewed; Based on the declarations or definitions of review elements in the review prompts in the code review guidelines for the navigation service, and the review check items in the review prompts, the code data source to be reviewed is reviewed to obtain the artificial intelligence review result of the code data source to be reviewed. The code review specification for the navigation service shall include at least review prompts for the map function, search function, guidance function or route calculation function of the navigation service, and the review elements and review check items in the review prompts shall be determined based on the corresponding function being reviewed.

2. The method according to claim 1, characterized in that, The review prompts for the map function include review prompts based on the mutual exclusion principle of map interfaces and / or review prompts based on the unique response principle of map animations; The review prompts based on the mutual exclusion principle of map interfaces are used to check whether map interfaces with mutually exclusive display perspectives are called within the same lifecycle. The review prompts based on the principle of unique response for map animations are used to check whether map animations that are prohibited from being displayed simultaneously are combined and called within the same lifecycle.

3. The method according to claim 2, characterized in that, The review prompt based on the mutual exclusion principle of map interfaces declares the following interface function and the mutual exclusion interface function; the following interface is the map interface that displays the viewpoint of following the vehicle, and the mutual exclusion interface is the map interface that displays the viewpoint that is mutually exclusive with the following viewpoint. Display perspectives that are mutually exclusive with the following vehicle perspective include the panoramic view and the map scrolling view; The review check item in the review prompt based on the map interface mutual exclusion principle is: check whether the following interface function and the mutual exclusion interface function are called in the same lifecycle; The review prompts based on the principle of unique response for map animations declare a list of map animation interfaces. The review prompts based on the principle of unique response for map animations include the following review check items: checking whether there are combined calls to the map animation interface, and checking whether combined calls to the map animation interface occur within the same lifecycle.

4. The method according to claim 1, characterized in that, The review prompts for the search function include review prompts based on the asynchronous retrieval tracing principle; The review prompts based on the asynchronous retrieval tracing principle are used to check whether asynchronous retrieval in the navigation service supports tracing. The review prompts based on the asynchronous retrieval and tracing principle define a list of retrieval interfaces; The review check items in the review prompts based on the asynchronous retrieval tracing principle include: checking whether a unique retrieval request identifier is created for the call to the retrieval interface function, whether the returned retrieval results carry the unique retrieval request identifier, and whether the unique retrieval request identifier is printed.

5. The method according to claim 1, characterized in that, The review prompts for the guidance function include review prompts based on the pairing principle of the guidance interface; The review prompts based on the pairing principle of the guidance interface are used to check whether the triggering and cancellation of navigation occur in pairs; The review prompts based on the pairing principle of the guidance interface define the associated interfaces of the navigation. The review check items in the review prompts based on the pairing principle of the guidance interface include: checking whether the call relationship of the navigation's associated interfaces remains paired throughout the action lifecycle, according to the call sequence of the interfaces.

6. The method according to claim 1, characterized in that, The review prompts for the route calculation function include review prompts based on state control principles and / or review prompts based on route accuracy principles; The review prompts based on the state control principle are used to check whether the state of key interfaces is interrupted during the route calculation process. The review prompts based on the principle of route accuracy are used to check whether the route calculation parameters are accurate.

7. The method according to claim 6, characterized in that, The review prompts based on the state control principle define a state list and a list of interfaces that should not be interrupted. The review check items in the review prompts based on the state control principle include: checking whether the interface functions in the list of interfaces that should not be interrupted have state check conditions, and using the state check conditions to check whether the state of the corresponding interface has been interrupted. The review prompts based on the principle of route accuracy define a list of routing-related interfaces. The review check items in the review prompts based on the principle of route accuracy include: checking whether there are parameters for unique location identifiers in the routing-related interface functions; wherein, the unique location identifier is a unique identifier information generated based on the latitude and longitude of the location and location attributes.

8. The method according to claim 1, characterized in that, Based on the declarations or definitions of review elements in the review prompts of the code review guidelines for the navigation service, and the review check items in the review prompts, the code data source to be reviewed is reviewed to obtain the artificial intelligence review results of the code data source to be reviewed, including: Based on the review prompts corresponding to the business rationality review dimension, interface call sequence review dimension, code specification review dimension, and business framework specification review dimension in the code review guidelines for the navigation service, the code data source to be reviewed is reviewed according to the business rationality review dimension, the interface call sequence review dimension, the code specification review dimension, and the business framework specification review dimension. Based on the review results of the code data source to be reviewed in the business rationality review dimension, the interface call sequence review dimension, the code specification review dimension, and the business framework specification review dimension, the artificial intelligence review result of the code data source to be reviewed is obtained. The review of the map function, search function, guidance function or route calculation function of the navigation service belongs to the review of the rationality of the service.

9. The method according to claim 8, characterized in that, The code review guidelines for the navigation service also include code scoring rules, which include the correspondence between code deduction items, code problem severity levels, and deduction values. The review results of the code data source to be reviewed in the business rationality review dimension, the interface call sequence review dimension, the code specification review dimension, and the business framework specification review dimension respectively include: the code deduction items corresponding to the code data source to be reviewed in the business rationality review dimension, the interface call sequence review dimension, the code specification review dimension, and the business framework specification review dimension respectively; The process of obtaining the AI ​​review result of the code data source to be reviewed based on the review results of the business rationality review dimension, the interface call sequence review dimension, the code specification review dimension, and the business framework specification review dimension includes: Based on the aforementioned correspondence and the code deduction items corresponding to the business rationality review dimension, the interface call sequence review dimension, the code convention review dimension, and the business framework specification review dimension of the code data source to be reviewed, the AI ​​review result of the code data source to be reviewed is obtained; the AI ​​review result includes a review score, and also includes at least one of the following: Code deduction items, corresponding code problems, and code modification solutions.

10. The method according to claim 8, characterized in that, Based on the review prompt words corresponding to the interface call timing review dimension in the code review guidelines for the navigation service, the code data source to be reviewed is reviewed according to the interface call timing review dimension, including: Based on the timing review prompts in the code review guidelines for the navigation service, check whether the code data source to be reviewed calls the interfaces according to the calling order and calling logic of the code architecture timing diagram, whether the calling parameters are passed correctly, and whether the return results between the interfaces meet the design requirements of the code architecture timing diagram.

11. The method according to claim 10, characterized in that, Also includes: Organize the correct calling order, calling logic, calling parameters and return results between the interfaces of the navigation service, and generate the code architecture sequence diagram; Generate the timing review prompts based on the code architecture timing diagram; The timing review prompts will be recorded in the code review specifications for the navigation service.

12. The method according to claim 8, characterized in that, Based on the review prompts corresponding to the business framework specification review dimensions in the code review guidelines for the navigation service, the code data source to be reviewed is reviewed according to the business framework specification review dimensions, including: Based on the business framework specification review prompts in the code review guidelines for the navigation service, check whether the code data source to be reviewed performs utility class calls, framework integration operations, and component usage in accordance with the prescribed methods when using the framework of the navigation service.

13. The method according to any one of claims 1-12, characterized in that, Also includes: The system invokes the MCP information synchronization service to synchronize the AI ​​review results to the code repository, as well as to the code submitter of the code data source to be reviewed and the technical team leader of the code submitter. Upon confirmation from both the code submitter and the technical team leader, the code data source to be reviewed is triggered to perform a code merging operation.

14. The method according to any one of claims 1-12, characterized in that, Also includes: The results of the review issue coverage analysis, review issue accuracy analysis, and scoring rule rationality analysis are obtained; wherein, the review issue coverage analysis, the review issue accuracy analysis, and the scoring rule rationality analysis are all obtained by analyzing the code review specifications of the navigation service based on the artificial intelligence review results; If the review issue coverage analysis results indicate that the code review specifications for the navigation service have insufficient coverage, then review prompt words related to the uncovered content found in the analysis will be added to the code review specifications for the navigation service based on the review issue coverage analysis results. If the accuracy analysis results of the review questions indicate that the code review specifications for the navigation service have insufficient accuracy, then based on the accuracy analysis results, the review prompt words related to the insufficient accuracy issues will be adjusted in the code review specifications for the navigation service. If the rationality analysis results of the scoring rules indicate that the scoring rules in the code review specifications of the navigation service are not rational enough, then the scoring rules shall be adjusted according to the rationality analysis results of the scoring rules.

15. A code review device based on artificial intelligence, characterized in that, The device includes: The data source retrieval module is used to retrieve the code data source to be reviewed in response to code merging requests from navigation services. The code review module is used to review the code data source to be reviewed based on the declarations or definitions of review elements in the review prompts in the code review specifications of the navigation service, and the review check items in the review prompts, and to obtain the artificial intelligence review results of the code data source to be reviewed. The code review specification for the navigation service shall include at least review prompts for the map function, search function, guidance function or route calculation function of the navigation service, and the review elements and review check items in the review prompts shall be determined based on the corresponding function being reviewed.