Vehicle program code analysis method and device, processor and electronic equipment
By decoding, analyzing, and filtering the change data of the vehicle program code, a target anomaly data report is generated, which solves the problem of low program code positioning accuracy and achieves accurate positioning of code increment risks.
Patent Information
- Application Number
- CN202511316172.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-15
- Publication Date
- 2026-01-23
AI Technical Summary
Existing technologies for locating problems in vehicle program code suffer from low accuracy, especially in legacy files, making it difficult to focus on the real risks introduced by the current code increment.
By receiving change data from the program code, decoding and anomaly analysis are performed to filter out target abnormal data, generate analysis reports, assess the degree of anomaly using a priority mapping table, and generate reports in a lightweight data exchange format.
It improves the accuracy of locating problems in vehicle program code, accurately pinpoints the real risks introduced by the code increment, and reduces interference from irrelevant abnormal data.
Smart Images

Figure CN121387696A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicles, and more specifically, to a method, apparatus, processor, and electronic device for analyzing vehicle program code. Background Technology
[0002] Currently, in existing technologies, when reviewing vehicle program code, the entire file is often reviewed. If the file is an old, legacy file with inconsistent code quality, the review results may report dozens or even hundreds of problems. This can prevent code reviewers from focusing on the real risks introduced by the current code increment, resulting in low accuracy in locating problems in the vehicle's program code.
[0003] There is currently no effective solution to the technical problem of low accuracy in locating problems in vehicle program code. Summary of the Invention
[0004] This invention provides a method, apparatus, processor, and electronic device for analyzing vehicle program code, to at least solve the technical problem of low accuracy in locating problems in vehicle program code.
[0005] According to one aspect of the present invention, a method for analyzing vehicle program code is provided. The method includes: responding to a first analysis request for modified program code, receiving first encoded data, wherein the program code represents underlying data implementing a vehicle application, the first encoded data includes modification data of the program code, the modification data at least representing the modified code content of the program code; decoding the first encoded data to obtain first decoded data of the program code, wherein the first decoded data includes the modified program code; performing anomaly analysis on the first decoded data to obtain a first initial analysis result, wherein the first initial analysis result indicates that the modified program code contains multiple abnormal data; filtering the first initial analysis result to obtain a first target analysis result, wherein the first target analysis result represents a target abnormal data among the multiple abnormal data, the target abnormal data indicating that the code content is abnormal code content.
[0006] Optionally, filtering the first initial analysis result to obtain a first target analysis result includes: determining the identifier data for each of the multiple abnormal data to obtain multiple identifier data, wherein the identifier data is used to identify the abnormal data; in response to the existence of identifier data in the multiple identifier data that is the same as candidate identifier data in the candidate identifier data table, determining the abnormal data corresponding to the identifier data that is the same as the candidate identifier data; filtering out the abnormal data corresponding to the identifier data that is the same as the candidate identifier data from the first initial analysis result to obtain a second initial analysis result, wherein the second initial analysis result is used to represent the multiple remaining abnormal data in the multiple abnormal data, excluding the abnormal data corresponding to the identifier data that is the same as the candidate identifier data; filtering the second initial analysis result to obtain the first target analysis result.
[0007] Optionally, filtering the second initial analysis result to obtain the first target analysis result includes: determining the position of each remaining abnormal data in the program code among multiple remaining abnormal data, obtaining multiple positions; in response to the existence of a position among the multiple positions that is different from the changed position in the changed data, determining the remaining abnormal data corresponding to the position that is different from the changed position, wherein the changed position is used to represent the position of the code content in the program code; filtering out the remaining abnormal data corresponding to the position that is different from the changed position from the second initial analysis result to obtain the first target analysis result.
[0008] Optionally, the method further includes: determining the level information of the target abnormal data corresponding to the first target analysis result, wherein the level information is used to indicate the degree of abnormality of the abnormal code content; searching for priority data corresponding to the level information from a priority mapping table, wherein the priority mapping table includes the mapping relationship between different level information and different priority data; and assembling the priority data, change data, and identification data of the target abnormal data to obtain an analysis report of the target abnormal data.
[0009] Optionally, anomaly analysis is performed on the first decoded data to obtain a first initial analysis result, including: calling the analysis engine to perform a full analysis on the first decoded data to obtain the first initial analysis result.
[0010] Optionally, the method further includes: in response to a second analysis request for a folder, receiving second encoded data, wherein the folder is used to store multiple modified program codes, and the second encoded data includes modification data of the multiple program codes; invoking a sub-thread to decode the second encoded data to obtain second decoded data, wherein the second decoded data includes the multiple modified program codes; invoking a sub-thread to perform anomaly analysis on the second decoded data to obtain a third initial analysis result, wherein the third initial analysis result is used to indicate that each program code among the multiple modified program codes contains multiple anomaly data; and invoking a sub-thread to filter the third initial analysis result to obtain a second target analysis result.
[0011] According to one aspect of the present invention, a vehicle program code analysis apparatus is provided. The apparatus may include: a first receiving unit, configured to receive first encoded data in response to a first analysis request for modified program code, wherein the program code represents underlying data implementing a vehicle application, and the first encoded data includes modification data of the program code, the modification data at least representing the modified code content of the program code; a first decoding unit, configured to decode the first encoded data to obtain first decoded data of the program code, wherein the first decoded data includes the modified program code; a first analysis unit, configured to perform anomaly analysis on the first decoded data to obtain a first initial analysis result, wherein the first initial analysis result indicates that the modified program code contains multiple abnormal data; and a first filtering unit, configured to filter the first initial analysis result to obtain a first target analysis result, wherein the first target analysis result indicates a target abnormal data among the multiple abnormal data, and the target abnormal data indicates that the code content is abnormal code content.
[0012] According to another aspect of the present invention, a processor is also provided. The processor is used to run a program, wherein the program, when run by the processor, executes the vehicle program code analysis method of the present invention.
[0013] According to another aspect of the embodiments of the present invention, an electronic device is also provided, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes the program code analysis method for a vehicle according to various embodiments of the present invention during runtime.
[0014] According to another aspect of the present invention, a computer-readable storage medium is also provided. The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to execute the program code analysis method for a vehicle according to the embodiments of the present invention.
[0015] According to another aspect of the present invention, a computer program product is also provided, the computer program product including a computer program, wherein the computer program, when executed by a processor, implements the vehicle program code analysis method of the present invention.
[0016] According to another aspect of the present invention, a computer program product is also provided, including a non-volatile computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the vehicle program code analysis method of the present invention.
[0017] According to another aspect of the embodiments of the present invention, the embodiments of the present application also provide a computer program that, when executed by a processor, implements the vehicle program code analysis method described in the embodiments of the present invention.
[0018] In this embodiment of the invention, when analyzing the vehicle's program code, in response to a first analysis request for the modified program code, first encoded data can be received; the received first encoded data can be decoded to obtain first decoded data of the program code; anomaly analysis can be performed on the obtained first decoded data to obtain a first initial analysis result; and the first initial analysis result can be filtered to obtain a first target analysis result, that is, the target anomaly data among multiple anomaly data can be obtained. This achieves the purpose of being able to locate the real risk introduced by the current code increment, thereby solving the technical problem of low accuracy in locating problems in the vehicle's program code, and thus achieving the technical effect of improving the accuracy of locating problems in the vehicle's program code. Attached Figure Description
[0019] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0020] Figure 1 This is a flowchart of a vehicle program code analysis method according to an embodiment of the present invention;
[0021] Figure 2 This is a schematic diagram of an automated code review system based on lines of code change according to an embodiment of the present invention;
[0022] Figure 3 This is a flowchart of an automated code review method based on lines of code change according to an embodiment of the present invention;
[0023] Figure 4 This is a schematic diagram of a vehicle program code analysis device according to an embodiment of the present invention;
[0024] Figure 5 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0025] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0027] According to an embodiment of the present invention, a method for analyzing the program code of a vehicle is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0028] Figure 1 This is a flowchart of a vehicle program code analysis method according to an embodiment of the present invention, such as... Figure 1 As shown, the method may include the following steps:
[0029] Step S101: In response to a first analysis request for the modified program code, first encoded data is received, wherein the program code is used to represent the underlying data for implementing the vehicle application, and the first encoded data includes modification data of the program code, which at least represents the modified code content of the program code.
[0030] In the technical solution provided by step S101 of the present invention, the program code can be used to represent the underlying data for implementing the vehicle application. The vehicle application can be embodied in different software or system forms. For example, different software may include media playback software and data transmission software, and different systems may include driver assistance systems, vehicle management systems, and suspension adjustment systems. These are merely illustrative examples and are not intended to be specific.
[0031] In this embodiment, the first encoded data may include change data of the program code. This change data can at least represent the changed code content, the unchanged code content, and the location of the changed code. The location of the changed code content can represent its position within the program code. For example, the changed code content and the unchanged code content can be stored in the file content to be reviewed (file.content). The location of the changed code content within the program code can be represented by an array of line numbers for the changed code (file.newLineNum). This is merely an example and not a specific limitation.
[0032] In this embodiment, the first analysis request can be a structured review task request.
[0033] In this embodiment, in response to a first analysis request for the modified program code, first encoded data is received. Optionally, in this embodiment, if the program code has been modified, and a first analysis request for the modified program code is received, the first encoded data can be received from the user terminal. For example, if the program code is the underlying data for implementing a driver assistance system, then if the underlying data for implementing the driver assistance system changes, and a first analysis request for the underlying data for implementing the driver assistance system is received, the first encoded data can be received from the user terminal. This is merely an example and not a specific limitation.
[0034] Step S102: Decode the first encoded data to obtain the first decoded data of the program code, wherein the first decoded data includes the modified program code.
[0035] In the technical solution provided by step S102 of the present invention, the first decoded data may include modified program code, which may include modified code content and unchanged code content.
[0036] In this embodiment, after receiving first encoded data in response to a first analysis request for modified program code, the first encoded data is decoded to obtain first decoded data of the program code. Optionally, this embodiment can obtain first decoded data of the program code by decoding the received first encoded data, thereby achieving the purpose of determining the modified code content and the unchanged code content.
[0037] Step S103: Perform anomaly analysis on the first decoded data to obtain a first initial analysis result, wherein the first initial analysis result is used to indicate that there are multiple abnormal data in the modified program code.
[0038] In the technical solution provided by step S103 of the present invention, the first initial analysis result can be used to indicate that the modified program code has multiple abnormal data. For example, the first initial analysis result can also be called the original analysis result, and the abnormal data can be used to indicate that the modified program code has multiple problems.
[0039] In this embodiment, after decoding the first encoded data to obtain the first decoded data of the program code, anomaly analysis is performed on the first decoded data to obtain a first initial analysis result. Optionally, this embodiment performs anomaly analysis on the first decoded data based on the decoded data to obtain the first initial analysis result, thereby achieving the purpose of determining that the modified program code contains multiple abnormal data.
[0040] Optionally, performing anomaly analysis on the first decoded data can yield a first initial analysis result. For example, performing a full analysis on the first decoded data can yield the first initial analysis result.
[0041] Step S104: Filter the first initial analysis result to obtain the first target analysis result, wherein the first target analysis result is used to represent the target abnormal data among multiple abnormal data, and the target abnormal data is used to represent code content as abnormal code content.
[0042] In the technical solution provided by step S104 of the present invention, the first target analysis result can be used to represent the target abnormal data among multiple abnormal data, and the target abnormal data can be used to represent code content that is abnormal code content. For example, if the target abnormal data exists among multiple abnormal data, it indicates that the code content changed (or modified) by the developer has a problem.
[0043] In this embodiment, after performing anomaly analysis on the first decoded data to obtain a first initial analysis result, the first initial analysis result is filtered to obtain a first target analysis result. Optionally, based on the first initial analysis result, this embodiment determines the identifier data for each of the multiple anomaly data, thus obtaining multiple identifier data; by judging whether there is any identifier data in the multiple identifier data that is the same as the candidate identifier data in the candidate identifier data table, a first judgment result can be obtained; based on the first judgment result, the first initial analysis result is filtered to obtain the first target analysis result.
[0044] Optionally, if the first judgment result indicates that there is identification data in the plurality of identification data that is the same as the candidate identification data in the candidate identification data table, then the abnormal data corresponding to the identification data that is the same as the candidate identification data can be filtered out from the first initial analysis result to obtain the second initial analysis result; the second initial analysis result can be filtered according to the change position in the change data to obtain the first target analysis result.
[0045] Optionally, if the first judgment result indicates that there is no identifier data in the plurality of identifier data that is the same as the candidate identifier data in the candidate identifier data table, then the first initial analysis result is filtered again according to the change position in the change data to obtain the first target analysis result.
[0046] It should be noted that the vehicle program code analysis method in this application is not only applicable to the program code analysis of specific types of vehicles (e.g., school buses and fire trucks), but also applicable to the program code analysis of other types of vehicles, including but not limited to trucks, buses, and cars. In other words, as long as the analysis of vehicle program code is involved, regardless of the type of vehicle, the program code analysis method in this application can be used to analyze the vehicle's program code.
[0047] In steps S101 to S104 of this application, when analyzing the vehicle's program code, the system can receive first encoded data in response to a first analysis request for the modified program code; decode the received first encoded data to obtain first decoded data of the program code; perform anomaly analysis on the obtained first decoded data to obtain a first initial analysis result; and filter the first initial analysis result to obtain a first target analysis result, that is, obtain the target anomaly data among multiple anomaly data. This achieves the purpose of locating the real risk introduced by the current code increment, thereby solving the technical problem of low accuracy in locating problems in the vehicle's program code, and thus achieving the technical effect of improving the accuracy of locating problems in the vehicle's program code.
[0048] The method described in this embodiment will be further described below.
[0049] As an optional embodiment, step S101, filtering the first initial analysis result to obtain a first target analysis result, includes: determining the identifier data of each abnormal data in the plurality of abnormal data to obtain a plurality of identifier data, wherein the identifier data is used to identify abnormal data; in response to the existence of identifier data in the plurality of identifier data that is the same as candidate identifier data in the candidate identifier data table, determining the abnormal data corresponding to the identifier data that is the same as candidate identifier data; filtering out the abnormal data corresponding to the identifier data that is the same as candidate identifier data from the first initial analysis result to obtain a second initial analysis result, wherein the second initial analysis result is used to represent the plurality of remaining abnormal data in the plurality of abnormal data, excluding the abnormal data corresponding to the identifier data that is the same as candidate identifier data; filtering the second initial analysis result to obtain the first target analysis result.
[0050] In this embodiment, the aforementioned identification data can be used to identify anomalous data. For example, the identification data can be a rule identifier (item.ruleId).
[0051] In this embodiment, the aforementioned candidate identifier data table can be a dynamic exclusion rule list (excludeScanRuleIdList). For example, the aforementioned candidate identifier data can be the candidate item.ruleId in the dynamic exclusion rule list.
[0052] In this embodiment, after performing anomaly analysis on the first decoded data to obtain a first initial analysis result, the identifier data of each of the multiple anomaly data is determined, resulting in multiple identifier data. In response to the presence of identifier data identical to candidate identifier data in the candidate identifier data table among the multiple identifier data, the anomaly data corresponding to the identifier data identical to the candidate identifier data is determined. Optionally, based on the first initial analysis result, this embodiment determines the identifier data of each of the multiple anomaly data, resulting in multiple identifier data. By judging whether there is identifier data identical to candidate identifier data in the candidate identifier data table among the multiple identifier data, a first judgment result can be obtained. If the first judgment result indicates that there is identifier data identical to candidate identifier data in the candidate identifier data table among the multiple identifier data, then the anomaly data corresponding to the identifier data identical to the candidate identifier data can be determined.
[0053] In this embodiment, the aforementioned second initial analysis result can be used to represent multiple remaining abnormal data among multiple abnormal data, excluding the abnormal data corresponding to the same identifier data as the candidate identifier data.
[0054] In this embodiment, after identifying the abnormal data corresponding to the same identifier data as the candidate identifier data, the abnormal data corresponding to the same identifier data as the candidate identifier data is filtered out from the first initial analysis result to obtain a second initial analysis result; the second initial analysis result is then filtered to obtain a first target analysis result. Optionally, in this embodiment, based on identifying the abnormal data corresponding to the same identifier data as the candidate identifier data, the abnormal data corresponding to the same identifier data as the candidate identifier data is filtered out from the first initial analysis result to obtain a second initial analysis result; the second initial analysis result is then filtered according to the change position in the changed data to obtain a first target analysis result. This achieves the goal of identifying the target abnormal data among multiple abnormal data, thereby improving the accuracy of the first target analysis result.
[0055] The following section further describes the steps of filtering the second initial analysis result to obtain the first target analysis result in this embodiment.
[0056] As an optional embodiment, filtering the second initial analysis result to obtain the first target analysis result includes: determining the position of each remaining abnormal data in the program code among multiple remaining abnormal data, obtaining multiple positions; in response to the existence of a position among the multiple positions that is different from the changed position in the changed data, determining the remaining abnormal data corresponding to the position that is different from the changed position, wherein the changed position is used to represent the position of the code content in the program code; filtering out the remaining abnormal data corresponding to the position that is different from the changed position from the second initial analysis result to obtain the first target analysis result.
[0057] In this embodiment, the position of each remaining abnormal data in the program code can be represented by an array of line numbers (LineNum).
[0058] In this embodiment, the aforementioned change location can be used to represent the position of the code content within the program code. For example, the aforementioned change location can be represented by an array of line numbers of the changed code (file.newLineNum).
[0059] In this embodiment, after determining the abnormal data corresponding to the same identifier data as the candidate identifier data, the position of each remaining abnormal data in the program code is determined, resulting in multiple positions. In response to the existence of a position among the multiple positions that differs from the changed position in the changed data, the remaining abnormal data corresponding to the position different from the changed position is determined. Optionally, based on the second initial analysis result, this embodiment can determine the position of each remaining abnormal data in the program code, resulting in multiple positions. By judging whether there is a position among the multiple positions that differs from the changed position in the changed data, a second judgment result can be obtained. If the second judgment result indicates that there is a position among the multiple positions that differs from the changed position in the changed data, then the remaining abnormal data corresponding to the position different from the changed position is determined.
[0060] Optionally, if the second judgment result indicates that there is no position among the multiple positions that is different from the changed position in the changed data, then the second initial analysis result is determined as the first target analysis result.
[0061] In this embodiment, after determining the remaining abnormal data corresponding to locations different from the changed location, the remaining abnormal data corresponding to locations different from the changed location is filtered out from the second initial analysis result to obtain the first target analysis result. Optionally, based on determining the remaining abnormal data corresponding to locations different from the changed location, this embodiment filters out the remaining abnormal data corresponding to locations different from the changed location from the second initial analysis result according to the changed location in the changed data to obtain the first target analysis result. This achieves the purpose of identifying the target abnormal data among multiple abnormal data, thereby improving the accuracy of the first target analysis result.
[0062] The method for analyzing the program code of the vehicle described in this embodiment will be further described below.
[0063] As an optional embodiment, the method further includes: determining the level information of the target abnormal data corresponding to the first target analysis result, wherein the level information is used to indicate the degree of abnormality of the abnormal code content; searching for priority data corresponding to the severity from a priority mapping table, wherein the priority mapping table includes the mapping relationship between the severity of different abnormal data and different priority data; assembling the priority data, change data, and identification data of the target abnormal data to obtain an analysis report of the target abnormal data.
[0064] In this embodiment, the aforementioned level information can be used to represent the degree of abnormality of the abnormal code content. For example, the degree of abnormality can also be referred to as the original severity (error / warn).
[0065] In this embodiment, the priority mapping table may include the mapping relationship between different levels of information and different priority data. For example, the priority mapping table may be a preset priority order mapping table.
[0066] In this embodiment, the level information of the target abnormal data corresponding to the first target analysis result is determined; priority data corresponding to the level information is searched from the priority mapping table. Optionally, after obtaining the first target analysis result, this embodiment evaluates the degree of abnormality of the target abnormal data corresponding to the first target analysis result to obtain the level information of the target abnormal data corresponding to the first target analysis result; and according to the mapping relationship between different level information and different priority data, if level information with the same level information as the target abnormal data is found in the priority mapping table, the priority data corresponding to that level information is determined as the priority data of the target abnormal data.
[0067] In this embodiment, the analysis report can be a lightweight data exchange format (JavaScript Object Notation, or JSON for short) report.
[0068] In this embodiment, after finding the priority data corresponding to the level information from the priority mapping table, the priority data, change data, and the identifier data of the target anomaly data are assembled to obtain an analysis report of the target anomaly data. Optionally, this embodiment can obtain an analysis report of the target anomaly data by assembling the priority data, change data, and the identifier data of the target anomaly data based on finding the priority data corresponding to the level information. For example, combining or aggregating the priority data, change data, and the aforementioned identifier data can obtain an analysis report of the target anomaly data, thereby achieving the purpose of generating an analysis report of the target anomaly data.
[0069] The steps of performing anomaly analysis on the first decoded data to obtain the first initial analysis result in this embodiment will be further described below.
[0070] As an optional embodiment, step S103, performing anomaly analysis on the first decoded data to obtain a first initial analysis result, includes: calling the analysis engine to perform a full analysis on the first decoded data to obtain the first initial analysis result.
[0071] In this embodiment, the analysis engine may include a static code analysis engine (e.g., ESLint).
[0072] In this embodiment, after decoding the first encoded data to obtain the first decoded data of the program code, an analysis engine is invoked to perform a full analysis of the first decoded data to obtain a first initial analysis result. Optionally, this embodiment, based on the first decoded data, invokes the analysis engine to perform a full analysis of the first decoded data to obtain a first initial analysis result. This achieves the goal of determining that the modified program code contains multiple abnormal data, thereby improving the accuracy of the first initial analysis result.
[0073] The method for analyzing the program code of the vehicle described in this embodiment will be further described below.
[0074] As an optional embodiment, the method further includes: in response to a second analysis request for a folder, receiving second encoded data, wherein the folder is used to store multiple modified program codes, and the second encoded data includes modification data of the multiple program codes; invoking a sub-thread to decode the second encoded data to obtain second decoded data, wherein the second decoded data includes the multiple modified program codes; invoking a sub-thread to perform anomaly analysis on the second decoded data to obtain a third initial analysis result, wherein the third initial analysis result is used to indicate that each of the multiple modified program codes contains multiple anomaly data; and invoking a sub-thread to filter the third initial analysis result to obtain a second target analysis result.
[0075] In this embodiment, the aforementioned folder can be used to store multiple program codes that have undergone changes.
[0076] In this embodiment, the second encoded data includes change data for multiple program codes.
[0077] In this embodiment, the second decoded data includes multiple modified program codes.
[0078] In this embodiment, the aforementioned sub-threads can be sub-worker threads (worker_threads) that are independent of the main thread.
[0079] In this embodiment, if a second analysis request for the aforementioned folder is received, second encoded data from the user terminal can be received; a sub-thread is invoked to decode the received second encoded data to obtain second decoded data; a sub-thread is invoked to perform anomaly analysis on the second decoded data to obtain a third initial analysis result; a sub-thread is invoked to perform initial filtering on the third initial analysis result to obtain a fourth initial analysis result; and the fourth initial analysis result is filtered again according to the change position in the changed data to obtain a second target analysis result. This achieves the goal of locating the real risk introduced by the current code increment, thereby realizing the technical effect of improving the accuracy of problem location in the vehicle's program code.
[0080] In this embodiment of the invention, when analyzing the vehicle's program code, in response to a first analysis request for the modified program code, first encoded data can be received; the received first encoded data can be decoded to obtain first decoded data of the program code; anomaly analysis can be performed on the obtained first decoded data to obtain a first initial analysis result; and the first initial analysis result can be filtered to obtain a first target analysis result, that is, the target anomaly data among multiple anomaly data can be obtained. This achieves the purpose of being able to locate the real risk introduced by the current code increment, thereby solving the technical problem of low accuracy in locating problems in the vehicle's program code, and thus achieving the technical effect of improving the accuracy of locating problems in the vehicle's program code.
[0081] The technical solutions of the embodiments of the present invention will be illustrated below with reference to preferred embodiments.
[0082] Currently, in existing technologies, when reviewing vehicle program code, the entire file is often reviewed. If the file is an old, legacy file with inconsistent code quality, the review results may report dozens or even hundreds of problems. This can prevent code reviewers from focusing on the real risks introduced by the current code increment, resulting in low accuracy in locating problems in the vehicle's program code.
[0083] To address the aforementioned technical problems, this invention proposes a method for analyzing vehicle program code. When analyzing vehicle program code, in response to a first analysis request for modified program code, first encoded data is received. The received first encoded data is decoded to obtain first decoded program code data. Anomaly analysis is performed on the obtained first decoded data to obtain a first initial analysis result. The first initial analysis result is then filtered to obtain a first target analysis result, i.e., the target anomaly data among multiple anomaly data. This achieves the goal of locating the real risk introduced by the current code increment, thus solving the technical problem of low accuracy in locating problems in vehicle program code and improving the accuracy of problem location in vehicle program code.
[0084] In this embodiment, an automated code review system based on line-of-change code can be used to pinpoint the actual risks introduced by the current code increment. For example, Figure 2 This is a schematic diagram of an automated code review system based on lines of code change according to an embodiment of the present invention, such as... Figure 2 As shown, the system 200 may include: an Application Programming Interface (API) module 201, a task processing module 202, a code analysis module 203, a result filtering module 204, a report generation module 205, and a worker thread management module 206.
[0085] The external caller 207 can invoke the automated code review system 200 based on line changes. The API module 201 can receive review tasks and send them to the task processing module 202. The task processing module 202 can preprocess the data in the review tasks, for example, decoding the Base64 encoded file content into source code and sending the source code string to the code analysis module 203. The code analysis module 203 can invoke the static code analysis engine, perform a full analysis of the source code using the system's preset, hierarchical rule set (e.g., mandatoryRules and recommendedRules), obtain the raw analysis results, and send the raw analysis results to the result filtering module 204. The result filtering module 204 can filter the raw analysis results according to the rule ID and line change number. The report generation module 205 can organize the analysis results output by the result filtering module 204 into a structured report. The task processing module 202 can be used to call the worker thread management module 206 to create an independent sub-worker thread when the task type is to scan the entire folder, and delegate the analysis task to it. After the sub-worker thread completes all the work such as analysis and filtering, the final report is sent back to the API module 201 through the message mechanism. This achieves the purpose of avoiding the main thread being occupied for a long time and keeping the system responsive.
[0086] In this embodiment, an automated code review system based on lines of code changes can be used to execute automated code review methods based on lines of code changes, thereby identifying the actual risks introduced by the current code increment. For example, Figure 3 This is a flowchart of an automated code review method based on lines of code change according to an embodiment of the present invention, such as... Figure 3 As shown, the method may include:
[0087] Step S301: Receive review task.
[0088] In the technical solution provided by step S301 of the present invention, this step is performed by the API interface module. This API interface module receives a structured review task request via a network (e.g., HTTP POST). Unlike existing technologies, the core data structure of this task includes the content of the file to be reviewed (e.g., file.content) and an array of line numbers for the change codes associated with the file content (e.g., file.newLineNum). Furthermore, the request may also include a dynamic exclusion rule list (e.g., excludeScanRuleIdList).
[0089] After receiving the review task, proceed to step S302 to determine the type of review task.
[0090] If the type of the review task is determined to be a folder, then proceed to step S303, where the program code is analyzed in a sub-worker thread to obtain the original analysis results.
[0091] If the type of the review task is determined to be code text, then proceed to step S304, where the program code is analyzed in the main thread to obtain the original analysis results.
[0092] In the technical solution provided by step S304 of the present invention, this step is initiated by the task processing module. The task processing module first preprocesses the received data, for example, decoding the Base64 encoded file content into source code strings. Then, the task processing module calls the code analysis module. The code analysis module calls a static code analysis engine and uses a system-preset, hierarchical rule set to perform a full analysis of the source code, obtaining raw analysis results. These raw analysis results may include all problems found in the file and their corresponding line numbers.
[0093] After obtaining the original analysis results, proceed to step S305 to filter the original analysis results according to rule ID and change line number.
[0094] In the technical solution provided by step S305 of the present invention, step S305 is executed by the result filtering module. This result filtering module performs two layers of filtering on the original analysis results generated in steps S303 / S304. The two layers of filtering are a sequential process: First layer (optional): Filtering by dynamic rules; wherein, the original results are traversed, and the rule Id (item.ruleId) of each question is checked to see if it exists in the dynamic exclusion rule column (excludeScanRuleIdList) passed in the request. If it exists, the question is directly discarded. Second layer: Filtering by change line number; wherein, for the questions remaining after the first layer of filtering, its line number (item.line) is checked to see if it exists in the change code line number array (newLineNum) corresponding to the file. Only questions existing in this array are retained.
[0095] After filtering the original analysis results according to the rule ID and the change line number, proceed to step S306 to generate a report from the filtered analysis results and return the report to the main thread.
[0096] In the technical solution provided in step S306 of the present invention, for each remaining issue, the system will look up the corresponding business priority (1 / 2) from the preset mapping table (rulePriorityMap) according to its original severity (error / warn), and assemble it into an issue object containing information such as path, line number, description, rule ID, and priority. Finally, these objects are collected to form a JSON format report, which is returned to the caller through the API interface module.
[0097] For example, the automated code review method based on lines of code change described above can be applied to the following scenario: Developer Xiao Wang modified the chooseEmployee.vue file in his project, changing only lines 24 and 48. After he submits the code, the Continuous Integration / Continuous Delivery (CI / CD) system automatically calls the review service.
[0098] The CI / CD system constructs an HTTP POST request and sends it to the / codeTest interface. After receiving the HTTP POST request, the code analysis module analyzes the content of the decoded chooseEmployee.vue file. Assuming that 5 issues are found, located at lines 10, 24, 30, 48, and 60 respectively, the issue on line 30 is no-console. The original analysis result is: [{line:10}, {line:24}, {line:30, ruleId:'no-console'}, {line:48}, {line:60}].
[0099] The result filtering module 104 performs filtering on the original analysis results. When the first layer of filtering is performed on the original results, it is found that the ruleId of the problem in line 30 is no-console. It exists in the request's excludeScanRuleIdList, so the problem is discarded. The intermediate result after filtering is [{line:10}, {line:24}, {line:48}, {line:60}]. When the second layer of filtering is performed on the original results, the intermediate results are traversed. The problem is in line 10, [24, 48].includes(10) is false, so the problem is discarded. The problem is in line 24, [24, 48].includes(24) is true, so the problem is kept. The problem is in line 48, [24, 48].includes(48) is true, so the problem is kept. The problem is in line 60, [24, 48].includes(60) is false, so the problem is discarded. After two layers of filtering, the first target analysis result is obtained as [{line:24}, {line:48}].
[0100] Finally, the report generation module 105 encapsulates these two issues into a problem list (problemList), assigns priorities based on their severity, and ultimately returns a JSON report containing only the issues on lines 24 and 48. In this embodiment, when analyzing the vehicle's program code, in response to a first analysis request for the modified program code, first encoded data is received; decoding the received first encoded data yields first decoded data of the program code; anomaly analysis is performed on the obtained first decoded data to obtain a first initial analysis result; and filtering the first initial analysis result yields a first target analysis result, that is, the target anomaly data among multiple anomaly data. This achieves the goal of locating the real risk introduced by the current code increment, thus solving the technical problem of low accuracy in locating problems in the vehicle's program code, and ultimately improving the technical effect of improving the accuracy of problem location in the vehicle's program code.
[0101] According to embodiments of the present invention, a vehicle program code analysis apparatus is also provided. It should be noted that this vehicle program code analysis apparatus can be used to execute a vehicle program code analysis method according to one of the embodiments.
[0102] Figure 4 This is a schematic diagram of a vehicle program code analysis device according to an embodiment of the present invention. Figure 4 As shown, the vehicle's program code analysis device 400 may include: a first receiving unit 401, a first decoding unit 402, a first analysis unit 403, and a first filtering unit 404.
[0103] The first receiving unit 401 is configured to receive first encoded data in response to a first analysis request for modified program code, wherein the program code is used to represent the underlying data for implementing the vehicle application, and the first encoded data includes modification data of the program code, the modification data being used to at least represent the modified code content of the program code.
[0104] The first decoding unit 402 is used to decode the first encoded data to obtain the first decoded data of the program code, wherein the first decoded data includes the modified program code.
[0105] The first analysis unit 403 is used to perform anomaly analysis on the first decoded data to obtain a first initial analysis result, wherein the first initial analysis result is used to indicate that there are multiple abnormal data in the modified program code.
[0106] The first filtering unit 404 is used to filter the first initial analysis result to obtain the first target analysis result, wherein the first target analysis result is used to represent the target abnormal data among multiple abnormal data, and the target abnormal data is used to represent the code content as abnormal code content.
[0107] Optionally, the first filtering unit 404 may include: a first determining module, configured to determine the identifier data of each abnormal data in the plurality of abnormal data to obtain a plurality of identifier data, wherein the identifier data is used to identify abnormal data; a second determining module, configured to determine the abnormal data corresponding to the identifier data that is the same as the candidate identifier data in the candidate identifier data table in response to the existence of identifier data that is the same as the candidate identifier data in the plurality of identifier data; a first filtering module, configured to filter out the abnormal data corresponding to the identifier data that is the same as the candidate identifier data from the first initial analysis result to obtain a second initial analysis result, wherein the second initial analysis result is used to represent a plurality of remaining abnormal data in the plurality of abnormal data other than the abnormal data corresponding to the identifier data that is the same as the candidate identifier data; and a second filtering module, configured to filter the second initial analysis result to obtain a first target analysis result.
[0108] Optionally, the second filtering module may include: a first determining submodule, configured to determine the position of each remaining abnormal data in the program code among multiple remaining abnormal data, thereby obtaining multiple positions; a second determining submodule, configured to determine the remaining abnormal data corresponding to the position different from the changed position in the changed data in response to the existence of a position among the multiple positions, wherein the changed position is used to represent the position of the code content in the program code; and a filtering submodule, configured to filter out the remaining abnormal data corresponding to the position different from the changed position from the second initial analysis result, thereby obtaining the first target analysis result.
[0109] Optionally, the vehicle's program code analysis device 400 may include: a determining unit, configured to determine the level information of the target abnormal data corresponding to the first target analysis result, wherein the level information is used to indicate the degree of abnormality of the abnormal code content; a searching unit, configured to search for priority data corresponding to the level information from a priority mapping table, wherein the priority mapping table includes the mapping relationship between different level information and different priority data; and an assembly unit, configured to assemble the priority data, change data, and identification data of the target abnormal data to obtain an analysis report of the target abnormal data.
[0110] Optionally, the first analysis unit 403 may include: an analysis module, used to call the analysis engine to perform full analysis on the first decoded data and obtain the first initial analysis result.
[0111] Optionally, the vehicle's program code analysis device 400 may include: a second receiving unit, configured to receive second encoded data in response to a second analysis request for a folder, wherein the folder is used to store multiple modified program codes, and the second encoded data includes modification data of the multiple program codes; a second decoding unit, configured to invoke a sub-thread to decode the second encoded data to obtain second decoded data, wherein the second decoded data includes the multiple modified program codes; a second analysis unit, configured to invoke a sub-thread to perform anomaly analysis on the second decoded data to obtain a third initial analysis result, wherein the third initial analysis result indicates that each of the multiple modified program codes contains multiple abnormal data; and a second filtering unit, configured to invoke a sub-thread to filter the third initial analysis result to obtain a second target analysis result.
[0112] In this embodiment, a vehicle program code analysis device is provided. The device may include: a first receiving unit, configured to receive first encoded data in response to a first analysis request for modified program code, wherein the program code represents underlying data implementing a vehicle application, and the first encoded data includes modification data of the program code, the modification data at least representing the modified code content; a first decoding unit, configured to decode the first encoded data to obtain first decoded data of the program code, wherein the first decoded data includes the modified program code; a first analysis unit, configured to perform anomaly analysis on the first decoded data to obtain a first initial analysis result, wherein the first initial analysis result indicates that the modified program code contains multiple abnormal data; and a first filtering unit, configured to filter the first initial analysis result to obtain a first target analysis result, wherein the first target analysis result represents a target abnormal data among the multiple abnormal data, the target abnormal data indicating that the code content is abnormal code content. This achieves the goal of locating the real risk introduced by the current code increment, thereby solving the technical problem of low accuracy in locating problems in vehicle program code, and ultimately achieving the technical effect of improving the accuracy of problem location in vehicle program code.
[0113] According to an embodiment of the present invention, a processor is also provided for running a program, wherein the program is executed by the processor to perform the program code analysis method of the vehicle in the embodiment.
[0114] According to embodiments of the present invention, an electronic device is also provided. Figure 5 This is a schematic diagram of an electronic device according to an embodiment of the present invention, such as... Figure 5 As shown, the electronic device 500 may include a memory 510 and a processor 520, wherein the memory 510 is used to store computer programs; and the processor 520 is used to run the programs stored in the memory 510 to implement the vehicle program code analysis method of this application.
[0115] In this application, "multiple" refers to two or more.
[0116] In this application, unless otherwise expressly defined, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0117] The terms “first,” “second,” “third,” “fourth,” etc., in this application (if present) are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0118] In this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, in this application, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0119] Unless otherwise specified, all steps in this application may be performed sequentially or randomly. For example, the vehicle program code analysis method of this application may include steps S101 and S102, indicating that the vehicle program code analysis method of this application may include steps S101 and S102 performed sequentially, or it may include steps S102 and S101 performed sequentially.
[0120] For example, the vehicle program code analysis method of this application may also include step S103, which means that step S103 can be added to the method in any order. For example, the vehicle program code analysis method of this application may include steps S101, S102 and S103, or it may include steps S101, S103 and S102, or it may include steps S103, S101 and S102, etc. This is only an example and is not specifically limited.
[0121] For example, the vehicle program code analysis method of this application may also include step S104, which means that step S104 can be added to the method in any order. For example, the vehicle program code analysis method of this application may include steps S101, S102, S103 and S104, or it may include steps S101, S103, S102 and S104, or it may include steps S104, S103, S101 and S102, etc. This is only an example and is not specifically limited.
[0122] According to another aspect of the present invention, a computer-readable storage medium is also provided. The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform the program code analysis method for the vehicle in the embodiment.
[0123] Computer-readable storage media, also known as computer storage media, may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. These propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable storage media can transmit, propagate, or transfer programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0124] The program code contained in a computer-readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, radio frequency, or any suitable combination thereof.
[0125] According to an embodiment of the present invention, a computer program product is also provided, the computer program product including a computer program, wherein the computer program, when executed by a processor, implements the program code analysis method for the vehicle in the embodiment.
[0126] According to an embodiment of the present invention, a computer program product is also provided, including a non-volatile computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the program code analysis method for the vehicle in the embodiment.
[0127] According to an embodiment of the present invention, a computer program is also provided, which, when executed by a processor, implements the program code analysis method for the vehicle in the embodiment.
[0128] Optionally, when the above-mentioned computer program is executed by the processor, the program code implements the following steps: in response to a first analysis request for the modified program code, receiving first encoded data, wherein the program code is used to represent the underlying data implementing the vehicle application, the first encoded data includes modification data of the program code, and the modification data is used to at least represent the modified code content of the program code; decoding the first encoded data to obtain first decoded data of the program code, wherein the first decoded data includes the modified program code; performing anomaly analysis on the first decoded data to obtain a first initial analysis result, wherein the first initial analysis result is used to indicate that the modified program code contains multiple abnormal data; filtering the first initial analysis result to obtain a first target analysis result, wherein the first target analysis result is used to represent the target abnormal data among the multiple abnormal data, and the target abnormal data is used to indicate that the code content is abnormal code content.
[0129] Optionally, when the above-mentioned computer program is executed by the processor, the program code implements the following steps: determining the identifier data of each abnormal data in a plurality of abnormal data to obtain a plurality of identifier data, wherein the identifier data is used to identify abnormal data; in response to the existence of identifier data in the plurality of identifier data that is the same as candidate identifier data in the candidate identifier data table, determining the abnormal data corresponding to the identifier data that is the same as candidate identifier data; filtering out the abnormal data corresponding to the identifier data that is the same as candidate identifier data from the first initial analysis result to obtain a second initial analysis result, wherein the second initial analysis result is used to represent the plurality of remaining abnormal data in the plurality of abnormal data, excluding the abnormal data corresponding to the identifier data that is the same as candidate identifier data; filtering the second initial analysis result to obtain a first target analysis result.
[0130] Optionally, when the above computer program is executed by the processor, the program code implements the following steps: determining the position of each remaining abnormal data in the program code among multiple remaining abnormal data, obtaining multiple positions; in response to the existence of a position among the multiple positions that is different from the changed position in the changed data, determining the remaining abnormal data corresponding to the position that is different from the changed position, wherein the changed position is used to represent the position of the code content in the program code; filtering out the remaining abnormal data corresponding to the position that is different from the changed position from the second initial analysis result, obtaining the first target analysis result.
[0131] Optionally, when the above computer program is executed by the processor, the program code implements the following steps: determining the level information of the target abnormal data corresponding to the first target analysis result, wherein the level information is used to indicate the degree of abnormality of the abnormal code content; searching for priority data corresponding to the level information from the priority mapping table, wherein the priority mapping table includes the mapping relationship between different level information and different priority data; assembling the priority data, change data and the identification data of the target abnormal data to obtain the analysis report of the target abnormal data.
[0132] Optionally, when the above computer program is executed by the processor, the program code implements the following steps: calling the analysis engine to perform a full analysis on the first decoded data and obtain the first initial analysis result.
[0133] Optionally, when the above-mentioned computer program is executed by the processor, the program code implements the following steps: in response to a second analysis request for a folder, receiving second encoded data, wherein the folder is used to store multiple modified program codes, and the second encoded data includes modification data of the multiple program codes; calling a sub-thread to decode the second encoded data to obtain second decoded data, wherein the second decoded data includes the multiple modified program codes; calling a sub-thread to perform anomaly analysis on the second decoded data to obtain a third initial analysis result, wherein the third initial analysis result is used to indicate that each of the multiple modified program codes contains multiple abnormal data; calling a sub-thread to filter the third initial analysis result to obtain a second target analysis result.
[0134] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0135] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0136] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.
[0137] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0138] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0139] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to related technologies, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0140] The above are merely preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for analyzing vehicle program code, characterized in that, include: In response to a first analysis request for modified program code, first encoded data is received, wherein the program code is used to represent underlying data implementing a vehicle application, and the first encoded data includes modification data of the program code, the modification data being used to at least represent the modified code content of the program code; The first encoded data is decoded to obtain the first decoded data of the program code, wherein the first decoded data includes the modified program code; Anomaly analysis is performed on the first decoded data to obtain a first initial analysis result, wherein the first initial analysis result is used to indicate that the modified program code contains multiple abnormal data; The first initial analysis result is filtered to obtain a first target analysis result, wherein the first target analysis result is used to represent the target abnormal data among the plurality of abnormal data, and the target abnormal data is used to represent the code content as abnormal code content.
2. The method according to claim 1, characterized in that, The first initial analysis result is filtered to obtain the first target analysis result, including: Each of the plurality of abnormal data is identified by a unique identifier, resulting in a plurality of identifiers, wherein the identifiers are used to identify the abnormal data. In response to the presence of identification data in the plurality of identification data that is identical to candidate identification data in the candidate identification data table, abnormal data corresponding to the identification data that is identical to the candidate identification data is determined; From the first initial analysis result, the abnormal data corresponding to the identifier data that is the same as the candidate identifier data is filtered out to obtain the second initial analysis result, wherein the second initial analysis result is used to represent the multiple remaining abnormal data among the multiple abnormal data, excluding the abnormal data corresponding to the identifier data that is the same as the candidate identifier data; The second initial analysis result is filtered to obtain the first target analysis result.
3. The method according to claim 2, characterized in that, The second initial analysis result is filtered to obtain the first target analysis result, including: The position of each remaining abnormal data in the program code is determined, resulting in multiple positions; In response to the existence of a location among the plurality of locations that differs from the changed location in the changed data, the remaining abnormal data corresponding to the location that differs from the changed location is determined, wherein the changed location is used to indicate the position of the code content in the program code; From the second initial analysis result, the remaining abnormal data corresponding to the position that is different from the changed position are filtered out to obtain the first target analysis result.
4. The method according to claim 1, characterized in that, The method further includes: Determine the level information of the target anomaly data corresponding to the first target analysis result, wherein the level information is used to indicate the degree of anomaly of the anomaly code content; From the priority mapping table, find the priority data corresponding to the level information, wherein the priority mapping table includes the mapping relationship between different level information and different priority data; The priority data, the change data, and the identification data of the target anomaly data are assembled to obtain an analysis report of the target anomaly data.
5. The method according to claim 1, characterized in that, Anomaly analysis is performed on the first decoded data to obtain a first initial analysis result, including: The analysis engine is invoked to perform a full analysis of the first decoded data, and the first initial analysis result is obtained.
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: In response to a second analysis request for a folder, second encoded data is received, wherein the folder is used to store multiple program codes that have been modified, and the second encoded data includes modification data of the multiple program codes; A sub-thread is invoked to decode the second encoded data to obtain second decoded data, wherein the second decoded data includes the modified plurality of program codes; The sub-thread is invoked to perform anomaly analysis on the second decoded data to obtain a third initial analysis result, wherein the third initial analysis result is used to indicate that each of the multiple program codes that have undergone changes contains multiple abnormal data. The sub-thread is invoked to filter the third initial analysis result to obtain the second target analysis result.
7. A vehicle code analysis device, characterized in that, include: The first receiving unit is configured to receive first encoded data in response to a first analysis request for modified program code, wherein the program code is used to represent the underlying data for implementing a vehicle application, and the first encoded data includes modification data of the program code, wherein the modification data is used to at least represent the modified code content of the program code. A first decoding unit is configured to decode the first encoded data to obtain first decoded data of the program code, wherein the first decoded data includes the modified program code; The first analysis unit is used to perform anomaly analysis on the first decoded data to obtain a first initial analysis result, wherein the first initial analysis result is used to indicate that the modified program code contains multiple abnormal data. A first filtering unit is used to filter the first initial analysis result to obtain a first target analysis result, wherein the first target analysis result is used to represent the target abnormal data among the plurality of abnormal data, and the target abnormal data is used to represent the code content as abnormal code content.
8. A processor, characterized in that, The processor is used to run a program, wherein the program is executed by the processor to perform the program code analysis method for the vehicle according to any one of claims 1 to 6.
9. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, executes the program code analysis method for the vehicle according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the storage medium is located to execute the program code analysis method for the vehicle according to any one of claims 1 to 6.