A method and device for locating a compilation error, an electronic device and a storage medium
By extracting error information from build logs and using large-scale model analysis, combined with code modification content, the commit information and responsible party for compilation errors are automatically located, solving the problem of time-consuming manual analysis and achieving fast and efficient compilation error location and repair.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG GEELY HLDG GRP CO LTD
- Filing Date
- 2026-04-24
- Publication Date
- 2026-07-21
AI Technical Summary
In large-scale software engineering and multi-repository parallel development scenarios, manually analyzing compilation logs and code commit records to locate compilation errors is time-consuming and difficult to do quickly and accurately, resulting in extended problem-solving cycles and impacting software integration efficiency and version delivery schedules.
By extracting error information from build logs, analyzing it using a large model, determining the location of the error, and correlating it with code modifications, the system can automatically pinpoint the target commit message and the person who made the commit that caused the compilation error.
It automates the process from compilation failure to identifying the responsible party, quickly pinpointing compilation errors and their source submissions, reducing manual analysis time, improving problem location efficiency, and shortening the repair cycle.
Smart Images

Figure CN122431679A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software development technology, and more specifically, to a method, apparatus, electronic device, and storage medium for locating compilation errors. Background Technology
[0002] When a compilation error occurs in the build system, the continuous integration pipeline typically outputs build logs, which are then manually reviewed by developers or integrators. Based on the error messages in the logs, the faulty file or module is located. Then, by combining this information with the commit records in the version control system, the code commits that may have caused the problem are gradually investigated, and finally, the person who committed the error is located and fixed.
[0003] However, the current method of locating compilation errors and their corresponding error submissions mainly relies on manual analysis of build logs and manual inspection of code commit records. In large-scale software engineering and multi-repository parallel development scenarios, the build log information is large, the error types are diverse, and the error information is scattered in a large number of log texts. Manual analysis is difficult and time-consuming, usually requiring several hours or even longer to locate the specific problem submission. Moreover, when multiple developers frequently submit code in the same period, it is difficult to quickly and accurately establish the correlation between error logs and code submissions, which can easily lead to inaccurate location or omission of problem submissions, resulting in a longer problem repair cycle and affecting software integration efficiency and version delivery schedule. Summary of the Invention
[0004] The problem addressed by this invention is how to improve the efficiency of compiler error location.
[0005] To address the above problems, the present invention provides a method, apparatus, electronic device, and storage medium for locating compilation errors.
[0006] In a first aspect, the present invention provides a method for locating compilation errors, comprising: Error information is extracted from the build logs, and the large model is called to analyze the error information to determine the location of the error; The error location is correlated with the code modification content to determine the target commit information that caused the compilation error; The corresponding submitter information is determined based on the target submission information.
[0007] Optionally, extracting error information from the build log includes: Analyze the build logs to locate the error log segments corresponding to compilation failures; The error information is generated by extracting error keywords, error file paths, and error type information from the error log paragraphs.
[0008] Optionally, the step of calling the large model to analyze the error information to determine the error location includes: The error message is input into a preset prompt word template to generate input content for large model analysis; The large model performs semantic understanding on the input content and outputs the corresponding error file location or error code location as the error location.
[0009] Optionally, the semantic understanding of the input content using a large model includes: The error information is matched with a pre-built compilation error knowledge base to obtain candidate error types; The candidate error types are input as contextual information into the large model for semantic understanding.
[0010] Optionally, the step of correlating the error location with the code modification content to determine the target commit information causing the compilation error includes: Get the code commit records within a preset time range before the build failure time, and extract the list of modified files and the modified content corresponding to each code commit record; The file path or keyword corresponding to the error location is matched with the list of modified files and the modified content to determine candidate submission information, and the target submission information is determined based on the candidate submission information.
[0011] Optionally, determining the target submission information based on the candidate submission information includes: Determine the correlation between each candidate submission and the error location, the correlation being determined based on at least one of file path matching degree, keyword matching degree, and code modification location matching degree; Select the candidate commit message with the highest relevance as the target commit message that causes the compilation error.
[0012] Optionally, determining the corresponding submitter information based on the target submission information includes: Extract the submission identifier information from the target submission information, and query the version management system based on the submission identifier information; The corresponding submitter's account information and contact information are obtained from the version control system as the submitter information.
[0013] Secondly, the present invention provides a compiler error location device, comprising: The first module is used to extract error information from the build logs and call the large model to analyze the error information to determine the error location; The second module is used to perform correlation analysis between the error location and the code modification content to determine the target commit information that caused the compilation error; The third module is used to determine the corresponding submitter information based on the target submission information.
[0014] Thirdly, the present invention provides an electronic device, including a memory and a processor; The memory is used to store computer programs; The processor is configured to implement the compiler error location method as described in the first aspect when executing the computer program.
[0015] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the compilation error location method as described in the first aspect.
[0016] The beneficial effects of the compilation error localization method of the present invention are as follows: by extracting error information from the build log and analyzing the error information using a large model to determine the error location, and then performing correlation analysis between the error location and the code modification content to determine the target commit information that caused the compilation error, and further determining the corresponding committer information, the method realizes the automated processing process from compilation failure to locating the responsible party. This enables the rapid location of compilation errors and their source commits in complex software build environments, reduces the time spent on manual log analysis and code investigation, improves problem localization efficiency, and shortens the problem repair cycle. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the compilation error localization method according to an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the principle of the compilation error localization method according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the process for extracting error information according to an embodiment of the present invention; Figure 4 This is a flowchart illustrating the process of determining the error location according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the semantic understanding process according to an embodiment of the present invention; Figure 6 This is a schematic diagram of the process for determining target submission information according to an embodiment of the present invention; Figure 7 This is a schematic diagram illustrating the specific process of determining target submission information in an embodiment of the present invention; Figure 8 This is a schematic diagram of the process for determining the information of the submitting personnel in an embodiment of the present invention; Figure 9 This is a system architecture diagram of the compiler error location device according to an embodiment of the present invention; Figure 10This is a system architecture diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0018] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Although some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the accompanying drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0019] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0020] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to"; the term "based on" means "at least partially based on"; the term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments"; and the term "optionally" means "optional embodiments". Definitions of other terms will be given in the following description. It should be noted that the concepts of "first," "second," etc., mentioned in this invention are used only to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.
[0021] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0022] The names of the messages or information exchanged between the multiple devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0023] like Figure 1 As shown, an embodiment of the present invention provides a method for locating compilation errors, including: S100: Extract error information from the build logs and call the large model to analyze the error information to determine the error location.
[0024] Specifically, in combination Figure 2As shown, the continuous integration pipeline automatically generates build log files after a build failure. The integration management platform pulls the build logs through an interface. The build logs can be in text format (e.g., log files). The platform scans the logs for key fields such as "error" and "failure" using preset rules (e.g., regular expressions) to extract the corresponding error information, such as "a header file is missing" or "a dependency file is missing," and records the corresponding file path and context. Then, the extracted error information is input into a preset prompt word template, such as: "Please analyze the following compilation error log and indicate the error file and possible error location." Subsequently, a large model (e.g., a general language model) is called to perform semantic analysis and output the error location results.
[0025] S200: Perform correlation analysis between the error location and the code modification content to determine the target commit information that caused the compilation error.
[0026] Specifically, in combination Figure 2 As shown, code commit records within a certain period before the build failure are obtained from the code version control system, and the code modification content corresponding to each commit is extracted. The file path or keyword corresponding to the error location is matched with the modification content of each commit. For example, the deletion or modification operation of the error file in a certain commit is identified, thereby determining the candidate commit information and further determining it as the target commit information that caused the compilation error.
[0027] S300: Determine the corresponding submitter information based on the target submission information.
[0028] Specifically, in combination Figure 2 As shown, based on the target submission information, the corresponding submission record is queried from the version control system, and the submitter's username, email, and other information are extracted as the submitter information for subsequent issue notifications. For example, error-related information and the target submission information that caused the error can be sent to the submitter's R&D WeChat account, Lark, etc.
[0029] In this embodiment, error information is extracted from the build log and analyzed using a large model to determine the error location. Then, the error location is correlated with the code modification content to determine the target commit information that caused the compilation error, and further, the corresponding committer information is determined. This realizes an automated process from compilation failure to locating the responsible party. As a result, compilation errors and their source commits can be quickly located in complex software build environments, reducing the time spent on manual log analysis and code investigation, improving the efficiency of problem location, and shortening the problem repair cycle.
[0030] Optionally, extracting error information from the build log includes: S110: Parse the build log and locate the error log segment corresponding to the compilation failure. Specifically, in combination Figure 3 As shown, the build log is parsed to locate the error log segment corresponding to the compilation failure. For example, in the build log, the line containing the keyword "error" is located, and several lines are extended upwards and downwards to extract the complete error context segment.
[0031] S120: Extract error keywords, error file paths, and error type information from the error log paragraphs to form the error information.
[0032] Specifically, error keywords (e.g., fatal error), error file paths (e.g., xxx.h), and error type information (e.g., missing header file) are extracted from error log segments to form structured error information.
[0033] Common error types include missing symbol tables, missing dependency files, code, artifacts, and other server errors, script errors, and insufficient server resources.
[0034] In this optional embodiment, by parsing the build log and locating the error log segment, and extracting error keywords, error file paths and error type information from the error log segment, the original unstructured log data can be transformed into structured error information, thereby providing accurate input for subsequent large model analysis, reducing interference from irrelevant information, and improving the accuracy of error identification and processing efficiency.
[0035] Optionally, the step of calling the large model to analyze the error information to determine the error location includes: S130: Input the error message into a preset prompt word template to generate input content for large model analysis. Specifically, in combination Figure 4 As shown, the extracted error information is filled into a preset prompt word template. For example, the preset prompt word template can be "Analyze the cause and location of the error based on the following error information" to generate input content for large model analysis.
[0036] S140: Perform semantic understanding on the input content using a large model, and output the corresponding error file location or error code location as the error location.
[0037] Specifically, the large model performs semantic understanding on the input content and outputs the error file path or code location, such as locating a specific file in a certain module, thereby determining the error location.
[0038] In this optional embodiment, by generating standardized input content by inputting error information into a preset prompt word template, and using a large model for semantic understanding to output the error location, it is possible to analyze multiple types of compilation errors based on a unified format, thereby improving the generalization ability and accuracy of error location, and avoiding the dependence of traditional rule matching methods on fixed error formats.
[0039] Optionally, the semantic understanding of the input content using a large model includes: S141: Match the error information with a pre-built compilation error knowledge base to obtain candidate error types. Specifically, in combination Figure 5 As shown, a compilation error knowledge base is pre-built, which includes common error types and their corresponding characteristics, such as "file does not exist, corresponding to missing dependency files" and "symbol undefined, corresponding to linking error". The error information is matched with the knowledge base to obtain candidate error types.
[0040] S142: Input the candidate error types as contextual information into the large model for semantic understanding.
[0041] Specifically, candidate error types are added with prompts, such as "This error may be due to 'missing header file,' please analyze the specific location further," to improve the accuracy of the analysis.
[0042] In this optional embodiment, candidate error types are obtained by matching error information with a pre-built compilation error knowledge base, and the candidate error types are input into the large model as context information. This allows the large model to combine existing experience and knowledge during the analysis process, thereby improving the ability to identify error types and the accuracy of error location judgment, and enhancing the system's analytical capabilities in complex error scenarios.
[0043] Optionally, the step of correlating the error location with the code modification content to determine the target commit information causing the compilation error includes: S210: Obtain code commit records within a preset time range prior to the build failure time, and extract the list of modified files and their contents corresponding to each code commit record. Specifically, in combination Figure 6 As shown, it retrieves code commit records within a preset time range (e.g., 24 hours) before the build failure time, and extracts the list of modified files and their contents corresponding to each code commit record.
[0044] S220: Match the file path or keyword corresponding to the error location with the list of modified files and the modified content to determine candidate submission information, and determine the target submission information based on the candidate submission information.
[0045] Specifically, the file path or keyword corresponding to the error location is compared with the list of modified files and the modified content. For example, it can identify whether a certain commit involves the modification or deletion of the file with the error, thereby determining the candidate commit information and thus determining the target commit information.
[0046] In this optional embodiment, by obtaining code commit records within a preset time range and extracting the list of modified files and their modified content, and then matching the file path or keywords corresponding to the error location with the modified content, it is possible to quickly filter out candidate commits related to the error from a large number of code commits, thereby narrowing down the scope of problem location and improving location efficiency.
[0047] Optionally, determining the target submission information based on the candidate submission information includes: S221: Determine the correlation between each candidate submission and the error location, the correlation being determined based on at least one of file path matching degree, keyword matching degree, and code modification location matching degree. Specifically, in combination Figure 7 As shown, the correlation between each candidate submission and the error location is calculated. For example, "file path matching degree: weight 0.6", "keyword matching degree: weight 0.3", and "modification location matching degree: weight 0.1". If the file path modified by the candidate submission is the same as the file path corresponding to the error location, the file path matching degree is high. If they are only files in the same directory, the file path matching degree is medium. If there is no path association, the value is low. If the modification content of the candidate submission contains the same keyword as the error message, the keyword matching degree is increased. If the modification location of the candidate submission is close to the code location indicated in the error log, the modification location matching degree is increased. The file path matching degree, keyword matching degree, and modification location matching degree are weighted and summed to obtain the correlation degree corresponding to each candidate submission.
[0048] S222: Select the candidate commit message with the highest relevance as the target commit message that causes the compilation error.
[0049] Specifically, the submission with the highest score is selected. For example, if commit A scores 0.9, it is the highest score among all candidate submissions and is therefore identified as the target submission.
[0050] In this optional embodiment, by calculating the correlation between candidate submission information and error location, and selecting the most relevant submission as the target submission information based on the correlation, the system can automatically determine the submission information most likely to cause the error among multiple candidate submission information, thereby improving the accuracy of the location results and avoiding the subjectivity and uncertainty brought about by manual judgment.
[0051] Optionally, determining the corresponding submitter information based on the target submission information includes: S310: Extract the submission identifier information from the target submission information, and query the version management system based on the submission identifier information. Specifically, in combination Figure 8 As shown, based on the commit identifier information in the target commit information, the corresponding commit record is queried in the version control system to obtain the basic information of the committer.
[0052] S320: Obtain the corresponding submitter account information and contact information from the version management system as the submitter information.
[0053] Specifically, the system extracts the account information and contact details of the submitting personnel, such as their WeChat accounts, to generate error notification messages and send them to the corresponding personnel.
[0054] In this optional embodiment, by extracting the submission identifier information from the target submission information and querying the version management system to obtain the corresponding submitter's account information and contact information, the system can automatically locate the responsible developer, thereby achieving rapid feedback and closed-loop processing of the problem, improving collaboration efficiency and shortening the problem handling time.
[0055] like Figure 9 As shown, an embodiment of the present invention provides a compiler error location device 900, comprising: The first module 910 is used to extract error information from the build log and call the large model to analyze the error information to determine the error location; The second module 920 is used to perform correlation analysis between the error location and the code modification content to determine the target commit information that caused the compilation error; The third module 930 is used to determine the corresponding submitter information based on the target submission information.
[0056] like Figure 10 As shown, an electronic device 1000 provided in this embodiment of the invention includes a memory 1020 and a processor 1010; the memory 1020 is used to store a computer program; the processor 1010 is used to implement the compilation error location method as described above when the computer program is executed.
[0057] Alternatively, an electronic device 1000 includes a memory 1020 and a processor 1010 coupled to the memory 1020; the memory 1020 is configured to store a computer program; the processor 1010 is configured to perform the following operations when the computer program is executed: Error information is extracted from the build logs, and the large model is called to analyze the error information to determine the location of the error; The error location is correlated with the code modification content to determine the target commit information that caused the compilation error; The corresponding submitter information is determined based on the target submission information.
[0058] This invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the compilation error location method described above.
[0059] Alternatively, a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the following operations: Error information is extracted from the build logs, and the large model is called to analyze the error information to determine the location of the error; The error location is correlated with the code modification content to determine the target commit information that caused the compilation error; The corresponding submitter information is determined based on the target submission information.
[0060] The present invention will now be described an electronic device 1000 that can serve as a server or client of the present invention, which is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device 1000 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device 1000 can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0061] Electronic device 1000 includes a computing unit that can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) or a computer program loaded from a storage unit into random access memory (RAM). The RAM may also store various programs and data required for device operation. The computing unit, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0062] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. In this application, 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 network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention according to actual needs. 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 units can be implemented in hardware or as software functional units.
[0063] While the present invention has been disclosed above, its scope of protection is not limited thereto. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, and all such changes and modifications will fall within the scope of protection of the present invention.
Claims
1. A method for locating compiler errors, characterized in that, include: Error information is extracted from the build logs, and the large model is called to analyze the error information to determine the location of the error; The error location is correlated with the code modification content to determine the target commit information that caused the compilation error; The corresponding submitter information is determined based on the target submission information.
2. The compilation error localization method according to claim 1, characterized in that, The extraction of error information from the build log includes: Analyze the build logs to locate the error log segments corresponding to compilation failures; The error information is generated by extracting error keywords, error file paths, and error type information from the error log paragraphs.
3. The compilation error localization method according to claim 1, characterized in that, The process of calling the large model to analyze the error information and determine the error location includes: The error message is input into a preset prompt word template to generate input content for large model analysis; The large model performs semantic understanding on the input content and outputs the corresponding error file location or error code location as the error location.
4. The compilation error localization method according to claim 3, characterized in that, The semantic understanding of the input content through a large model includes: The error information is matched with a pre-built compilation error knowledge base to obtain candidate error types; The candidate error types are input as contextual information into the large model for semantic understanding.
5. The compilation error localization method according to claim 1, characterized in that, The step of correlating the error location with the code modification content to determine the target commit information that caused the compilation error includes: Get the code commit records within a preset time range before the build failure time, and extract the list of modified files and the modified content corresponding to each code commit record; The file path or keyword corresponding to the error location is matched with the list of modified files and the modified content to determine candidate submission information, and the target submission information is determined based on the candidate submission information.
6. The compilation error localization method according to claim 5, characterized in that, Determining the target submission information based on the candidate submission information includes: Determine the correlation between each candidate submission and the error location, the correlation being determined based on at least one of file path matching degree, keyword matching degree, and code modification location matching degree; Select the candidate commit message with the highest relevance as the target commit message that causes the compilation error.
7. The compilation error localization method according to claim 1, characterized in that, The step of determining the corresponding submitter information based on the target submission information includes: Extract the submission identifier information from the target submission information, and query the version management system based on the submission identifier information; The corresponding submitter's account information and contact information are obtained from the version control system as the submitter information.
8. A compiler error location device, characterized in that, include: The first module is used to extract error information from the build logs and call the large model to analyze the error information to determine the error location; The second module is used to perform correlation analysis between the error location and the code modification content to determine the target commit information that caused the compilation error; The third module is used to determine the corresponding submitter information based on the target submission information.
9. An electronic device, characterized in that, Including memory and processor; The memory is used to store computer programs; The processor is configured to implement the compiler error location method as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the compilation error location method as described in any one of claims 1 to 7.