CN117348915B - Automatic kernel code synchronization method and system - Google Patents

Automatic kernel code synchronization method and system Download PDF

Info

Publication number
CN117348915B
CN117348915B CN202311657156.2A CN202311657156A CN117348915B CN 117348915 B CN117348915 B CN 117348915B CN 202311657156 A CN202311657156 A CN 202311657156A CN 117348915 B CN117348915 B CN 117348915B
Authority
CN
China
Prior art keywords
patch
list
patches
repair
patch list
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311657156.2A
Other languages
Chinese (zh)
Other versions
CN117348915A (en
Inventor
郑泓
张铎
吕志奇
金赞
柳豪
刘云
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kirin Software Co Ltd
Original Assignee
Kirin Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kirin Software Co Ltd filed Critical Kirin Software Co Ltd
Priority to CN202311657156.2A priority Critical patent/CN117348915B/en
Publication of CN117348915A publication Critical patent/CN117348915A/en
Application granted granted Critical
Publication of CN117348915B publication Critical patent/CN117348915B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/865Monitoring of software

Abstract

The invention discloses a method and a system for automatically synchronizing kernel codes, wherein the method comprises the following steps: acquiring interval parameters of the synchronous patch; obtaining all patches in interval parameters of synchronous patches to obtain a patch list L orign The method comprises the steps of carrying out a first treatment on the surface of the Deleting patch list L according to blacklist patch list orign Obtaining a patch list L by black list patches in the database rb The method comprises the steps of carrying out a first treatment on the surface of the For patch list L rb Filtering and outputting a synchronous patch list L fliter The method comprises the steps of carrying out a first treatment on the surface of the Recursively acquiring patch list L rb All patches in the upper branch of the repair patches form a repair patch list L fix The method comprises the steps of carrying out a first treatment on the surface of the List of synchronization patches L fliter And repair patch list L fix Is incorporated into the local branch in order. The invention avoids various abnormal processes existing in the process of manually transplanting the patch to the local branch, greatly improves the development efficiency of the kernel and effectively ensures the quality of the kernel.

Description

Automatic kernel code synchronization method and system
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and a system for automatically synchronizing kernel codes.
Background
The code maintenance of the Linux kernel community adopts Git for distributed version control, and the kernel main line branch represents an official public version and is called an upstream main line branch. On the basis of the upstream main line branch, each kernel development organization creates and maintains its own local kernel branch to add specific drivers and modifications to meet the respective needs. These maintained kernel local branches are updated iteratively as internal products and projects continue; however, since organizations do not synchronize upstream branch code to local branches in real time during development, the code of the local branches and the upstream main line branches will gradually diverge and deviate over time. The problems of large number of code conflicts, repeated loopholes introduction and the like are caused in the process of combining patches into local branches, so that the maintenance cost is greatly increased.
The existing code synchronization and push logic has the following problems:
firstly, in the Linux kernel development process, due to the continuous evolution of patches, the problems of code deviation and code conflict exist between an upstream community version and a local maintenance version, and codes cannot be accurately incorporated by simple code pulling and replacing operation.
Secondly, in the continuous evolution and transplantation process of the local code, the repaired problem is most likely to be reintroduced due to the sequence of the non-processed patches submitted when the patches are combined in a large quantity.
Finally, for some patches, when repair patches exist but are not processed, problem codes are introduced, so that the kernel introduces holes, the same errors need to be repeatedly solved in the later period, and the maintenance cost is increased.
In view of the foregoing, a more intelligent and customizable code synchronization method is needed to solve the above-mentioned problems, thereby improving the maintenance efficiency of the local kernel branch.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: aiming at the technical problems existing in the prior art, the invention provides a method and a system for automatically synchronizing kernel codes, which are used for automatically selecting upstream patches needing to be synchronized based on a time range or a label and filtering the patches which are not needed by upstream branches through a custom rule; and finally, processing the dependency relationship through a recursion algorithm to ensure the integrity of the code. Various abnormal processes existing during manual transplanting are avoided, the kernel development efficiency is greatly improved, and the kernel quality is effectively guaranteed.
In order to solve the technical problems, the technical scheme provided by the invention is as follows:
an automatic kernel code synchronization method comprises the following steps:
acquiring interval parameters of the synchronous patch;
obtaining all patches in an upstream branch designated interval according to interval parameters to obtain a patch list;
filtering the patch list and outputting a synchronous patch list L fliter
Recursively acquiring repair patches of all patches in the patch list, which are branched at the upstream, to form a repair patch list L fix
List of synchronization patches L fliter And repair patch list L fix Is incorporated into the local branch in order.
Further, a blacklist patch list is obtained; the filtering of the patch list further comprises: and deleting the blacklist patches in the patch list according to the blacklist patch list.
Further, when filtering the patch list, the method includes the following steps:
calculating status bits for each patch in a patch listWhereinA header flag bit indicating the current patch in the patch list,/->A header flag bit indicating the patch in the upstream branch that most recently matches the current patch,/for>A title flag bit representing a patch in the local branch that most recently matches the current patch;
ordering all patches of the specified status bits in the patch list to obtain a synchronous patch list L fliter
Advancing oneStep, calculating the status bit of each patch in the patch listWhen the method comprises the following steps:
if the title flag bit corresponding to the patch in the patch listAnd->The same value, the status bit of the patch=0;
If the title flag bit corresponding to the patch in the patch listAnd->The values are different, the status bits of the patch=/>Wherein->The title zone bit corresponding to the patch>And->The value is 1, < >>The title zone bit corresponding to the patch>And->The value is 0 when the values are not identical.
Further, calculating a status bit for each patch in the patch listWhen the method is used, the method also comprises the step of assigning the title flag bit, and specifically comprises the following steps:
if the title of the current patch in the patch list contains the appointed character, the appointed character is removed and the corresponding title flag bit is set0, otherwise, the original title is reserved and the corresponding title flag bit is set +.>1 is shown in the specification;
if the title of the patch which is most recently matched with the current patch of the patch list in the upstream branch contains a designated character, setting a corresponding title flag bitIs 0, otherwise, the corresponding title flag bit is set +.>1 is shown in the specification;
if the title of the patch which is matched with the current patch of the patch list in the local branch contains a designated character or the local branch does not have the patch which is matched with the current patch of the patch list, setting a corresponding title flag bitIs 0, otherwise, the corresponding title flag bit is set +.>1.
Further, the designated status bit is 1, and the sorting of all patches of the designated status bit in the patch list is specifically: all patches with status bit 1 in the patch list are ordered according to the commit time order.
Further, when recursively acquiring the repair patches of all patches in the patch list in the upstream branch, the method comprises the following steps:
traversing the patch list, if the patch information contains the appointed keyword, finding out the corresponding patch according to the appointed keyword and adding the patch into the patch list L upstr
Traversing patch list L upstr And recursively obtain a list of repair patches in the upstream branch for each patchWhere i represents patch list L upstr The serial number of each patch in the list L upstr Repair patch list for each patch in +.>Merging to obtain a repair patch list L fix
According to the time sequence of patch submission, repairing patch list L fix The patches in (a) are ordered.
Further, traversing patch list L upstr And recursively obtaining a repair patch list in an upstream branch for each patch, comprising the steps of:
searching Patch List L from upstream Branch upstr If the current patch has the repair patch, adding all the repair patches of the current patch into a corresponding repair patch listThe method comprises the steps of carrying out a first treatment on the surface of the If the current patch does not have the repair patch, selecting a patch list L upstr The next patch is used as a new current patch and the step is repeatedly executed;
traversing repair patch listsSearching for repair patch list from upstream branch +.>Each patch of (a)If the repair patch exists, the repair patch is formed into a repair patch list +.>And list repair patches->Incorporated into->
Further, list L of synchronous patches fliter And repair patch list L fix After being orderly integrated into the local branch, the patch in the (a) further comprises: pushing the local branch codes after being patched to a code review platform for code verification; the synchronization process when each patch is merged into the local branch is recorded and saved as a synchronization log.
The invention also proposes a kernel code automatic synchronization system comprising a microprocessor and a storage medium, interconnected, said microprocessor being programmed or configured to perform the kernel code automatic synchronization method of any one of the above.
Compared with the prior art, the invention has the advantages that:
1. automatically acquiring all patches in a specific time interval or patch interval of an upstream branch; intelligently filtering and processing patches according to preset rules, wherein the intelligent filtering and processing comprises removing changes contained in local branches, processing dependency relations among patches, and customizing needed or unneeded patches according to requirements;
2. the processed patches are combined with the existing patch sequence and are correctly and orderly applied to the branches to be synchronized, the synchronization process can be tracked, and detailed synchronization logs can be recorded for inspection;
3. the code synchronization is automatically pushed to a code examination platform to support a subsequent continuous integration flow.
Drawings
FIG. 1 is a flow chart of an embodiment of the present invention.
FIG. 2 is a diagram illustrating an embodiment of the present invention for obtaining a synchronization patch list L fliter Is a flow chart of (a).
FIG. 3 is a diagram illustrating a repair patch list L obtained according to an embodiment of the present invention fix Is a flow chart of (a).
Fig. 4 is an example of various hierarchical relationships of repair patches.
Detailed Description
The invention is further described below in connection with the drawings and the specific preferred embodiments, but the scope of protection of the invention is not limited thereby.
Before describing particular embodiments of the present invention, related terms will be described.
Git: is an open-source distributed version control system for agilely and efficiently handling any small or large items.
gerit is a web code audit platform based on the git version control system for reviewing each submitted patch prior to code warehousing. Gerrit will record each submitted code modification but only be able to be incorporated as part of the item after they have been reviewed and received.
commit: is an operation step (git commit) in git, which is used to save the local modification to the git database, and commit information refers to description information filled in when a developer executes a git commit command when submitting a patch, and the patch is mapped with commit information one by one.
Fixe patches: the information used to record which target patch is currently submitted is used to repair. If the Fixe in the commit information of patch B is commit A, it means that patch B is to repair the error in patch A, and similarly, patch B may have its own Fixe patch.
commit-id: each commit in the git generates a 40-bit hash value as a unique identifier, which is a component of the commit message.
Codemerge: and a code checking tool for checking whether the commit-id of the patch to be synchronized is correct and exists, checking whether the patch is synchronized on the branch to be synchronized, modifying the commit information of the patch according to the rule of the code inspection platform, and performing patch rollback operation when unresolved conflict occurs in synchronization.
Example 1
By sorting existing code synchronization and push logic, we find that the following problems exist:
1) Only all patch changes can be merged at one time, and partial commit cannot be selectively applied.
2) Handling large-volume patch merges can easily cause conflicts with existing code.
3) The dependencies between patches are not carded.
4) The local branch cannot timely and accurately acquire the new function and error repair of the upstream branch.
In order to solve the above problems, the present embodiment provides an automatic synchronization method for kernel codes, by automatically acquiring patches and repair patches of upstream branches, filtering the upstream patches and repair patches in combination with preset rules, and performing dependency processing, automatically synchronizing the upstream patches and repair patches meeting the conditions to branches to be synchronized, and pushing the successfully synchronized patches to a code inspection platform for subsequent continuous integration, thereby effectively improving the maintenance efficiency of local kernel branches through the customizable and more intelligent code synchronization mechanism. As shown in fig. 1, the method comprises the following steps:
s1) acquiring required parameter data, wherein the required parameter data comprises: synchronizing interval parameters of patches and a blacklist patch list;
s2) obtaining all patches of the upstream kernel main line branch in a designated interval according to interval parameters of the synchronous patches to obtain a patch list L orign
S3) deleting patch list L based on blacklist patch list orign Obtaining a patch list L by black list patches in the database rb
S4) Patch List L rb Filtering and outputting a synchronous patch list L fliter
S5) recursively acquiring Patch List L rb All patches in the upper branch of the repair patches form a repair patch list L fix
S6) list L of synchronous patches fliter And repair patch list L fix Sequentially merging patches in the local branches; pushing the local branch codes after being patched to a code review platform for code verification;
s7) recording the synchronization process when each patch is integrated into the local branch and storing the synchronization process as a synchronization log for checking.
Each step is specifically explained below.
In step S1, the interval parameter of the synchronization patch may be a patch commit-id interval, or may be a time interval, and the blacklist patch list may be a manually specified patch set that does not need synchronization. It should be noted that, the blacklist patch list may be obtained along with the interval parameters of the synchronization patch, and meanwhile, since there is a case that the blacklist patch is not required to be deleted, the blacklist patch list may be obtained when the blacklist patch is required to be deleted in the subsequent step. In this embodiment, the interval parameter is a patch commit-id interval [ A, G ], and the blacklist patch list is { C }.
Correspondingly, the step S2 includes the following steps:
s21: analyzing interval parameters of the synchronous patch;
s22: acquiring all patch lists in the designated section of the upstream corresponding branch according to the section parameters of the synchronous patchesAnd output. For example, if the interval parameter of the synchronous patch is the patch commit-id interval [ A, B ]]All patch information of the patch commit-id A to patch commit-id B interval is acquired. If the interval parameter of the synchronous patch is the time interval [2022/10/01, 2022/10/06 ]]All submitted patch information is obtained within the 2022/10/01 to 2022/10/06 time period.
Thus, the present embodiment can be obtained by step S2= { a, B, C, D, E, F, G }, obtainable by step S3 +.>={A,B,D,E,F,G}。
Step S4 as shown in FIG. 2, for the patch list L rb When filtering, the method comprises the following steps:
s41) performing intelligent filtering according to metadata such as title, commit information and the like, and circularly processing a patch listCalculate patch list L rb Status bit of each patch +.>Wherein->Representing patch list L rb Header flag bit of current patch in +.>A header flag bit indicating the patch in the upstream branch that most recently matches the current patch,/for>The title flag bit of the patch which is matched with the current patch in the local branch recently is represented, and the title flag bit comprises the following steps:
first, the title flag bit is assigned, which specifically includes:
s411) processing Patch List L rb Title in current patch commit informationWhere i represents the sequence number of the current patch, if the patch list L rb Title of the current patch->Contains the designated character 'reverse', removes the designated character 'reverse' and sets the corresponding title flag bit +.>0, otherwise, the original title is reserved and the corresponding title flag bit is set +.>1 is shown in the specification;
s412) according to titleFinding the most recently matched patch from the upstream branch +.>If the upstream branch is in the patch list L rb The patch that the current patch of (1) most recently matches +.>The title contains the designated character "reverse", the corresponding title flag bit is set +.>Is 0, otherwise, the corresponding title flag bit is set +.>1. The expression mode is as follows:
s413) according to titleFinding the latest matching patch from the local branches +.>If the local branch is in the local branch and the patch list L rb The patch that the current patch of (1) most recently matches +.>The header contains the designated character "reverse", or the local branch does not exist with the patch list L rb The current patch of (2) is matched with the current patch of (1), the corresponding title flag bit is set>Is 0, otherwise, the corresponding title flag bit is set +.>1 is shown in the specification;
then, assign a value to the status bit according to the value of the title flag bit, including:
s414) according to the formulaAcquiring the current patch status bit->Is a value of (2). Wherein (1)>=f, formula F is expressed as follows:
as can be seen from the expression of formula F, the patch list L rb Title zone bit corresponding to middle patchAnd->The values are the same, the status bit of the patch +.>=0; if Patch list L rb Title flag bit corresponding to middle patch>And->The values are different, the status bit of the patch +.>=/>Wherein->The expression is as follows:
from the slaveThe expression can be seen for ∈ ->The title zone bit corresponding to the patch>And->The value is 1, < >>The title zone bit corresponding to the patch>And->The value is 0 when the values are not identical.
The patch list L can be obtained by calculation through the steps rb Status bits of each patch in (a)Value of->If 0, the patch is not needed to be synchronized, and if 1, the patch is needed to be synchronized;
s42) list of patches L rb Ordering all patches of the designated status bit to obtain a synchronous patch list L fliter Specifically, the method comprises the steps of,when 1, it indicates that the corresponding patch needs to be synchronized, becauseThe designated status bit is 1, and the patch list L rb All patches with the status bit of 1 are ordered according to the sequence of the original commit time. The step judges whether the patch needs to be combined into the synchronous patch list L according to the status bit of each patch fliter If it is determined by the value of the status bit that no merge is required, then this patch will not appear in the synchronization patch list L fliter Is a kind of medium.
Assume that in this embodiment the patch sequenceAfter the processing of steps S411 to S414, the header flag bit and the status bit of each patch are shown in table 1, respectively.
TABLE 1Patch list Patch node State Table
According to step S42, each patch status bit is obtainedThe values of { A:0, B:1, D:1, E:0, F:0, G:0}, indicating that only patches B and D need to be merged into synchronization patch list L fliter Is a kind of medium. Thus, synchronization patch list->= { B, D }, followed by outputting +.>
Step S5 As shown in FIG. 3, a patch list L is recursively obtained rb When repairing patches of an upstream branch, the method comprises the following steps:
s51) traversing Patch List L rb If the patch information contains an appointed keyword 'upstream', finding a corresponding patch according to the appointed keyword and adding a patch list L upstr This is due to each complementThe text information only contains only one "up" patch, so that the patch list L can be quickly found out by the key word rb Patches branching upstream of each patch;
s52) traversing the Patch List L upstr And recursively obtain a list of repair patches in the upstream branch for each patchWhere i represents patch list L upstr The serial number of each patch in the list L upstr Repair patch list for each patch in +.>Merging to obtain a repair patch list L fix Comprising the following steps:
first, the patch list L is traversed upstr And recursively obtain a list of repair patches in the upstream branch for each patchComprising:
s521) looking up patch list L from upstream branches upstr In the current patchIf the repair patch exists, adding all the repair patches of the current patch into a corresponding repair patch list ++>Wherein i represents the sequence number of the current patch; if the current patch does not have a repair patch, its repair patch list +.>Length 0, selecting patch list L upstr Next patch->As a new current patch and repeatedly executing the step;
s522) passCalendar repair patch listSearching for repair patch list from upstream branch +.>If the repair patch exists, the repair patches form a repair patch list +.>And list the repair patchesIncorporated into->As shown in fig. 4, for a patch, there may be three cases of multi-layer repair patches, multiple repair patches, and no repair patches in the upstream branch, and the repair patches in all cases of the upstream branch may be combined into the repair patch list through this step.
Specifically, the repair patch list is traversedWhen the repair patch is judged to be the mth repair patch->Whether there is an additional repair patch list in the upstream branch +.>. If so, repair patch list ++>Incorporated into->The expression is as follows:
=/>
if not, traversing the next patchThe step is repeated until +.>And (5) finishing the traversal;
then, list the patches L upstr Repair patch list for each patch in the pluralityMerging, comprising:
s523) willIncorporating repair patch list->Output->The expression is as follows:
=/>
s53) according to the time sequence of patch submission, repairing patch list L fix The patches in (a) are ordered.
Assume that in this embodiment, by executing step S51, the patch listOnly A, B patches contain the key word and correspond to patches E, H, respectively, so the patch list +.>=[E,H];
Further assume that the patch list=[E,H]In the method, two patches j and k exist in an upstream branch to repair an E patch, a g patch repairs a j patch, corresponding repair patches do not exist in the two patches g and k, and a repair patch does not exist in H. Thus, the first and second substrates are bonded together,=[g],/>[j,k,g],/>,/>=[j,k,g]。
in step S6, the Cosmerger tool is used to list the synchronous patchesAnd repair patch list->And automatically pushing the local branch codes after being patched to a code review platform to realize continuous code integration.
It should be noted that, the use of the code tool to perform patch synchronization and push the local branch code to the code review platform are common technical means for those skilled in the art, and the embodiment does not involve improvement of related content, so specific implementation processes are not repeated.
The steps of the embodiment are executed on the actual production environment to complete all logics of 10000+ patches, such as synchronization, analysis, carding, pushing and the like, and the complete carding can be achieved in 18 hours, abnormal patches are output, and then manual intervention processing is performed, so that patch synchronization efficiency is greatly improved.
Example two
The present embodiment provides a kernel code automatic synchronization system, comprising a microprocessor and a storage medium connected to each other, wherein the microprocessor is programmed or configured to execute the kernel code automatic synchronization method according to the first embodiment.
The foregoing is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. While the invention has been described with reference to preferred embodiments, it is not intended to be limiting. Therefore, any simple modification, equivalent variation and modification of the above embodiments according to the technical substance of the present invention shall fall within the scope of the technical solution of the present invention.

