Kernel built-in module upgrading method and device, electronic equipment and storage medium

By adding the kernel built-in module to be upgraded to the list of rejected loads and loading the guardian service of the target upgrade module when the system kernel starts, the problem of large workload of upgrading the kernel is solved, and flexible upgrades are achieved and security is improved.

CN119311290APending Publication Date: 2025-01-14BEIJING QINGYUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411328503.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

In the operating system, when the kernel module exists in the form of a kernel built-in module, it is impossible to upgrade the kernel built-in module through direct replacement or update, and the complete kernel must be recompiled, resulting in a large workload.

Method used

By adding the built-in modules of the kernel to be upgraded to the list of rejected loads, and obtaining the guardian service of the target upgrade module, adding it to the root file system of the system kernel, loading the target upgrade module at startup, achieving flexible upgrade of the built-in modules of the kernel.

Benefits of technology

Without recompiling the complete kernel, flexible upgrades of kernel built-in modules are implemented, reducing the upgrade workload and improving the security of upgrades.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311290A_ABST
    Figure CN119311290A_ABST
Patent Text Reader

Abstract

The invention discloses a kernel built-in module upgrading method and device, electronic equipment and a storage medium, and relates to the technical field of computer operating systems. According to the specific implementation scheme, a to-be-upgraded built-in module in a system kernel is determined, and the to-be-upgraded built-in module is added to a loading rejection list; obtaining a target upgrading module of the built-in module to be upgraded, and adding a guarding service of the target upgrading module to a root file system of a system kernel; and when the system kernel is started, loading the target upgrading module according to the root file system. According to the embodiment of the invention, under the condition that the complete kernel is not recompiled, flexible upgrading of the kernel built-in module is realized, and the workload of upgrading the kernel built-in module is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer operation technology, and in particular to a kernel built-in module upgrading method, device, electronic device and storage medium. Background Art

[0002] The operating system kernel is the core part of the operating system, responsible for managing the system's hardware and software resources. Due to the modular design and scalability of the kernel, the kernel can easily adapt to different hardware platforms and device requirements. However, the kernel maintenance process often involves the need to upgrade kernel modules. In the operating system, when the kernel module exists in the form of a kernel built-in module, the kernel built-in module will be forcibly loaded by the kernel when the kernel starts, so it is impossible to upgrade the kernel built-in module by directly replacing or updating the kernel built-in module. The purpose of upgrading the kernel built-in module can only be achieved by recompiling the entire kernel, but this method introduces a huge workload. Summary of the invention

[0003] The embodiments of the present invention provide a kernel built-in module upgrade method, device, electronic device and storage medium, which can realize flexible upgrade of kernel built-in modules without recompiling the entire kernel, thereby reducing the workload of upgrading kernel built-in modules.

[0004] According to one aspect of an embodiment of the present invention, a method for upgrading a kernel built-in module is provided, comprising:

[0005] Determine the built-in modules to be upgraded in the system kernel, and add them to the list of rejected modules;

[0006] Get the target upgrade module of the built-in module to be upgraded, and add the daemon service of the target upgrade module to the root file system of the system kernel;

[0007] When the system kernel is started, the target upgrade module is loaded according to the root file system.

[0008] Another aspect of an embodiment of the present invention provides a kernel built-in module device, including:

[0009] Reject loading module, used to determine the built-in modules to be upgraded in the system kernel, and add the built-in modules to be upgraded to the rejected loading list;

[0010] The kernel reload module is used to obtain the target upgrade module of the built-in module to be upgraded, and add the daemon service of the target upgrade module to the root file system of the system kernel;

[0011] The module loading module is used to load the target upgrade module according to the root file system when starting the system kernel.

[0012] Another aspect of an embodiment of the present invention provides an electronic device, including:

[0013] at least one processor; and

[0014] a memory communicatively connected to at least one processor; wherein,

[0015] The memory stores a computer program executable by at least one processor, and the computer program is executed by at least one processor so that the at least one processor can execute the kernel built-in module upgrade method described in any one of claims 1-7.

