Kernel configuration item repair method and device based on large language model
By parsing kernel configuration logs using a large language model and combining configuration repairers and algorithm optimizations, repair solutions are automatically generated. This solves the accuracy and efficiency problems of kernel crash configuration repair in existing technologies, and achieves efficient and automatic configuration repair.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INST OF SOFTWARE - CHINESE ACAD OF SCI
- Filing Date
- 2025-12-26
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies cannot effectively identify and automatically repair misconfigurations caused by kernel crashes, and common automatic repair tools have high learning curves and poor configuration repair results.
The Large Language Model (LLM) is used to parse the configuration change log information of kernel configuration items, generate repair suggestions, and perform dependency analysis and logical verification through a configuration item repairer. The configuration items are optimized by combining the Cartesian product algorithm and the conflict matrix to achieve automatic generation of repair solutions.
It improves the accuracy and efficiency of kernel configuration error repair, reduces reliance on manual rules, ensures that the repaired configuration items are legal and consistent, and reduces the cost of manual intervention and debugging.
Smart Images

Figure CN122111722A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method and apparatus for repairing kernel configuration items based on a large language model. Background Technology
[0002] Currently, some research has focused on the identification and analysis of kernel configuration errors; for example, the TUXML tool was used to analyze the options and patterns of high-incidence configuration errors, revealing that a few key configuration items can cause the vast majority of builds to fail.
[0003] In related technologies, the TUXML tool is typically used to compile over 95,000 Linux kernel configurations on a large scale to identify high-frequency failure modes. However, this method only addresses issues during the compilation phase and cannot capture kernel panics during startup. It also lacks automatic repair capabilities, resulting in low practicality and an inability to effectively diagnose and repair system hangs or crashes that occur during the boot phase. Furthermore, common automatic repair tools (such as ConfigFix) have a high learning curve, requiring users to have strong Kconfig semantic understanding capabilities. The Kmax tool focuses on enabling errors caused by unmet configuration item dependencies, resulting in a high false positive rate. It can only cover a single error type and cannot handle more complex configuration conflicts and startup failures, leading to low accuracy in configuration repair. Summary of the Invention
[0004] This invention provides a kernel configuration item repair method and apparatus based on a large language model, addressing the shortcomings of existing technologies that use TUXML tools to fail to identify erroneous configurations caused by kernel crashes and cannot automatically repair erroneous configuration items, while common automatic repair tools have high learning curves and poor configuration repair results. The method and apparatus of this invention improve the accuracy and efficiency of repairing kernel configuration errors.
[0005] This invention provides a kernel configuration item repair method based on a large language model, comprising: Obtain the configuration change log information for the kernel configuration items to be repaired; The configuration change log information is parsed and processed based on a pre-defined Large Language Model (LLM) to obtain configuration repair suggestions; wherein, the LLM is used to represent the mapping relationship between different configuration change log information and different repair suggestions. The kernel configuration item to be repaired is repaired according to the configuration repair suggestions to obtain the repaired configuration item.
[0006] According to the present invention, a kernel configuration item repair method based on a large language model is provided, wherein obtaining the configuration change log of the kernel configuration item to be repaired includes: The kernel configuration items to be repaired were compiled and tested, and error log information was obtained. The error configuration items corresponding to the error log information are predicted using a large language model to obtain the error configuration item prediction results; The error configuration item prediction results are compared and analyzed with the corresponding initial configuration items to obtain the configuration change log.
[0007] According to the present invention, a kernel configuration item repair method based on a large language model is provided, wherein the kernel configuration item to be repaired is obtained through the following steps: The kernel configuration items to be repaired are obtained by disrupting various dependencies in the sample kernel configuration items and injecting error information.
[0008] According to a kernel configuration item repair method based on a large language model provided by the present invention, after obtaining the configuration repair suggestion corresponding to the corrupted configuration item, the method further includes: Based on the semantic constraints and dependency rules of Kconfig, the configuration repair suggestions are subjected to dependency analysis, logical verification and correction to obtain new configuration repair suggestions.
[0009] According to a kernel configuration item repair method based on a large language model provided by the present invention, after obtaining the repaired configuration item, the method further includes: The repaired configuration items were reconstructed and the test was started to obtain new log information; If the test of the repaired configuration item fails, the model parameters of the LLM are adjusted according to the new log information to obtain the adjusted LLM.
[0010] According to a kernel configuration item repair method based on a large language model provided by the present invention, the kernel configuration item to be repaired is repaired according to the configuration repair suggestion to obtain the repaired configuration item, which includes: A kernel configuration set is constructed using the Cartesian product algorithm, and the kernel configuration set includes multiple kernel configurations. A conflict matrix is constructed based on the configuration repair suggestions, and the maximum independent set problem is solved using the conflict matrix and the kernel configuration set to obtain a target configuration set combination, which is a subset of the kernel configuration set. The target configuration set combination is deduplicated and non-conflicting items are removed to obtain the repaired configuration items.
[0011] This invention also provides a kernel configuration item repair device based on a large language model, comprising: The log information acquisition module is used to acquire configuration change log information of the kernel configuration items to be repaired; The repair suggestion generation module is used to parse and process the configuration change log information based on a preset Large Language Model (LLM) to obtain configuration repair suggestions; wherein, the LLM is used to represent the mapping relationship between different configuration change log information and different repair suggestions; The configuration repair module is used to repair the kernel configuration item to be repaired according to the configuration repair suggestions, so as to obtain the repaired configuration item.
[0012] The present invention also provides a kernel configuration item repair device based on a large language model, the device further comprising: The verification module is used to perform dependency analysis, logical verification and correction on the configuration repair suggestions according to the semantic constraints and dependency rules of Kconfig after obtaining the configuration repair suggestions corresponding to the corrupted configuration items, so as to obtain new configuration repair suggestions. The feedback module is used to reconstruct the repaired configuration items and start the test after the repaired configuration items are obtained, so as to obtain new log information. If the test of the repaired configuration item fails, the model parameters of the LLM are adjusted according to the new log information to obtain the adjusted LLM.
[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the kernel configuration item repair method based on any of the above-described methods.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the kernel configuration item repair method based on any of the above-described methods.
[0015] The kernel configuration item repair method and apparatus based on a large language model provided by this invention obtains corresponding configuration repair suggestions by using configuration change log information as prompt words through a large language model, and then repairs the kernel configuration item to be repaired according to the configuration repair suggestions to obtain the repaired configuration item. This realizes the automatic generation of repair suggestions, reduces the high dependence on manual rules, and improves the accuracy and efficiency of repairing kernel configuration errors. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0017] Figure 1 This is one of the flowcharts illustrating the kernel configuration item repair method based on a large language model provided by this invention.
[0018] Figure 2 This is the second flowchart of the kernel configuration item repair method based on a large language model provided by the present invention.
[0019] Figure 3 This is a schematic diagram of the LLM iterative optimization process provided by the present invention.
[0020] Figure 4 This is a schematic diagram of the kernel configuration item repair device based on a large language model provided by the present invention.
[0021] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0023] The following is combined with Figures 1-4 This invention describes a kernel configuration item repair method and apparatus based on a large language model.
[0024] Figure 1 This is one of the flowcharts illustrating the kernel configuration item repair method based on a large language model provided by this invention, such as... Figure 1 As shown, the method includes the following steps: Step 110: Obtain the configuration change log information of the kernel configuration item to be repaired.
[0025] In this step, the kernel configuration items to be fixed are one or more kernel configuration options that cause system malfunctions (such as compilation failures or kernel panics at startup).
[0026] In this embodiment, the kernel configuration item to be repaired can be obtained in real time, or it can be obtained by breaking the dependencies of key configurations in normal kernel configuration items through a configuration item destroyer.
[0027] In this step, the configuration change log records all modification details of the configuration item to be repaired from a known normal state (such as the previous stable version or initial baseline configuration) to the current faulty state. This configuration change log can be used to track changes to critical configuration items instead of blindly analyzing the entire configuration set, while also helping to identify conflicts, missing items or broken dependencies between configuration items.
[0028] Step 120: Based on the preset Large Language Model (LLM), the configuration change log information is parsed and processed to obtain configuration repair suggestions; whereby the LLM is used to represent the mapping relationship between different configuration change log information and different repair suggestions.
[0029] In this step, the Large Language Model (LLM) is used to understand complex kernel configuration dependencies and failure modes.
[0030] In this step, the configuration repair suggestion is a specific modification plan generated by LLM based on the input logs to correct faulty configurations.
[0031] It should be noted that before the LLM was put into use, it had already utilized a large-scale, high-quality misconfiguration dataset (such as a dataset containing 25,707 misconfiguration samples generated by the Config Destroyer tool) to learn how various configuration changes cause problems and the corresponding correct fixes. The trained LLM was able to understand the meaning of configuration changes at the semantic level.
[0032] It should be noted that this embodiment does not require training of the LLM model; a publicly available LLM model can be directly used to process error logs and output the corresponding error configuration items, or the configuration change log information between the error configuration items and the correct configuration items can be input into the LLM to output the corresponding configuration repair suggestions.
[0033] In this embodiment, LLM uses configuration change log information as prompt words, making full use of a large amount of structured change logs and precise remediation tags, and combining LLM's pattern recognition and generation capabilities to achieve a precise mapping from configuration change log information to remediation suggestions.
[0034] This embodiment introduces a Large Language Model (LLM) combined with configuration change logs and error feedback to achieve semantic understanding of complex configuration errors and generate intelligent repair suggestions, overcoming the limitations of traditional rule-based or static analysis-based repair methods in handling diverse error scenarios.
[0035] Step 130: Repair the kernel configuration items to be repaired according to the configuration repair suggestions to obtain the repaired configuration items.
[0036] In this step, a configuration item repairer is used to actually modify the relevant options in the kernel configuration item to be repaired according to the configuration repair suggestions. After modification, the configuration item can resolve the original fault and ensure that the configuration item has the correct syntax logic.
[0037] In this embodiment, the configuration item repairer performs strict dependency verification and logical error correction on the repair suggestions generated by LLM to identify and eliminate any conflicting items that may cause new compilation or runtime problems, ensuring that the final output set of configuration items is legal and consistent.
[0038] Specifically, the configuration item repairer first merges the LLM's repair suggestions into the current set of configuration items to be repaired, forming a target configuration item set. For each modification item in the target configuration item set, a comprehensive Kconfig dependency analysis is performed, and it checks whether there are other deeper rules that may conflict with these two configuration items. When the configuration item repairer detects such a conflict, it does not simply accept the LLM's suggestions, but rather, based on preset priorities or deeper Kconfig semantics, it "removes" illogical or suboptimal configuration items from multiple conflicting configuration items, or corrects them. After all dependency checks and conflict resolution, the configuration item repairer finally generates a completely legal and conflict-free kernel configuration file, that is, the repaired configuration items.
[0039] The kernel configuration item repair method based on a large language model provided in this invention obtains corresponding configuration repair suggestions by using configuration change log information as prompt words through a large language model, and then repairs the kernel configuration item to be repaired according to the configuration repair suggestions to obtain the repaired configuration item. This realizes the automatic generation of repair suggestions, reduces the high dependence on manual rules, and improves the accuracy and efficiency of repairing kernel configuration errors.
[0040] In some embodiments, obtaining the configuration change log of the kernel configuration item to be repaired includes: compiling and booting the kernel configuration item to be repaired to obtain error log information; using a large language model to predict the error configuration item corresponding to the error log information to obtain the error configuration item prediction result; and comparing and analyzing the error configuration item prediction result with the corresponding initial configuration item to obtain the configuration change log.
[0041] In this embodiment, the kernel configuration item to be repaired can be a kernel configuration file (.config) that the user tried to use but caused abnormal system function (such as compilation failure, system crash, etc.).
[0042] In this embodiment, the kernel generated based on the kernel configuration items to be repaired is compiled and attempted to be loaded and run in a real hardware or virtual machine environment. This can simulate a real environment to trigger and capture system failures, thereby generating error log information required for subsequent analysis.
[0043] For example, an embedded system developer modifies the Linux kernel configuration based on a baseline version, generating a new .config file. To verify the correctness of this new configuration, they first attempt to compile the kernel. If compilation fails, the compiler will output detailed compilation error logs (such as the output of the make command). If compilation succeeds, the new kernel is then flashed and booted into the target device or an emulator such as QEMU. If a kernel panic occurs during the boot process or the system fails to enter the operating system normally, the system will output corresponding boot error logs (such as dmesg information and panic stack backtrace information), thus obtaining the error log information corresponding to the new configuration.
[0044] In this embodiment, the core "sample error configuration item" that caused the error can be inferred from the complex error log by using preset rules, heuristic algorithms, or preliminary pattern matching tools.
[0045] For example, the big oracle model can be used to associate unstructured error logs with structured configuration items and accurately indicate which (or which group of) configuration items were modified that caused the error reflected in the log, i.e., the error configuration item prediction result.
[0046] In this embodiment, the initial configuration item can be a kernel configuration that is known to be in a normal working state (e.g., the configuration of the previous stable version, or a known compileable / bootable baseline configuration).
[0047] In this embodiment, by comparing and analyzing the erroneous configuration item with the corresponding initial configuration item, the specific differences between the "erroneous configuration item" that caused the failure and the "initial configuration item" in the current configuration are identified, i.e., the configuration change log.
[0048] The kernel configuration item repair method based on a large language model provided in this invention involves compiling and booting the kernel configuration item to be repaired to obtain error log information; using a large language model to identify the erroneous configuration item in the kernel configuration to be repaired from the error log information; and then comparing and analyzing the erroneous configuration item with the corresponding initial configuration item to obtain a configuration change log. This provides data support for subsequent intelligent analysis and repair suggestions by the large language model, and reduces the amount of information that the model needs to process.
[0049] In some embodiments, the kernel configuration item to be repaired is obtained by the following steps: breaking multiple dependencies in the sample kernel configuration item and injecting error information to obtain the kernel configuration item to be repaired.
[0050] In this embodiment, a configuration item disruptor can systematically inject various dependency disruption modes (including disabling critical drivers, modifying complex dependencies, etc.) into the sample kernel configuration items, injecting build failures, thereby simulating misconfigurations in a real environment and building a large-scale, high-quality failure sample, i.e., a kernel configuration error dataset.
[0051] Specifically, by configuring a disruptor to randomly or according to a preset strategy modify one or a group of configuration items in the sample kernel configuration, causing them to violate Kconfig's dependency rules or introduce known failure patterns, the system simulates various misconfigurations that may occur in the real world, providing large-scale, high-quality and representative "misconfiguration" inputs for LLM training.
[0052] For example, the ConfigDestroyer tool was used to systematically inject failure points into the kernel configuration, generating a large-scale failure dataset containing 25,707 erroneous configuration samples. This is an order of magnitude larger than existing public datasets, providing a solid data foundation for the training and evaluation of configuration repair algorithms.
[0053] The kernel configuration item repair method based on a large language model provided in this invention destroys multiple dependencies in the sample kernel configuration items and injects error information to obtain a kernel configuration error dataset. This method can quickly obtain a large amount of error configuration data and improve the efficiency of algorithm testing and verification.
[0054] In some embodiments, after obtaining the configuration repair suggestion corresponding to the corrupted configuration item, the method further includes: performing dependency analysis, logical verification and correction on the configuration repair suggestion according to the semantic constraints and dependency rules of Kconfig to obtain a new configuration repair suggestion.
[0055] In this embodiment, the semantic constraints and dependency rules of Kconfig are a series of strict definitions and constraints unique to the Linux kernel configuration system Kconfig, including syntax, types, dependencies, mutual exclusion, and selection, used to determine whether kernel configuration items are valid.
[0056] In this embodiment, the configuration repairer performs a deep check on the LLM's configuration repair suggestions. First, it checks the dependencies of the configuration items corresponding to the configuration repair suggestions. If there are obvious dependency conflicts, they are corrected to ensure that there are no conflicts between the configuration items corresponding to the configuration repair suggestions.
[0057] Next, it checks whether the configuration item corresponding to the configuration repair suggestion conflicts with other existing or forced configuration items. If a conflict exists, the configuration item repairer will correct it according to the preset strategy and finally output a legal and logically correct configuration repair suggestion to modify the kernel configuration item to be repaired, and finally obtain the repaired configuration item.
[0058] The kernel configuration item repair method based on a large language model provided in this invention achieves consistent maintenance of dependencies between complex configuration items by dynamically parsing the configuration graph and correcting semantic conflicts caused by repair suggestions, thus avoiding secondary build failures caused by repair suggestions.
[0059] In some embodiments, after obtaining the repaired configuration item, the method further includes: reconstructing the repaired configuration item and starting a test to obtain new log information; if the test of the repaired configuration item fails, adjusting the model parameters of the LLM according to the new log information to obtain the adjusted LLM.
[0060] In this embodiment, QEMU and the compiler can be invoked to verify the newly generated configuration file. The verification process includes compilation checks, boot tests, and functional verification to ensure that the configuration can generate the kernel and run correctly.
[0061] In this embodiment, the entire Linux kernel (or related modules) is recompiled using the repaired configuration items, and the newly compiled kernel is burned into a QEMU virtual machine to attempt to start and run. New log information is obtained, which can determine whether the repair was truly successful and capture any new problems or unresolved old problems that may have been introduced during the repair process.
[0062] In this embodiment, if the virtual machine starts normally without a Kernel Panic or other anomalies, and the system functions normally, the new log information indicates that the repair was successful. If a Kernel Panic still occurs during the virtual machine startup process, or other new errors occur, the Kernel Panic information, error stack traceback, and other diagnostic outputs can be used to obtain corresponding new log information. This log records in detail the problems encountered in actual operation of the repaired configuration.
[0063] In this embodiment, the failure of the repaired configuration item test is the condition that triggers the LLM model parameter adjustment, that is, the initial LLM recommendation (even after preliminary verification by the Kconfig repairer) failed to completely solve the problem or introduced new problems.
[0064] Based on this, this embodiment uses specific machine learning mechanisms (such as reinforcement learning, continuous fine-tuning, etc.) to update the internal parameters (weights) of LLM with new log information, thereby further improving the accuracy of LLM prediction configuration modification opinions.
[0065] The kernel configuration item repair method based on a large language model provided in this invention optimizes LLM parameters by utilizing new log information, forming a closed-loop automated process from error injection, log feedback, intelligent repair to verification and confirmation, which significantly reduces the cost of manual intervention and debugging. At the same time, this feedback mechanism enables dynamic verification of repair results and multi-round iterative optimization of LLM, thereby improving the robustness and automation level of system repair.
[0066] In some embodiments, the kernel configuration items to be repaired are repaired according to the configuration repair suggestions to obtain the repaired configuration items, including: constructing a kernel configuration set using the Cartesian product algorithm, the kernel configuration set including multiple kernel configurations; constructing a conflict matrix according to the configuration repair suggestions, and using the conflict matrix and the kernel configuration set to solve the maximum independent set problem to obtain a target configuration set combination, the target configuration set combination being a subset of the kernel configuration set; and performing deduplication and removal of non-conflicting items on the target configuration set combination to obtain the repaired configuration items.
[0067] In this embodiment, the Cartesian product algorithm is used to systematically traverse and combine all possible configuration item modifications to generate a set containing all feasible combinations, thus obtaining the complete search space consisting of all potential repair combinations.
[0068] In this embodiment, the conflict matrix is used to record the conflicting relationships between various configuration items (and their values) in the kernel configuration set, including "mutual exclusion" or "dependency".
[0069] In this embodiment, the maximum independent set problem is a classic graph theory problem. Given a graph (where nodes are configurations and edges are conflicts), the goal is to find a subset of nodes such that there are no edges (i.e., no conflicts) between any two nodes in the subset, and the size of this subset is the largest.
[0070] In this embodiment, the conflict matrix is converted into a graph, and a maximum independent set algorithm (such as an approximate algorithm or an exact algorithm, depending on the problem size and performance requirements) is used to solve the maximum independent set problem. This algorithm is used to select the largest, internally consistent and conflict-free combination of configuration items from the kernel configuration set generated in the previous step, and obtain the corresponding target configuration set combination.
[0071] In this embodiment, duplicate or equivalent configuration items in the target configuration set combination are removed by deduplication, and items in the target configuration set combination that do not change the original faulty configuration item and do not directly contribute to solving the original problem, or have become redundant due to the adjustment of other configuration items, are removed by eliminating non-conflicting items.
[0072] The kernel configuration item repair method based on a large language model provided in this invention constructs a kernel configuration set using the Cartesian product algorithm, then constructs a conflict matrix based on configuration repair suggestions, and uses the conflict matrix and kernel configuration set to solve the maximum independent set problem to obtain a target configuration set combination. Finally, the target configuration set combination is deduplicated and non-conflicting items are removed to obtain the repaired configuration items. This reduces unnecessary configuration modifications, thereby reducing the risk of introducing new problems. Moreover, it ensures that the repaired configuration items can solve the original problem in a minimal and accurate manner, improving the quality and maintainability of the repair.
[0073] Figure 2 This is the second flowchart of the kernel configuration item repair method based on a large language model provided by this invention. Figure 2 In the illustrated embodiment, the kernel configuration item repair method includes: Step 1 (#1 Configuration Item Destroyer): Use the configuration item destroyer to break the dependency structure between kernel configuration items (using a tree diagram, with arrows indicating "dependencies" between nodes), and output the broken configuration items; where blue, red, and gray represent configuration items in different states (not selected, conflicting, manually set). Step 2 (#2 Error Message): The user inputs kernel error messages using natural language or other methods; for example, inputting the QEMU error message into the large language model: QEMU encountered the following problem during startup: "'End Kernel Panic-xxx'. Please help determine which modules are misconfigured and causing this problem"; the large language model outputs the incorrect configuration items (i.e., critical modules).
[0074] Step 3 (#3 Modify Log Information): Compare the erroneous configuration items with the corresponding initial configuration items to obtain configuration item change information (i.e., logs), which corresponds to the prompt: "The modification records of the above modules are as follows: 1. CONFIG_VIRTIO_BLK y→n; 2. CONFIG_VIRTIO_PCI y→n…"; Then input the log into LLM to obtain configuration repair suggestions (i.e., large model suggestions); Step 4 (#4 Configuration Item Repairer): Since the configuration recommended by the large model itself introduces incorrect configuration item dependencies, this embodiment uses a configuration item repairer to repair the configuration combination given by the large model, and obtains the repaired configuration item. Step 5 (Application of Configuration Item #5): QEMU and the compiler are invoked to verify the newly generated configuration file. This verification process includes compilation checks, startup tests, and functional verification to ensure that the configuration can generate the kernel and run normally. If the corrected configuration item fails to start normally, it indicates that the LLM repair suggestion is invalid (a new error has occurred). The new error data is fed back to LLM for parameter tuning. If the corrected configuration item is found to have a duplicate error, a new prompt word is constructed, "Prompt the large model and increase the temperature of the large model," to dynamically adjust the model generation parameters to increase output diversity, and the next round of iteration repair begins.
[0075] Figure 3 This is a schematic diagram of the LLM iterative optimization process provided by the present invention. Figure 3 The LLM iterative repair process is implemented through the following steps in the illustrated embodiment: Step 1: Use a configuration item destroyer to systematically destroy the initial configuration items (such as disabling important drivers or modifying dependencies), inject build failures, thereby simulating misconfigurations in a real environment and building a large-scale, high-quality failure sample, which is the destroyed configuration item.
[0076] Step two involves comparing the corrupted configuration items of key modules with their original normal configurations to generate detailed configuration change logs. These logs are used to track changes to key configuration items and help identify conflicts, missing items, or broken dependencies between them. During this process, the corrupted configuration items can be compiled and tested using the QEMU virtual machine environment. Build logs and startup logs (including kernel panic information) are collected as direct feedback on system-level failures. The larger model then uses this log information to determine which key kernel module modification caused the error.
[0077] Step 3: Input the configuration change log into the LLM model to generate preliminary configuration repair suggestions.
[0078] Step four: To prevent LLM from introducing new build errors, the system introduces a configuration item repairer to perform dependency analysis, logical verification, and correction on the configuration repair suggestions generated by the model, ensuring that the final configuration meets the semantic constraints and dependency rules of Kconfig.
[0079] Step 5: Repair the corrupted configuration items using the configuration item repair tool's corrected configuration repair suggestions. Step 6: In the configuration verification phase, rebuild the repaired configuration and test the startup in QEM. If the system starts successfully, the repair is complete. If it still fails, feed the new diagnostic information back to LLM and dynamically adjust the model generation parameters (such as temperature) to increase output diversity, and proceed to the next round of iterative repair.
[0080] The kernel configuration item repair device based on a large language model provided by the present invention will be described below. The kernel configuration item repair device based on a large language model described below and the kernel configuration item repair method based on a large language model described above can be referred to in correspondence.
[0081] Figure 4 This is a schematic diagram of the kernel configuration item repair device based on a large language model provided by the present invention, as shown below. Figure 4 As shown, the kernel configuration item repair device based on the large language model includes: a log information acquisition module 410, a repair suggestion generation module 420, and a configuration repair module 430.
[0082] Log information acquisition module 410 is used to acquire configuration change log information of the kernel configuration items to be repaired; The repair suggestion generation module 420 is used to parse and process the configuration change log information based on the preset Large Language Model (LLM) to obtain configuration repair suggestions; wherein, the LLM is used to represent the mapping relationship between different configuration change log information and different repair suggestions; The configuration repair module 430 is used to repair the kernel configuration items to be repaired according to the configuration repair suggestions, and obtain the repaired configuration items.
[0083] The kernel configuration item repair device based on a large language model provided in this invention obtains corresponding configuration repair suggestions using configuration change log information as prompts through the large language model. Then, it repairs the kernel configuration item to be repaired according to the suggestions, resulting in the repaired configuration item. This achieves automatic generation of repair suggestions, reduces the heavy reliance on manual rules, and improves the accuracy and efficiency of repairing kernel configuration errors. In some embodiments, the device further includes: The verification module is used to perform dependency analysis, logical verification, and correction on the configuration repair suggestions corresponding to the corrupted configuration items, according to the semantic constraints and dependency rules of Kconfig, to obtain new configuration repair suggestions.
[0084] The kernel configuration item repair device based on a large language model provided in this embodiment of the invention achieves consistent maintenance of dependencies between complex configuration items by dynamically parsing the configuration graph and correcting semantic conflicts caused by repair suggestions, thus avoiding secondary build failures caused by repair suggestions.
[0085] In some embodiments, the device further includes: The feedback module is used to reconstruct the fixed configuration items after receiving the corrected configuration items and start the test to obtain new log information. If the test of the repaired configuration item fails, adjust the model parameters of the LLM based on the new log information to obtain the adjusted LLM.
[0086] The kernel configuration item repair device based on a large language model provided in this invention optimizes the parameters of the LLM using new log information, forming a closed-loop automated process from error injection, log feedback, intelligent repair to verification and confirmation, which greatly reduces the cost of manual intervention and debugging. At the same time, this feedback mechanism enables dynamic verification of repair results and multi-round iterative optimization of the LLM, thereby improving the robustness and automation level of system repair.
[0087] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5 As shown, the electronic device may include a processor 510, a communications interface 520, a memory 530, and a communication bus 540, wherein the processor 510, communications interface 520, and memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute a kernel configuration item repair method based on a large language model. This method includes: obtaining configuration change log information of the kernel configuration item to be repaired; parsing and processing the configuration change log information based on a preset large language model (LLM) to obtain configuration repair suggestions; wherein the LLM is used to represent the mapping relationship between different configuration change log information and different repair suggestions; and repairing the kernel configuration item to be repaired according to the configuration repair suggestions to obtain the repaired configuration item.
[0088] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0089] On the other hand, the present invention also provides a computer program product, which includes a computer program that 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 kernel configuration item repair method based on the large language model provided by the above methods. The method includes: obtaining configuration change log information of the kernel configuration item to be repaired; parsing and processing the configuration change log information based on a preset large language model (LLM) to obtain configuration repair suggestions; wherein, the LLM is used to represent the mapping relationship between different configuration change log information and different repair suggestions; and repairing the kernel configuration item to be repaired according to the configuration repair suggestions to obtain the repaired configuration item.
[0090] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program is implemented to perform the kernel configuration item repair method based on the large language model provided by the above methods. The method includes: obtaining configuration change log information of the kernel configuration item to be repaired; parsing and processing the configuration change log information based on a preset large language model (LLM) to obtain configuration repair suggestions; wherein, the LLM is used to represent the mapping relationship between different configuration change log information and different repair suggestions; and repairing the kernel configuration item to be repaired according to the configuration repair suggestions to obtain the repaired configuration item.
[0091] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0092] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A kernel configuration item repair method based on a large language model, characterized in that, include: Obtain the configuration change log information for the kernel configuration items to be repaired; The configuration change log information is parsed and processed based on a pre-defined Large Language Model (LLM) to obtain configuration repair suggestions; wherein, the LLM is used to represent the mapping relationship between different configuration change log information and different repair suggestions. The kernel configuration item to be repaired is repaired according to the configuration repair suggestions to obtain the repaired configuration item.
2. The kernel configuration item repair method based on a large language model according to claim 1, characterized in that, The configuration change log for obtaining the kernel configuration items to be repaired includes: The kernel configuration items to be repaired were compiled and tested, and error log information was obtained. The error configuration items corresponding to the error log information are predicted using a large language model to obtain the error configuration item prediction results; The error configuration item prediction results are compared and analyzed with the corresponding initial configuration items to obtain the configuration change log.
3. The kernel configuration item repair method based on a large language model according to claim 1 or 2, characterized in that, The kernel configuration items to be repaired are obtained through the following steps: The kernel configuration items to be repaired are obtained by disrupting various dependencies in the sample kernel configuration items and injecting error information.
4. The kernel configuration item repair method based on a large language model according to claim 1, characterized in that, After obtaining the configuration repair suggestions corresponding to the damaged configuration item, the method further includes: Based on the semantic constraints and dependency rules of Kconfig, the configuration repair suggestions are subjected to dependency analysis, logical verification and correction to obtain new configuration repair suggestions.
5. The kernel configuration item repair method based on a large language model according to claim 1, characterized in that, After obtaining the repaired configuration items, the method further includes: The repaired configuration items were reconstructed and the test was started to obtain new log information; If the test of the repaired configuration item fails, the model parameters of the LLM are adjusted according to the new log information to obtain the adjusted LLM.
6. The kernel configuration item repair method based on a large language model according to claim 1, characterized in that, The process of repairing the kernel configuration items to be repaired according to the configuration repair suggestions yields the following repaired configuration items: A kernel configuration set is constructed using the Cartesian product algorithm, and the kernel configuration set includes multiple kernel configurations. A conflict matrix is constructed based on the configuration repair suggestions, and the maximum independent set problem is solved using the conflict matrix and the kernel configuration set to obtain a target configuration set combination, which is a subset of the kernel configuration set. The target configuration set combination is deduplicated and non-conflicting items are removed to obtain the repaired configuration items.
7. A kernel configuration item repair device based on a large language model, characterized in that, include: The log information acquisition module is used to acquire configuration change log information of the kernel configuration items to be repaired; The repair suggestion generation module is used to parse and process the configuration change log information based on a preset Large Language Model (LLM) to obtain configuration repair suggestions; wherein, the LLM is used to represent the mapping relationship between different configuration change log information and different repair suggestions; The configuration repair module is used to repair the kernel configuration item to be repaired according to the configuration repair suggestions, so as to obtain the repaired configuration item.
8. The kernel configuration item repair device based on a large language model according to claim 7, characterized in that, The device further includes: The verification module is used to perform dependency analysis, logical verification and correction on the configuration repair suggestions according to the semantic constraints and dependency rules of Kconfig after obtaining the configuration repair suggestions corresponding to the corrupted configuration items, so as to obtain new configuration repair suggestions. The feedback module is used to reconstruct the repaired configuration items and start the test after the repaired configuration items are obtained, so as to obtain new log information. If the test of the repaired configuration item fails, the model parameters of the LLM are adjusted according to the new log information to obtain the adjusted LLM.
9. 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, it implements the kernel configuration item repair method based on the large language model as described in any one of claims 1 to 6.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the kernel configuration item repair method based on the large language model as described in any one of claims 1 to 6.