[go: up one dir, main page]

CN107643924A - A kind of upgrade method, system, equipment and the storage medium of kernel state client - Google Patents

A kind of upgrade method, system, equipment and the storage medium of kernel state client Download PDF

Info

Publication number
CN107643924A
CN107643924A CN201710912392.2A CN201710912392A CN107643924A CN 107643924 A CN107643924 A CN 107643924A CN 201710912392 A CN201710912392 A CN 201710912392A CN 107643924 A CN107643924 A CN 107643924A
Authority
CN
China
Prior art keywords
function
replacement
replaced
event
name
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.)
Pending
Application number
CN201710912392.2A
Other languages
Chinese (zh)
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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology 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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710912392.2A priority Critical patent/CN107643924A/en
Publication of CN107643924A publication Critical patent/CN107643924A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The invention discloses a kind of upgrade method, system, equipment and the storage medium of kernel state client, wherein this method includes:Obtain the replacement function of extraneous input and be replaced the respective identification information of function;By replacement function and it is replaced the respective identification information of function and is combined into replacement event;Replacement event is added to the clobal chained list of kernel state module, the function that is replaced in own module is replaced with by replacement function based on replacement event when performing clobal chained list for kernel state module.A kind of upgrade method of kernel state client provided by the invention, by replacement function and it is replaced the respective identification information of function and is combined into replacement event, replacement event is added in the clobal chained list of kernel state module, by clobal chained list replacement event is triggered by kernel state module, when performing clobal chained list due to kernel state module, it is out of service without front end applications, the applicability of kernel state upgrade method is improved to a certain extent.

Description

一种内核态客户端的升级方法、系统、设备及存储介质An upgrade method, system, device and storage medium of a kernel mode client

技术领域technical field

本发明涉及分布式存储技术领域,更具体地说,涉及一种内核态客户端的升级方法、系统、设备及存储介质。The present invention relates to the technical field of distributed storage, and more specifically, relates to an upgrade method, system, device and storage medium of a kernel state client.

背景技术Background technique

随着存储技术的发展,分布式存储的应用越来越广泛。而分布式存储的IO时延较高,为了降低IO时延,现有的分布式文件系统采用内核态客户端来提高IO效率。With the development of storage technology, the application of distributed storage is becoming more and more extensive. However, the IO latency of distributed storage is high. In order to reduce the IO latency, the existing distributed file system uses a kernel-mode client to improve IO efficiency.

然而在对内核态客户端进行函数升级时,需要先停止前端应用,再从新加载内核态模块,这里所说的内核态模块中封装有待运行函数和全局事件链表,不适合那些不允许前端应用停止的内核态分布式文件系统,使得现有的内核态升级方法的适用性差。However, when upgrading the function of the kernel mode client, it is necessary to stop the front-end application first, and then reload the kernel mode module. The kernel mode module mentioned here encapsulates the functions to be run and the global event list, which is not suitable for those who do not allow the front-end application to stop. The distributed file system in the kernel state makes the applicability of the existing kernel state upgrade method poor.

综上所述,如何提高内核态升级方法的适用性是目前本领域技术人员亟待解决的问题。To sum up, how to improve the applicability of the method for upgrading the kernel mode is an urgent problem to be solved by those skilled in the art.

发明内容Contents of the invention

本发明的目的是提供一种内核态客户端的升级方法,其能在一定程度上解决如何提高内核态升级方法的适用性的技术问题。本发明还提供了一种内核态客户端的升级系统、设备及存储介质。The purpose of the present invention is to provide an upgrade method of a kernel state client, which can solve the technical problem of how to improve the applicability of the kernel state upgrade method to a certain extent. The invention also provides an upgrade system, equipment and storage medium of the kernel state client.

为了实现上述目的,本发明提供如下技术方案:In order to achieve the above object, the present invention provides the following technical solutions:

一种内核态客户端的升级方法,包括:A method for upgrading a kernel client, comprising:

获取外界输入的替换函数和被替换函数各自的标识信息;Obtain the identification information of the replacement function input from the outside world and the replaced function;

将所述替换函数和所述被替换函数各自的标识信息组合成替换事件;Combining the respective identification information of the replacement function and the replaced function into a replacement event;

添加所述替换事件至内核态模块的全局事件链表,以供所述内核态模块执行所述全局事件链表时基于所述替换事件将自身模块中的所述被替换函数替换为所述替换函数。Adding the replacement event to the global event list of the kernel mode module, so that the kernel mode module can replace the replaced function in its own module with the replacement function based on the replacement event when executing the global event list.

优选的,所述获取外界输入的替换函数和被替换函数各自的标识信息,包括:Preferably, said acquiring the identification information of the replacement function input from the outside world and the replaced function includes:

获取外界输入的替换函数和被替换函数各自的函数名;Obtain the respective function names of the replacement function and the replaced function input from the outside world;