[0016] Another aspect of an embodiment of the present invention provides a computer-readable storage medium storing computer instructions, which are used to enable a processor to implement the kernel built-in module upgrade method of any embodiment of the present invention when executing the computer instructions.

[0017] According to an embodiment of the present invention, a built-in module that needs to be upgraded in the system kernel is taken as a built-in module to be upgraded, and the built-in module to be upgraded is added to a list of rejected loading, a new version of the built-in module to be upgraded is obtained, and the new version of the built-in module is taken as a target upgrade module, and a daemon service of the target upgrade module is created. After the daemon service is created, the daemon service is added to the root file system of the system kernel. When the system kernel is started, the system kernel will load the target upgrade module according to the root file system. The technical solution of the embodiment of the present invention can improve the security of the kernel built-in module upgrade by adding the built-in module to be upgraded to a list of rejected loading to prevent the built-in module to be upgraded from erroneously starting during the upgrade process. The system kernel completes the loading of the target upgrade module according to the root file system, thereby realizing the upgrade of the kernel built-in module. The kernel built-in module can be flexibly upgraded without recompiling the entire kernel, thereby reducing the workload of upgrading the kernel built-in module.

[0018] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 is a flowchart of a kernel built-in module upgrade method provided according to the first embodiment of the present invention;

[0021] Figure 2 is a flowchart of another kernel built-in module upgrade method provided according to Embodiment 2 of the present invention;

[0022] Figure 3 It is a schematic diagram of the structure of a kernel built-in module upgrade device to implement an embodiment of the present invention;

[0023] Figure 4 It is a schematic diagram of the structure of another kernel built-in module upgrade device implementing an embodiment of the present invention;

[0024] Figure 5 The invention is a block diagram of an electronic device for implementing the kernel built-in module upgrade method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] Embodiment 1

[0028] Figure 1 A flowchart of a method for upgrading a kernel built-in module is provided for the first embodiment of the present invention. This embodiment can be applied to upgrading a kernel built-in module without recompiling the entire kernel. The method can be executed by a kernel built-in module upgrading device. The kernel built-in module upgrading device can be implemented in the form of hardware and / or software. The kernel built-in module upgrading device can be configured in an electronic device. Figure 1 As shown, the method includes:

[0029] S110, determining the built-in modules to be upgraded in the system kernel, and adding the built-in modules to be upgraded to a list of rejected modules.

[0030] In an embodiment of the present invention, the system kernel refers to the core component of the operating system, which is used to manage system resources. For example, the system kernel is responsible for managing the memory space or disk space allocated to the operating system; the built-in modules to be upgraded can be understood as the built-in modules that need to be upgraded in the current system; the rejection list can be understood as a mechanism for preventing module loading, which is used to specify modules that should not be loaded by the kernel. The methods for preventing module loading may include: editing the configuration file of modprobe or modifying the initialization configuration item, wherein the initialization configuration item exists in the boot program in the kernel.

[0031] Specifically, the built-in modules that need to be upgraded in the system kernel are determined as built-in modules to be upgraded, and the built-in modules to be upgraded are added to a list of rejected loads, so as to prevent the built-in modules to be upgraded from being loaded incorrectly when the system kernel is started.

[0032] For example, the implementation method of adding the built-in module to be upgraded to the rejection list may include: implementing it by editing the modprobe configuration file, the format of the modprobe configuration file is usually as follows: blacklist MODULE_NAME, where MODULE_NAME is the name of the module that you want to prevent from loading, or implementing it by modifying the initialization configuration item. Taking the modification of the initcall_blacklist configuration item as an example, if you need to reject the loading of the ext4 file system module, you can specify initcall_blacklist = ext4_init_fs, where the ext4_init_fs function is the entry function of the ext4 module, and the ext4_init_fs function can be defined through the module_init function.

[0033] S120: Obtain a target upgrade module of the built-in module to be upgraded, and add a daemon service of the target upgrade module to the root file system of the system kernel.