Claims (9)

1. An automatic kernel code synchronization method is characterized by comprising the following steps:
acquiring interval parameters of the synchronous patch;
obtaining all patches in an upstream branch designated interval according to interval parameters to obtain a patch list;
filtering the patch list and outputting a synchronous patch list L fliter
Recursively acquiring repair patches of all patches in the patch list, which are branched at the upstream, to form a repair patch list L fix
List of synchronization patches L fliter And repair patch list L fix Sequentially merging patches in the local branches;
when filtering the patch list, the method comprises the following steps:
calculating status bits for each patch in a patch listWherein->A header flag bit indicating the current patch in the patch list,/->A header flag bit indicating the patch in the upstream branch that most recently matches the current patch,/for>The title flag bit of the patch which is matched with the current patch in the local branch recently is represented, and the title flag bit comprises the following steps:
if the title flag bit corresponding to the patch in the patch listAnd->The values are the same, the status bit of the patch +.>=0;
If the title flag bit corresponding to the patch in the patch listAnd->The values are different, the status bits of the patch=/>Wherein->The title zone bit corresponding to the patch>And->The value is 1, < >>The title zone bit corresponding to the patch>And->The value is 0 when the values are not identical.
2. The kernel code automatic synchronization method of claim 1, further comprising: obtaining a blacklist patch list; the filtering of the patch list further comprises: and deleting the blacklist patches in the patch list according to the blacklist patch list.
3. The method for automatically synchronizing kernel code according to claim 1, wherein the filtering of the patch list comprises the steps of:
ordering all patches of the specified status bits in the patch list to obtain a synchronous patch list L fliter
4. A method of automatically synchronizing kernel code according to claim 3, wherein the status bits of each patch in the patch list are calculatedWhen the method is used, the method also comprises the step of assigning the title flag bit, and specifically comprises the following steps:
if the title of the current patch in the patch list contains the appointed character, the appointed character is removed and the corresponding title flag bit is set0, otherwise, the original title is reserved and the corresponding title flag bit is set +.>1 is shown in the specification;
if the title of the patch which is most recently matched with the current patch of the patch list in the upstream branch contains a designated character, setting a corresponding title flag bitIs 0, otherwise, the corresponding title flag bit is set +.>1 is shown in the specification;
if the title of the patch which is matched with the current patch of the patch list in the local branch contains a designated character or the local branch does not have the patch which is matched with the current patch of the patch list, setting a corresponding title flag bitIs 0, otherwise, the corresponding title flag bit is set +.>1.
5. The method for automatically synchronizing kernel code according to claim 3, wherein the assigned status bit is 1, and wherein the ordering of all patches of the assigned status bit in the patch list is specifically: all patches with status bit 1 in the patch list are ordered according to the commit time order.
6. The method for automatically synchronizing kernel code according to claim 1, wherein when recursively acquiring repair patches of all patches in the patch list on an upstream branch, comprising the steps of:
traversing the patch list, if the patch information contains the appointed keyword, finding out the corresponding patch according to the appointed keyword and adding the patch into the patch list L upstr
Traversing patch list L upstr And recursively obtain a list of repair patches in the upstream branch for each patchWhere i represents patch list L upstr The serial number of each patch in the list L upstr Repair patch list for each patch in +.>Merging to obtain a repair patch list L fix
According to the time sequence of patch submission, repairing patch list L fix The patches in (a) are ordered.
7. The method for automatically synchronizing kernel code according to claim 6, wherein the patch list L is traversed upstr And recursively obtaining a repair patch list in an upstream branch for each patch, comprising the steps of:
searching Patch List L from upstream Branch upstr If the current patch has the repair patch, adding all the repair patches of the current patch into a corresponding repair patch listThe method comprises the steps of carrying out a first treatment on the surface of the If the current patch does not have the repair patch, selecting a patch list L upstr The next patch is used as a new current patch and the step is repeatedly executed;
traversing repair patch listsSearching for repair patch list from upstream branch +.>If the repair patch exists, the repair patches form a repair patch list +.>And list repair patches->Incorporated into->
8. The method for automatically synchronizing kernel code according to claim 1, wherein the synchronization patch list L is set fliter And repair patch list L fix After being orderly integrated into the local branch, the patch in the (a) further comprises: pushing the local branch codes after being patched to a code review platform for code verification; the synchronization process when each patch is merged into the local branch is recorded and saved as a synchronization log.
9. A kernel code auto-synchronization system comprising a microprocessor and a storage medium connected to each other, the microprocessor being programmed or configured to perform the kernel code auto-synchronization method of any one of claims 1-8.
CN202311657156.2A 2023-12-06 2023-12-06 Automatic kernel code synchronization method and system Active CN117348915B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311657156.2A CN117348915B (en) 2023-12-06 2023-12-06 Automatic kernel code synchronization method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311657156.2A CN117348915B (en) 2023-12-06 2023-12-06 Automatic kernel code synchronization method and system