基于所述函数名查找所述替换函数和所述被替换函数各自的函数地址;Finding respective function addresses of the replacement function and the replaced function based on the function name;

所述将所述替换函数和所述被替换函数的标识信息组合成替换事件,包括:The combining the identification information of the replacement function and the replaced function into a replacement event includes:

将所述函数名和所述函数地址组合成替换事件。The function name and the function address are combined into a replacement event.

优选的,所述将所述函数名和所述函数地址组合成替换事件,包括:Preferably, said combining said function name and said function address into a replacement event includes:

将所述函数名和所述函数地址组合成替换事件,所述函数名和所述函数地址在所述替换事件中的排列顺序包括:被替换函数的函数名、被替换函数的函数地址、替换函数的函数名、替换函数的函数地址。Combining the function name and the function address into a replacement event, the sequence of the function name and the function address in the replacement event includes: the function name of the replaced function, the function address of the replaced function, the replacement function Function name, function address of the replacement function.

本发明还提供了一种内核态客户端的升级系统,包括:The present invention also provides an upgrade system for a kernel state client, comprising:

获取装置,用于获取外界输入的替换函数和被替换函数各自的标识信息;An acquisition device, configured to acquire the identification information of the replacement function input from the outside and the replaced function;

组合装置,用于将所述替换函数和所述被替换函数各自的标识信息组合成替换事件;Combining means for combining the respective identification information of the replacement function and the replaced function into a replacement event;

添加装置,用于添加所述替换事件至内核态模块的全局事件链表,以供所述内核态模块执行所述全局事件链表时基于所述替换事件将自身模块中的所述被替换函数替换为所述替换函数。Adding means for adding the replacement event to the global event list of the kernel mode module, so that when the kernel mode module executes the global event list, the replaced function in its own module is replaced by the replaced function based on the replacement event The replacement function.

优选的,所述获取装置包括:Preferably, the acquisition device includes:

获取模块,用于获取外界输入的替换函数和被替换函数各自的函数名;The acquisition module is used to acquire the respective function names of the replacement function and the replaced function input from the outside world;

查找模块,用于基于所述函数名查找所述替换函数和所述被替换函数各自的函数地址;A search module, configured to search for the respective function addresses of the replacement function and the replaced function based on the function name;

所述组合装置包括:The combined device includes:

组合模块,用于将所述函数名和所述函数地址组合成替换事件。A combining module, used for combining the function name and the function address into a replacement event.

优选的,所述组合模块包括:Preferably, the combination module includes:

组合单元,用于将所述函数名和所述函数地址组合成替换事件,所述函数名和所述函数地址在所述替换事件中的排列顺序包括:被替换的函数名、被替换的函数地址、替换的函数名、替换的函数地址。A combination unit, configured to combine the function name and the function address into a replacement event, the arrangement order of the function name and the function address in the replacement event includes: the replaced function name, the replaced function address, Replaced function name, replaced function address.

本发明还提供了一种内核态客户端的升级设备,包括:The present invention also provides an upgrade device for a kernel state client, comprising:

存储器,用于存储计算机程序;memory for storing computer programs;

处理器,用于执行所述计算机程序时实现上述任一种内核态客户端的升级方法的步骤。The processor is configured to implement the steps of any one of the above methods for upgrading the kernel-mode client when executing the computer program.

本发明还提供了一种存储介质,所述存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一种内核态客户端的升级方法的步骤。The present invention also provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the above methods for upgrading a kernel state client are realized.