[0034] In an embodiment of the present invention, a target upgrade module is a built-in module corresponding to a module to be upgraded, and there is a corresponding relationship between the target upgrade module and the module to be upgraded. The target upgrade module can be understood as a new version of the built-in module of the module to be upgraded, wherein the method for obtaining the target upgrade module may include: directly downloading a compiled new version of the built-in module or downloading the source code containing the module to be upgraded, and compiling the source code again, and the download channels may include: downloading from a software warehouse or downloading from the manufacturer's official website; a daemon service can be understood as a program file that runs in the background and is used to provide continuous services and functions for the system, users or other programs; the root file system is the first file system loaded when the operating system starts, and the root file system contains all programs, libraries and configuration files required for system startup.

[0035] Specifically, obtain a new version of the built-in module of the module to be upgraded, take the new version of the built-in module as the target upgrade module, create a daemon service for the target upgrade module, and after the creation is completed, add the daemon service of the target upgrade module to the root file system of the system kernel.

[0036] S130: When starting the system kernel, load the target upgrade module according to the root file system.

[0037] Specifically, when the system kernel is booting, the system kernel needs to access the root file system to continue the booting process. The root file system guides the system kernel to boot, and the system kernel automatically loads the target upgrade module according to the root file system.

[0038] According to the embodiment of the present invention, the built-in modules that need to be upgraded in the system kernel are taken as the built-in modules to be upgraded, and the built-in modules to be upgraded are added to the rejection list, the new version of the built-in modules of the modules to be upgraded are obtained, the new version of the built-in modules are taken as the target upgrade modules, and the guardian service of the target upgrade module is created. After the guardian service is created, the guardian service is added to the root file system of the system kernel. When the system kernel is started, the system kernel will load the target upgrade module according to the root file system. The technical solution of the embodiment of the present invention can improve the security of the kernel built-in module upgrade by adding the built-in module to be upgraded to the rejection list to prevent the built-in module to be upgraded from erroneously starting during the upgrade process. The system kernel completes the loading of the target upgrade module according to the root file system, thereby realizing the upgrade of the kernel built-in module. The kernel built-in module can be flexibly upgraded without recompiling the complete kernel, thereby reducing the workload of upgrading the kernel built-in module.

[0039] Embodiment 2

[0040] Figure 2This is a flowchart of another kernel built-in module upgrade method provided by the second embodiment of the present invention. Based on the above embodiment, the embodiment of the present invention provides another kernel built-in module upgrade method. Figure 2 As shown, the method includes:

[0041] S210: Obtain user selection information, and determine the built-in modules to be upgraded in the system kernel according to the user selection information.

[0042] In an embodiment of the present invention, user selection information can be understood as information used by users to select built-in modules to be upgraded. The user selection information can exist in the form of configuration files or transmission instructions. The user selection information at least includes information indicating one or more built-in modules. The one or more built-in modules indicated can be upgraded. Users can determine which built-in modules can be upgraded by checking official update logs, paying attention to security announcements, or directly obtaining them from third parties. Therefore, the corresponding user selection information can be triggered to control the upgrade of the built-in modules to be upgraded in the system kernel.

[0043] Specifically, the information used by the user to select the built-in module to be upgraded is used as the user selection information. The electronic device obtains the user selection information and determines the built-in module to be upgraded in the system kernel according to the user selection information, and uses the built-in module to be upgraded as the built-in module to be upgraded.

[0044] S220. Modify the initialization configuration item of the built-in module to be upgraded in the boot program of the system kernel to add the initialization function of the built-in module to be upgraded to a rejection list, wherein the boot program includes at least one of the following: a grub boot program, a lilo boot program, a syslinux boot program, or a uboot boot program.

[0045] In an embodiment of the present invention, a boot program refers to a software program responsible for loading the system kernel and starting the system during the computer startup process, wherein the boot program includes: at least one of a grub boot program, a lilo boot program, a syslinux boot program or a uboot boot program, wherein the grub (grand unified bootloader) boot program supports multiple operating systems and file systems and provides users with a graphical and command line interface; the LiLo (Linux Loader) boot program is simple and reliable, easy to configure, and cannot recognize large hard disks and file systems; the syslinux boot program is suitable for removable storage media and has a fast startup speed; the uboot boot program is highly customizable and supports multiple processor architectures and hardware platforms; it is understandable that these boot programs have their own characteristics, and users can select a suitable boot program according to the different operating systems and hardware environments.

[0046] Initialization configuration items refer to a series of parameters that need to be configured before the system or software is started, including but not limited to: hardware setting configuration parameters, system environment variable configuration parameters or service startup configuration parameters, etc. Initialization configuration items ensure that the system or software can run as expected.

[0047] The initialization function can be understood as the code that is automatically called when a program or object is created, and is used to set the initial state of the program or object when it is started or created.

[0048] Specifically, the boot program of the built-in module to be upgraded is determined in the system kernel, and the initialization configuration item of the boot program of the determined built-in module to be upgraded is modified. By modifying the initialization configuration item, the initialization function of the built-in module to be upgraded is added to a rejection list. When the system kernel starts, the built-in module to be upgraded added to the rejection list will not be loaded, so as to prevent the built-in module to be upgraded from being erroneously loaded during the kernel built-in module upgrade process.

[0049] S230: Acquire a program file of a target upgrade module associated with the built-in module to be upgraded, wherein the association between the built-in module to be upgraded and the target upgrade module includes the same module name or the same module identifier.

[0050] In the embodiment of the present invention, the program file may be understood as a collection of configuration information required by the target upgrade module. By way of example, the program file may include: a module code of the target upgrade module or an installation script of the target upgrade module.

[0051] Specifically, determine the module name or module identifier of the built-in module to be upgraded, obtain the program file of the target upgrade module associated with the built-in module to be upgraded, and determine whether there is an association between the built-in module to be upgraded and the target upgrade module. The method may include: determining by determining whether the module name or module identifier is the same, wherein, if the module name or module identifier is the same, it is determined that the built-in module to be upgraded is associated with the target upgrade module.

[0052] S240. Create a daemon service for the target upgrade module, wherein the daemon service includes at least one of a systemd daemon service, an upstart daemon service, a busybox-init daemon service, or an OpenRC daemon service.

[0053] Specifically, the daemon service program of the target upgrade module is configured, and the daemon service of the target upgrade module is created. Creating the daemon service in the target upgrade module can ensure the stable operation and monitoring of the target upgrade module. Among them, the daemon service includes at least one of the following: systemd daemon service, upstart daemon service, busybox-init daemon service or OpenRC daemon service. Different target upgrade modules have different functions and characteristics, and require different types of daemon services for management and maintenance. For example, a systemd daemon service is created for the network upgrade module; an upstart daemon service is created for the security patch update module; a busybox-init daemon service is created for the embedded device firmware upgrade module; and an OpenRC daemon service is created for the database upgrade module. It can be understood that different daemon services have different methods for configuring daemon services. The method for configuring daemon services is a common method in the field of computer operations, and the embodiments of the present invention will not be repeated.

[0054] S250. Add a daemon service to a root file system, wherein the root file system includes an initrd image file or an initramfs image file.

[0055] Specifically, the daemon service of the created target upgrade module is added to the appropriate location of the root file system of the system kernel to complete the operation of adding the daemon service to the root file system. Among them, the initrd image file can be used as a temporary root file system during system startup. If the real root file system is not ready, for example, the required driver has not been loaded, the initrd image file can be used as a temporary root file system to continue to perform necessary initialization and loading tasks; the initramfs image file plays a bridge role in the system startup process, helping the kernel to complete the pre-boot preparations, for example, loading the necessary drivers and tools so that the real root file system can be mounted and accessed.

[0056] S260: When starting the system kernel, load the target upgrade module according to the root file system.

