Driver updating method and device, computer equipment and storage medium

By compiling and running driver codes from the same driver source but different versions in the target kernel, the adaptability and reliability problems caused by kernel code incompatibility are solved, and the adaptability and reliability of driver updates are improved.

CN118733075APending Publication Date: 2024-10-01TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310371691.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-30
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In the existing technology, when computer drivers are updated, due to the incompatibility of the kernel code, the adaptability and reliability are reduced, making it difficult to achieve stable driver updates.

Method used

By obtaining driver code files from the same driver source but different versions, determine the target kernel driver directory to which they belong, and compile and run them in this directory to ensure that the driver is updated in the same kernel, thereby avoiding kernel code incompatibility issues.

Benefits of technology

It improves the adaptability and reliability of driver updates, avoids the problem of unstable adaptation, and ensures that driver updates run directly in the target kernel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733075A_ABST
    Figure CN118733075A_ABST
Patent Text Reader

Abstract

The invention relates to a driver updating method and device, computer equipment, a storage medium and a computer program product. The method comprises the steps that a first drive code file corresponding to a first drive is obtained, the first drive is used for updating a second drive, and the first drive and the second drive are the same in drive source but different in drive version; a target kernel drive directory to which a second drive code file corresponding to the second drive belongs is determined, a first drive directory is created in the target kernel drive directory, the first drive directory and the second drive directory belong to the target kernel drive directory, and the second drive directory is matched with the second drive; the target kernel drive directory corresponds to a target kernel; compiling a first drive code file in the first drive directory; and after compilation of the first drive code file is completed, running the first drive in the target kernel. By adopting the method, the adaptability and reliability of drive updating can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer device and storage medium for driver update. Background Art

[0002] With the continuous development of computer and Internet technologies, in order to ensure the normal performance of computer computing, the computer drivers need to be updated frequently. At present, due to the diversity of computer performance, it is usually necessary to update the computer drivers through driver codes from different manufacturers to support different computing functions. However, since the driver codes supporting different computing functions may have kernel code incompatibility issues, the updated drivers may have unstable adaptation problems, thereby reducing the adaptability and reliability of driver updates. Therefore, how to improve the adaptability and reliability of driver updates is an urgent problem to be solved. Summary of the invention

[0003] Based on this, it is necessary to provide a driver update method, device, computer equipment and storage medium that can improve the adaptability and reliability of driver updates in response to the above technical problems.

[0004] In a first aspect, the present application provides a method for driver update. The method comprises:

[0005] Obtaining a first driver code file corresponding to a first driver, where the first driver is a driver used to update a second driver, and the first driver and the second driver have the same driver source but different driver versions;

[0006] Determine a target kernel driver directory to which a second driver code file corresponding to the second driver belongs, and create a first driver directory in the target kernel driver directory, the first driver directory and the second driver directory both belong to the target kernel driver directory, the second driver directory matches the second driver, and the target kernel driver directory corresponds to the target kernel;

[0007] Compile the first driver code file in the first driver directory;

[0008] After the compilation of the first driver code file is completed, the first driver is run in the target kernel.

[0009] In a second aspect, the present application also provides a driver update device. The device includes:

[0010] A driver code file acquisition module, used to acquire a first driver code file corresponding to a first driver, where the first driver is a driver used to update a second driver, and the first driver and the second driver have the same driver source but different driver versions;

[0011] A driver directory creation module is used to determine a target kernel driver directory to which a second driver code file corresponding to the second driver belongs, and to create a first driver directory in the target kernel driver directory, wherein the first driver directory and the second driver directory both belong to the target kernel driver directory, the second driver directory matches the second driver, and the target kernel driver directory corresponds to the target kernel;

[0012] A compiling module, used for compiling a first driver code file in a first driver directory;

[0013] The update operation module is used to run the first driver in the target kernel after completing the compilation of the first driver code file.

[0014] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0015] Obtaining a first driver code file corresponding to a first driver, where the first driver is a driver used to update a second driver, and the first driver and the second driver have the same driver source but different driver versions;

[0016] Determine a target kernel driver directory to which a second driver code file corresponding to the second driver belongs, and create a first driver directory in the target kernel driver directory, the first driver directory and the second driver directory both belong to the target kernel driver directory, the second driver directory matches the second driver, and the target kernel driver directory corresponds to the target kernel;

[0017] Compile the first driver code file in the first driver directory;

[0018] After the compilation of the first driver code file is completed, the first driver is run in the target kernel.

[0019] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0020] Obtaining a first driver code file corresponding to a first driver, where the first driver is a driver used to update a second driver, and the first driver and the second driver have the same driver source but different driver versions;

[0021] Determine a target kernel driver directory to which a second driver code file corresponding to the second driver belongs, and create a first driver directory in the target kernel driver directory, the first driver directory and the second driver directory both belong to the target kernel driver directory, the second driver directory matches the second driver, and the target kernel driver directory corresponds to the target kernel;

[0022] Compile the first driver code file in the first driver directory;

[0023] After the compilation of the first driver code file is completed, the first driver is run in the target kernel.

[0024] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0025] Obtaining a first driver code file corresponding to a first driver, where the first driver is a driver used to update a second driver, and the first driver and the second driver have the same driver source but different driver versions;

[0026] Determine a target kernel driver directory to which a second driver code file corresponding to the second driver belongs, and create a first driver directory in the target kernel driver directory, the first driver directory and the second driver directory both belong to the target kernel driver directory, the second driver directory matches the second driver, and the target kernel driver directory corresponds to the target kernel;

[0027] Compile the first driver code file in the first driver directory;

[0028] After the compilation of the first driver code file is completed, the first driver is run in the target kernel.