本发明提供的一种内核态客户端的升级方法,包括:获取外界输入的替换函数和被替换函数各自的标识信息;将替换函数和被替换函数各自的标识信息组合成替换事件;添加替换事件至内核态模块的全局事件链表,以供内核态模块执行全局事件链表时基于替换事件将自身模块中的被替换函数替换为替换函数。本发明提供的一种内核态客户端的升级方法,先获取外界输入的替换函数和被替换函数各自的标识信息;然后将替换函数和被替换函数各自的标识信息组合成替换事件;最后将替换事件添加到内核态模块的全局事件链表中,这样,内核态模块在执行全局事件链表时便可以基于替换事件将自身模块中的被替换函数替换为替换函数。本发明提供的一种内核态客户端的升级方法,通过将替换函数和被替换函数各自的标识信息组合成替换事件,然后将替换事件添加到内核态模块的全局事件链表中,借助全局事件链表让内核态模块触发替换事件,进而将被替换函数替换为替换函数,由于内核态模块执行全局事件链表时,无需前端应用停止运行,所以本发明提供的一种内核态客户端的升级方法无需前端应用停止运行便可将被替换函数替换为替换函数,具有更好的适应性。综上所述,本发明提供的一种内核态客户端的升级方法在一定程度上解决了如何提高内核态升级方法的适用性的技术问题。本发明提供的一种内核态客户端的升级系统、设备及存储介质也解决了相应的技术问题。A method for upgrading a kernel-mode client provided by the present invention includes: acquiring the identification information of a replacement function input from the outside world and the replaced function; combining the identification information of the replacement function and the replaced function into a replacement event; adding the replacement event to The global event chain list of the kernel mode module is used for the kernel mode module to replace the replaced function in its own module with the replacement function based on the replacement event when executing the global event chain list. A method for upgrading a kernel-mode client provided by the present invention first obtains the respective identification information of the replacement function and the replaced function input from the outside world; then combines the respective identification information of the replacement function and the replaced function into a replacement event; finally converts the replacement event Added to the global event list of the kernel mode module, so that the kernel mode module can replace the replaced function in its own module with the replacement function based on the replacement event when executing the global event list. The method for upgrading a kernel state client provided by the present invention combines the identification information of the replacement function and the function to be replaced into a replacement event, and then adds the replacement event to the global event list of the kernel state module. The kernel mode module triggers the replacement event, and then replaces the replaced function with the replacement function. Since the kernel mode module executes the global event list, the front-end application does not need to stop running, so a method for upgrading the kernel mode client provided by the present invention does not require the front-end application to stop. After running, the replaced function can be replaced with the replacement function, which has better adaptability. To sum up, the method for upgrading the kernel mode client provided by the present invention solves the technical problem of how to improve the applicability of the method for upgrading the kernel mode to a certain extent. The upgrading system, equipment and storage medium of a kernel state client provided by the present invention also solve the corresponding technical problems.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only It is an embodiment of the present invention, and those skilled in the art can also obtain other drawings according to the provided drawings without creative work.

图1为本发明实施例提供的一种内核态客户端的升级方法的流程图;Fig. 1 is a flow chart of a method for upgrading a kernel mode client provided by an embodiment of the present invention;

图2为本发明实施例提供的一种内核态客户端的升级系统的结构示意图;FIG. 2 is a schematic structural diagram of an upgrade system for a kernel state client provided by an embodiment of the present invention;

图3为本发明实施例提供的一种内核态客户端的升级设备的结构示意图。FIG. 3 is a schematic structural diagram of an upgrade device for a kernel-mode client provided by an embodiment of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

请参阅图1,图1为本发明实施例提供的一种内核态客户端的升级方法的流程图。Please refer to FIG. 1 . FIG. 1 is a flow chart of a method for upgrading a kernel state client provided by an embodiment of the present invention.

本发明实施例提供的一种内核态客户端的升级方法可以包括以下步骤:A method for upgrading a kernel state client provided in an embodiment of the present invention may include the following steps:

步骤S101:获取外界输入的替换函数和被替换函数各自的标识信息。Step S101: Obtain the identification information of the replacement function input from the outside and the replaced function.

实际应用中,因为内核态客户端的升级是以函数为单位实现的,所以可以先获取升级所需的替换函数和被替换函数各自的标识信息。这里的替换函数和被替换函数各自的标识信息可以是外界输入的。In practical applications, because the upgrade of the kernel-mode client is implemented in units of functions, it is possible to first obtain the identification information of the replacement function and the replaced function required for the upgrade. The respective identification information of the replacement function and the replaced function may be input from the outside.

步骤S102:将替换函数和被替换函数各自的标识信息组合成替换事件。Step S102: Combining the identification information of the replacement function and the replaced function into a replacement event.

在获取到替换函数和被替换函数各自的标识信息之后,便可以将替换函数和被替换函数各自的标识信息组合成替换事件,这里所说的替换事件是可以添加至内核态模块的全局事件链表中的事件。After obtaining the identification information of the replacement function and the replaced function, you can combine the identification information of the replacement function and the replaced function into a replacement event. The replacement event mentioned here is a global event list that can be added to the kernel mode module. events in .

步骤S103:添加替换事件至内核态模块的全局事件链表,以供内核态模块执行全局事件链表时基于替换事件将自身模块中的被替换函数替换为替换函数。Step S103: Add a replacement event to the global event list of the kernel mode module, so that when the kernel mode module executes the global event list, the replaced function in its own module is replaced with the replacement function based on the replacement event.

在组合成替换事件后,便可将替换事件添加至全局事件链表中。因为内核态模块会执行全局事件链表,而替换事件又在全局事件链表中,所以内核态模块在执行全局事件链表时便会执行替换事件,这样便可以通过替换事件将自身模块中的被替换函数替换为替换函数,替换过程可以是:内核态模块先根据替换事件中的标识信息查找到被替换函数和替换函数,当运行到被替换函数时,停止运行被替换函数,转而运行替换函数。由于内核态模块在执行全局事件链表时无需前端应用停止运行,所以可以在前端应用不停止运行的情况下实现内核态客户端的升级。After being combined into a replacement event, the replacement event can be added to the global event chain list. Because the kernel mode module will execute the global event list, and the replacement event is in the global event list, the kernel mode module will execute the replacement event when executing the global event list, so that the replaced function in its own module can be replaced by the replacement event To replace with a replacement function, the replacement process can be as follows: the kernel mode module first finds the replaced function and the replacement function according to the identification information in the replacement event, and when running to the replaced function, stops running the replaced function and runs the replacement function instead. Since the kernel mode module does not need the front-end application to stop running when executing the global event list, the kernel mode client can be upgraded without stopping the front-end application.

本发明提供的一种内核态客户端的升级方法,包括:获取外界输入的替换函数和被替换函数各自的标识信息;将替换函数和被替换函数各自的标识信息组合成替换事件;添加替换事件至内核态模块的全局事件链表,以供内核态模块执行全局事件链表时基于替换事件将自身模块中的被替换函数替换为替换函数。本发明提供的一种内核态客户端的升级方法,先获取外界输入的替换函数和被替换函数各自的标识信息;然后将替换函数和被替换函数各自的标识信息组合成替换事件;最后将替换事件添加到内核态模块的全局事件链表中,这样,内核态模块在执行全局事件链表时便可以基于替换事件将自身模块中的被替换函数替换为替换函数。本发明提供的一种内核态客户端的升级方法,通过将替换函数和被替换函数各自的标识信息组合成替换事件,然后将替换事件添加到内核态模块的全局事件链表中,借助全局事件链表让内核态模块触发替换事件,进而将被替换函数替换为替换函数,由于内核态模块执行全局事件链表时,无需前端应用停止运行,所以本发明提供的一种内核态客户端的升级方法无需前端应用停止运行便可将被替换函数替换为替换函数,具有更好的适应性。综上所述,本发明提供的一种内核态客户端的升级方法在一定程度上解决了如何提高内核态升级方法的适用性的技术问题。A method for upgrading a kernel-mode client provided by the present invention includes: acquiring the identification information of a replacement function input from the outside world and the replaced function; combining the identification information of the replacement function and the replaced function into a replacement event; adding the replacement event to The global event chain list of the kernel mode module is used for the kernel mode module to replace the replaced function in its own module with the replacement function based on the replacement event when executing the global event chain list. A method for upgrading a kernel-mode client provided by the present invention first obtains the respective identification information of the replacement function and the replaced function input from the outside world; then combines the respective identification information of the replacement function and the replaced function into a replacement event; finally converts the replacement event Added to the global event list of the kernel mode module, so that the kernel mode module can replace the replaced function in its own module with the replacement function based on the replacement event when executing the global event list. The method for upgrading a kernel state client provided by the present invention combines the identification information of the replacement function and the function to be replaced into a replacement event, and then adds the replacement event to the global event list of the kernel state module. The kernel mode module triggers the replacement event, and then replaces the replaced function with the replacement function. Since the kernel mode module executes the global event list, the front-end application does not need to stop running, so a method for upgrading the kernel mode client provided by the present invention does not require the front-end application to stop. After running, the replaced function can be replaced with the replacement function, which has better adaptability. To sum up, the method for upgrading the kernel mode client provided by the present invention solves the technical problem of how to improve the applicability of the method for upgrading the kernel mode to a certain extent.

本发明实施例提供的一种内核态客户端的升级方法中,获取外界输入的替换函数和被替换函数各自的标识信息,可以包括:In an upgrade method of a kernel-mode client provided by an embodiment of the present invention, obtaining the identification information of the replacement function input from the outside world and the replaced function may include:

获取外界输入的替换函数和被替换函数各自的函数名;Obtain the respective function names of the replacement function and the replaced function input from the outside world;

基于函数名查找替换函数和被替换函数各自的函数地址;Find the respective function addresses of the replacement function and the replaced function based on the function name;

将替换函数和被替换函数的标识信息组合成替换事件,可以包括:Combine the identification information of the replacement function and the replaced function into a replacement event, which can include:

将函数名和函数地址组合成替换事件。Combine the function name and function address into a replacement event.