[0057] In the embodiment of the present invention, the information used by the user to select the built-in module to be upgraded is used as the user selection information. The electronic device determines the built-in module to be upgraded in the system kernel according to the obtained user selection information, adds the initialization function of the built-in module to be upgraded to the rejection list by modifying the initialization configuration item of the built-in module to be upgraded, obtains the program file of the target upgrade module associated with the built-in module to be upgraded, creates a guardian service for the target upgrade module and adds the guardian service of the target upgrade module to the root file system. When the system kernel is started, the system kernel will load the target upgrade module according to the root file system to complete the upgrade of the kernel built-in module. The technical solution of the embodiment of the present invention can prevent the built-in module to be upgraded from being incorrectly loaded by the kernel by modifying the initialization configuration item of the built-in module to be upgraded and add the initialization function of the built-in module to the rejection list, thereby improving the security of the kernel built-in module upgrade; adds the target upgrade module to the root file system of the system kernel, and loads the target upgrade module according to the root file system when the kernel is started to complete the upgrade of the kernel built-in module. The kernel built-in module can be flexibly upgraded without recompiling the complete kernel, thereby reducing the workload of upgrading the kernel built-in module.

[0058] On the basis of the above embodiment, the embodiment of the present invention further includes: calling the daemon process of the target upgrade module in the root file system through the system kernel to forcibly load the target upgrade module.

[0059] In the implementation of the present invention, a daemon process can be understood as a process that runs continuously in the background and is used to execute a specified system task or service.

[0060] Specifically, the daemon service is deployed to an appropriate location of the root file system, and the system kernel can achieve the purpose of forcibly loading the target upgrade module by calling the daemon process responsible for executing the target upgrade module in the root file system.

[0061] Embodiment 3

[0062] Figure 3 This is a schematic diagram of the structure of a kernel built-in module upgrade device provided by Embodiment 3 of the present invention. Figure 3 As shown, the device comprises:

[0063] The kernel built-in module rejection loading module 310 is used to obtain user selection information, and determine the kernel built-in module to be upgraded in the system kernel through the user selection information, and modify the kernel initialization configuration items in the kernel boot program to configure the initialization function of the kernel built-in module to be upgraded to the rejection loading list, and add the configuration file for modifying the kernel initialization configuration items to the boot program.

[0064] The kernel built-in module upgrade module 320 is used to obtain the target upgrade module, create a daemon service for the target upgrade module, and add the daemon service to the root file system. When the system kernel is started, the kernel built-in module upgrade module will cause the system kernel to load the target upgrade module to complete the upgrade of the kernel built-in module.

[0065] On the basis of the above embodiments, the embodiments of the present invention take the need to upgrade the ext4 built-in kernel module as an example. If the ext4 built-in kernel module needs to be upgraded, it is necessary to obtain the target upgrade module of the ext4 built-in kernel module, create a daemon service for the target upgrade module of the ext4 built-in kernel module, and add the daemon service to the root file system, wherein the new version of the ext4 built-in kernel module needs to be forcibly loaded before switching the root file to prevent the root file system from failing to switch due to the ext4 file system module not being loaded. The method for obtaining the target upgrade module of the ext4 built-in kernel module may include: directly downloading the compiled new version of the ext4 built-in kernel module or downloading the source code containing the ext4 built-in kernel module, and compiling the source code again. The download channels may include: downloading from the software warehouse or downloading from the manufacturer's official website. The creation of the daemon service for the target upgrade module of the ext4 built-in kernel module takes the creation of the systemd init daemon service as an example. The creation code of the systemdinit daemon service may include:

[0066] [Unit]

[0067] Description=Force reload kernel builtin module ext4

[0068] DefaultDependencies=no

[0069] Conflicts = shutdown.target

[0070] Before=sysinit.target shutdown.target

[0071] ConditionCapability=CAP_SYS_MODULE

[0072] [Service]

[0073] Type=forking

[0074] RemainAfterExit=yes

[0075] ExecStart= / usr / sbin / insmod-f