Publications (2)

Publication Number Publication Date
CN117348915A CN117348915A (en) 2024-01-05
CN117348915B true CN117348915B (en) 2024-04-05

Family

ID=89367107

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311657156.2A Active CN117348915B (en) 2023-12-06 2023-12-06 Automatic kernel code synchronization method and system

Country Status (1)

Country Link
CN (1) CN117348915B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6477703B1 (en) * 1999-06-29 2002-11-05 Hewlett-Packard Company Software patch selection tool
US8607208B1 (en) * 2008-10-01 2013-12-10 Oracle International Corporation System and methods for object code hot updates
CN106933591A (en) * 2017-03-15 2017-07-07 东软集团股份有限公司 The method and device that code merges
KR20180135348A (en) * 2017-06-12 2018-12-20 박영춘 Safe patch system and method of white list
CN112579150A (en) * 2020-12-29 2021-03-30 中标软件有限公司 Method for enhancing system real-time performance supporting multi-CPU architecture
US11204759B1 (en) * 2020-06-23 2021-12-21 Red Hat, Inc. Software patch comparison
CN115328524A (en) * 2021-05-11 2022-11-11 中兴通讯股份有限公司 Patch merging method and device, computer equipment and storage medium
CN116108446A (en) * 2022-12-06 2023-05-12 西安电子科技大学 Vulnerability patch existence detection method based on deep learning
CN116305140A (en) * 2023-02-20 2023-06-23 浙江大学 Method and system for identifying Git commit introducing Linux kernel loopholes
CN116305133A (en) * 2022-09-09 2023-06-23 中国人民解放军国防科技大学 Virtualization-based kernel vulnerability patch verification method and device
CN117034284A (en) * 2023-07-21 2023-11-10 深圳华为云计算技术有限公司 Tracing method and related device for repairing patch corresponding to open source vulnerability

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8615752B2 (en) * 2008-12-30 2013-12-24 International Business Machines Corporation System and method for detecting software patch dependencies
US9052983B2 (en) * 2012-01-16 2015-06-09 International Business Machines Corporation Source code patches
US9710253B2 (en) * 2015-04-16 2017-07-18 Commvault Systems, Inc. Managing a software-patch submission queue

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6477703B1 (en) * 1999-06-29 2002-11-05 Hewlett-Packard Company Software patch selection tool
US8607208B1 (en) * 2008-10-01 2013-12-10 Oracle International Corporation System and methods for object code hot updates
CN106933591A (en) * 2017-03-15 2017-07-07 东软集团股份有限公司 The method and device that code merges
KR20180135348A (en) * 2017-06-12 2018-12-20 박영춘 Safe patch system and method of white list
US11204759B1 (en) * 2020-06-23 2021-12-21 Red Hat, Inc. Software patch comparison
CN112579150A (en) * 2020-12-29 2021-03-30 中标软件有限公司 Method for enhancing system real-time performance supporting multi-CPU architecture
CN115328524A (en) * 2021-05-11 2022-11-11 中兴通讯股份有限公司 Patch merging method and device, computer equipment and storage medium
CN116305133A (en) * 2022-09-09 2023-06-23 中国人民解放军国防科技大学 Virtualization-based kernel vulnerability patch verification method and device
CN116108446A (en) * 2022-12-06 2023-05-12 西安电子科技大学 Vulnerability patch existence detection method based on deep learning
CN116305140A (en) * 2023-02-20 2023-06-23 浙江大学 Method and system for identifying Git commit introducing Linux kernel loopholes
CN117034284A (en) * 2023-07-21 2023-11-10 深圳华为云计算技术有限公司 Tracing method and related device for repairing patch corresponding to open source vulnerability

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于语义补丁的Linux驱动程序后向移植技术;朱丽华;文艳军;董威;;计算机科学(第11期);全文 *