实际应用中,在替换函数和被替换函数均为已存在的函数时,可以直接获取外界输入的替换函数的函数名和被替换函数的函数名,用户输入的函数名的格式可以是ikc—admin,其中ikc表示被替换函数名,admin表示替换函数名;接着通过获取的函数名查找替换函数的函数地址和被替换函数的函数地址,比如在内核态模块的内核sys_call_table中查找函数地址,这时,替换函数和被替换函数可以位于不同的函数集中,用户还可以将一个新的函数写入函数集中,并将该新函数的函数名和函数地址写入内核sys_call_table中,实现对函数的更新;然后将替换函数的函数名和函数地址、被替换函数的函数名和函数地址组合成替换事件,此时,标识信息即为函数名和函数地址。对应的,内核态模块执行替换事件时,可以先根据替换事件中被替换函数的函数地址找到被替换函数,当运行到被替换函数时,可以先进入中断状态,然后通过替换事件中替换函数的函数地址查找到替换函数,结束中断状态并转而运行替换函数,由于内核态模块不运行被替换函数转而运行替换函数,实现了将被替换函数替换为替换函数。实际应用中,可以将被替换函数的函数指针的第一个字节设置为INT3_INSTRUCTION的第一个字节,这样,在内核态模块运行到该字节时便会自动进入中断状态。当然,实际应用中还可以借助函数指针来实现将被替换函数替换为替换函数,比如将内核态模块的函数运行指针设置为替换函数的函数指针,将函数运行指针的函数地址由被替换函数的函数地址变更为替换函数的函数地址,这样,内核态模块在执行到被替换函数时,由于函数地址发生变化,便会触发notifier_block.notifer_call函数,判断函数运行指针跟替换函数的函数指针是否一致,若是,则进行函数替换操作;此外,当需要中断替换过程时,可以将替换事件中的替换函数的相关信息删除,并将函数运行指针的函数地址还原为被替换函数的函数地址。In practical applications, when both the replacement function and the replaced function are existing functions, the function name of the replacement function and the function name of the replaced function input from the outside world can be obtained directly. The format of the function name input by the user can be ikc—admin, Among them, ikc represents the name of the replaced function, and admin represents the name of the replacement function; then find the function address of the replacement function and the function address of the replaced function through the obtained function name, such as searching the function address in the kernel sys_call_table of the kernel mode module. At this time, The replacement function and the replaced function can be located in different function sets, and the user can also write a new function into the function set, and write the function name and function address of the new function into the kernel sys_call_table to update the function; then The function name and function address of the replacement function, and the function name and function address of the replaced function are combined to form a replacement event. At this time, the identification information is the function name and function address. Correspondingly, when the kernel mode module executes the replacement event, it can first find the replaced function according to the function address of the replaced function in the replacement event. When running to the replaced function, it can enter the interrupt state first, and then pass the The function address finds the replacement function, ends the interrupt state and turns to run the replacement function. Since the kernel mode module does not run the replaced function but instead runs the replacement function, the replacement function is replaced with the replacement function. In practical applications, the first byte of the function pointer of the replaced function can be set as the first byte of INT3_INSTRUCTION, so that when the kernel mode module runs to this byte, it will automatically enter the interrupt state. Of course, in practical applications, function pointers can also be used to replace the replaced function with the replacement function, such as setting the function running pointer of the kernel mode module as the function pointer of the replacement function, and changing the function address of the function running pointer from the function pointer of the replaced function The function address is changed to the function address of the replacement function. In this way, when the kernel mode module executes the replaced function, because the function address changes, the notifier_block.notifer_call function will be triggered to determine whether the function running pointer is consistent with the function pointer of the replacement function. If so, the function replacement operation is performed; in addition, when the replacement process needs to be interrupted, the relevant information of the replacement function in the replacement event can be deleted, and the function address of the function running pointer can be restored to the function address of the replaced function.

本发明实施例提供的一种内核态客户端的升级方法中,将函数名和函数地址组合成替换事件,可以包括:In a method for upgrading a kernel mode client provided by an embodiment of the present invention, combining a function name and a function address into a replacement event may include:

将函数名和函数地址组合成替换事件,函数名和函数地址在替换事件中的排列顺序可以包括:被替换的函数名、被替换的函数地址、替换的函数名、替换的函数地址。Combining the function name and function address into a replacement event, the arrangement order of the function name and function address in the replacement event may include: the replaced function name, the replaced function address, the replaced function name, and the replaced function address.

实际应用中,函数名和函数地址在替换事件中的排列顺序可以为:被替换的函数名、被替换的函数地址、替换的函数名、替换的函数地址。当然替换事件中还可以根据实际需要添加其他事项,比如替换发生的时间等,本发明在这里不做具体限定。In practical applications, the sequence of the function name and function address in the replacement event may be: the replaced function name, the replaced function address, the replaced function name, and the replaced function address. Of course, other items may be added to the replacement event according to actual needs, such as the time when the replacement occurs, which is not specifically limited in the present invention.

本发明还提供了一种内核态客户端的升级系统,其具有本发明实施例提供的一种内核态客户端的升级方法具有的对应效果。请参阅图2,图2为本发明实施例提供的一种内核态客户端的升级系统的结构示意图。The present invention also provides an upgrade system for a kernel state client, which has the corresponding effect of the upgrade method for a kernel state client provided by the embodiment of the present invention. Please refer to FIG. 2 . FIG. 2 is a schematic structural diagram of an upgrade system for a kernel state client provided by an embodiment of the present invention.

本发明实施例提供的一种内核态客户端的升级系统,可以包括:An upgrade system for a kernel state client provided in an embodiment of the present invention may include:

获取装置A1,用于获取外界输入的替换函数和被替换函数各自的标识信息;The obtaining device A1 is used to obtain the identification information of the replacement function input from the outside and the replaced function;

组合装置A2,用于将替换函数和被替换函数各自的标识信息组合成替换事件;Combining means A2, configured to combine the respective identification information of the replacement function and the replaced function into a replacement event;

添加装置A3,用于添加替换事件至内核态模块的全局事件链表,以供内核态模块执行全局事件链表时基于替换事件将自身模块中的被替换函数替换为替换函数。The adding device A3 is used to add a replacement event to the global event list of the kernel mode module, so that when the kernel mode module executes the global event list, the replaced function in its own module is replaced with the replacement function based on the replacement event.

实际应用中,内核态客户端有内核态和用户态两个状态,用户只能通过用户态对内核态进行操作,所以可以在本发明提供的一种内核态客户端的升级系统中设置用户态操作接口,接收外界输入的操作指令,比如替换、反替换、查询等;设置字符设备,实现将用户态操作接口接收的操作指令转化为内核态模块可以识别的字符。In practical applications, the kernel state client has two states of kernel state and user state, and the user can only operate the kernel state through the user state, so the user state operation can be set in a kind of kernel state client upgrade system provided by the present invention. The interface receives operation instructions input from the outside world, such as replacement, reverse replacement, query, etc.; the character device is set to convert the operation instructions received by the user-mode operation interface into characters that can be recognized by the kernel-mode module.

本发明实施例提供的一种内核态客户端的升级系统中,获取装置可以包括:In an upgrade system of a kernel state client provided by an embodiment of the present invention, the obtaining device may include:

获取模块,用于获取外界输入的替换函数和被替换函数各自的函数名;The acquisition module is used to acquire the respective function names of the replacement function and the replaced function input from the outside world;

查找模块,用于基于函数名查找替换函数和被替换函数各自的函数地址;A search module for finding the respective function addresses of the replacement function and the replaced function based on the function name;

组合装置可以包括:Combinations can include:

组合模块,用于将函数名和函数地址组合成替换事件。Composite module for compositing function names and function addresses into replacement events.

本发明实施例提供的一种内核态客户端的升级系统中,组合模块可以包括:In an upgrade system of a kernel state client provided by an embodiment of the present invention, the combination module may include:

组合单元,用于将函数名和函数地址组合成替换事件,函数名和函数地址在替换事件中的排列顺序可以包括:被替换的函数名、被替换的函数地址、替换的函数名、替换的函数地址。The combination unit is used to combine the function name and function address into a replacement event. The order of the function name and function address in the replacement event can include: replaced function name, replaced function address, replaced function name, replaced function address .

本发明还提供了一种内核态客户端的升级设备及存储介质,其均具有本发明实施例提供的一种内核态客户端的升级方法具有的对应效果。请参阅图3,图3为本发明实施例提供的一种内核态客户端的升级设备的结构示意图。The present invention also provides an upgrade device and a storage medium for a kernel-mode client, both of which have corresponding effects of the method for upgrading a kernel-state client provided by an embodiment of the present invention. Please refer to FIG. 3 . FIG. 3 is a schematic structural diagram of an upgrade device for a kernel state client provided by an embodiment of the present invention.

本发明实施例提供的一种内核态客户端的升级设备,包括:An upgrade device for a kernel state client provided in an embodiment of the present invention includes:

存储器B1,用于存储计算机程序;memory B1 for storing computer programs;

处理器B2,用于执行计算机程序时实现上述任一种内核态客户端的升级方法的步骤。The processor B2 is configured to implement the steps of any one of the above methods for upgrading the kernel state client when executing the computer program.

本发明实施例提供的一种存储介质中,存储介质上存储有计算机程序,计算机程序被处理器执行时实现上述任一种内核态客户端的升级方法的步骤。In a storage medium provided by an embodiment of the present invention, a computer program is stored on the storage medium, and when the computer program is executed by a processor, the steps of any one of the methods for upgrading a kernel-mode client are implemented.

本发明实施例提供的一种内核态客户端的升级系统中相关部分的说明请参见本发明实施例提供的一种内核态客户端的升级方法中对应部分的详细说明,在此不再赘述。另外,本发明实施例提供的上述技术方案中与现有技术中对应技术方案实现原理一致的部分并未详细说明,以免过多赘述。For the description of the relevant parts of the system for upgrading the kernel-mode client provided by the embodiment of the present invention, please refer to the detailed description of the corresponding part in the method for upgrading the kernel-mode client provided by the embodiment of the present invention, and details will not be repeated here. In addition, the parts of the technical solutions provided by the embodiments of the present invention that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail, so as to avoid redundant description.

对所公开的实施例的上述说明,使本领域技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention will not be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1.一种内核态客户端的升级方法,其特征在于,包括:1. A method for upgrading a kernel state client, comprising: 获取外界输入的替换函数和被替换函数各自的标识信息;Obtain the identification information of the replacement function input from the outside world and the replaced function; 将所述替换函数和所述被替换函数各自的标识信息组合成替换事件;Combining the respective identification information of the replacement function and the replaced function into a replacement event; 添加所述替换事件至内核态模块的全局事件链表,以供所述内核态模块执行所述全局事件链表时基于所述替换事件将自身模块中的所述被替换函数替换为所述替换函数。Adding the replacement event to the global event list of the kernel mode module, so that the kernel mode module can replace the replaced function in its own module with the replacement function based on the replacement event when executing the global event list. 2.根据权利要求1所述的方法,其特征在于,所述获取外界输入的替换函数和被替换函数各自的标识信息,包括:2. The method according to claim 1, wherein said acquiring the identification information of the replacement function input from the outside world and the replaced function includes: 获取外界输入的替换函数和被替换函数各自的函数名;Obtain the respective function names of the replacement function and the replaced function input from the outside world; 基于所述函数名查找所述替换函数和所述被替换函数各自的函数地址;Finding respective function addresses of the replacement function and the replaced function based on the function name; 所述将所述替换函数和所述被替换函数各自的标识信息组合成替换事件,包括:The combining the respective identification information of the replacement function and the replaced function into a replacement event includes: 将所述函数名和所述函数地址组合成替换事件。The function name and the function address are combined into a replacement event. 3.根据权利要求2所述的方法,其特征在于,所述将所述函数名和所述函数地址组合成替换事件,包括:3. The method according to claim 2, wherein said combining said function name and said function address into a replacement event comprises: 将所述函数名和所述函数地址组合成替换事件,所述函数名和所述函数地址在所述替换事件中的排列顺序包括:被替换函数的函数名、被替换函数的函数地址、替换函数的函数名、替换函数的函数地址。Combining the function name and the function address into a replacement event, the sequence of the function name and the function address in the replacement event includes: the function name of the replaced function, the function address of the replaced function, the replacement function Function name, function address of the replacement function. 4.一种内核态客户端的升级系统,其特征在于,包括:4. An upgrade system for a kernel state client, characterized in that it comprises: 获取装置,用于获取外界输入的替换函数和被替换函数各自的标识信息;An acquisition device, configured to acquire the identification information of the replacement function input from the outside and the replaced function; 组合装置,用于将所述替换函数和所述被替换函数各自的标识信息组合成替换事件;Combining means for combining the respective identification information of the replacement function and the replaced function into a replacement event; 添加装置,用于添加所述替换事件至内核态模块的全局事件链表,以供所述内核态模块执行所述全局事件链表时基于所述替换事件将自身模块中的所述被替换函数替换为所述替换函数。Adding means for adding the replacement event to the global event list of the kernel mode module, so that when the kernel mode module executes the global event list, the replaced function in its own module is replaced by the replaced function based on the replacement event The replacement function. 5.根据权利要求4所述的系统,其特征在于,所述获取装置包括:5. The system according to claim 4, wherein the acquiring means comprises: 获取模块,用于获取外界输入的替换函数和被替换函数各自的函数名;The acquisition module is used to acquire the respective function names of the replacement function and the replaced function input from the outside world; 查找模块,用于基于所述函数名查找所述替换函数和所述被替换函数各自的函数地址;A search module, configured to search for the respective function addresses of the replacement function and the replaced function based on the function name; 所述组合装置包括:The combined device includes: 组合模块,用于将所述函数名和所述函数地址组合成替换事件。A combining module, used for combining the function name and the function address into a replacement event. 6.根据权利要求5所述的系统,其特征在于,所述组合模块包括:6. The system according to claim 5, wherein the combination module comprises: 组合单元,用于将所述函数名和所述函数地址组合成替换事件,所述函数名和所述函数地址在所述替换事件中的排列顺序包括:被替换函数的函数名、被替换函数的函数地址、替换函数的函数名、替换函数的函数地址。A combination unit, configured to combine the function name and the function address into a replacement event, the arrangement order of the function name and the function address in the replacement event includes: the function name of the replaced function, the function of the replaced function address, the function name of the replacement function, and the function address of the replacement function. 7.一种内核态客户端的升级设备,其特征在于,包括:7. An upgrade device for a kernel client, comprising: 存储器,用于存储计算机程序;memory for storing computer programs; 处理器,用于执行所述计算机程序时实现如权利要求1至3任一项所述一种内核态客户端的升级方法的步骤。The processor is configured to implement the steps of the method for upgrading a kernel mode client according to any one of claims 1 to 3 when executing the computer program. 8.一种存储介质,其特征在于,所述存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至3任一项所述一种内核态客户端的升级方法的步骤。8. A storage medium, characterized in that a computer program is stored on the storage medium, and when the computer program is executed by a processor, a method for upgrading a kernel state client as described in any one of claims 1 to 3 is realized A step of.
CN201710912392.2A 2017-09-29 2017-09-29 A kind of upgrade method, system, equipment and the storage medium of kernel state client Pending CN107643924A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710912392.2A CN107643924A (en) 2017-09-29 2017-09-29 A kind of upgrade method, system, equipment and the storage medium of kernel state client

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710912392.2A CN107643924A (en) 2017-09-29 2017-09-29 A kind of upgrade method, system, equipment and the storage medium of kernel state client

Publications (1)

Publication Number Publication Date
CN107643924A true CN107643924A (en) 2018-01-30

Family

ID=61122733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710912392.2A Pending CN107643924A (en) 2017-09-29 2017-09-29 A kind of upgrade method, system, equipment and the storage medium of kernel state client

Country Status (1)

Country Link
CN (1) CN107643924A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070169086A1 (en) * 2005-12-30 2007-07-19 Siliconmotion Inc. System and method for updating in-system program
CN101799763A (en) * 2009-02-10 2010-08-11 华为技术有限公司 Method, device and system for patching kernel on line
US20120246456A1 (en) * 2010-10-13 2012-09-27 International Business Machines Corporation Memory tagging and preservation during a hot upgrade
CN105630491A (en) * 2015-12-18 2016-06-01 Tcl集团股份有限公司 Method and device for changing functions of program
CN105786537A (en) * 2014-12-24 2016-07-20 中兴通讯股份有限公司 Hot patch realization method and device
CN106598667A (en) * 2016-12-12 2017-04-26 百度在线网络技术(北京)有限公司 Method and device for repairing kernel vulnerabilities
CN107092496A (en) * 2016-12-28 2017-08-25 北京小度信息科技有限公司 The upgrade method and device of a kind of application software

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070169086A1 (en) * 2005-12-30 2007-07-19 Siliconmotion Inc. System and method for updating in-system program
CN101799763A (en) * 2009-02-10 2010-08-11 华为技术有限公司 Method, device and system for patching kernel on line
US20120246456A1 (en) * 2010-10-13 2012-09-27 International Business Machines Corporation Memory tagging and preservation during a hot upgrade
CN105786537A (en) * 2014-12-24 2016-07-20 中兴通讯股份有限公司 Hot patch realization method and device
CN105630491A (en) * 2015-12-18 2016-06-01 Tcl集团股份有限公司 Method and device for changing functions of program
CN106598667A (en) * 2016-12-12 2017-04-26 百度在线网络技术(北京)有限公司 Method and device for repairing kernel vulnerabilities
CN107092496A (en) * 2016-12-28 2017-08-25 北京小度信息科技有限公司 The upgrade method and device of a kind of application software

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
(美)DAVID A.SOLOMON 等著,詹剑锋 等译: "《Windows 2000内部揭密》", 30 October 2001, 北京:机械工业出版社 *

Similar Documents

Publication Publication Date Title
US12468552B2 (en) Execution of sub-application processes within application program
US11803451B2 (en) Application exception recovery
CN102236621B (en) Computer interface information configuration system and method
JP6430970B2 (en) Operating system execution on processors with different instruction set architectures
CN102103567B (en) Sharing virtual memory-based multi-version data among heterogeneous processors
US9606818B2 (en) Systems and methods of executing multiple hypervisors using multiple sets of processors
US10929149B2 (en) Method and system for updating firmware
WO2022134358A1 (en) Microservice data processing method, apparatus, microservice processing platform, and medium
US8135898B2 (en) Memory management in a nested virtualization environment
WO2018103532A1 (en) Monitoring method and related device free of burying-point deployment
US10977101B2 (en) Interoperability between programs associated with different addressing modes
CN104536737A (en) Program development framework based on assemblies
CN105144122A (en) Externally programmable memory management unit
CN114253681B (en) Interrupt registration and sharing management method and electronic equipment
CN111651248A (en) Scheduled task execution method, device, electronic device and storage medium
CN105159703A (en) Factory setting restoration method and system
US11263082B2 (en) Data recovery of guest virtual machines
CN116643778B (en) Application program optimization method and electronic equipment
US8453149B2 (en) Efficient multi-core processing of events
CN107643924A (en) A kind of upgrade method, system, equipment and the storage medium of kernel state client
CN108182081B (en) User state timer processing method and device, storage medium and electronic equipment
WO2020073200A1 (en) Program debugging method and system
WO2024067348A2 (en) Memory allocator determination method and apparatus, and electronic device and storage medium
CN106294143B (en) Debugging method and device for chip register
US20180101421A1 (en) Storage and application intercommunication using acpi

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20180130

RJ01 Rejection of invention patent application after publication