Software package construction problem repairing method, system, equipment, medium and product
By obtaining error log information during the RISC-V package construction process, and using a large language model to multiple rounds of dialogue with the preset construction problem knowledge base, we generate recommended solutions for repairing software package construction problems, solving the problem that construction errors are difficult to locate and repair during the package migration process, and improving repair efficiency and accuracy.
Patent Information
- Application Number
- CN202510346478.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-04-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
During the migration of RISC-V software packages, it is difficult for developers to accurately analyze and locate construction errors, resulting in ineffective repairs.
By obtaining error log information during the software package construction process, using a large language model to conduct multiple rounds of dialogue, building a problem knowledge base in combination with presets, matching and generating recommended solutions for problem repair of target software package construction.
Improves the efficiency and accuracy of software package construction problems, and reduces the time and effort of developers to manually analyze and repair.
Smart Images

Figure CN119861966A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software package migration, and in particular to a method, system, device, medium and product for repairing software package construction problems. Background Art
[0002] As an emerging open source reduced instruction set architecture (ISA), RISC-V actively promotes the deep integration of software and hardware, which is in line with the development trend of open and free architecture. Although RISC-V is developing rapidly and building an ecosystem, and basic software such as operating systems and compilers are relatively mature, there is still a large demand for application software porting.
[0003] Since the key information of the software package building platform is diverse and complex, even experienced migration personnel need to spend a lot of time and energy to deal with the software packages in the wrong state. When faced with a large number of complex error prompts on the data package building platform, it is difficult for developers to conduct accurate analysis and error location, resulting in the inability to effectively and accurately fix the build error problem.
[0004] Therefore, there is an urgent need for a software package construction problem repair method, system, device, medium and product to solve the above problems. Summary of the invention
[0005] In view of the problems existing in the prior art, the present invention provides a method, system, device, medium and product for repairing software package construction problems.
[0006] The present invention provides a method for repairing a software package construction problem, comprising: Get the error log information generated during the software package building process; Based on a preset prompt word set, a large language model is conducted with multiple rounds of dialogues, and after it is determined that the large language model enters a software package building problem repair scenario mode after the multiple rounds of dialogues, the error log information is input into the large language model to obtain a target software package building problem repair recommendation output by the large language model; Among them, the target software package construction problem repair recommendation plan is constructed by the target software package construction problem repair template determined by the large language model from multiple candidate software package construction problem repair templates; the multiple candidate software package construction problem repair templates are obtained by searching a preset construction problem knowledge base; the preset construction problem knowledge base is constructed based on sample error log fragment information and the software package construction problem repair template corresponding to the sample error log fragment information.
[0007] According to a method for repairing software package construction problems provided by the present invention, the preset construction problem knowledge base is constructed by the following steps: Based on the software package building problem generated during the historical migration process, obtaining the sample error log fragment information corresponding to the software package building problem; Constructing the software package construction problem repair template according to the repair solution code information or repair patch information corresponding to the sample error log fragment information; Performing data enhancement processing on the sample error log fragment information to obtain a plurality of data enhanced processed sample error fragment information; Associating the sample error segment information after data enhancement processing with the software package construction problem repair template corresponding to the sample error segment information after data enhancement processing to obtain a construction problem data set; Based on the construction question data set, the preset construction question knowledge base is constructed.
[0008] According to a method for repairing a software package construction problem provided by the present invention, after obtaining error log information generated during the construction process of the software package, the method further includes: According to the text similarity between the log key segment in the error log information and the error log segment information in the preset construction problem knowledge base, the multiple candidate software package construction problem repair templates are matched from the construction problem data set in the preset construction problem knowledge base.
[0009] According to a method for repairing a software package construction problem provided by the present invention, the preset prompt word set includes a first preset prompt word and a second preset prompt word, wherein the first preset prompt word is constructed based on construction problem case information, the construction problem case information includes an error log fragment case and a repair template fragment corresponding to the error log fragment case; the second preset prompt word is constructed based on a software package configuration file fragment and a source code file fragment; The method of conducting multiple rounds of dialogue on the large language model based on the preset prompt word set includes: Inputting the first preset prompt word into the large language model to obtain software package construction problem repair templates of different construction problem types output by the large language model in the first round of dialogue; Determining a software package construction problem repair template of a target construction problem type from the software package construction problem repair templates of different construction problem types, and generating the second preset prompt word according to the software package configuration file fragment and the source code file fragment corresponding to the software package construction problem repair template of the target construction problem type; inputting the second preset prompt word into the large language model, obtaining software package construction problem repair case information corresponding to the software package construction problem repair template of the target construction problem type output by the large language model in the second round of dialogue, and determining that the large language model has entered the software package construction problem repair scenario mode; The software package construction problem repair case information is used as guidance information for generating a construction problem repair solution for the large language model, and the error log information is input into the large language model to obtain a recommended solution for repairing the target software package construction problem output by the large language model.
[0010] According to a method for repairing a software package construction problem provided by the present invention, the data enhancement processing is performed on the sample error log segment information to obtain a plurality of sample error segment information after the data enhancement processing, including: Based on the BERT model, data enhancement processing is performed on the sample error log fragment information to obtain the sample error fragment information after the multiple data enhancement processing.
[0011] According to a method for repairing a software package construction problem provided by the present invention, after inputting the error log information into the large language model to obtain target software package construction problem repair information output by the large language model, the method further includes: constructing new build problem data according to the error log information and the target software package build problem repair information; The construction problem data set is updated according to the new construction problem data to obtain an updated preset construction problem knowledge base.
[0012] The present invention also provides a software package construction problem repair system, comprising: Build a log collection module to obtain error log information generated during the software package building process; a multi-round dialogue module, configured to conduct a multi-round dialogue with a large language model based on a preset prompt word set, and after determining that the large language model enters a software package building problem repair scenario mode after the multi-round dialogue, input the error log information into the large language model to obtain a target software package building problem repair recommendation output by the large language model; Among them, the target software package construction problem repair recommendation plan is constructed by the target software package construction problem repair template determined by the large language model from multiple candidate software package construction problem repair templates; the multiple candidate software package construction problem repair templates are obtained by searching a preset construction problem knowledge base; the preset construction problem knowledge base is constructed based on sample error log fragment information and the software package construction problem repair template corresponding to the sample error log fragment information.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-mentioned methods for repairing software package construction problems is implemented.
[0014] 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 repairing software package construction problems as described above is implemented.
[0015] 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 methods for repairing software package construction problems.
[0016] The software package construction problem repair method, system, device, medium and product provided by the present invention conduct multiple rounds of dialogue with a large language model based on a preset prompt word set, and after determining that the large language model has entered the software package construction problem repair scenario mode, the error log information is input into the large language model to obtain a more accurate recommended solution for repairing the software package construction problem. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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.
[0018] Figure 1 A schematic diagram of a process for repairing a software package construction problem provided by the present invention; Figure 2 A schematic diagram of the overall process of the software package construction problem repair process based on the large language model provided by the present invention; Figure 3 A schematic diagram of the structure of a problem repair system constructed for the software package provided by the present invention; Figure 4 This is a schematic structural diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0019] 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.
[0020] Automated Program Repair (APR) plays a vital role in software development and maintenance. Its purpose is to repair software errors without human intervention. Currently, a large number of APR technologies are based on templates, heuristic methods or deep learning. Among them, deep learning has the fastest development in APR due to its ability to learn hidden code repair patterns from massive data.
[0021] The current APR repair solutions for large language models are mostly suitable for repair scenarios with relatively complete data sets, and cannot effectively solve the problems of RISC-V software package build error repair scenarios. In addition, the existing APR technology is difficult to directly use for software package build error analysis on the Open Build Service (OBS) build platform. Although the OBS build platform can provide complex and diverse software package information and display complex, hierarchically nested errors, it is necessary to extract, analyze and classify specific error types in order to design targeted repair solutions.
[0022] The present invention utilizes a large language model and uses data augmentation methods based on the problem of limited data set size. At the same time, a domain knowledge repair template for software package construction is designed and combined with the Retrieval-augmented Generation (RAG) method to conduct multiple rounds of dialogues to achieve the generation of code-level repair solutions, thereby proposing repair solutions for various software package construction problems, such as compilers, instruction set architectures, functions, and software version changes.
[0023] Figure 1 A flowchart of a method for repairing a software package construction problem provided by the present invention is shown in FIG. Figure 1 As shown, the present invention provides a method for repairing a software package construction problem, comprising: Step 100: Obtain error log information generated during the construction of the software package.
[0024] During the software package building process, it is necessary to monitor the progress and status of the building task in real time. In the present invention, the building process of the software package is monitored through relevant monitoring tools (such as build logs, build status indicators, etc.) in the OBS building platform. If errors or warnings occur during the building process, these will be recorded in the error log. The error log records in detail every step of the building process, the commands used, the output generated, and any errors or warnings encountered.
[0025] Step 101, based on a preset prompt word set, conduct multiple rounds of dialogue with a large language model, and after determining that the large language model enters a software package building problem repair scenario mode after the multiple rounds of dialogue, input the error log information into the large language model to obtain a target software package building problem repair recommendation output by the large language model; Among them, the target software package construction problem repair recommendation plan is constructed by the target software package construction problem repair template determined by the large language model from multiple candidate software package construction problem repair templates; the multiple candidate software package construction problem repair templates are obtained by searching a preset construction problem knowledge base; the preset construction problem knowledge base is constructed based on sample error log fragment information and the software package construction problem repair template corresponding to the sample error log fragment information.
[0026] In the present invention, a set of preset prompt words is used to guide the large language model into a specific dialogue or task mode, namely, a software package building problem repair scenario mode. These prompt words include words that guide the model to focus on a specific problem area (such as software package migration), ask for specific types of information (such as error causes or repair steps), or instruct the model to perform specific operations (such as selecting the best answer from alternative solutions).
[0027] In the present invention, multiple rounds of dialogues are conducted with the large language model through the user end or the automated repair system. The purpose of these dialogues is to gradually guide the model to understand the specific problems of software package construction and to collect sufficient information to locate errors and propose solutions. Through multiple rounds of dialogues, the large language model deeply understands the current problem and enters the scenario mode of software package construction problem repair, thereby continuing the next step of repair operation.
[0028] Furthermore, after the large language model enters the repair scenario mode, the error log information is input into the large language model. These error log information are extracted from the build log, system log or user report during the software package construction process, and contain detailed information about the error, such as error code, error description, context of the error, etc. The large language model uses this information to search in a preset construction problem knowledge base. This knowledge base is a pre-built database that contains a large amount of sample error log fragment information and software package construction problem repair templates corresponding to these fragment information. In the present invention, after obtaining the sample error log fragment information, the fragment information of the sample error log fragment information after repair, that is, the sample error repair fragment information, is further obtained, so that according to the sample error log fragment information and the sample error repair fragment information, the software package construction problem repair template corresponding to the sample error log fragment information is summarized. Each repair template provides standardized repair steps or suggestions for one or more specific error types. In the present invention, in order to improve the efficiency of repairing software package building problems, after obtaining the error log information, based on retrieval methods such as BM25 retrieval and DPR retrieval, the key fragments in the error log information can be matched with the error log fragment information rows in the preset building problem knowledge base, so as to match some error log fragment information with high similarity to the error log information, and then the software package building problem repair templates corresponding to these error log fragment information are used as alternative software package building problem repair templates.
[0029] In the present invention, the large language model selects a template that best matches the current error from multiple alternative repair templates based on the error log information, and then uses the template to construct specific repair information, including filling in placeholders in the template, adjusting the repair steps to adapt to the current environment, or providing additional contextual information.
[0030] Finally, the large language model outputs the target software package build problem repair information to the user end or the automated repair system. The target software package build problem repair recommendation includes detailed repair steps, necessary code snippets, or links to related resources.
[0031] The software package construction problem repair method provided by the present invention conducts multiple rounds of dialogues with a large language model based on a preset prompt word set, and after determining that the large language model has entered the software package construction problem repair scenario mode, the error log information is input into the large language model to obtain a more accurate repair recommendation plan for the software package migration problem.
[0032] Based on the above embodiment, the preset construction question knowledge base is constructed by the following steps: Based on the software package building problem generated during the historical migration process, obtaining the sample error log fragment information corresponding to the software package building problem; Constructing the software package construction problem repair template according to the repair solution code information or repair patch information corresponding to the sample error log fragment information; Performing data enhancement processing on the sample error log fragment information to obtain a plurality of data enhanced processed sample error fragment information; Associating the sample error segment information after data enhancement processing with the software package construction problem repair template corresponding to the sample error segment information after data enhancement processing to obtain a construction problem data set; Based on the construction question data set, the preset construction question knowledge base is constructed.
[0033] In the process of migrating a software package from one architecture to another (such as from x86 to RISC-V), various build problems may be encountered. These problems may originate from aspects such as the source code, dependencies, configuration settings, and compatibility of the software. In order to effectively solve these problems, the present invention first collects these build problems and their related error log fragment information from the historical build process, wherein the sample error log fragment information can come from the build platforms (such as koji, OBS, buildd) of multiple operating system distributions (such as Fedora, OpenEuler, Debian, etc.), and these sample error log fragment information contain detailed information of the error, such as the error type (compatibility issues, source code issues, and configuration issues, etc.), the error location (which file, which line of code), and the error description, etc.
[0034] Furthermore, for each sample error log fragment, it is necessary to find the corresponding repair solution code information or repair patch information. The repair solution can be the modification of source code, the adjustment of configuration files, the addition of dependencies, etc. The present invention constructs the corresponding software package construction problem repair template according to these repair solutions.
[0035] Since the existing software package building platform lacks a unified software source code historical version repository, the automated collection process is difficult to implement and the samples are relatively small. At the same time, the patches and submission records generated between iterative versions contain a large number of modifications that do not match the build error logs. Preferably, the present invention uses data enhancement technology to generate a plurality of sample error fragment information after data enhancement processing. These data-enhanced samples can increase the diversity and richness of the data set and help improve the generalization ability of the model. Furthermore, the present invention associates the sample error fragment information after data enhancement processing with the corresponding software package construction problem repair template to obtain a construction problem data set. This data set contains multiple error log fragments that have been processed with data enhancement and their corresponding repair templates, which helps to more comprehensively cover various construction problems and repair solutions when subsequently constructing a preset construction problem knowledge base.
[0036] Finally, based on the build problem data set, a preset build problem knowledge base is constructed. This preset build problem knowledge base contains descriptions of various build problems, error log snippets, repair templates and other information. During the migration process, when encountering new build problems, the description of the problem or the error log snippet can be matched with the information in the knowledge base to quickly find the corresponding repair solution. Such a knowledge base can greatly improve the efficiency and accuracy of the build work.
[0037] Based on the above embodiment, after obtaining the error log information generated during the construction of the software package, the method further includes: According to the text similarity between the log key segment in the error log information and the error log segment information in the preset construction problem knowledge base, the multiple candidate software package construction problem repair templates are matched from the construction problem data set in the preset construction problem knowledge base.
[0038] In the present invention, when a problem occurs during the software package building process, the software package building system will generate corresponding error log information, which usually includes a detailed error description, the context of the error (such as the operating system version, hardware architecture, etc.), and the code location or function call stack that may cause the error. In order to efficiently use this information, it is necessary to extract key fragments of the log, such as the specific error code, error type prompt, or the specific function call that caused the error.
[0039] The preset build problem knowledge base is a pre-built database that stores a large number of software package build problems encountered in the early stage and their corresponding software package build problem repair templates. These software package build problem repair templates are summarized based on past build experience and contain general or specific repair solutions for specific types of errors. Table 1 shows examples of related repair templates for 7 types of errors. For specific contents of software package build problem repair templates, please refer to Table 1: Table 1 Package build problem fix template
[0040] In the present invention, each entry in the preset construction problem knowledge base is associated with one or more error log fragment information, which is the key to identifying the problem type and matching the repair template. Further, after obtaining the error log key fragment generated in the current construction process, the error log key fragment is compared with the error log fragment information in the preset construction problem knowledge base. Specifically, the present invention uses text similarity (such as cosine similarity) to measure the similarity between two text fragments in content or structure. Based on the calculation results of text similarity, entries with high similarity to the current error log key fragment are screened out from the preset construction problem knowledge base, and the repair templates associated with these entries are regarded as alternative repair solutions for the current construction problem. Optionally, in order to improve the accuracy and reliability of matching, a similarity threshold can be set, and only repair templates with scores exceeding the threshold will be selected as alternative software package construction problem repair templates.
[0041] Preferably, in the present invention, in order to improve the retrieval performance of the problem repair template, the BM25 retrieval method is combined with the DPR (Deep Relevance Parser) retrieval method, thereby improving the retrieval effect. Specifically, BM25 is a retrieval algorithm based on word frequency, which is mainly used to solve text retrieval problems. The BM25 retrieval method calculates the correlation between the query and the document by adjusting the weight of each word in the text. The number of times each word appears in the document is proportional to the total number of words in the document, but is also affected by the frequency of occurrence of the word in the entire corpus. This weight calculation method enables the BM25 retrieval method to balance the importance of words to a certain extent, thereby improving the retrieval effect.
[0042] The DPR retrieval method is a retrieval algorithm based on a neural network, which achieves more accurate retrieval by learning the semantic representation of text. The DPR retrieval method first encodes the text to generate a dense vector representation, and then uses a contrastive learning method to train the model. During the training process, the DPR retrieval method uses the error-repair pairs that appear in the data set as the repair content, which can have the same semantics as the constructed error fragment. Through this training method, the DPR retrieval method can capture deeper code semantics, thereby improving the retrieval effect. In the present invention, based on different retrieval requirements (such as the need for efficient retrieval or deep semantic understanding), the corresponding retrieval method is determined between the BM25 retrieval method and the DPR retrieval method to obtain better recall results.
[0043] In one embodiment, a preliminary search may be performed from a preset construction problem knowledge base using the BM25 search method to obtain a set of preliminary search results, and then a more detailed search may be performed from the set of preliminary search results using the DPR search method to obtain multiple candidate software package construction problem repair templates, thereby improving the search efficiency and accuracy of the software package construction problem repair templates.
[0044] Based on the above embodiment, the preset prompt word set includes a first preset prompt word and a second preset prompt word, wherein the first preset prompt word is constructed based on the problem case construction information, the problem case construction information includes an error log fragment case and a repair template fragment corresponding to the error log fragment case; the second preset prompt word is constructed based on the software package configuration file fragment and the source code file fragment; The method of conducting multiple rounds of dialogue on the large language model based on the preset prompt word set includes: Inputting the first preset prompt word into the large language model to obtain software package construction problem repair templates of different construction problem types output by the large language model in the first round of dialogue; Determining a software package construction problem repair template of a target construction problem type from the software package construction problem repair templates of different construction problem types, and generating the second preset prompt word according to the software package configuration file fragment and the source code file fragment corresponding to the software package construction problem repair template of the target construction problem type; inputting the second preset prompt word into the large language model, obtaining software package construction problem repair case information corresponding to the software package construction problem repair template of the target construction problem type output by the large language model in the second round of dialogue, and determining that the large language model has entered the software package construction problem repair scenario mode; The software package construction problem repair case information is used as guidance information for generating a construction problem repair solution for the large language model, and the error log information is input into the large language model to obtain a recommended solution for repairing the target software package construction problem output by the large language model.
[0045] In actual software package construction, the information types of the software package construction platform are diverse, complex, and contain a lot of redundancy. For example, various software package resources such as build logs, source code, and configuration information require the design of multi-step dialogues to guide the large language model to give specific code repair suggestions, including code location, configuration files, and modifications to code details, as well as the direction and type of problem solving.
[0046] The first preset prompt words are constructed based on the construction problem case information, which includes various construction problems encountered in history and their corresponding repair solutions. Specifically, the case information consists of error log fragment cases and repair template fragments corresponding to these cases. The error log fragment cases are excerpts of error logs actually generated during the construction process, and the repair template fragments are general or specific repair solutions summarized for these error logs. Furthermore, integrating and refining these case information into the first preset prompt words can guide the large language model to understand the basic types of construction problems and repair ideas at the beginning of the conversation. In the first round of the conversation, the present invention inputs these first preset prompt words into the large language model, and the large language model will output software package construction problem repair templates for different construction problem types based on this information.
[0047] The second preset prompt word is constructed based on the software package configuration file fragment and the source code file fragment. These file fragments are an indispensable part of the software package construction process, and contain the configuration information and source code implementation of the software package. By extracting the key information in these file fragments, more specific and targeted prompt words can be constructed. Specifically, in the second round of the dialogue, according to the target build problem type determined in the first round of the dialogue (that is, the build problem type that best matches the current error log), the required software package configuration file fragment and source code file fragment are found from the corresponding software package build problem repair template. Then, based on this information, the second preset prompt word is generated and input into the large language model. Based on this more detailed information, the large language model will output the repair case information corresponding to the software package build problem repair template of the target build problem type.
[0048] In the present invention, by inputting the first preset prompt word, the large language model is guided to output software package construction problem repair templates of different construction problem types. This is the first round of dialogue of the large language model. Then, the user end determines the most suitable target construction problem type from the repair template output by the large language model according to the specific content of the current error log.
[0049] Further, according to the determined target build problem type, the required configuration file fragment and source code file fragment are obtained to generate a second preset prompt word. The second preset prompt word is input to guide the large language model to output the repair case information corresponding to the software package build problem repair template of the target build problem type. This is the second round of dialogue for the large language model. After the second round of dialogue, the large language model has been able to understand the specific background and repair requirements of the build problem more deeply, so the output repair case information will be more detailed and accurate. If the large language model can output repair case information that is highly relevant to the current build problem, it can be determined that the large language model enters the scenario mode of software package build problem repair; if the repair solution output by the large language model deviates from the current build problem, a new second preset prompt word can be constructed, and the second round of dialogue can be performed again until the large language model can output repair case information that is highly relevant to the current build problem.
[0050] Finally, the software package building problem repair case information is used as the guidance information for generating the building problem repair plan, and the original error log information is input into the model again (this stage can be defined as the third round of dialogue). At this time, the large language model will output a specific repair recommendation plan for the target software package building problem based on the previous dialogue content and error log information. The recommendation plan includes the direction of repair, specific code modification suggestions, configuration file adjustments, etc. In the present invention, the large language model will retrieve the template related to the current error log information from multiple candidate software package building problem repair templates based on the previous dialogue content and repair case information, and then generate specific repair information for the target software package building problem.
[0051] Based on the above embodiment, the sample error log fragment information is subjected to data enhancement processing to obtain a plurality of sample error fragment information after data enhancement processing, including: Based on the BERT model, data enhancement processing is performed on the sample error log fragment information to obtain the sample error fragment information after the multiple data enhancement processing.
[0052] In order to expand the data set in the preset construction problem knowledge base and solve the problems of imbalanced construction error categories and fewer samples in the data set, the present invention further expands the data set by data enhancement. Specifically, the present invention uses Conditional Bert to perform data enhancement processing. Among them, Conditional Bert predicts the words in the mask position by combining context and labels, thereby ensuring that the generated new sentence has the same semantics as the original sentence and maintains label consistency. When predicting replacement words, Conditional Bert not only considers context information, but also considers label information. In the construction scenario of the preset construction problem knowledge base, the data enhancement processing process of Conditional Bert is used, and compiler incompatibility, architecture incompatibility, function update, file conflict, variable definition error, function error and grammatical spelling error can be used as label information. In one embodiment, BERT Expand can also be used for data enhancement processing to maintain the semantic information of the input sentence.
[0053] Based on the above embodiment, after inputting the error log information into the large language model to obtain the target software package construction problem repair information output by the large language model, the method further includes: constructing new build problem data according to the error log information and the target software package build problem repair information; The construction problem data set is updated according to the new construction problem data to obtain an updated preset construction problem knowledge base.
[0054] In the present invention, when a build problem is successfully fixed and detailed error log information and target software package build problem repair information are available, these information can be used to construct a new build problem data. The new build problem data will record the problems encountered during the build process in detail, including the context of the error, specific error information or code exceptions, etc.; at the same time, it will record the specific repair plan for the problem, including the repair steps, modified code, and referenced external resources, etc.
[0055] In the present invention, if the new construction problem data is associated with other problems encountered before, in this case, these associated information can be recorded so that a more comprehensive perspective can be formed during the subsequent analysis of the problem.
[0056] Furthermore, after constructing new construction problem data, it is added to the construction problem data set, thereby updating the preset construction problem knowledge base. Before adding the new construction problem data to the preset construction problem knowledge base, it needs to be verified to ensure the accuracy, completeness and consistency of the data and avoid introducing erroneous or redundant information.
[0057] Figure 2 The present invention provides a schematic diagram of the overall process of the software package building problem repair process based on the large language model. In the present invention, for the failed state of the software package of the release version OBS build platform, a preset build problem knowledge base (a knowledge base for storing bug-fix pairs) is designed and created according to the software package migration build error log, source code, related configuration files and repair patches. The preset build problem knowledge base stores and summarizes the existing actual migration scenario build error repair instances, and extracts repair templates for various build errors through manual screening. At the same time, a variety of data enhancement methods are used to make up for the problems of missing data sets and unbalanced build error repair categories in the preset build problem knowledge base.
[0058] Furthermore, for the preset build problem knowledge base, a hybrid search method is used to improve the search efficiency and accuracy, and the error log and source code information of the software package to be repaired are matched with the historical repair records in the preset build problem knowledge base, so as to perform relevant searches. Then, the historical repair examples with high similarity to the software package to be repaired are organized into prompt engineering. Specifically, the Transformer pre-trained model and a small number of sample prompt engineering methods can be used, combined with manually summarized repair templates to provide rich domain knowledge for the large language model, solving the migration build error repair problem for RISC-V.
[0059] In the present invention, by screening the error log fragments and specific repair codes of build problems on the corresponding software package building platforms of operating system distributions such as Debian and OpenEuler, a preset build problem knowledge base is created, and the corresponding build problem repair templates are manually screened and summarized.
[0060] Furthermore, the semantic and grammatical BM25 retrieval method and the DPR retrieval method can be used to perform a hybrid search on the preset build problem knowledge base to obtain multiple candidate software package build problem repair history examples and templates. In addition, through the designed multi-step dialogue, the error information and detailed engineering code information required by the large language model are dynamically provided to stimulate the large language model to enter the software package build problem repair scenario mode, so that the large language model can determine the historical repair and template matching the target software package build problem from multiple candidate software package build problem repair examples and templates, and then generate the software package build problem repair recommendation corresponding to the current error log based on the target software package build problem history example and repair template.
[0061] The software package construction problem repairing system provided by the present invention is described below. The software package construction problem repairing system described below and the software package construction problem repairing method described above can be referred to each other.
[0062] Figure 3 The schematic diagram of the structure of the problem repair system constructed by the software package provided by the present invention is as follows: Figure 3 As shown, the present invention provides a software package construction problem repair system, including a construction log collection module 300 and a multi-round dialogue module 301, wherein the construction log collection module 300 is used to obtain error log information generated during the construction process of the software package; the multi-round dialogue module 301 is used to conduct multi-round dialogues with a large language model based on a preset prompt word set, and after determining that the large language model enters the software package construction problem repair scenario mode after the multi-round dialogues, the error log information is input into the large language model to obtain a target software package construction problem repair recommendation solution output by the large language model; wherein the target software package construction problem repair recommendation solution is constructed by a target software package construction problem repair template determined by the large language model from multiple candidate software package construction problem repair templates; the multiple candidate software package construction problem repair templates are obtained by searching a preset construction problem knowledge base; the preset construction problem knowledge base is constructed based on sample error log fragment information and the software package construction problem repair template corresponding to the sample error log fragment information.
[0063] The software package construction problem repair system provided by the present invention conducts multiple rounds of dialogues with a large language model based on a preset prompt word set, and after determining that the large language model has entered the software package construction problem repair scenario mode, the error log information is input into the large language model to obtain a more accurate recommended solution for repairing the software package construction problem.
[0064] The system provided in the embodiment of the present invention is used to execute the above-mentioned method embodiments. Please refer to the above-mentioned embodiments for the specific process and detailed contents, which will not be repeated here.
[0065] Figure 4 A schematic diagram of the structure of an electronic device provided by the present invention, such as Figure 4As shown, the electronic device may include: a processor (Processor) 400, a communication interface (Communications Interface) 401, a memory (Memory) 402 and a communication bus 403, wherein the processor 400, the communication interface 401, and the memory 402 communicate with each other through the communication bus 403. The processor 400 may call the logic instructions in the memory 402 to execute a method for repairing software package construction problems, the method comprising: obtaining error log information generated during the construction process of the software package; conducting multiple rounds of dialogues with a large language model based on a preset prompt word set, and after determining that the large language model enters a software package construction problem repair scenario mode after the multiple rounds of dialogues, inputting the error log information into the large language model to obtain a target software package construction problem repair recommendation solution output by the large language model; wherein the target software package construction problem repair recommendation solution is constructed by a target software package construction problem repair template determined by the large language model from a plurality of candidate software package construction problem repair templates; the plurality of candidate software package construction problem repair templates are obtained by searching a preset construction problem knowledge base; the preset construction problem knowledge base is constructed based on sample error log fragment information and the software package construction problem repair template corresponding to the sample error log fragment information.
[0066] In addition, the logic instructions in the above-mentioned memory 402 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 such an 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, etc. Various media that can store program codes.
[0067] On the other hand, the present invention also provides a computer program product, the computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by a computer, the computer can execute the software package construction problem repair method provided by the above methods, the method comprising: obtaining error log information generated during the construction process of the software package; based on a preset prompt word set, conducting multiple rounds of dialogues with a large language model, and after determining that the large language model enters the software package construction problem repair scenario mode after the multiple rounds of dialogues, inputting the error log information into the large language model to obtain a target software package construction problem repair recommendation solution output by the large language model; wherein the target software package construction problem repair recommendation solution is constructed by a target software package construction problem repair template determined by the large language model from multiple candidate software package construction problem repair templates; the multiple candidate software package construction problem repair templates are obtained by searching a preset construction problem knowledge base; the preset construction problem knowledge base is constructed based on sample error log fragment information and the software package construction problem repair template corresponding to the sample error log fragment information.
[0068] 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 executed by a processor to execute the software package construction problem repair method provided by each of the above embodiments, the method comprising: obtaining error log information generated during the construction process of the software package; conducting multiple rounds of dialogues with a large language model based on a preset prompt word set, and after determining that the large language model enters the software package construction problem repair scenario mode after the multiple rounds of dialogues, inputting the error log information into the large language model to obtain a target software package construction problem repair recommendation solution output by the large language model; wherein the target software package construction problem repair recommendation solution is constructed by a target software package construction problem repair template determined by the large language model from a plurality of candidate software package construction problem repair templates; the plurality of candidate software package construction problem repair templates are obtained by searching a preset construction problem knowledge base; the preset construction problem knowledge base is constructed based on sample error log fragment information and the software package construction problem repair template corresponding to the sample error log fragment information.
[0069] 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.
[0070] 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.
[0071] 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 repairing a software package construction problem, characterized in that: include: Get the error log information generated during the software package building process; Based on a preset prompt word set, a large language model is conducted with multiple rounds of dialogues, and after it is determined that the large language model enters a software package building problem repair scenario mode after the multiple rounds of dialogues, the error log information is input into the large language model to obtain a target software package building problem repair recommendation output by the large language model; Among them, the target software package construction problem repair recommendation plan is constructed by the target software package construction problem repair template determined by the large language model from multiple candidate software package construction problem repair templates; the multiple candidate software package construction problem repair templates are obtained by searching a preset construction problem knowledge base; the preset construction problem knowledge base is constructed based on sample error log fragment information and the software package construction problem repair template corresponding to the sample error log fragment information.
2. The method for repairing software package construction problems according to claim 1, characterized in that: The preset construction question knowledge base is constructed by the following steps: Based on the software package building problem generated during the historical migration process, obtaining the sample error log fragment information corresponding to the software package building problem; Constructing the software package construction problem repair template according to the repair solution code information or repair patch information corresponding to the sample error log fragment information; Performing data enhancement processing on the sample error log fragment information to obtain a plurality of data enhanced processed sample error fragment information; Associating the sample error segment information after data enhancement processing with the software package construction problem repair template corresponding to the sample error segment information after data enhancement processing to obtain a construction problem data set; Based on the construction question data set, the preset construction question knowledge base is constructed.
3. The method for repairing software package construction problems according to claim 2, characterized in that: After obtaining the error log information generated during the construction of the software package, the method further includes: According to the text similarity between the log key segment in the error log information and the error log segment information in the preset construction problem knowledge base, the multiple candidate software package construction problem repair templates are matched from the construction problem data set in the preset construction problem knowledge base.
4. The method for repairing software package construction problems according to claim 3, characterized in that: The preset prompt word set includes a first preset prompt word and a second preset prompt word, wherein the first preset prompt word is constructed based on problem case construction information, the problem case construction information includes an error log fragment case and a repair template fragment corresponding to the error log fragment case; the second preset prompt word is constructed based on a software package configuration file fragment and a source code file fragment; The method of conducting multiple rounds of dialogue on the large language model based on the preset prompt word set includes: Inputting the first preset prompt word into the large language model to obtain software package construction problem repair templates of different construction problem types output by the large language model in the first round of dialogue; Determining a software package construction problem repair template of a target construction problem type from the software package construction problem repair templates of different construction problem types, and generating the second preset prompt word according to the software package configuration file fragment and the source code file fragment corresponding to the software package construction problem repair template of the target construction problem type; inputting the second preset prompt word into the large language model, obtaining software package construction problem repair case information corresponding to the software package construction problem repair template of the target construction problem type output by the large language model in the second round of dialogue, and determining that the large language model has entered the software package construction problem repair scenario mode; The software package construction problem repair case information is used as guidance information for generating a construction problem repair solution for the large language model, and the error log information is input into the large language model to obtain a recommended solution for repairing the target software package construction problem output by the large language model.
5. The method for repairing software package construction problems according to claim 2, characterized in that: The performing data enhancement processing on the sample error log segment information to obtain a plurality of data enhanced processed sample error segment information includes: Based on the BERT model, data enhancement processing is performed on the sample error log fragment information to obtain the sample error fragment information after the multiple data enhancement processing.
6. The method for repairing software package construction problems according to claim 2, characterized in that: After inputting the error log information into the large language model to obtain target software package construction problem repair information output by the large language model, the method further includes: constructing new build problem data according to the error log information and the target software package build problem repair information; The construction problem data set is updated according to the new construction problem data to obtain an updated preset construction problem knowledge base.
7. A software package construction problem repair system, characterized in that: include: Build a log collection module to obtain error log information generated during the software package building process; a multi-round dialogue module, configured to conduct a multi-round dialogue with a large language model based on a preset prompt word set, and after determining that the large language model enters a software package building problem repair scenario mode after the multi-round dialogue, input the error log information into the large language model to obtain a target software package building problem repair recommendation output by the large language model; Among them, the target software package construction problem repair recommendation plan is constructed by the target software package construction problem repair template determined by the large language model from multiple candidate software package construction problem repair templates; the multiple candidate software package construction problem repair templates are obtained by searching a preset construction problem knowledge base; the preset construction problem knowledge base is constructed based on sample error log fragment information and the software package construction problem repair template corresponding to the sample error log fragment information.
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 repairing a software package construction problem 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 repairing a software package construction problem 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 repairing a software package construction problem according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
System log intelligent analysis method and device based on large language model
CN117873979A
Log analysis method and device, equipment, medium and program product
CN118132305A
Text2SQL semantic parsing method for domain large language model
CN118377796A
Abnormal log processing method and device based on large language dialogue model
CN119512866A
Detecting and repairing reliability issues in operating systems and applications using a generative artificial intelligence system
WO2025029426A1
Cited By
Code automatic generation method and system based on algorithm model
CN121116382A