Also Published As

Publication number Publication date
CN117348915A (en) 2024-01-05

Similar Documents

Publication Publication Date Title
US10970673B2 (en) Bill of material synchronization
CN109063421B (en) Open source license compliance analysis and conflict detection method
WO2019056540A1 (en) Test case automation management method and apparatus, device, and storage medium
CN109271326B (en) Cloud database testing method and device, equipment and storage medium thereof
US11593336B2 (en) Data pipeline branching
CN112130891B (en) Method and equipment for continuously deploying database
US10248409B1 (en) Limiting the effects of source code patches on corresponding native-code patches
CN111400354B (en) Machine tool manufacturing BOM (Bill of Material) storage query and tree structure construction method based on MES (manufacturing execution System)
US20210334292A1 (en) System and method for reconciliation of data in multiple systems using permutation matching
CN115712623B (en) Batch data fault-tolerant collection method based on captured metadata change
CN105159718A (en) Firmware updating method and device
CN110442371A (en) A kind of method, apparatus of release code, medium and computer equipment
CN114780138B (en) Flow field simulation software code version management method and device and storage medium
CN110543469B (en) Database version management method and server
CN117348915B (en) Automatic kernel code synchronization method and system
CN111159020B (en) Method and device applied to synchronous software test
JP2008225898A (en) Conversion device, conversion program, and conversion method
CN111241293A (en) Knowledge graph algorithm constructed based on academic literature
CN114579171A (en) Code processing method and device, computer equipment and storage medium
JP6993573B2 (en) Program analysis method, program analysis device and program analysis program
CN111930413B (en) Automatic patch generation method, device and system
CN117271476A (en) Ibatis architecture upgrading method, device, equipment and storage medium
CN114461605A (en) Method, device and equipment for realizing multi-version of transaction data of memory multidimensional database
CN113886223A (en) Code test management method and device, computer equipment and readable storage medium
CN113780950A (en) Data processing method, device, server and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant