Software package construction error analysis method and device, equipment and medium

Through the combination of vector distance chunking and large language model, the error log blocks of software packages are automatically analyzed in the process of migrating the software package to the RISC-V architecture, solving the problem of inefficient error analysis in the existing technology and achieving more efficient error cause determination.

CN119847807APending Publication Date: 2025-04-18INST OF SOFTWARE - CHINESE ACAD OF SCI
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510325161.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The prior art error analysis is inefficient during the migration of software packages to RISC-V architecture, and relies on manual analysis to be time-consuming and labor-intensive.

Method used

By obtaining the log data of the target software package, using a combination of vector distance chunking and large language model, the error log blocks are automatically identified and analyzed to determine the cause of the error.

Benefits of technology

It improves the efficiency of determining the cause of errors during software package migration, and reduces the time and labor cost of manual analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119847807A_ABST
    Figure CN119847807A_ABST
Patent Text Reader

Abstract

The invention provides a software package construction error analysis method and device, equipment and a medium, and relates to the technical field of artificial intelligence, and the method comprises the following steps: obtaining log data migrated from a target software package to an RISC-V architecture; partitioning the log data based on the vector distance between the log lines, and determining a plurality of error log blocks containing error information from a plurality of obtained log blocks; and determining the error reason of each error log block based on the knowledge base and the large language model. According to the method, the big language model is guided to perform preliminary classification through the thinking chain, and then the big language model is guided to perform deep analysis on the error log blocks of each error category, so that the automatic determination process of the error reasons is realized, and the efficiency of determining the error reasons is improved. The error cause determination process is realized based on preliminary classification and further analysis, so that attention can be focused on a specific error category, the error cause can be positioned more quickly, and the efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method, device, equipment and medium for analyzing software package construction errors. Background Art

[0002] RISC-V is an open source instruction set architecture. Migrating a software package to the RISC-V architecture means modifying and optimizing a software package that was originally developed based on other instruction set architectures so that it can run on RISC-V hardware. Errors often occur during the construction of software packages in the RISC-V architecture. These errors are often related to the characteristics of the RISC-V architecture, such as instruction set differences and hardware compatibility.

[0003] Existing software package migration errors mainly rely on manual analysis and repair by professionals, which not only consumes a lot of time and manpower, but is also inefficient, time-consuming and labor-intensive. Summary of the invention

[0004] The present invention provides a software package construction error analysis method, device, equipment and medium, which are used to improve the efficiency of determining the cause of the error during the migration of the software package to the RISC-V architecture.

[0005] The present invention provides a method for analyzing software package construction errors, comprising the following steps: Obtain log data of the target software package migration to the RISC-V architecture; Based on the vector distance between each log line in the log data, the log data is divided into blocks to obtain a plurality of log blocks, and a plurality of error log blocks containing error information are determined from the plurality of log blocks; Determine the error cause of each error log block based on the pre-built thought chain and large language model; Among them, the thinking chain is used to guide the large language model to determine the error category of each error log block, and guide the large language model to determine the error cause of each error log block in the migration process according to the error category based on a pre-built knowledge base. The knowledge base is determined according to multiple error handling information of the RISC-V architecture migration process, and the error handling information includes error log file information, error repair information and error cause.

[0006] According to a method for analyzing software package building errors provided by the present invention, the step of determining a plurality of error log blocks containing error information from the plurality of log blocks comprises: Based on the error recognition model, error recognition is performed on each log block respectively to determine a plurality of error log blocks containing error information, wherein the error recognition model is determined based on log samples and error information labels corresponding to the log samples.

[0007] According to a method for analyzing software package building errors provided by the present invention, before dividing the log data into blocks based on the vector distance between log lines in the log data, the method further includes: The log data is filtered based on a filter, wherein the filter is based on a regular expression matching method and identifies and deletes invalid data in the log data according to a preset invalid log template.

[0008] According to a method for analyzing software package building errors provided by the present invention, the log data is divided into blocks based on the vector distance between each log line in the log data to obtain multiple log blocks, including: Performing vectorized representation on each log line in the log data, and determining the vector distance between the log lines based on the vectorized representation between the log lines; The log data is divided into blocks based on the vector distances between the log lines to obtain a plurality of log blocks.

[0009] According to a method for analyzing software package building errors provided by the present invention, after determining the error cause of each error log block, the method further includes: Based on the large language model and the knowledge base, repair recommendation information of the error cause is determined, and based on the repair recommendation information, a repair process of the target software package is executed.

[0010] According to a method for analyzing software package building errors provided by the present invention, after executing the repair process of the target software package based on the repair recommendation information, the method further includes: Obtain error handling information during the repair process of the target software package, and update the knowledge base based on the error handling information.

[0011] The present invention also provides a software package construction error analysis device, comprising the following modules: A data acquisition module is used to obtain log data of the target software package migration to the RISC-V architecture; A block division module, configured to divide the log data into blocks based on the vector distance between each log line in the log data to obtain a plurality of log blocks, and determine a plurality of error log blocks containing error information from the plurality of log blocks; An error cause determination module is used to determine the error cause of each error log block based on a pre-built thought chain and a large language model; Among them, the thinking chain is used to guide the large language model to determine the error category of each error log block, and guide the large language model to determine the error cause of each error log block in the migration process according to the error category based on a pre-built knowledge base. The knowledge base is determined according to multiple error handling information of the RISC-V architecture migration process, and the error handling information includes error log file information, error repair information and error cause.

[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, any of the software package building error analysis methods described above is implemented.

[0013] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for analyzing software package building errors as described above is implemented.

[0014] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned software package building error analysis methods.

[0015] The software package construction error analysis method, device, equipment and medium provided by the present invention guides the large language model to perform preliminary classification first through a pre-constructed thinking chain to determine the error category of the error log block, and then guides the large language model to perform in-depth analysis on the error log blocks of each error category based on the pre-constructed knowledge base to determine the error cause of each error log block in the migration process, thereby realizing the automatic determination process of the error cause and improving the efficiency of determining the error cause. Based on the preliminary classification and further analysis to realize the determination process of the error cause, attention can be focused on a specific error category, the error cause can be located more quickly, and the efficiency of determining the error cause can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 It is a flow chart of the software package building error analysis method provided by the present invention.

[0018] Figure 2 It is a schematic diagram of the execution flow provided by the present invention.

[0019] Figure 3It is a schematic diagram of the error cause determination process provided by the present invention.

[0020] Figure 4 It is a structural schematic diagram of the root cause analysis system provided by the present invention.

[0021] Figure 5 The present invention is a schematic diagram of the use process of the root cause analysis system.

[0022] Figure 6 It is a schematic diagram of structured output display provided by the present invention.

[0023] Figure 7 It is a schematic diagram of the repair process of the root cause analysis module provided by the present invention.

[0024] Figure 8 It is a structural schematic diagram of a software package construction error analysis device provided by the present invention.

[0025] Fig. 9 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] Since its launch, RISC-V has quickly gained popularity due to its advantages such as openness, stability, modularity and scalability. However, there are many challenges in migrating mainstream software packages to the RISC-V architecture. Errors frequently occur during the construction of software packages, which are often related to the characteristics of the RISC-V architecture, such as instruction set differences and hardware compatibility.

[0028] Related methods for software package migration mainly rely on manual analysis and repair by professional R&D personnel, which not only consumes a lot of time and manpower, but is also inefficient, time-consuming and labor-intensive.

[0029] Specifically, R&D personnel mainly fix build errors based on the error log information generated during the software package build process. The process of parsing the error log faces the following difficulties, resulting in low processing efficiency. The specific difficulties are mainly: Software package build error files are large and contain a lot of information: Software package builds contain many types of files (spec, patch, log, etc.), which are difficult to interpret. The error log alone can reach tens of MB, and the related repair materials can reach hundreds of MB; Difficulty in automated parsing of log files: The build log formats of different software packages vary. Build logs are unstructured logs with complex formats and no unified identifiers. The log contains a large amount of error information, making it difficult to locate key errors: There are multiple different error messages in a log file, the location of key error information is uncertain, and the relationship between errors is unclear; Moreover, after locating the key error information, how to correctly fix the build error is also a big problem. The software package building process is divided into nine stages, and build errors mainly occur in the following four stages, namely, the prep stage, the build stage, the check stage, and the install stage. In each stage, build errors may occur.

[0030] Finally, the process of repairing software packages often requires R&D personnel to have cross-domain expertise. This is because software package problems may originate from different levels, including but not limited to the understanding of hardware architecture, the application of compilation principles, and the proficiency of programming languages. R&D personnel must have a certain understanding and in-depth research in these areas in order to accurately diagnose problems and develop effective repair strategies. Specifically, repair personnel need to obtain detailed error information from a variety of different information sources (build logs, spec configuration files, patch files, system configuration information, etc.) before they can try to repair the errors. Therefore, the efficiency of error repair during the migration of software packages to the RISC-V architecture is low.

[0031] In view of the defects of the related methods, the present invention provides a method for analyzing software package construction errors. Figure 1 FIG. 1 is a flow chart of a method for analyzing software package building errors provided by the present invention. Figure 1 As shown, the method includes the following: Step 110, obtaining log data of the target software package migration to the RISC-V architecture; Step 120, based on the vector distance between each log line in the log data, the log data is divided into blocks to obtain a plurality of log blocks, and a plurality of error log blocks containing error information are determined from the plurality of log blocks; Step 130, determining the error cause of each error log block based on the pre-built thought chain and the large language model; Among them, the thinking chain is used to guide the large language model to determine the error category of each error log block, and guide the large language model to determine the error cause of each error log block in the migration process according to the error category based on a pre-built knowledge base. The knowledge base is determined according to multiple error handling information of the RISC-V architecture migration process, and the error handling information includes error log file information, error repair information and error cause.

[0032] The execution subject of the software package construction error analysis method provided by the present invention can be an electronic device, a component in an electronic device, an integrated circuit, or a chip. The electronic device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a notebook computer, a palmtop computer, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (NAS), or a personal computer (PC), etc., which is not specifically limited by the present invention.

[0033] The following takes the method for analyzing software package building errors provided by the present invention executed by a computer as an example to describe the technical solution of the present invention in detail.

[0034] In step 110, log data of the migration of the target software package to the RISC-V architecture is obtained.

[0035] Migrating the target software package to the RISC-V architecture means adapting and optimizing the target software package (including applications, libraries, tools, etc.) to the hardware platform based on the RISC-V instruction set architecture. The migration process mainly includes the prep stage, the build stage, the check stage, and the install stage. The target software package is any software package that needs to be migrated.

[0036] It is understandable that software packages may depend on specific versions of libraries that are unavailable or not fully compatible on RISC-V. Software packages may depend on the correct installation and configuration of other software packages, which may not be properly handled during the migration process, resulting in a large number of errors during the migration process. Errors may occur at all stages of the migration. Error information is recorded in the log data, so the error cause analysis process of the subsequent migration process can be implemented based on the log data of the target software package migrated to the RISC-V architecture.

[0037] In step 120, the log data is divided into blocks based on the vector distance between each log line in the log data to obtain a plurality of log blocks, and a plurality of error log blocks containing error information are determined from the plurality of log blocks.

[0038] Each log line in the log data is converted into vectorized log line data. Specifically, the llm-embedder model can be used to convert log data into vectors to capture the semantic information of the log. The llm-embedder model is a model for embedding text into a vector space. The llm-embedder can convert text into a high-dimensional vector to facilitate various natural language processing tasks, such as text classification and semantic similarity calculation.

[0039] After the log lines are vectorized, the distance between the log line vectors can be calculated based on a distance measurement method. For example, the similarity between two log line vectors can be measured based on the cosine similarity method.

[0040] Log data can be divided into blocks according to vector distance. For example, a distance threshold is set, and log lines whose vector distance between log lines is less than the threshold are divided into the same block, so as to divide the log data into multiple log blocks.

[0041] After obtaining a plurality of log blocks, the plurality of log blocks are screened based on identifying the error information in each log block, and a plurality of error log blocks containing the error information are determined.

[0042] It is understandable that in the unfiltered log files, there are a lot of normal operation log information, which is useless for error diagnosis and may even interfere with analysis and judgment. By filtering the error log blocks, these interferences can be significantly reduced, making the analysis clearer and improving the analysis efficiency.

[0043] In step 130 , based on the pre-built thought chain and the large language model, the error cause of each error log block is determined.

[0044] Pre-build knowledge base. A high-quality knowledge base is the key to effective bug fixing. As RISC-V is promoted as an open source instruction set architecture in the embedded device and server markets, a large amount of log and repair data is generated during the migration and maintenance of software packages. These valuable data can not only help reduce the hallucination effect of large language models, but also play an important role in the few-sample fine-tuning of open source large language models (LLM). A high-quality knowledge base not only helps to improve the automation of migration and repair, but also reduces development and maintenance costs and improves system stability and security by providing accurate troubleshooting and repair suggestions.

[0045] In the specific knowledge base construction, the knowledge base can be in a data set format, including multiple error handling information. Error handling information may include error log file information, error repair information, and error causes. Among them, the error log file information is used to characterize specific error events encountered during the migration process, including its code, error message, occurrence scenario, and associated logs, so as to facilitate error diagnosis, tracking, and repair. The error log file may specifically include error codes, error message, error occurrence scenarios, and associated log files. Error repair information is relevant information on how to repair errors during error handling. The cause of the error is the root cause of unexpected behavior or failure during the migration of the software package to the RISC-V architecture.

[0046] Pre-build a thought chain, which is the reasoning process used to guide the output of the large language model. The thought chain helps the large language model to perform more complex reasoning. Through step-by-step reasoning steps, the performance and intelligence level of the large language model can be improved.

[0047] A large language model refers to a deep learning model that is trained using a large amount of text data and labels corresponding to the text data. Through large-scale training, the model learns the patterns and structures of natural language, enabling the model to generate natural language text or understand the meaning of language text.

[0048] Optionally, large language models can adopt agents from the ReAct framework to enhance interaction with external knowledge and tools. The ReAct framework is a method that combines reasoning and acting, aiming to improve the performance of models in language understanding and interactive decision making by generating reasoning processes and task-specific actions through large language models. The core idea of ​​ReAct is to closely combine reasoning and action, enabling the model to dynamically reason, create, maintain, and adjust action plans while performing tasks. This combination allows the model to not only rely on internal knowledge, but also to obtain and integrate information through interaction with the external environment.

[0049] The execution flow of the ReAct framework can be as follows Figure 2 As shown in the schematic diagram of the execution flow provided by the present invention, it may specifically include: Receive a task: The ReAct framework receives a task or question as input; Generate reasoning traces: The ReAct framework generates reasoning traces about how to solve a problem. These traces may involve breaking down task goals, creating action plans, etc. The ReAct framework can also access and use various tools and select the appropriate tool for execution; Execute actions: Based on reasoning and tracking, the ReAct framework executes specific actions, such as querying information, navigating, or interacting with the environment. It can also adjust action strategies based on environmental feedback to ensure successful completion of the task; Update context: After each action, the ReAct framework updates the context information so that future reasoning and actions can be based on the latest information; Iterative process: The process of reasoning and acting is iterative, and the ReAct framework continuously adjusts its action plan based on the latest contextual information; Completing the task: Once the goal is achieved or the task requirements are met, the ReAct framework completes the action sequence and outputs the final result.

[0050] After determining the large language model for analysis, you need to build a thought chain. The pre-built thought chain is used to guide the large language model to perform two steps. One step is to guide the large language model to classify the error log blocks. Specifically, guide the large language model to determine the category of each error log block and implement the preliminary classification process of the error log blocks.

[0051] Specifically, the classified error categories may be syntax errors, configuration file errors, compatibility errors, etc. The large language model identifies the error types in the error log blocks according to the guidance of the thinking chain, and determines the error categories of each error log block.

[0052] Another step is to guide the large language model to further analyze the error log blocks of specific categories based on the pre-built knowledge base to determine the cause of the error. Specifically, after preliminary classification, multiple categories are obtained, each of which contains at least one error log block. According to the category, the error log blocks in each category are analyzed one by one to obtain the analysis results of each error log block.

[0053] Optionally, the large language model can be guided to match the features of the log block with the features of the data in the knowledge base to find possible causes of the error. Based on the chain of thought, the large language model can also perform logical reasoning to exclude impossible causes and narrow the range of possible causes. Based on the language model, weights can also be assigned to different pieces of evidence (such as error messages, system status, etc.) to determine the most likely cause of the error.

[0054] It should be noted that in the process of migrating the target software package to the RISC-V architecture, due to the possible differences in instruction sets between RISC-V and other architectures (such as x86 and ARM), it may be necessary to modify the code written in architecture-specific instructions in the software package, which will lead to more types of errors in the migration process. If an automated error cause identification method is used, a large amount of data needs to be processed. In the process of performing preliminary classification and then determining the cause of the error, attention can be focused on specific error categories instead of searching aimlessly on the entire log data set, which can locate the problem faster and improve efficiency.

[0055] Furthermore, preliminary classification is performed to determine the error category of the error log block, and then the pre-built knowledge base is used to guide the large language model to determine the cause of the error. Through preliminary classification, the error log block can be classified into more specific categories, which helps the large language model to identify and locate the problem more accurately. Using the pre-built knowledge base, the large language model can use the knowledge and experience in the knowledge base to improve the accuracy of error cause analysis.

[0056] At the same time, through the guidance of the thinking chain, the reasoning process of the large language model is more transparent, easier to understand and track.

[0057] Optionally, a flowchart for determining the cause of an error based on a thought chain guided large language model implementation can be as follows: Figure 3 The error cause determination process provided by the present invention is shown in a schematic diagram.

[0058] After acquiring the log data, multiple error log blocks containing the error log are determined. According to a pre-built knowledge base, similar cases are retrieved in the knowledge base, and error handling information corresponding to similar error log fragments is determined from the knowledge base to obtain summary information.

[0059] The summary information is input into the large language model, which performs primary error classification on the error log block to obtain the basic error categories of common classification causes. On this basis, combined with the error handling information of similar cases in the knowledge base, the large language model is further guided to perform secondary classification on the error log block to clarify the specific error cause. Throughout the process, RAG technology can be used to mitigate the hallucination effect that may be produced by the large language model to ensure the accuracy and reliability of the classification results.

[0060] Optionally, a root cause analysis system can be pre-built to implement the error cause determination and analysis process. The root cause analysis system can be constructed as follows: Figure 4 As shown in the structural diagram of the root cause analysis system provided by the present invention, it can specifically include an interaction module, a service module and a storage module.

[0061] The interactive module is responsible for collecting log data based on browser plug-ins or web pages through APIs or crawlers. These data include log files, spec files, and patch files, which are the basis for subsequent error analysis and classification. After obtaining the log data, it is transmitted to the service module through the gateway layer.

[0062] The service module receives the log data obtained by the interaction module through the interface. The service module includes user management, task management, log error detection and root cause analysis. Among them, the service module implements error detection and root cause analysis of log data by calling the encapsulated large language model and the task calculation engine.

[0063] The storage module is responsible for data persistence and query optimization. It includes MySQL database, search engine and search service. Among them, MySQL database is used to store structured data, such as error categories and repair solutions; the search engine focuses on text search and similarity matching, which is suitable for fast retrieval of unstructured data; the search service provides a distributed full-text search engine that supports complex search functions and real-time data processing.

[0064] The use process of the root cause analysis system can be as follows: Figure 5 The use flow diagram of the root cause analysis system provided by the present invention is shown in FIG.

[0065] The specific steps include: User login: Enter the user name and password to enter the root cause analysis system after identity verification; The user uploads the relevant files containing the error log data and creates a root cause analysis task: select the file, fill in the task name and description, and submit the task after confirming that everything is correct; Asynchronous task processing: After receiving a task, the root cause analysis system generates a unique identifier, creates a task, associates the task with the user, and automatically allocates computing resources. The background starts to execute the analysis process, determines the analysis results, and saves the analysis results to the database without interfering with other user operations. Actively query the task status: Select "My Tasks" or "Task List" on the system interface to view the processing progress of the current task, such as "Queued", "Analyzing", "Completed", etc. Actively query task details and obtain parsed answers: After the task status is displayed as "Completed", click the task name to view the analysis report, including information such as the cause of the error, possible impact, and recommended solutions.

[0066] The software package construction error analysis method provided by the present invention guides the large language model to perform preliminary classification first through a pre-constructed thinking chain to determine the error category of the error log block, and then guides the large language model to perform in-depth analysis on the error log blocks of each error category based on the pre-constructed knowledge base to determine the error cause of each error log block in the migration process, thereby realizing an automatic determination process of the error cause and improving the efficiency of determining the error cause. Based on the preliminary classification and further analysis to realize the determination process of the error cause, attention can be focused on a specific error category, the error cause can be located more quickly, and the efficiency of determining the error cause can be improved.

[0067] In one embodiment, multiple error log blocks containing error information are determined from the multiple log blocks, including: based on an error recognition model, error recognition is performed on each log block respectively to determine multiple error log blocks containing error information, wherein the error recognition model is determined based on log samples and error information labels corresponding to the log samples.

[0068] It can be understood that determining the error log block containing error information from multiple log blocks can reduce the amount of data in the subsequent large language model processing process and improve efficiency.

[0069] The specific error information recognition process can be implemented based on the error recognition model. The error recognition model needs to be trained in advance. In the model training stage, the preprocessed log samples and the corresponding error information labels can be used to train the error recognition model.

[0070] The specific process of error information identification based on the error identification model can be as follows: extract features from log blocks using the same feature extraction method as in the training phase. Input the extracted features into the error identification model, which outputs the probability or label of whether each log block contains an error. According to the output of the error identification model, filter out error log blocks containing error information.

[0071] Among them, the error recognition model can be implemented based on the error information extraction agent. The error information extraction agent is a deep learning model that can understand the complexity and context of natural language, so as to more accurately determine which information is a real error message and which specific error category they belong to. For example, it can distinguish between compile-time errors, runtime errors, resource allocation problems, etc. During the processing of the error information extraction agent, it considers multiple factors to evaluate the severity and relevance of each potential error message, including the frequency of error occurrence, the content of the error message, the system state when the error occurred, etc. Through weighted analysis of these factors, the error information extraction agent can determine which error messages are the most critical and mark them for the screening process.

[0072] Optionally, after error recognition, the recognized error information can be displayed in a structured output, as follows: Figure 6 The structured output display diagram provided by the present invention is shown as follows. Specifically, after obtaining the log data, the log data is filtered based on a log filter with multiple rules to obtain the filtered log data. The filtered log data is divided into blocks, and error information is identified to obtain an error log block containing error information. The error cause analysis is performed on the error log block to determine the error cause of the error log block.

[0073] The error cause of the error log block can be associated with the corresponding build phase (such as the prep phase, the build phase, the install phase, and the check phase) to form a structured error report. This report not only includes the specific content of the error, but also indicates at which stage of the build process the error occurred, providing developers with clues to quickly locate and solve the problem.

[0074] In one embodiment, before the log data is segmented based on the vector distance between each log line in the log data, it also includes: filtering the log data based on a filter, wherein the filter is based on a regular expression matching method, and according to a preset invalid log template, identifies and deletes invalid data in the log data.

[0075] Specifically, the log preprocessing stage mainly uses the parallel filtering method to filter out invalid log information in the original log. Among them, the filter uses a variety of different filtering mechanisms to filter different types of invalid information. The filter mainly filters according to the preset invalid log template through the regular expression matching method.

[0076] For example, filters filter logs based on a range of log levels. You can set a minimum and maximum level to output only logs within the specified range. Filters filter logs based on strings in the log content. You can set a string to match to output only logs containing the specified string. Filters filter based on log sources.

[0077] Optionally, the specific functions of the filter may include: cleaning up log information related to reports; handling the cleaning of log information related to the object storage service; cleaning and processing path-related logs; identifying and removing redundant or duplicate log lines; focusing on timestamp processing and analysis to ensure time accuracy; processing logs generated by Java programs, processing and optimizing such log files; processing and optimizing logs generated by Python scripts.

[0078] In one embodiment, the log data is divided into blocks based on the vector distance between each log line in the log data to obtain a plurality of log blocks, including: vectorizing each log line in the log data, and determining the vector distance between each log line based on the vectorized representation between each log line; and dividing the log data into blocks based on the vector distance between each log line to obtain a plurality of log blocks.

[0079] Optionally, you can use the llm-embedder model to convert the text content of the log line into a high-dimensional vector. This model can capture the semantic information of the log line, making semantically similar log lines close to each other in the vector space.

[0080] Calculate the vector distance between log lines. Common distance metrics include cosine similarity, Euclidean distance, etc. These distance metrics help determine the semantic relevance between log lines.

[0081] The log lines are divided into multiple blocks according to the calculated vector distance. Usually, log lines with close distance are grouped into the same block because they may describe the same or related error events.

[0082] In one embodiment, after determining the error cause of each error log block, the method further includes: determining repair recommendation information of the error cause based on the large language model and the knowledge base, and executing a repair process of the target software package based on the repair recommendation information.

[0083] Leverage a large language model to query a pre-built knowledge base of historical error causes and their corresponding fixes.

[0084] It is understandable that the knowledge base is built based on multiple error handling information, including error log file information, error repair information, and error causes. Therefore, based on the query of the data in the knowledge base, the large language model will generate repair recommendation information for the current error cause. These recommendations may include code modification suggestions, configuration adjustment steps, environment setting guides, etc.

[0085] Perform the repair process according to the repair recommendation information.

[0086] Optionally, the repair process can be implemented based on the root cause analysis module, as follows Figure 7 The repair process diagram of the root cause analysis module provided by the present invention is shown as follows. The root cause analysis module identifies the last error based on the output results of the first two stages, namely, the determination of the error log block, the time when the error log block occurred, and the error cause corresponding to the error log block. These errors are likely to be the key factors causing system problems. The identified key errors are scored and compared with other errors to ensure their accuracy. If the result is inaccurate, the analysis is iterated again until the most fundamental cause of the error is found.

[0087] After finding the cause of the error, try to give corresponding repair solution suggestions. You can design a dedicated repairer for a specific problem to better improve the repair effect. Design multiple repairers for different error categories, and let the repair solution selector dynamically select and recommend them to provide the most suitable repair solution.

[0088] The repair solution selector is used to select the corresponding repairer according to the error prompt. Specifically, it can include dependency-related problem repairers and configuration-related problem repairers. The dependency-related problem repairer determines the missing dependency supplementary information corresponding to the error, and the configuration-related problem repairer determines the problem-related configuration information, and generates a repair solution based on the large language model to implement the repair process.

[0089] In one embodiment, after executing the repair process of the target software package based on the repair recommendation information, the method further includes: acquiring error handling information during the repair process of the target software package, and updating the knowledge base based on the error handling information.

[0090] Specifically, record every step of the repair process in detail, including code modification, configuration update, dependency management, etc. Record the results of the repair operation, including whether the error was successfully resolved, whether side effects or new problems occurred. Record the environment information during the repair, such as operating system version, software package version, hardware configuration, etc.

[0091] Extract key information from the repair records, such as the root cause of the error, the repair strategy adopted, the difficulty of the repair, etc. Integrate the determined error handling information into the knowledge base to ensure the timeliness and completeness of the knowledge base. According to the new error handling information, adjust the structure of the knowledge base to make it more adaptable to actual needs.

[0092] The software package building error analysis device provided by the present invention is described below. The software package building error analysis device described below and the software package building error analysis method described above can be referred to each other.

[0093] like Figure 8 As shown, the device comprises: A data acquisition module 810 is used to acquire log data of the migration of the target software package to the RISC-V architecture; A block division module 820, configured to divide the log data into blocks based on the vector distance between each log line in the log data to obtain a plurality of log blocks, and determine a plurality of error log blocks containing error information from the plurality of log blocks; The error cause determination module 830 is used to determine the error cause of each error log block based on the pre-built thought chain and the large language model; Among them, the thinking chain is used to guide the large language model to determine the error category of each error log block, and guide the large language model to determine the error cause of each error log block in the migration process according to the error category based on a pre-built knowledge base. The knowledge base is determined according to multiple error handling information of the RISC-V architecture migration process, and the error handling information includes error log file information, error repair information and error cause.

[0094] The software package provided by the present invention constructs an error analysis device, which guides the large language model to perform preliminary classification first through a pre-constructed thinking chain to determine the error category of the error log block, and then guides the large language model to perform in-depth analysis on the error log blocks of each error category based on the pre-constructed knowledge base to determine the error cause of each error log block in the migration process, thereby realizing an automatic determination process of the error cause and improving the efficiency of determining the error cause. Based on the preliminary classification and further analysis to realize the determination process of the error cause, attention can be focused on a specific error category, the error cause can be located more quickly, and the efficiency of determining the error cause can be improved.

[0095] In one embodiment, the block module 820 is specifically used to: Determining a plurality of error log blocks containing error information from the plurality of log blocks comprises: Based on the error recognition model, error recognition is performed on each log block respectively to determine a plurality of error log blocks containing error information, wherein the error recognition model is determined based on log samples and error information labels corresponding to the log samples.

[0096] In one embodiment, the block module 820 is further specifically configured to: Before dividing the log data into blocks based on the vector distances between the log lines in the log data, the method further includes: The log data is filtered based on a filter, wherein the filter is based on a regular expression matching method and identifies and deletes invalid data in the log data according to a preset invalid log template.

[0097] In one embodiment, the block module 820 is further specifically configured to: Based on the vector distance between each log line in the log data, the log data is divided into blocks to obtain multiple log blocks, including: Performing vectorized representation on each log line in the log data, and determining the vector distance between the log lines based on the vectorized representation between the log lines; The log data is divided into blocks based on the vector distances between the log lines to obtain a plurality of log blocks.

[0098] In one embodiment, the error cause determination module 830 is specifically used to: After determining the cause of the error in each error log block, it also includes: Based on the large language model and the knowledge base, repair recommendation information of the error cause is determined, and based on the repair recommendation information, a repair process of the target software package is executed.

[0099] In one embodiment, the error cause determination module 830 is further specifically configured to: After executing the repair process of the target software package based on the repair recommendation information, the method further includes: Obtain error handling information during the repair process of the target software package, and update the knowledge base based on the error handling information.

[0100] Fig. 9 An example of a physical structure diagram of an electronic device is shown in FIG. Fig. 9 As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930 and a communication bus 940, wherein the processor 910, the communication interface 920 and the memory 930 communicate with each other through the communication bus 940. The processor 910 may call the logic instructions in the memory 930 to execute the software package building error analysis method, which includes: obtaining log data of the target software package migration to the RISC-V architecture; Based on the vector distance between each log line in the log data, the log data is divided into blocks to obtain a plurality of log blocks, and a plurality of error log blocks containing error information are determined from the plurality of log blocks; Determine the error cause of each error log block based on the pre-built thought chain and large language model; Among them, the thinking chain is used to guide the large language model to determine the error category of each error log block, and guide the large language model to determine the error cause of each error log block in the migration process according to the error category based on a pre-built knowledge base. The knowledge base is determined according to multiple error handling information of the RISC-V architecture migration process, and the error handling information includes error log file information, error repair information and error cause.

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

[0102] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the software package building error analysis method provided by the above methods, the method comprising: obtaining log data of the migration of the target software package to the RISC-V architecture; Based on the vector distance between each log line in the log data, the log data is divided into blocks to obtain a plurality of log blocks, and a plurality of error log blocks containing error information are determined from the plurality of log blocks; Determine the error cause of each error log block based on the pre-built thought chain and large language model; Among them, the thinking chain is used to guide the large language model to determine the error category of each error log block, and guide the large language model to determine the error cause of each error log block in the migration process according to the error category based on a pre-built knowledge base. The knowledge base is determined according to multiple error handling information of the RISC-V architecture migration process, and the error handling information includes error log file information, error repair information and error cause.

[0103] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the software package building error analysis method provided by the above methods, the method comprising: obtaining log data of the migration of the target software package to the RISC-V architecture; Based on the vector distance between each log line in the log data, the log data is divided into blocks to obtain a plurality of log blocks, and a plurality of error log blocks containing error information are determined from the plurality of log blocks; Determine the error cause of each error log block based on the pre-built thought chain and large language model; Among them, the thinking chain is used to guide the large language model to determine the error category of each error log block, and guide the large language model to determine the error cause of each error log block in the migration process according to the error category based on a pre-built knowledge base. The knowledge base is determined according to multiple error handling information of the RISC-V architecture migration process, and the error handling information includes error log file information, error repair information and error cause.

[0104] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0105] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0106] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for analyzing software package building errors, characterized in that: include: Obtain log data of the target software package migration to the RISC-V architecture; Based on the vector distance between each log line in the log data, the log data is divided into blocks to obtain a plurality of log blocks, and a plurality of error log blocks containing error information are determined from the plurality of log blocks; Determine the error cause of each error log block based on the pre-built thought chain and large language model; Among them, the thinking chain is used to guide the large language model to determine the error category of each error log block, and guide the large language model to determine the error cause of each error log block in the migration process according to the error category based on a pre-built knowledge base. The knowledge base is determined according to multiple error handling information of the RISC-V architecture migration process, and the error handling information includes error log file information, error repair information and error cause.

2. The software package building error analysis method according to claim 1, characterized in that: The step of determining a plurality of error log blocks containing error information from the plurality of log blocks comprises: Based on the error recognition model, error recognition is performed on each log block respectively to determine a plurality of error log blocks containing error information, wherein the error recognition model is determined based on log samples and error information labels corresponding to the log samples.

3. The software package building error analysis method according to claim 1, characterized in that: Before dividing the log data into blocks based on the vector distances between the log lines in the log data, the method further includes: The log data is filtered based on a filter, wherein the filter is based on a regular expression matching method and identifies and deletes invalid data in the log data according to a preset invalid log template.

4. The software package building error analysis method according to claim 1, characterized in that: The log data is divided into blocks based on the vector distance between each log line in the log data to obtain multiple log blocks, including: Performing vectorization on each log line in the log data, and determining a vector distance between the log lines based on the vectorization between the log lines; The log data is divided into blocks based on the vector distances between the log lines to obtain a plurality of log blocks.

5. The software package building error analysis method according to claim 1, characterized in that: After determining the error cause of each error log block, the method further includes: Based on the large language model and the knowledge base, repair recommendation information of the error cause is determined, and based on the repair recommendation information, a repair process of the target software package is executed.

6. The software package building error analysis method according to claim 5, characterized in that: After executing the repair process of the target software package based on the repair recommendation information, the method further includes: Obtain error handling information during the repair process of the target software package, and update the knowledge base based on the error handling information.

7. A software package construction error analysis device, characterized in that: include: A data acquisition module is used to obtain log data of the target software package migration to the RISC-V architecture; A block division module, configured to divide the log data into blocks based on the vector distance between each log line in the log data to obtain a plurality of log blocks, and determine a plurality of error log blocks containing error information from the plurality of log blocks; An error cause determination module is used to determine the error cause of each error log block based on a pre-built thought chain and a large language model; Among them, the thinking chain is used to guide the large language model to determine the error category of each error log block, and guide the large language model to determine the error cause of each error log block in the migration process according to the error category based on a pre-built knowledge base. The knowledge base is determined according to multiple error handling information of the RISC-V architecture migration process, and the error handling information includes error log file information, error repair information and error cause.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method for analyzing software package building errors according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for analyzing software package building errors according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for analyzing software package building errors according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Safety-critical software failure mode identification method based on large language model

    CN117648404A

  • Communication network fault log analysis method based on large language model assistance

    CN117792882A

  • System log intelligent analysis method and device based on large language model

    CN117873979A

  • Log analysis method and device, electronic equipment and storage medium

    CN118132711A

  • Log analysis method and system based on large language model

    CN118626359A