[0029] The above-mentioned driver update method, device, computer equipment, storage medium and computer program product obtain the first driver code file corresponding to the first driver, the first driver is a driver for updating the second driver, and the first driver and the second driver have the same driver source but different driver versions, then determine the target kernel driver directory to which the second driver code file corresponding to the second driver belongs, and create the first driver directory in the target kernel driver directory, the first driver directory and the second driver directory belong to the target kernel driver directory, the second driver directory matches the second driver, and the target kernel driver directory corresponds to the target kernel, and compile the first driver code file in the first driver directory, and finally run the first driver in the target kernel after completing the compilation of the first driver code file. Since the first driver code file corresponding to the first driver is compiled in the first driver directory, and the second driver directory matching the first driver directory with the second driver belongs to the same kernel driver directory, after the first driver code file is compiled, it can include the second driver and the first driver compiled uniformly at the same time, because the updated first driver can be directly run in the target kernel, so that the problem of kernel code incompatibility can be avoided, so the updated first driver will not have the problem of unstable adaptation, thereby improving the adaptability and reliability of the driver update. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A schematic diagram of a prior art flow chart of a method for driving update in one embodiment;

[0031] Figure 2 An application environment diagram of a method for driving update in an embodiment;

[0032] Figure 3 A schematic flow chart of a method for driving update in one embodiment;

[0033] Figure 4 A schematic diagram of a portion of the process flow of driver update and operation in one embodiment;

[0034] Figure 5 A schematic diagram of a compiling process of a driver code file based on compile isolation in one embodiment;

[0035] Figure 6 A schematic diagram of a process of compiling a first driver code file in a first driver directory in an embodiment;

[0036] Figure 7 A schematic diagram of a process of driving operation after compiling in one embodiment;

[0037] Figure 8 A schematic flow chart of a method for driving update in another embodiment;

[0038] Fig. 9 A complete flowchart of a method for driving update in one embodiment;

[0039] Fig.10 is a structural block diagram of a driver update device in one embodiment;

[0040] Fig.11 is a structural block diagram of a driver updating device in another embodiment;

[0041] Fig.12 is a structural block diagram of a drive update device in yet another embodiment;

[0042] Fig.13 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0044] With the continuous development of computer and Internet technology, in order to ensure the normal performance of computer computing, it is necessary to frequently update the computer driver. At present, due to the diversity of computer performance, it is usually necessary to update the computer driver through the driver code of different manufacturers to support different computing functions. For ease of understanding, the installation and update of the third-party driver named NewMpt3sas is used as a specific example. Figure 1 As shown, first use the configuration corresponding to the system to compile and install the new kernel required by the New Mpt3sas driver 102, then install the compiled kernel and restart to the new kernel. Because the driver version of the old driver (i.e., Mpt3sas driver 104) in the old kernel cannot meet the usage requirements, in the system restarted to the new kernel, it is necessary to recompile and install the new New Mpt3sas driver 102, that is, obtain the driver code file corresponding to the New Mpt3sas driver 102, and then decompress the driver code file corresponding to the New Mpt3sas driver 102 into the new kernel restarted locally, thereby compiling the driver code file corresponding to the New Mpt3sas driver 102 in the new kernel, removing the old Mpt3sas driver 104, and running the New Mpt3sas driver 102 in the new kernel restarted locally. By Figure 1 It can be seen that since the driver code supporting different computing functions may be incompatible with the kernel code, and running the driver in different kernels may also cause the updated driver to have unstable adaptation problems, which will reduce the adaptability and reliability of the driver update. In response to the above problems, the present application provides a driver update method that can improve the adaptability and reliability of the driver update.

[0045] The driver update method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the terminal 202 communicates with the server 204 through a network. The data storage system can store data that the server 204 needs to process. The data storage system can be integrated on the server 204, or placed on the cloud or other servers.

[0046] Specifically, the application of terminal 202 is used as an example for explanation. When the second driver needs to be updated, the first driver code file corresponding to the first driver is first obtained, and the first driver is used to update the second driver. Then the target kernel driver directory to which the second driver code file corresponding to the second driver belongs is determined, and the first driver directory is created in the target kernel driver directory. The first driver directory and the second driver directory belong to the target kernel driver directory, the second driver directory matches the second driver, and the target kernel driver directory corresponds to the target kernel, so that the first driver and the second driver can be compiled into the same kernel. Thus, the first driver code file is compiled in the first driver directory, and finally, after the compilation of the first driver code file is completed, the first driver is run in the target kernel. Thus, the first driver after the update can be directly run in the target kernel, so that the problem of incompatibility of the kernel code can be avoided, so the first driver after the update will not have the problem of unstable adaptation, thereby improving the adaptability and reliability of the driver update.

[0047] The terminal 202 may be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart vehicle-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 204 may be implemented as an independent server or a server cluster consisting of multiple servers.

[0048] In one embodiment, Figure 3 As shown, a method for driver update is provided. This embodiment takes the method applied to a terminal as an example for explanation. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0049] Step 302: Obtain a first driver code file corresponding to a first driver, where the first driver is a driver for updating a second driver, and the first driver and the second driver have the same driver source but different driver versions.

[0050] Wherein, the first driver is a driver for updating the second driver, and each driver has a corresponding driver source and driver version, the driver source is to describe the manufacturer of the driver, and the driver version is used to describe the specific version of the driver under the manufacturer. Therefore, since the first driver is a driver for updating the second driver, then considering the compatibility of the codes between the drivers, the compatibility of the codes between the drivers usually originating from the same manufacturer is higher, so the driver source of the first driver is the same as the driver source of the second driver, but since the first driver needs to update the second driver, the driver version of the first driver is different from the driver version of the second driver, or the driver version of the first driver is later than the driver version of the second driver. The manufacturer of the second driver is driver source 1, and the driver version of the second driver is 2.2.1, then the manufacturer of the first driver must be driver source 1, and the driver version of the first driver can be 2.2.2, 2.2.3, 2.3.0 or 3.1, etc., which is later than the specific version of the driver version of the second driver, and is not specifically limited here.

[0051] Specifically, the terminal first determines the second driver that needs to be updated. That is, the terminal can determine the second driver that needs to be updated based on the update driver identifier or related description information carried in the update instruction issued by the user using the terminal. Alternatively, the terminal can also receive the update driver identifier or related description information carried in the update request for the second driver from the operator through the communication connection with the server, and determine the second driver that needs to be updated.

[0052] Based on this, the terminal determines the first driver for updating the second driver, and obtains the first driver code file corresponding to the first driver. That is, the terminal can determine the manufacturer of the second driver based on the driver source of the second driver, thereby determining the latest driver version of the driver from the manufacturer's website as the first driver, or using the driver of the required driver version as the first driver, and then downloading the first driver code file corresponding to the first driver from the manufacturer's website.