[0076] / lib / modules / %v / updates / ext4.ko

[0077] TimeoutSec=30s

[0078] [Install]

[0079] WantedBy=sysinit.target

[0080] The embodiment of the present invention modifies the initialization configuration item of the kernel built-in module to be upgraded through the kernel built-in module rejection loading module, so as to configure the initialization function of the kernel built-in module to be upgraded to the rejection loading list, and install the configuration file of the kernel built-in module initialization configuration item into the boot program, so that the kernel built-in module to be upgraded is no longer loaded when the kernel is started; the creation file of the daemon service of the new version of the kernel built-in module is installed into the root file system through the kernel built-in module upgrade module, and when the kernel is started, the kernel will load the new version of the kernel built-in module according to the creation file. The technical solution of the embodiment of the present invention can prevent the system kernel from mistakenly loading the built-in module to be upgraded when starting by configuring the initialization function of the kernel built-in module to the rejection loading list, and can improve the security of the kernel built-in module upgrade, add the daemon service of the new version of the kernel built-in module to the root file system of the system kernel, and the system kernel will load the new version of the kernel built-in module according to the root file system when it starts, and complete the upgrade of the kernel built-in module, and can flexibly upgrade the kernel built-in module without recompiling the complete kernel, thereby reducing the workload of upgrading the kernel built-in module.

[0081] Embodiment 4

[0082] Figure 4 This is a schematic diagram of the structure of another kernel built-in module upgrade device provided by the fourth embodiment of the present invention. Figure 4 As shown, the device comprises:

[0083] The load rejection module 410 is used to determine the internal modules to be upgraded in the system kernel and add the internal modules to be upgraded to the load rejection list;

[0084] The kernel reload module 420 is used to obtain a target upgrade module of the built-in module to be upgraded, and add the daemon service of the target upgrade module to the root file system of the system kernel;

[0085] The module loading module 430 is used to load the target upgrade module according to the root file system when starting the system kernel.

[0086] The embodiment of the present invention determines the built-in module to be upgraded in the system kernel as the built-in module to be upgraded and adds the built-in module to be upgraded to a list of rejected loading, creates a daemon service for the target upgrade module, and adds the daemon service to the root file system of the system kernel after the daemon service is created. When the system kernel is started, the target upgrade module will be loaded according to the root file system. The technical solution of the embodiment of the present invention adds the built-in module to be upgraded to a list of rejected loading, so that the built-in module to be upgraded will not be loaded when the kernel is started, and the built-in module to be upgraded will be prevented from being started incorrectly during the upgrade process, which can improve the security of the upgrade, add the target upgrade module to the root file system of the system kernel, and when the system kernel is started, the system kernel will load the target upgrade module according to the root file system to complete the upgrade of the kernel built-in module, and can achieve flexible upgrade of the kernel built-in module without recompiling the complete kernel, reducing the workload of upgrading the kernel built-in module.

[0087] On the basis of the above embodiment, the embodiment of the present invention further includes: calling the daemon process of the target upgrade module in the root file system through the system kernel to force loading of the target upgrade module.

[0088] Optionally, the refusal to load module 410 is specifically used for:

[0089] Obtain user selection information, and determine the built-in module to be upgraded in the system kernel according to the user selection information;

[0090] Modify the initialization configuration item of the built-in module to be upgraded in the boot program of the system kernel to add the initialization function of the built-in module to be upgraded to a rejection list, wherein the boot program includes at least one of the following: a grub boot program, a lilo boot program, a syslinux boot program or a uboot boot program;

[0091] Optionally, the kernel reload module 420 is specifically used for:

[0092] Acquire a program file of a target upgrade module associated with the built-in module to be upgraded, wherein the association between the built-in module to be upgraded and the target upgrade module includes the same module name or the same module identifier;

[0093] Creating a daemon service for the target upgrade module, wherein the daemon service includes at least one of a systemd daemon service, an upstart daemon service, a busybox-init daemon service, or an OpenRC daemon service;

