Kernel patch locating method and system based on large language model and dynamic dichotomy convergence

By using a large language model and dynamic binary search convergence technology, combined with compiler cache reuse and parallel testing, the problem of low efficiency in kernel patch location was solved, achieving fast and stable patch location and system stability.

CN123178284APending Publication Date: 2026-11-27KYLIN CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611655902.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-26
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing technologies suffer from low patch location efficiency during kernel iteration, inability to effectively utilize patch semantic information, unusable compilation results, and inability to support concurrent functional testing, thus affecting system stability.

Method used

A kernel patch localization method based on a large language model is adopted, which combines compiler cache reuse and parallel testing strategies. The large language model is used to perform semantic analysis to generate a list of candidate problem patches, and the localization range is narrowed by dynamic binary convergence technique.

Benefits of technology

It enables rapid location of kernel problem patches, improves location efficiency, reduces compilation time, supports concurrent functional testing, and ensures system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178284A_ABST
    Figure CN123178284A_ABST
Patent Text Reader

Abstract

The application discloses a kernel patch positioning method and system based on a large language model and dynamic dichotomy convergence, which comprises the following steps: obtaining a commit interval of kernel patch positioning, performing compilation testing on left and right endpoints and storing them in a tested list; determining a patch type according to a right endpoint test result; inputting commit description texts of other patches in the interval into a large language model to generate a candidate problem patch list, simultaneously issuing compilation testing on a patch point corresponding to a position and a first element A1 of the QwList, and dynamically adjusting a convergence interval according to a reporting sequence and a test result; when the QwList is empty, issuing compilation testing on three to-be-tested version points, dynamically judging a convergence direction according to a first reporting result and terminating irrelevant test tasks; and outputting all problem patch points and a last marked problem patch point. The application can reduce the problem patch positioning efficiency from O(n) of a traditional dichotomy method to O(log n) level.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer software testing and kernel debugging technology, specifically to a kernel patch location method and system based on a large language model and dynamic binary convergence. Background Technology

[0002] The kernel is the core of the operating system, and its stability is crucial to the overall reliability of the system. During kernel iteration, the massive number of patches submitted by multiple developers can easily introduce new defects after integration. These patches need to be verified one by one through compilation, deployment, and testing to locate problematic patches.

[0003] Existing solutions mostly employ a binary search approach to narrow down the scope of problematic patches, but they all suffer from the following shortcomings: First, they do not fully utilize patch commit information for preprocessing, resulting in limited location efficiency; second, each location attempt requires a full kernel recompile, and the compilation results cannot be reused between different versions, further lengthening the location cycle; third, some solutions are only suitable for performance testing scenarios and cannot support concurrent verification and rapid convergence of functional test cases; fourth, some methods rely on known vulnerability locations or focus on code-level modification analysis, failing to assess the impact of patches on system functionality. Currently, there is a lack of an efficient kernel patch location method that can effectively utilize patch semantic information, achieve compilation result reuse, and support parallel testing. Summary of the Invention

[0004] The technical problem to be solved by this invention is to provide a kernel patch location method and system based on a large language model and dynamic binary convergence, which can use a large language model to perform semantic analysis on patch description text, generate a candidate problem patch list, and combine a compiler cache reuse mechanism and a parallel testing strategy to achieve rapid location of problem patches.

[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention includes the following steps: S1, Obtain the commit range where the kernel patch is located. The commit interval contains multiple patch commit points arranged in chronological order, each corresponding to the left endpoint of the commit interval. and right endpoint The corresponding kernel version is used for compilation and testing, and the version point of the completed test is stored in the tested list. Before each compilation, the previously tested list is queried. If the kernel version to be compiled already exists in the tested list... If the kernel is already successfully compiled, it will be reused; otherwise, a kernel compilation task will be issued.

[0006] S2, based on the right endpoint The test results determine the patch type: if the right endpoint If it is a problem patch, then mark it as a problem patch point and proceed to step S3; if the right endpoint If it is a normal patch, mark it as a normal patch point and end the current process.

[0007] S3, within the commit interval excluding the left endpoint and the right endpoint The commit-id, range position, and commit description text of other patch points are input into a large language model. The large language model outputs a candidate list QwList of potential issue patches based on the semantics of the commit description text. Elements in the candidate list QwList are sorted in ascending order of their position within the commit range, and the length QLength of the candidate list QwList is given by the formula QLength = ... Determine, where n is the total number of patch points in the commit interval, n≥2.

[0008] S4, input QwList, calculate the location of the next site to be determined. and to The kernel compilation and testing are based on the version point corresponding to the location and the A1 point in QwList, according to the reporting order of the test results, the status of their respective normal / problem patch points, and A1 relative to... The position is dynamically adjusted to convergence interval, and segments that are unlikely to contain problem patches are removed from the candidate list QwList.

[0009] S5, when the candidate list QwList is empty, enter the three-point parallel acceleration stage: calculate the positions of three test points L1, L2, and L3 within the current convergence interval, and simultaneously issue compilation and testing tasks to the version points corresponding to the three test points; dynamically determine the convergence direction based on the first reported test result and terminate irrelevant test tasks.

[0010] S6, end this round of binary search and output the problem patch list Candilist, which consists of all problem patch points marked as problem patch points, and output the last problem patch point marked as a problem patch point. .

[0011] Furthermore, step S2, determining the patch type based on the test results, specifically includes: setting a preset comparison parameter threshold Thres; if the test results... If the value is weaker than the threshold Thres, then it is marked. This is a patch for the problem; if the test results... If the value is greater than or equal to the threshold Thres, then it is marked. This is a normal patch.

[0012] Furthermore, in the candidate list QwList output by the large language model in step S3, each element contains the commit-id corresponding to the patch and the position information of the patch point in the commit interval.

[0013] Furthermore, step S4 involves the order in which the test results are reported, the status of each normal patch point / problem patch point, and A1 relative to... The position of the segment is dynamically adjusted, the convergence interval is dynamically adjusted, and segments that are unlikely to contain the problem patch are removed from the candidate list QwList. Specifically, this includes: If A1 is reported first and is a problem patch, then A1 is marked as a problem patch point, and all patch points in the candidate list QwList are removed; if A1 is located in... If the right boundary of the convergence interval is on the left, then the position A1 is set; if A1 is located on the right... On the right, the left boundary of the convergence interval is set to position A1; If A1 reports first and A1 is a normal patch, mark A1 as a normal patch point and wait. The test results, and based on The test results determine the new convergence interval and the deletion strategy of QwList; when Report first and When patching an issue, mark it. For the problem patching point, determine the new convergence interval and the deletion strategy of QwList based on the location of A1 and the test results; when Report first and When it is a normal patch, mark it. As a normal patch point, a new convergence interval and deletion strategy for QwList are determined based on the position of A1 and the test results.

[0014] Furthermore, the calculation of the positions of the three test points L1, L2, and L3 in step S5 specifically includes: , ,

[0015] in This represents the position index of the left boundary point of the current convergence interval within the commit interval. This is the position number of the right boundary point of the current convergence interval within the commit interval.

[0016] Furthermore, step S5, which involves dynamically determining the convergence direction and terminating irrelevant test tasks based on the first reported test result, specifically includes: If the first reported patch point is a normal patch, then mark it as a normal patch point, terminate all waiting test tasks to the left of that patch point, and continue to wait for the results of the unreported test tasks to the right. If the first reported patch is a problematic patch, it is marked as a problematic patch, all waiting test tasks to the right of that patch are terminated, and the system continues to wait for the results of unreported test tasks to the left.

[0017] Furthermore, in steps S4 and S5, after each compilation and test is completed, the successfully compiled version is stored in the tested list. middle.

[0018] This invention also provides a kernel patch location system based on a large language model and dynamic binary search convergence, for implementing the above method, including: The endpoint compilation and caching module is used to obtain the commit range to be located, perform compilation and testing on the endpoint, and check the list of already tested endpoints. Reuse the compiled kernel; The endpoint type determination module is used to determine the endpoint patch type based on the test results and mark problematic or normal patch points. The large language model pre-screening module is used to input the patch commit-id, range position, and commit description text into the large language model, and output a candidate issue patch list QwList, based on QLength= Constrain the length of the output list; Parallel binary search convergence module, used for midpoint The compilation and testing were conducted simultaneously with the first element A1 of QwList, based on the reporting order, test results, and A1 relative to... The position is dynamically adjusted to convergence interval and QwList; The three-point parallel acceleration module is used to calculate three test points in the convergence interval after QwList is exhausted and simultaneously send out compilation tests. It dynamically determines the convergence direction based on the first reported result and terminates irrelevant tasks. The results output module outputs a list of all problematic patches, called Candilist, along with the last marked problematic patch. .

[0019] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described method. Attached Figure Description

[0020] Figure 1This is a flowchart illustrating the overall process of the kernel patch location method of this invention.

[0021] Figure 2 This is a flowchart of step S4, parallel binary search and dynamic convergence, of the present invention.

[0022] Figure 3 This is a flowchart of the process in step A1 of the present invention, which involves reporting the issue and determining whether A1 is a problem patch.

[0023] Figure 4 This is a flowchart of the process when step A1 of the present invention is reported first and is a normal patch.

[0024] Figure 5 A1 was reported first and its position was... A schematic diagram illustrating the convergence situation over the interval.

[0025] Figure 6 The position of A1 is interval and This diagram illustrates the convergence process when the problem is patched.

[0026] Figure 7 The position of A1 is interval and This is a schematic diagram illustrating the convergence process when the patch point is normal.

[0027] Figure 8 The position of A1 is interval and This is a schematic diagram illustrating the convergence process when the patch point is normal.

[0028] Figure 9 The position of A1 is interval and This diagram illustrates the convergence process when the problem is patched.

[0029] Figure 10 The position of A1 is A schematic diagram illustrating the convergence when A1 is reported as a normal patch point first.

[0030] Figure 11 for First, report it as a problem patch point; the location of A1 is... A schematic diagram illustrating the convergence of the interval where A1 is the problem patch point.

[0031] Figure 12 for First, report it as a problem patch point; the location of A1 is... A schematic diagram illustrating the convergence of the interval where A1 is a normal patch point.

[0032] Figure 13 for First, report it as a problem patch point; the location of A1 is... A schematic diagram illustrating the convergence situation over the interval.

[0033] Figure 14 for First, report it as a normal patch point; the location of A1 is... A schematic diagram illustrating the convergence situation over the interval.

[0034] Figure 15 for First, report it as a normal patch point; the location of A1 is... A diagram illustrating the convergence of the interval where A1 is the problem patch point.

[0035] Figure 16 for First, report it as a normal patch point; the location of A1 is... A schematic diagram of convergence when A1 is a normal patch point in the interval. Detailed Implementation

[0036] The present invention will be further described below with reference to the accompanying drawings and specific preferred embodiments, but this does not limit the scope of protection of the present invention.

[0037] In this embodiment, the server is deployed on a high-performance compilation server. The server is responsible for obtaining the commit range to be located, issuing compilation and testing tasks, and managing the list of tested tasks. The execution end is responsible for performing kernel compilation, kernel upgrade, and test case testing, and reporting the test results to the server.

[0038] server Stores version point information of successfully compiled versions, i.e. = The test record for each version point is represented as , Indicates the test result (pass or fail). This indicates that the point in this version is in the interval. Position in the list Indicates the version point type. This indicates the commit-id corresponding to the version number. Indicates the test end time. This indicates the testing order of this version in this round of localization.

[0039] like Figure 1 As shown, the server first obtains the commit range to be located. This range contains multiple patch commit points arranged chronologically. = [ , , , ..., ],in The left endpoint The right endpoint is used; the server uses the left endpoint. and right endpoint The corresponding kernel version executes the compilation and testing tasks. Before issuing the compilation task, the server first queries the list of already tested kernels. Then determine whether the kernel version to be compiled already exists. If the kernel already exists, it is directly assigned to the current compilation task without needing to compile it again; if it does not exist, the kernel compilation task is sent to the execution end, which then completes the kernel compilation. After compilation, the execution end performs test cases on the compiled kernel version and reports the test results to the server. After the tests are completed, the server will... and Store the corresponding version information In the middle, through The caching mechanism avoids the time-consuming and repetitive work of fully compiling the kernel.

[0040] Specifically, such as Figure 1 As shown, the test results are compared using the preset comparison parameter threshold Thres. With threshold Thres. If Weaker than the threshold Thres, for example, the preset threshold Thres value is pass. Patch Corresponding If the value is fail, then mark it. This is the issue patch (issue patch point), and we will continue with subsequent location steps; if If it is better than or equal to the threshold Thres, then mark it. If this is a normal patch (normal patch point), it means there are no problematic patches in the entire commit range, and the process ends. Simultaneously, the server will... and The test results for both versions are stored in the tested list. middle; Specifically, such as Figure 1 As shown, when Once marked as an issue patch point, the server will commit the range excluding the left endpoint. t and right endpoint Information about other patch points besides these is input into the large language model. The server constructs the input information Msg = Each element Includes the commit-id of the corresponding patch, and the range in which the patch is located. The location information and commit message text are included. Based on the semantics of each patch's commit message text, the large language model identifies whether each patch is related to the issue discovered in this test, and outputs a candidate list QwList of potential issue patches. QwList = Each element Includes the commit-id corresponding to the patch and the range in which the patch point is located. The elements in the QwList are sorted in ascending order based on their position within the commit interval. To ensure that the QwList output by the large model can effectively improve convergence efficiency, the server constrains the length of the QwList, QLength, which is calculated using the formula QLength = ... Where n is the commit interval The total number of patch points, n≥2. The LLM output length is linked to the theoretical number of steps of binary search. The LLM analyzes the patch submission description text to generate a candidate list, reducing the problem patch location efficiency from O(n) to O(log n).

[0041] Specifically, such as Figure 2 As shown, calculate the midpoint position of the commit interval. , ,in Left endpoint The position number in the interval. Right endpoint The position number within the interval. Server-side midpoint position. The corresponding version point and the version point corresponding to the first element A1 in QwList are simultaneously issued for compilation and testing tasks. Before issuing the compilation task, the server queries the already tested list. The system checks if the kernel version to be compiled already exists; if it does, it reuses it directly; otherwise, it issues a compilation task. The server waits. The test results for version points and A1 version point are reported. Based on the order in which the two version points are reported and their respective test results, the convergence interval and QwList are dynamically adjusted. Specifically, this includes the following scenarios: like Figure 3 As shown, when A1 reports first and A1 is a problem patch, A1 is marked as a problem patch point, and all patch points in QwList are removed. If A1 is located in... The left side, i.e., position A1, is located at and Between, then, as Figure 5 As shown, the right boundary of the convergence interval is set as position A1; if A1 is located at... The right side, i.e., position A1, is located at and In between, wait Version point test results reporting, such as Figure 6 As shown, if If it is a problem patch, then mark it as a problem patch point; such as Figure 7 As shown, if If it is a normal patch, then mark it as a normal patch point.

[0042] like Figure 3 As shown, when A1 reports first and A1 is a normal patch, A1 is marked as a normal patch point. If A1 is located in... On the left, wait. Version point result reporting; such as Figure 8 As shown, if If it is a normal patch, then mark it. This is a normal patch point; delete items that are not present in QwList. and Patch points between; such as Figure 9 As shown, if If it's a problem patch, then mark it. To patch the issue, remove items from QwList that are not in A1 and... The elements between. If A1 is located in The right side, i.e., position A1, is located at and Between, then, as Figure 10 As shown, termination Version point result reporting, delete items in QwList that are not in A1 and Elements between.

[0043] like Figure 4 As shown, when Report first and When patching an issue, mark it. This is a patch for the problem. For example... Figure 11 As shown, if A1 is located If A1 is a problematic patch on the left, then mark A1 as the problematic patch point and remove all patch points from QwList; for example... Figure 12 As shown, if A1 is a normal patch, then mark A1 as a normal patch point and delete the items in QwList that are not in the range of A1 and A2. All element patch points between. If A1 is located at... On the right side, as follows Figure 13 As shown, terminate the test task corresponding to A1, and delete items from QwList that are not in A1 and... All elements between.

[0044] After the above processing is completed, the server selects the original interval positions corresponding to the latest marked normal patch point and the problem patch point, as follows: Figure 4 As shown, when Report first and When it is a normal patch, mark it. This is a normal patch point. For example... Figure 14 As shown, if A1 is located If the left side is selected, the A1 test result reporting will be terminated, and items not found in QwList will be deleted. and The element patch points between. For example... Figure 15 As shown, if A1 is located On the right, we need to wait for the A1 test results to be reported; if A1 is a problem patch, mark A1 as a problem patch point and delete it from QwList. and Elements between; such as Figure 16 As shown, if A1 is a normal patch, mark A1 as a normal patch point, and delete items in QwList that are not in the range of A1 and A2. All elements between.

[0045] The newly marked normal patch point and the original interval position corresponding to the problem patch point form a new convergence interval. ,in This provides the location information of the newly marked normal patch point within the original interval. This provides the location information of the newly marked problem patch point within the original interval. If the length of the elements in the QwList is not 0, the parallel binary search and dynamic convergence steps described above are repeated; if the QwList is empty, the three-point parallel acceleration stage begins. Parallel testing with the first element A1 of QwList allows two test points to proceed simultaneously, maximizing the use of test resources. Dynamic convergence based on the reporting order can adjust the convergence direction immediately when the test results are obtained earliest, effectively reducing unnecessary compilation and testing overhead.

[0046] like Figure 1 As shown, when QwList is empty, the three-point parallel acceleration phase begins. The server is currently in the convergence interval... Calculate the positions of the three test points L1, L2, and L3, where L2 = ( + ) / 2 L1= (L2+ ) / 2 L3= ( + L2) / 2 ,in This represents the position index of the left boundary point of the current convergence interval within the commit interval. This represents the position index of the right boundary point of the current convergence interval within the commit interval. Using the above formula, the server divides the current convergence interval into four equal parts and selects three boundary points as test points.

[0047] The server simultaneously issues compilation and testing tasks for the version points corresponding to the three test points L1, L2, and L3. Before issuing the compilation tasks, the server queries the list of already tested test points. It determines whether the kernel version to be compiled already exists; if it does, it is reused directly; otherwise, a compilation task is issued.

[0048] The server dynamically determines the convergence direction and terminates irrelevant test tasks based on the first reported test result. If the first reported patch is a normal patch, it is marked as such, all waiting test tasks to its left are terminated, and the server continues to wait for the results of unreported test tasks to its right. If the first reported patch is a problematic patch, it is marked as such, all waiting test tasks to its right are terminated, and the server continues to wait for the results of unreported test tasks to its left. After all results from the three test points have been processed, the server retrieves the positions of the latest marked normal and problematic patch points from the current convergence interval, forming a new convergence interval. This three-point parallel acceleration process is repeated until the interval converges. After each compilation test, the server stores the successfully compiled version points in the tested list. In the middle, through a three-point parallel testing mechanism, after QwList is exhausted, three test points simultaneously issue compilation tests, and the convergence direction is immediately determined based on the first reported result, and irrelevant test tasks are terminated, further accelerating convergence.

[0049] like Figure 1 As shown, after this round of binary search localization is completed, the server outputs a list of all problem patch points marked as problem patch points (Candilist), and also outputs the last problem patch point marked as a problem patch point. .

[0050] Preferably, the present invention also provides a kernel patch location system based on a large language model and dynamic binary search convergence, for implementing the above method, including: an endpoint compilation and caching module, used to obtain the commit interval to be located, perform compilation and testing on the endpoint, and check the already tested list. Reuse the compiled kernel; an endpoint type determination module is used to determine the endpoint patch type based on test results and mark problematic or normal patch points; a large language model pre-screening module is used to input the patch commit-id, range position, and commit description text into the large language model, output a candidate problematic patch list QwList, and then pre-screen based on QLength= Constrain the length of the output list; use a parallel binary search convergence module for midpoint... The compilation and testing were conducted simultaneously with the first element A1 of QwList, based on the reporting order, test results, and A1 relative to... The system dynamically adjusts the convergence interval and QwList; a three-point parallel acceleration module calculates three test points within the convergence interval after QwList is exhausted and simultaneously sends out compilation tests, dynamically determining the convergence direction based on the first reported result and terminating irrelevant tasks; and a result output module outputs a Candilist, a list of all problem patch points, along with the last marked problem patch point. .

[0051] Preferably, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described method.

[0052] To better understand this invention, a specific example is given below. Assume a commit interval... = [a, b, c, d, e, f, g, h, i, j, k], a total of 11 patch points, corresponding to the positions ①, ②, ③, ④, ⑤, ⑥, ⑦, ⑧, ⑨, ⑩, respectively. The server distributes, compiles, and tests the kernel versions corresponding to points a and k. (Query) Afterwards, if a compilation record already exists at point a, then test is directly deployed to point a; otherwise, compilation and testing are deployed to point a. Assuming point k is identified as a problem patch point, the binary search localization process is initiated. The server inputs the information of other patch points within the interval besides a and k into the large language model. According to the QLength formula, when n=11, QLength = log2(9) -1 = 3 -1 = 2, the large model outputs a candidate problem patch list QwList = [d, h]. The server calculates the midpoint position. = (11 + 1) / 2 = 6, meaning the corresponding patch point is f. Compilation and testing are simultaneously deployed for point f and the first element d of QwList. Assuming point d is reported first and identified as a problematic patch, d is marked as the problematic patch point. All patches in QwList are deleted, and the new convergence interval is determined to be [a, b, c, d]. The process then directly enters the three-point parallel acceleration phase. Within the convergence interval [a, b, c, d], the server calculates three test points: L2 = (4 + 1) / 2 = 2 (corresponding to point b), L1 = (2 + 1) / 2 = 1 (corresponding to point a, already tested), L3= (4 + 2) / 2 = 3 (corresponding to point c), and issue compilation tests to points b and c that have not been tested. Assuming that point b is the first to be reported and is determined to be a problem patch, mark b as a problem patch point, terminate all waiting test tasks to the right of point b (i.e., point c), the interval converges to [a, b], and output the final location result: the problem patch list Candilist = [d, b], with the last marked problem patch point being b.

[0053] The list of tests conducted throughout the entire positioning process described above. Throughout the entire process, the server queries the database before each compilation task is issued. If the kernel version to be compiled already exists, the already successfully compiled kernel is reused to avoid duplicate compilation. This mechanism produces significant synergistic effects when combined with large language model-assisted candidate generation and parallel testing: the large language model may suggest testing distant patch points, which may have already been compiled in previous tests. The existence of this method allows for the reuse of these compilation results, further shortening the localization cycle. This method does not rely on known vulnerability locations and is suitable for rapid patch convergence in functional testing scenarios, exhibiting good versatility and scalability.

[0054] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0055] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A kernel patch localization method based on a large language model and dynamic binary search convergence, characterized in that, Includes the following steps: S1, Obtain kernel patch location commit range The commit interval contains multiple patch commit points arranged in chronological order, each corresponding to the left endpoint of the commit interval. and right endpoint The corresponding kernel version is used for compilation and testing, and the version point of the completed test is stored in the tested list. Before each compilation, the previously tested list is queried. If the kernel version to be compiled already exists in the tested list... If the kernel is already successfully compiled, it will be reused; otherwise, a kernel compilation task will be issued. S2, a preset comparison parameter threshold Thres, based on the right endpoint. Test results The patch type is determined by comparing the result with the threshold Thres: if If the value is weaker than the threshold Thres, then it is marked. Patch the problem and proceed to step S3; if If the value is greater than or equal to the threshold Thres, then it is marked. This is a normal patch point, and the process ends here. S3, within the commit interval excluding the left endpoint and the right endpoint The commit-id, range position, and commit description text of other patch points are input into a large language model. The large language model outputs a candidate list QwList of potential issue patches based on the semantics of the commit description text. Elements in the candidate list QwList are sorted in ascending order of their position within the commit range, and the length QLength of the candidate list QwList is given by the formula QLength = ... Determined, where n is the total number of patch points in the commit interval, n≥2; S4, Calculate the midpoint position of the commit interval. For the midpoint position The corresponding version point and the version point corresponding to the first element A1 in the candidate list QwList are simultaneously issued compilation and testing tasks; based on the reporting order of the test results, the status of their respective normal patch points / problem patch points, and A1 relative to... The position of the convergence interval is dynamically adjusted and the segments that cannot contain the problem patch are removed from the candidate list QwList; S5, when the candidate list QwList is empty, enter the three-point parallel acceleration stage: calculate three test points within the current convergence interval. At the specified location, compilation and testing tasks are simultaneously issued to the version points corresponding to the three test points; the convergence direction is dynamically determined based on the first reported test result, and irrelevant test tasks are terminated. S6 outputs a list of all problem patch points marked as problem patch points, named Candilist, and also outputs the last problem patch point marked as a problem patch point. .

2. The kernel patch localization method based on a large language model and dynamic binary search convergence as described in claim 1, characterized in that, Step S2, determining the patch type based on the test results, specifically includes: setting a preset comparison parameter threshold Thres; if the test results... If the value is weaker than the threshold Thres, then it is marked. This is a patch for the problem; if the test results... If the value is greater than or equal to the threshold Thres, then it is marked. This is a normal patch.

3. The kernel patch localization method based on a large language model and dynamic binary search convergence as described in claim 1, characterized in that, In step S3, the candidate list QwList output by the large language model contains the commit-id corresponding to the patch and the position information of the patch point in the commit interval.

4. The kernel patch localization method based on a large language model and dynamic binary search convergence as described in claim 1, characterized in that, Step S4 describes the reporting order of test results for the two version points, the status of their respective normal / problem patch points, and A1 relative to... The position of the segment is dynamically adjusted, the convergence interval is dynamically adjusted, and segments that are unlikely to contain the problem patch are removed from the candidate list QwList. Specifically, this includes: If A1 is reported first and is a problem patch, then A1 is marked as a problem patch point, and all patch points in the candidate list QwList are removed; if A1 is located in... If the right boundary of the convergence interval is on the left, then the position A1 is set; if A1 is located on the right... On the right, the left boundary of the convergence interval is set to position A1; If A1 reports first and A1 is a normal patch, mark A1 as a normal patch point and wait. The test results, and based on The test results determine the new convergence interval and the deletion strategy of QwList; when Report first and When patching an issue, mark it. As a patch point for the problem, a new convergence interval and a deletion strategy for QwList are determined based on the location of A1 and the test results; when Report first and When it is a normal patch, mark it. As a normal patch point, a new convergence interval and deletion strategy for QwList are determined based on the position of A1 and the test results.

5. The kernel patch localization method based on a large language model and dynamic binary search convergence as described in claim 1, characterized in that, The calculation of three test points in step S5 , , The locations specifically include: = ( + ) / 2 , = (L2+ ) / 2 , = ( + L2) / 2 ; in This represents the position index of the left boundary point of the current convergence interval within the commit interval. This is the position number of the right boundary point of the current convergence interval within the commit interval.

6. The kernel patch localization method based on a large language model and dynamic binary search convergence as described in claim 1, characterized in that, Step S5, which involves dynamically determining the convergence direction and terminating irrelevant test tasks based on the first reported test results, specifically includes: If the first reported patch point is a normal patch, then mark it as a normal patch point, terminate all waiting test tasks to the left of that patch point, and continue to wait for the results of the unreported test tasks to the right. If the first reported patch is a problematic patch, it is marked as a problematic patch, all waiting test tasks to the right of that patch are terminated, and the system continues to wait for the results of unreported test tasks to the left.

7. The kernel patch localization method based on a large language model and dynamic binary search convergence as described in claim 1, characterized in that, In steps S4 and S5, after each compilation and test is completed, the successfully compiled version is stored in the tested list. middle.

8. A kernel patch location system based on a large language model and dynamic binary search convergence, used to implement the method as described in any one of claims 1 to 7, characterized in that, include: The endpoint compilation and caching module is used to obtain the commit range to be located, perform compilation and testing on the endpoint, and check the list of already tested endpoints. Reuse the compiled kernel; The endpoint type determination module is used to determine the endpoint patch type based on the test results and mark problematic or normal patch points. The large language model pre-screening module is used to input the patch commit-id, range position, and commit description text into the large language model, and output a candidate issue patch list QwList, based on QLength= Constrain the length of the output list; Parallel binary search convergence module, used for midpoint The compilation and testing were conducted simultaneously with the first element A1 of QwList, based on the reporting order, test results, and A1 relative to... The position is dynamically adjusted to convergence interval and QwList; The three-point parallel acceleration module is used to calculate three test points in the convergence interval after QwList is exhausted and simultaneously send out compilation tests. It dynamically determines the convergence direction based on the first reported result and terminates irrelevant tasks. The results output module is used to output a list of all problematic patches, called Candilist, along with the last marked problematic patch. .

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.