[0053] Alternatively, the user can also obtain the first driver code file corresponding to the first driver of the same driver source as the second driver but with a different driver version by other means, and enable the terminal to obtain the first driver code file corresponding to the first driver by means of a hardware transmission connection, such as obtaining the first driver code file from a hardware device storing the first driver code file, or obtaining the first driver code file from a USB flash disk (USB) disk storing the first driver code file, etc., which is not limited here. Therefore, in this embodiment, the method of obtaining the first driver code file is not specifically limited.

[0054] Step 304, determine the target kernel driver directory to which the second driver code file corresponding to the second driver belongs, and create a first driver directory in the target kernel driver directory, the first driver directory and the second driver directory belong to the target kernel driver directory, the second driver directory matches the second driver, and the target kernel driver directory corresponds to the target kernel.

[0055] Among them, the driver code file corresponding to each driver needs to be stored in a driver directory, and the driver target belongs to the kernel driver directory corresponding to a certain kernel, that is, different kernels have different kernel driver directories. The aforementioned kernel is specifically used to manage the process, memory, device driver, file and network system of the operating system. For example, kernel A1 corresponds to kernel driver directory B1, and there are driver directories C1 and driver directory C2 under kernel driver directory B1, then the driver compiled in driver directory C1 and driver directory C2 can run in kernel A1. It can be seen from this that the driver that needs to run under a certain kernel needs to be compiled in a certain driver directory of the kernel driver directory corresponding to the kernel to obtain the corresponding driver module, and the driver module obtained by compilation enables the driver to run smoothly. Based on the above example, if the driver compiled in the driver directory C1 needs to be able to run in kernel A1, it is necessary to compile the driver code file E1 corresponding to the corresponding driver D1 in the driver directory C1, so that the terminal can run the driver D1 in kernel A1 based on the driver code file E1 after compilation.

[0056] Based on this, the target kernel driver directory corresponds to the target kernel, and the target kernel is a kernel that can be used to run the second driver. Therefore, the second driver code file corresponding to the second driver belongs to the target kernel driver directory corresponding to the target kernel, and the first driver directory and the second driver directory belong to the target kernel driver directory. The first driver directory is used to store the first driver code file corresponding to the first driver and provide a compilation environment for the first driver code file.

[0057] Specifically, considering that different versions of drivers can be supported in the same kernel and a unified compilation environment can be provided, it can be ensured that the required new driver can be accurately run in the kernel, and the adaptability of the code can be guaranteed through unified compilation parameters. Therefore, the terminal first determines that the second driver code file corresponding to the second driver that needs to be updated belongs to the target kernel driver directory corresponding to the target kernel, and creates a first driver directory in the determined target kernel driver directory to accommodate the first driver used to update the second driver, thereby achieving the purpose of the first driver and the second driver belonging to the same target kernel driver.

[0058] Exemplarily, based on the above example, further introduction is given, and the driver D1 in the above example is determined as the second driver. Then the second driver directory (i.e., driver directory C1) matched by the first driver code file (i.e., driver code file E1) corresponding to the second driver (i.e., driver D1) belongs to the kernel driver directory B1, that is, the kernel driver directory B1 can be determined as the target kernel driver directory. At this time, the terminal can create a first driver directory in the target kernel driver directory (i.e., kernel driver directory B1).

[0059] Step 306: compile the first driver code file in the first driver directory.

[0060] The aforementioned compilation at least includes: creating a kernel compilation rule file, and creating a kernel compilation relationship configuration file based on the kernel configuration name set in the kernel compilation rule file. Based on this, after completing the compilation of the first driver code file, at least the created: first kernel compilation rule file of the first driver, and first kernel compilation relationship configuration file of the first driver can be obtained.

[0061] Specifically, the terminal compiles the first driver code file in the first driver directory newly created in the target kernel driver directory. That is, the terminal first creates a kernel compilation rule file for the first driver in the first driver directory, and configures a new kernel configuration name for the kernel compilation rule file of the first driver, that is, the terminal specifically distinguishes the kernel compilation rule file of the second driver from the kernel compilation rule file of the first driver through the kernel configuration name. Based on this, the terminal then creates a kernel compilation relationship configuration file for the first driver in the first driver directory according to the configured new kernel configuration name. The kernel compilation relationship configuration file of the first driver can describe: the compilation dependency relationship when compiling the first driver, that is, the interface information required to be called and other compilation related information, thereby completing the compilation of the first driver code file.

[0062] Step 308: After the first driver code file is compiled, the first driver is run in the target kernel.

[0063] Specifically, after the terminal completes compiling the first driver code file, it can run the first driver in the target kernel.

[0064] For ease of understanding, based on the above Figure 1 The example of installing and updating a third-party driver named New Mpt3sas is further described in the introduction. Figure 4 As shown, in this embodiment, it is not necessary to Figure 1The configuration corresponding to the system is used to compile and install the new kernel required by the New Mpt3sas driver 402, and then the compiled kernel is installed and restarted to the new kernel. Instead, the New Mpt3sas driver 402 can be directly determined to be used to update the Mpt3sas driver 404, and the target kernel driver directory 406 to which the second driver code file corresponding to the Mpt3sas driver 404 belongs is determined, and a first driver directory 408 matching the New Mpt3sas driver is created under the target kernel driver directory 406, thereby compiling the first driver code file corresponding to the New Mpt3sas driver 402 in the first driver directory 408. After completing the compilation of the first driver code file corresponding to the New Mpt3sas driver 402, the New Mpt3sas driver 402 is directly run.

[0065] Therefore, this scheme does not require Figure 1 As shown in the prior art, a new kernel is created to run the new New Mpt3sas driver 402, and there is no need to remove the old Mpt3sas driver 404 in the old stable kernel. Instead, the New Mpt3sas driver 402 and the Mpt3sas driver 404 are made to coexist in the same kernel to ensure a unified compilation environment and ensure the adaptability of the code through unified compilation parameters.

[0066] In the above driver update method. Since the first driver code file corresponding to the first driver is compiled in the first driver directory, and the second driver directory matching the first driver directory belongs to the same kernel driver directory, after the first driver code file is compiled, it can include the second driver and the first driver compiled uniformly at the same time. Because the updated first driver can be directly run in the target kernel, the problem of kernel code incompatibility can be avoided. Therefore, the updated first driver will not have the problem of unstable adaptation, thereby improving the adaptability and reliability of the driver update.

[0067] It can be seen from the above embodiments that the first driver code file corresponding to the first driver used to update the second driver is included in the kernel management of the matched target kernel. However, in actual applications, when the driver code files corresponding to multiple drivers are compiled in the same kernel, multiple driver conflicts may occur. Therefore, considering the driver conflict problem, in this embodiment, the driver conflict problem of multiple drivers in the same kernel can also be avoided by compiling isolation during the compilation process. The following is a detailed description of this:

[0068] In one embodiment, Figure 5 As shown, the driver update method also includes:

[0069] Step 502: configure compilation isolation in the kernel code compilation file of the second driver.

[0070] Among them, the kernel code compilation file is a related configuration file in the kernel for compiling the driver code file, so the kernel code compilation file of the second driver is specifically: a related configuration file in the target kernel for compiling the second driver code file. Secondly, compilation isolation is used to isolate the driver code files corresponding to other drivers that do not need to be compiled during the compilation of the driver code file, that is, skip the compilation process of the driver code files corresponding to the drivers that do not need to be compiled.

[0071] The whole process of compiling the driver specifically includes: preprocessing process, file compilation process, file assembly process, and linking process. In this embodiment, the process of compiling the driver code file is specifically the file compilation process in the aforementioned process, so the kernel code compilation file is specifically the compilation configuration file required for the compilation process.

[0072] For ease of understanding, the detailed process of driver compilation is further introduced: the preprocessing process is used to replace all #include header files and macro definitions in the driver code file with the real content in the file. After preprocessing the driver code file, the text file corresponding to the driver code file is still obtained. The file compilation process does not refer to the entire process from compiling the driver code file to the binary program, but refers to the process of converting the text file corresponding to the driver code file obtained after preprocessing into a specific assembly code (assembly code). Therefore, the file assembly process converts the assembly code obtained by the file compilation process into machine code (machine code), and the aforementioned machine code is specifically in binary format. Therefore, through the linking process, multiple machine codes and required library files are linked into a final executable file (executable file). Therefore, when it is necessary to run the aforementioned driver, the normal operation of the driver is specifically performed through the executable file.

[0073] Specifically, considering that driver code files corresponding to multiple drivers are compiled in the same kernel, conflicts between multiple drivers may occur. The terminal configures compilation isolation in the kernel code compilation file of the second driver.

[0074] Step 504 , during the process of compiling the first driver code file in the first driver directory, the compilation process of the second driver code file is skipped based on the compilation isolation configured in the kernel code compilation file of the second driver.

[0075] Specifically, during the process of compiling the first driver code file in the first driver directory, the terminal directly skips the compilation process of the second driver code file based on the compilation isolation configured in the kernel code compilation file of the second driver, that is, the second driver code file corresponding to the second driver is not compiled to avoid the second driver from continuing to run. At this time, it can be ensured that multiple driver code files belong to the same kernel driver directory, but the driver conflict problem caused by simultaneous compilation and update in the kernel matching the kernel driver directory is avoided.

[0076] Exemplarily, again, the second driver to be updated is the Mpt3sas driver, and the first determination for updating the Mpt3sas driver is the New Mpt3sas driver. The terminal can specifically set "SCSI_MPT3SAS" and depend on no newmpt3sas for the second driver code file corresponding to the second driver in the kernel code compilation file "drivers / scsi / mpt3sas / K config" of the second driver. The aforementioned "SCSI_MPT3SAS" and the dependence on nonewmpt3sas are compilation isolation. The aforementioned "no newmpt3sas" is a module dependency, that is, it describes that the "SCSI_MPT3SAS" module depends on "no module", indicating that the "SCSI_MPT3SAS" module does not need to be compiled. Therefore, in the process of compiling the first driver code file in the first driver directory, the terminal will not compile the second driver code file in the second driver directory, that is, skip the compilation process of the second driver code file, so that only one driver from the same driver source is compiled in the target kernel. Thereby avoiding the driver conflict problem.

[0077] In this embodiment, by configuring compilation isolation in the kernel code compilation file of the second driver, the second driver code file can be avoided from being compiled at the same time during the compilation of the first driver code file. On the basis of ensuring that multiple driver code files belong to the same kernel driver directory, the driver conflict problem caused by compiling and updating in the kernel matching the kernel driver directory is avoided, and the reliability and compatibility of the driver update are further improved.

[0078] In one embodiment, Figure 6 As shown, compile the first driver code file in the first driver directory, including:

[0079] Step 602: Create a first kernel compilation rule file corresponding to the first driver code file in the first driver directory.

[0080] The kernel compilation rule file is a compilation rule for compiling a driver code file. That is, the first kernel compilation rule file is a compilation rule for compiling a first driver code file. The aforementioned compilation rule at least includes: the kernel configuration names of drivers with the same driver source but different driver versions are different.

[0081] Specifically, the terminal first copies the first driver code file to the first driver directory created by the aforementioned embodiment, and then the terminal creates the first kernel compilation rule file corresponding to the first driver code file in the first driver directory. The aforementioned first kernel compilation rule file is specifically a Make File, that is, it is necessary to instruct how to specifically compile and link the first driver according to the first kernel compilation rule file (Make File). Therefore, the kernel compilation rule file (MakeFile) at least includes: a target (Target), a prerequisite (Prerequisites) and a command (Command). The aforementioned target can be an object file (object file), an executable file, or a label (label), and the prerequisite is used to generate the file on which the target depends, and the command is the specific command that the target needs to execute (which can be any shell command). The aforementioned description is a dependency relationship in a kernel compilation rule file, that is, the target, one or more target files, depend on the files in the prerequisite, and the generation rule of the target is defined in the command.

[0082] Step 604: Create a corresponding first kernel compilation relationship configuration file based on the first kernel compilation rule file, where the first kernel compilation relationship configuration file is used to describe: compilation dependency relationships in the first driver.

[0083] Among them, the first kernel compilation relationship configuration file is used to describe: the compilation dependency relationship in the first driver. The aforementioned first kernel compilation relationship configuration file is specifically K config, and K config can describe the kernel configuration menu related to the directory to which it belongs. Therefore, K config is specifically a source file. The kernel configuration tool reads the K config file to generate a configuration interface for developers to configure the kernel, and finally generates a configuration file .config. Based on this, when the kernel is compiled, the configuration of the specific kernel can be known by calling this configuration file .config through MakeFile. Similarly, when the first driver code file is compiled, the kernel compilation configuration file can be generated through the first kernel compilation relationship configuration file in a similar manner as mentioned above, and the specific compilation configuration can be known by calling the generated kernel compilation configuration file through the first kernel compilation rule file.

[0084] Specifically, based on the first kernel compilation rule file, a corresponding first kernel compilation relationship configuration file is created. Based on the above introduction, it can be known that the compilation dependency relationship in the first driver is used to describe the relevant information for compiling the first driver; the compilation dependency relationship in the first driver at least includes: interface information of the first driver, relevant compilation information of the first driver, and driver description information of the first driver.

[0085] Exemplarily, taking the second driver that needs to be updated as the Mpt3sas driver, and the first driver used to update the Mpt3sas driver as the New Mpt3sas driver as an example, the interface information of the aforementioned first driver can be described as follows: the first driver depends on an external link (Peripheral Component Interconnect, PCI) and a small computer system interface (SCSI, Small Computer System Interface).

[0086] Secondly, the compilation information of the first driver can describe: when the first driver is compiled, the SCSI_SAS_ATTRS driver and the RADI_ATTRS, IRQ_POLL driver need to be compiled at the same time. And the driver description information of the first driver can describe: the first driver is an LSI MPT Fusion SAS 3.0 & SAS 2.0 device driver, that is, the driver description information of the first driver can specifically describe that the driver source and driver version of the first driver are the same.

[0087] Step 606: compile the first driver code file based on the first kernel compilation relationship configuration file and the first kernel compilation rule file.

[0088] Specifically, the terminal compiles the first driver code file based on the first kernel compilation relationship configuration file and the first kernel compilation rule file in the first driver directory. That is, when compiling the first driver code file, the kernel configuration menu related to the first driver directory is described by the first kernel compilation relationship configuration file, and then the kernel configuration tool reads the first kernel compilation relationship configuration file to generate a configuration interface for developers to configure, that is, the kernel compilation configuration file is generated through the compilation dependency relationship in the configured first driver in the aforementioned first kernel compilation relationship configuration file, and thus the kernel compilation configuration file is generated through the first kernel compilation relationship configuration file, and the specific compilation configuration situation can be known by calling the generated kernel compilation configuration file through the first kernel compilation rule file, and then the first driver code file is compiled based on this.

[0089] In this embodiment, compiling the first driver code file through the first kernel compilation relationship configuration file and the first kernel compilation rule file can ensure that the configured compilation rules and the required compilation dependencies are taken into account during the compilation process, thereby ensuring that the compilation of the first driver code file can be completed accurately and reliably to improve the reliability of driver updates.

[0090] The following describes how to run the driver after the compilation is completed: In one embodiment, Figure 7 As shown, after the first driver code file is compiled, the first driver is run in the target kernel, including:

[0091] Step 702: After the compilation of the first driver code file is completed, the first driver is run in the target kernel based on the first kernel compilation relationship configuration file and the first kernel compilation rule file.

[0092] Specifically, it can be known from the above-mentioned embodiments that after the compilation of the first driver code file is completed based on the first kernel compilation relationship configuration file and the first kernel compilation rule file, what can be obtained is the process of converting the text file corresponding to the driver code file obtained after preprocessing into a specific assembly code. Therefore, the terminal will also convert the obtained assembly code into a machine code in a binary format, and then link the obtained machine code in a binary format and the required library files into an executable file corresponding to the first driver, that is, after the terminal specifically completes the compilation of the first driver code file based on the first kernel compilation relationship configuration file and the first kernel compilation rule file, it will further generate an executable file corresponding to the first driver in the above-mentioned manner, so that the terminal runs the first driver in the target kernel based on the executable file corresponding to the first driver.

[0093] In this embodiment, after completing the compilation of the first driver code file, the executable file corresponding to the first driver is further generated through the first kernel compilation relationship configuration file and the first kernel compilation rule file, so that the terminal completes the operation of the first driver through the executable file to ensure the feasibility of the driver operation after the update.

[0094] It can be seen from the above embodiments that the compilation rules at least include: the kernel configuration names of drivers with the same driver source but different driver versions are different, so when determining the first kernel compilation rule file, it should be considered that the kernel configuration name of the first driver code file of the first driver should be different from the kernel configuration name of the second driver code file of the second driver. The above process will be described in detail below: In one embodiment, if Figure 8 As shown, the driver update method also includes:

[0095] Step 802: Determine a second kernel compilation rule file corresponding to the second driver code file, where the second kernel compilation rule file at least includes: a first kernel configuration name corresponding to the second driver code file.

[0096] The second kernel compilation rule file at least includes: the first kernel configuration name corresponding to the second driver code file. Specifically, the terminal determines the second kernel compilation rule file from the second driver directory to which the second driver code file of the second driver belongs, thereby also being able to determine the first kernel configuration name corresponding to the second driver code file in the second kernel compilation rule file. Similar to the aforementioned first kernel compilation rule file, the aforementioned second kernel compilation rule file is a Make File, that is, when it is necessary to instruct how to specifically compile and link the second driver according to the second kernel compilation rule file.

[0097] Based on this, in the first driver directory, a first kernel compilation rule file corresponding to the first driver code file is created, including:

[0098] Step 804: Create a first kernel compilation rule file in the first driver directory based on the second kernel compilation rule file. The created first kernel compilation rule file at least includes: a second kernel configuration name corresponding to the first driver code file, and the second kernel configuration name is different from the first kernel configuration name.

[0099] Among them, the first kernel compilation rule file at least includes: the second kernel configuration name corresponding to the first driver code file, and the second kernel configuration name is different from the first kernel configuration name. Specifically, the terminal creates the first kernel compilation rule file in the first driver directory based on the second kernel compilation rule file. That is, the terminal determines the first kernel configuration name corresponding to the second driver code file based on the second kernel compilation rule file, and when creating the first kernel compilation rule file in the first driver directory, the second kernel configuration name corresponding to the first driver code file is set to be different from the first kernel configuration name. For example, if the first kernel configuration name corresponding to the second driver code file is CONFIG_SCSI_MPT3SAS, then the second kernel configuration name corresponding to the first driver code file in the first kernel compilation rule file can be set to CONFIG_NEWMPT3SAS, as long as it is different from the first kernel configuration name, and no specific limitation is made here.

[0100] In this embodiment, a first kernel compilation rule file is created using the first kernel configuration name in the second kernel compilation rule file, and the first kernel configuration name is ensured to be different from the second kernel configuration name, thereby avoiding the problem of kernel compilation rule file errors and compilation exceptions due to the same kernel configuration name, thereby ensuring the reliability and accuracy of the compilation process, thereby further improving the reliability of driver updates.

[0101] Based on the detailed description of the above embodiments, the complete process of the method for driving update in the embodiments of the present application will be described below. In one embodiment, Fig. 9 As shown, a method for driver update is provided. This embodiment takes the method applied to a terminal as an example for explanation. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0102] Step 901: Obtain a first driver code file corresponding to a first driver.

[0103] Among them, the first driver is a driver for updating the second driver, and each driver has a corresponding driver source and driver version, the driver source is to describe the manufacturer of the driver, and the driver version is used to describe the specific version of the driver under the manufacturer. Therefore, since the first driver is a driver for updating the second driver, then considering the compatibility of the codes between the drivers, the compatibility of the codes between the drivers from the same manufacturer is usually higher, so the driver source of the first driver is the same as the driver source of the second driver, but since the first driver needs to update the second driver, the driver version of the first driver is different from the driver version of the second driver, or the driver version of the first driver is later than the driver version of the second driver.

[0104] Specifically, the terminal first determines the second driver that needs to be updated. That is, the terminal can determine the second driver that needs to be updated based on the update driver identifier or related description information carried in the update instruction issued by the user using the terminal. Alternatively, the terminal can also receive the update driver identifier or related description information carried in the update request for the second driver from the operator through the communication connection with the server, and determine the second driver that needs to be updated.

[0105] Based on this, the terminal determines the first driver for updating the second driver, and obtains the first driver code file corresponding to the first driver. That is, the terminal can determine the manufacturer of the second driver based on the driver source of the second driver, thereby determining the latest driver version of the driver from the manufacturer's website as the first driver, or using the driver of the required driver version as the first driver, and then downloading the first driver code file corresponding to the first driver from the manufacturer's website.

[0106] Alternatively, the user can also obtain the first driver code file corresponding to the first driver with the same driver source as the second driver but with a different driver version by other means, and enable the terminal to obtain the first driver code file corresponding to the first driver by means of a hardware transmission connection, such as obtaining the first driver code file from a hardware device storing the first driver code file, or obtaining the first driver code file from a USB flash drive storing the first driver code file, etc., which is not limited here. Therefore, the method of obtaining the first driver code file is not specifically limited in this embodiment.

[0107] Step 902: determine the target kernel driver directory to which the second driver code file corresponding to the second driver belongs, and create a first driver directory in the target kernel driver directory.

[0108] The driver code files corresponding to each driver need to be stored in a driver directory, and the driver target belongs to the kernel driver directory corresponding to a kernel, that is, different kernels have different kernel driver directories. The aforementioned kernel is specifically used to manage the operating system's processes, memory, device drivers, files, and network systems.

[0109] Based on this, the target kernel driver directory corresponds to the target kernel, and the target kernel is a kernel that can be used to run the second driver. Therefore, the second driver code file corresponding to the second driver belongs to the target kernel driver directory corresponding to the target kernel, and the first driver directory and the second driver directory belong to the target kernel driver directory. The first driver directory is used to store the first driver code file corresponding to the first driver and provide a compilation environment for the first driver code file.

[0110] Specifically, considering that different versions of drivers can be supported in the same kernel and a unified compilation environment can be provided, it can be ensured that the required new driver can be accurately run in the kernel, and the adaptability of the code can be guaranteed through unified compilation parameters. Therefore, the terminal first determines that the second driver code file corresponding to the second driver that needs to be updated belongs to the target kernel driver directory corresponding to the target kernel, and creates a first driver directory in the determined target kernel driver directory to accommodate the first driver used to update the second driver, thereby achieving the purpose of the first driver and the second driver belonging to the same target kernel driver.

[0111] Step 903: configure compilation isolation in the kernel code compilation file of the second driver.

[0112] Among them, the kernel code compilation file is a related configuration file in the kernel for compiling the driver code file, so the kernel code compilation file of the second driver is specifically: a related configuration file in the target kernel for compiling the second driver code file. Secondly, compilation isolation is used to isolate the driver code files corresponding to other drivers that do not need to be compiled during the compilation of the driver code file, that is, skip the compilation process of the driver code files corresponding to the drivers that do not need to be compiled.

[0113] Specifically, considering that driver code files corresponding to multiple drivers are compiled in the same kernel, conflicts between multiple drivers may occur. The terminal configures compilation isolation in the kernel code compilation file of the second driver.

[0114] Step 904: Determine a second kernel compilation rule file corresponding to the second driver code file.

[0115] The second kernel compilation rule file at least includes: the first kernel configuration name corresponding to the second driver code file. Specifically, the terminal determines the second kernel compilation rule file from the second driver directory to which the second driver code file of the second driver belongs, thereby also being able to determine the first kernel configuration name corresponding to the second driver code file in the second kernel compilation rule file.

[0116] Step 905: Create a first kernel compilation rule file in the first driver directory based on the second kernel compilation rule file, and skip the compilation process of the second driver code file based on the compilation isolation configured in the kernel code compilation file of the second driver.

[0117] Among them, the first kernel compilation rule file at least includes: the second kernel configuration name corresponding to the first driver code file, and the second kernel configuration name is different from the first kernel configuration name. Specifically, the terminal first copies the first driver code file to the first driver directory created by the aforementioned embodiment, and then the terminal creates the first kernel compilation rule file in the first driver directory based on the second kernel compilation rule file. That is, the terminal determines the first kernel configuration name corresponding to the second driver code file based on the second kernel compilation rule file, and when creating the first kernel compilation rule file in the first driver directory, the second kernel configuration name corresponding to the first driver code file is set to be different from the first kernel configuration name. For example, if the first kernel configuration name corresponding to the second driver code file is CONFIG_SCSI_MPT3SAS, then the second kernel configuration name corresponding to the first driver code file in the first kernel compilation rule file can be set to CONFIG_NEWMPT3SAS, as long as it is different from the first kernel configuration name, and no specific limitation is made here.

[0118] Furthermore, the terminal will directly skip the compilation process of the second driver code file based on the compilation isolation configured in the kernel code compilation file of the second driver, that is, not compiling the second driver code file corresponding to the second driver to avoid the second driver from continuing to run. At this time, it can be ensured that multiple driver code files belong to the same kernel driver directory, but the driver conflict problem caused by simultaneous compilation and update in the kernel matching the kernel driver directory is avoided.

[0119] Exemplarily, again, the second driver to be updated is the Mpt3sas driver, and the first determination for updating the Mpt3sas driver is the New Mpt3sas driver. The terminal can specifically set "SCSI_MPT3SAS" and depend on no newmpt3sas for the second driver code file corresponding to the second driver in the kernel code compilation file "drivers / scsi / mpt3sas / K config" of the second driver. The aforementioned "SCSI_MPT3SAS" and the dependence on nonewmpt3sas are compilation isolation. The aforementioned "no newmpt3sas" is a module dependency, that is, it describes that the "SCSI_MPT3SAS" module depends on "no module", indicating that the "SCSI_MPT3SAS" module does not need to be compiled. Therefore, in the process of compiling the first driver code file in the first driver directory, the terminal will not compile the second driver code file in the second driver directory, that is, skip the compilation process of the second driver code file, so that only one driver from the same driver source is compiled in the target kernel. Thereby avoiding the driver conflict problem.

[0120] Step 906: Create a corresponding first kernel compilation relationship configuration file based on the first kernel compilation rule file.

[0121] Among them, the first kernel compilation relationship configuration file is used to describe: the compilation dependency relationship in the first driver. Specifically, based on the first kernel compilation rule file, a corresponding first kernel compilation relationship configuration file is created. And based on the above introduction, it can be known that the compilation dependency relationship in the first driver is used to describe the relevant information for compiling the first driver; the compilation dependency relationship in the first driver at least includes: the interface information of the first driver, the relevant compilation information of the first driver, and the driver description information of the first driver.

[0122] Exemplarily, taking the second driver that needs to be updated as the Mpt3sas driver, and the first driver used to update the Mpt3sas driver as the New Mpt3sas driver as an example, the interface information of the aforementioned first driver can be described as follows: the first driver depends on an external link (Peripheral Component Interconnect, PCI) and a small computer system interface (SCSI, Small Computer System Interface).

[0123] Secondly, the compilation information of the first driver can describe: when the first driver is compiled, the SCSI_SAS_ATTRS driver and the RADI_ATTRS, IRQ_POLL driver need to be compiled at the same time. And the driver description information of the first driver can describe: the first driver is an LSI MPT Fusion SAS 3.0 & SAS 2.0 device driver, that is, the driver description information of the first driver can specifically describe that the driver source and driver version of the first driver are the same.

[0124] Step 907: compile the first driver code file based on the first kernel compilation relationship configuration file and the first kernel compilation rule file.

[0125] Specifically, the terminal compiles the first driver code file based on the first kernel compilation relationship configuration file and the first kernel compilation rule file in the first driver directory. That is, when compiling the first driver code file, the kernel configuration menu related to the first driver directory is described by the first kernel compilation relationship configuration file, and then the kernel configuration tool reads the first kernel compilation relationship configuration file to generate a configuration interface for developers to configure, that is, the kernel compilation configuration file is generated through the compilation dependency relationship in the configured first driver in the aforementioned first kernel compilation relationship configuration file, and thus the kernel compilation configuration file is generated through the first kernel compilation relationship configuration file, and the specific compilation configuration situation can be known by calling the generated kernel compilation configuration file through the first kernel compilation rule file, and then the first driver code file is compiled based on this.

[0126] Step 908: After the compilation of the first driver code file is completed, the first driver is run in the target kernel based on the first kernel compilation relationship configuration file and the first kernel compilation rule file.

[0127] Specifically, it can be known from the above-mentioned embodiments that after the compilation of the first driver code file is completed based on the first kernel compilation relationship configuration file and the first kernel compilation rule file, what can be obtained is the process of converting the text file corresponding to the driver code file obtained after preprocessing into a specific assembly code. Therefore, the terminal will also convert the obtained assembly code into a machine code in a binary format, and then link the obtained machine code in a binary format and the required library files into an executable file corresponding to the first driver, that is, after the terminal specifically completes the compilation of the first driver code file based on the first kernel compilation relationship configuration file and the first kernel compilation rule file, it will further generate an executable file corresponding to the first driver in the above-mentioned manner, so that the terminal runs the first driver in the target kernel based on the executable file corresponding to the first driver.

[0128] It should be understood that the specific implementations of step 901 to step 908 are similar to the above-mentioned embodiments and will not be described in detail here.

[0129] It should be understood that, although the steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0130] Based on the same inventive concept, the embodiment of the present application also provides a driver update device for implementing the driver update method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more driver update device embodiments provided below can refer to the limitations of the driver update method above, and will not be repeated here.

[0131] In one embodiment, Fig.10 As shown, a driver update device is provided, including: a driver code file acquisition module 1002, a driver directory creation module 1004, a compilation module 1006 and an update operation module 1008, wherein:

[0132] A driver code file acquisition module 1002 is used to acquire a first driver code file corresponding to a first driver, where the first driver is a driver used to update a second driver, and the first driver and the second driver have the same driver source but different driver versions;

[0133] The driver directory creation module 1004 is used to determine the target kernel driver directory to which the second driver code file corresponding to the second driver belongs, and create a first driver directory in the target kernel driver directory, the first driver directory and the second driver directory both belong to the target kernel driver directory, the second driver directory matches the second driver, and the target kernel driver directory corresponds to the target kernel;

[0134] Compiling module 1006, used to compile the first driver code file in the first driver directory;

[0135] The update operation module 1008 is used to run the first driver in the target kernel after completing the compilation of the first driver code file.

[0136] In one embodiment, Fig.11 As shown, the driver update device also includes a compilation isolation module 1102;

[0137] A compilation isolation module 1102, used to configure compilation isolation in a kernel code compilation file of a second driver;

[0138] The compiling module 1006 is further configured to skip the compilation process of the second driver code file based on the compilation isolation configured in the kernel code compilation file of the second driver during the process of compiling the first driver code file in the first driver directory.

[0139] In one embodiment, the compilation module 1006 is specifically used to create a first kernel compilation rule file corresponding to the first driver code file in the first driver directory; based on the first kernel compilation rule file, create a corresponding first kernel compilation relationship configuration file, the first kernel compilation relationship configuration file is used to describe: the compilation dependency relationship in the first driver; based on the first kernel compilation relationship configuration file and the first kernel compilation rule file, compile the first driver code file.

[0140] In one embodiment, the update operation module 1008 is specifically used to run the first driver in the target kernel based on the first kernel compilation relationship configuration file and the first kernel compilation rule file after completing the compilation of the first driver code file.

[0141] In one embodiment, Fig.12 As shown, the driver update device also includes a kernel compilation rule file determination module 1202;

[0142] The kernel compilation rule file determination module 1202 is used to determine a second kernel compilation rule file corresponding to the second driver code file, where the second kernel compilation rule file at least includes: a first kernel configuration name corresponding to the second driver code file;

[0143] Compilation module 1006 is specifically used to create a first kernel compilation rule file in the first driver directory based on the second kernel compilation rule file, and the created first kernel compilation rule file at least includes: a second kernel configuration name corresponding to the first driver code file, and the second kernel configuration name is different from the first kernel configuration name.

[0144] In one embodiment, the compilation dependency in the first driver is used to describe relevant information for compiling the first driver; the compilation dependency in the first driver includes at least: interface information of the first driver, relevant compilation information of the first driver, and driver description information of the first driver.

[0145] Each module in the above-mentioned driver update device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0146] In one embodiment, a computer device is provided. The computer device may be a terminal or a server. The computer device is a terminal as an example for explanation. The internal structure diagram thereof may be as follows: Fig.13As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for driver update is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.

[0147] Those skilled in the art will understand that Fig.13 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0148] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0149] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0150] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0151] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0152] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0153] The technical feature information of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical feature information in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical feature information, they should be considered to be within the scope of this specification.

[0154] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for driver update, characterized in that: include: Obtaining a first driver code file corresponding to a first driver, where the first driver is a driver for updating a second driver, and the first driver and the second driver have the same driver source but different driver versions; Determine a target kernel driver directory to which a second driver code file corresponding to the second driver belongs, and create a first driver directory in the target kernel driver directory, wherein the first driver directory and the second driver directory both belong to the target kernel driver directory, the second driver directory matches the second driver, and the target kernel driver directory corresponds to a target kernel; Compile the first driver code file in the first driver directory; After the compilation of the first driver code file is completed, the first driver is run in the target kernel.

2. The method according to claim 1, characterized in that The method further comprises: Configuring compilation isolation in the kernel code compilation file of the second driver; During the process of compiling the first driver code file in the first driver directory, the compilation process of the second driver code file is skipped based on the compilation isolation configured in the kernel code compilation file of the second driver.

3. The method according to claim 1, characterized in that The compiling the first driver code file in the first driver directory includes: In the first driver directory, creating a first kernel compilation rule file corresponding to the first driver code file; Based on the first kernel compilation rule file, create a corresponding first kernel compilation relationship configuration file, where the first kernel compilation relationship configuration file is used to describe: a compilation dependency relationship in the first driver; The first driver code file is compiled based on the first kernel compilation relationship configuration file and the first kernel compilation rule file.

4. The method according to claim 3, characterized in that After completing the compilation of the first driver code file, running the first driver in the target kernel includes: After the compilation of the first driver code file is completed, the first driver is run in the target kernel based on the first kernel compilation relationship configuration file and the first kernel compilation rule file.

5. The method according to claim 3, characterized in that: The method further comprises: Determine a second kernel compilation rule file corresponding to the second driver code file, wherein the second kernel compilation rule file at least includes: a first kernel configuration name corresponding to the second driver code file; The step of creating a first kernel compilation rule file corresponding to the first driver code file in the first driver directory includes: Based on the second kernel compilation rule file, the first kernel compilation rule file is created in the first driver directory, and the created first kernel compilation rule file at least includes: a second kernel configuration name corresponding to the first driver code file, and the second kernel configuration name is different from the first kernel configuration name.

6. The method according to claim 3, characterized in that The compilation dependency relationship in the first driver is used to describe relevant information for compiling the first driver; The compilation dependency relationship in the first driver includes at least: interface information of the first driver, relevant compilation information of the first driver, and driver description information of the first driver.

7. A driver update device, characterized in that: The device comprises: A driver code file acquisition module, used to acquire a first driver code file corresponding to a first driver, wherein the first driver is a driver used to update a second driver, and the first driver and the second driver have the same driver source but different driver versions; a driver directory creation module, configured to determine a target kernel driver directory to which the second driver code file corresponding to the second driver belongs, and to create a first driver directory in the target kernel driver directory, wherein the first driver directory and the second driver directory both belong to the target kernel driver directory, the second driver directory matches the second driver, and the target kernel driver directory corresponds to a target kernel; A compiling module, used for compiling the first driver code file in the first driver directory; The update operation module is used to run the first driver in the target kernel after completing the compilation of the first driver code file.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.