[0094] Add a daemon service to the root file system, where the root file system includes an initrd image file or an initramfs image file.

[0095] Embodiment 5

[0096] The embodiments of the present invention provide an electronic device, a computer-readable storage medium and a computer program product for a kernel built-in module upgrade method.

[0097] Figure 5 A schematic diagram of an electronic device that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown in the embodiments of the present invention, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of the present invention described and / or required herein.

[0098] like Figure 5 As shown, the electronic device includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the ROM 12 or the computer program loaded from the storage unit 18 to the RAM 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.

[0099] A number of components in the electronic device are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0100] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit, a graphics processing unit, various special artificial intelligence computing chips, various processors running machine learning model algorithms, digital signal processors, and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, for example, a kernel built-in module upgrade method.

[0101] In some embodiments, the kernel built-in module upgrade method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for identifying heating defects of the power transmission equipment may be performed. Alternatively, in other embodiments, the processor 11 may be configured as the kernel built-in module upgrade method in any other appropriate manner (e.g., by means of firmware).

[0102] Various implementations of the systems and techniques described above in the embodiments of the present invention may be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays, application specific integrated circuits, application specific standard products, systems on a chip, load programmable logic devices, computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: being implemented in one or more computer programs, which may be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general programmable processor, which may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0103] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0104] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a RAM, a ROM, an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0105] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a cathode ray tube or a liquid crystal display monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including: acoustic input, voice input, or tactile input).

[0106] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local area networks, wide area networks, blockchain networks, and the Internet.

[0107] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private server services.

[0108] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0109] The above specific implementations do not constitute a limitation on the protection scope of the embodiments of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for upgrading a kernel built-in module, characterized in that: include: Determine the built-in modules to be upgraded in the system kernel, and add the built-in modules to be upgraded to a list of rejected modules; Obtain a target upgrade module for the built-in module to be upgraded, and add a daemon service of the target upgrade module to the root file system of the system kernel; When starting the system kernel, the target upgrade module is loaded according to the root file system.

2. The method according to claim 1, characterized in that: The step of determining the built-in module to be upgraded in the system kernel and adding the built-in module to be upgraded to a list of rejected modules includes: Acquiring user selection information, and determining the built-in module to be upgraded in the system kernel according to the user selection information; The initialization configuration item of the built-in module to be upgraded is modified in the boot program of the system kernel to add the initialization function of the built-in module to be upgraded to the rejection list.

3. The method according to claim 2, characterized in that: The boot program includes at least one of the following: a grub boot program, a lilo boot program, a syslinux boot program or a uboot boot program.

4. The method according to claim 1, characterized in that: The step of obtaining a target upgrade module of the built-in module to be upgraded includes: A program file of the target upgrade module associated with the built-in module to be upgraded is obtained, wherein the association between the built-in module to be upgraded and the target upgrade module includes the same module name or the same module identifier.

5. The method according to claim 1, characterized in that: The step of adding the daemon service of the target upgrade module to the root file system of the system kernel comprises: Creating a daemon service for the target upgrade module; The daemon service is added to the root file system, wherein the root file system includes an initrd image file or an initramfs image file.

6. The method according to claim 5, characterized in that: The daemon service includes at least one of a systemd daemon service, an upstart daemon service, a busybox-init daemon service or an OpenRC daemon service.

7. The method according to claim 5, characterized in that: Also includes: The system kernel calls the daemon process of the target upgrade module in the root file system to forcibly load the target upgrade module.

8. A kernel built-in module upgrade device, characterized in that: include: A rejection module, used for determining a built-in module to be upgraded in the system kernel, and adding the built-in module to be upgraded to a rejection list; A kernel reloading module, used for obtaining a target upgrade module of the built-in module to be upgraded, and adding a daemon service of the target upgrade module to the root file system of the system kernel; A module loading module is used to load the target upgrade module according to the root file system when starting the system kernel.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the kernel built-in module upgrade method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the kernel built-in module upgrade method according to any one of claims 1 to 7 when executed.