CN113703813A - Kernel upgrading method, device, equipment and computer readable storage medium - Google Patents
Kernel upgrading method, device, equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN113703813A CN113703813A CN202111044888.5A CN202111044888A CN113703813A CN 113703813 A CN113703813 A CN 113703813A CN 202111044888 A CN202111044888 A CN 202111044888A CN 113703813 A CN113703813 A CN 113703813A
- Authority
- CN
- China
- Prior art keywords
- upgrade
- information
- target kernel
- installation
- kernel
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 103
- 238000012795 verification Methods 0.000 claims abstract description 95
- 238000009434 installation Methods 0.000 claims abstract description 70
- 238000004590 computer program Methods 0.000 claims description 18
- 230000015654 memory Effects 0.000 claims description 11
- 238000012986 modification Methods 0.000 claims description 4
- 230000004048 modification Effects 0.000 claims description 4
- 230000008569 process Effects 0.000 description 19
- 238000010586 diagram Methods 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 238000005192 partition Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 238000012546 transfer Methods 0.000 description 3
- 238000001514 detection method Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000007689 inspection Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 238000004883 computer application Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The method comprises the steps of acquiring upgrade check information in an upgrade package, checking relevant information of a target kernel according to the upgrade check information, downloading the upgrade package under the condition of successful checking to obtain a target kernel file and an upgrade installation program, and further installing the target kernel file at a preset position in equipment to be upgraded by executing the upgrade installation program. The existing upgrading verification logic and upgrading installation logic are solidified in equipment, and the codes of the upgrading verification logic and the upgrading installation logic are fixed, so that verification and installation can be performed only according to the established upgrading verification logic and upgrading installation logic. The upgrade verification information and the upgrade installation program are stored in the upgrade package and can be downloaded along with the upgrade package, and the upgrade package can realize self-verification and self-installation, so that kernel verification and kernel installation become more flexible, and the flexibility of the kernel upgrade method is improved.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a kernel upgrade method, apparatus, device, and computer-readable storage medium.
Background
With the continuous development of computer technology, embedded devices are widely used. Specifically, the embedded device includes hardware and software. The hardware includes peripheral devices, processors, memories, hard disks, etc. The software may be an operating system, and the core of the operating system is a kernel.
Generally, the upgrading frequency of the kernel in the embedded device is high, the upgrading requirements of different types of embedded devices on the kernel are different, and the upgrading requirements of the kernel of the same type of embedded device may also be different.
However, the existing kernel upgrading method is relatively fixed, so that the kernel upgrading method lacks certain flexibility.
Disclosure of Invention
In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a kernel upgrade method, apparatus, device and computer-readable storage medium, so as to meet different upgrade requirements of different types of devices or devices of the same type, and the kernel upgrade method can be customized according to user requirements, thereby improving flexibility of kernel upgrade.
In a first aspect, an embodiment of the present disclosure provides a kernel upgrade method, including:
acquiring upgrade check information in an upgrade package;
verifying the relevant information of the target kernel according to the upgrading verification information;
under the condition that the relevant information of the target kernel is successfully verified, obtaining the upgrade package, wherein the upgrade package comprises the upgrade verification information, a target kernel file and an upgrade installation program;
and installing the target kernel file at a preset position in the equipment to be upgraded by executing the upgrade installation program.
In a second aspect, an embodiment of the present disclosure provides a kernel upgrade apparatus, including:
the first acquisition module is used for acquiring the upgrade check information in the upgrade package;
the verification module is used for verifying the related information of the target kernel according to the upgrading verification information;
the second obtaining module is used for obtaining the upgrade package under the condition that the relevant information of the target kernel is successfully verified, wherein the upgrade package comprises the upgrade verification information, the target kernel file and the upgrade installation program;
and the installation module is used for installing the target kernel file at a preset position in the equipment to be upgraded by executing the upgrade installation program.
In a third aspect, an embodiment of the present disclosure provides an embedded device, including:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of the first aspect.
In a fourth aspect, the disclosed embodiments provide a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the method according to the first aspect.
In a fifth aspect, the disclosed embodiments also provide a computer program product comprising a computer program or instructions which, when executed by a processor, implement the method according to the first aspect.
According to the kernel upgrading method, the kernel upgrading device, the kernel upgrading equipment and the computer readable storage medium, by obtaining the upgrading verification information in the upgrading package, the relevant information of the target kernel is verified according to the upgrading verification information, and under the condition that verification is successful, the upgrading package is downloaded to obtain the target kernel file and the upgrading installation program, the equipment to be upgraded executes the upgrading installation program, and the target kernel file is installed at the preset position in the equipment to be upgraded. Because the upgrade verification information and the upgrade installation program are stored in the upgrade package, the upgrade package can be downloaded along with the upgrade package, so that the upgrade package can be self-verified and self-installed. Different from the existing upgrading verification logic and upgrading installation logic, the upgrading verification logic and the upgrading installation logic are solidified in equipment, and the codes of the upgrading verification logic and the upgrading installation logic are fixed, so that verification and installation can be performed only according to the established upgrading verification logic and the established upgrading installation logic. Therefore, the upgrade check information and the upgrade installation program are stored in the upgrade package, so that the kernel check and the kernel installation become more flexible, and the flexibility of the kernel upgrade method is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a flowchart of a kernel upgrade method provided in an embodiment of the present disclosure;
fig. 2 is a schematic diagram of an application scenario provided by the embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an upgrade package provided in an embodiment of the present disclosure;
fig. 4 is a flowchart of a kernel upgrade method according to another embodiment of the present disclosure;
fig. 5 is a flowchart of a kernel upgrade method according to another embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a kernel upgrade apparatus according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an embedded device according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
With the continuous development of computer technology, embedded devices are widely used. Specifically, the embedded device includes hardware and software. The hardware includes peripheral devices, processors, memories, hard disks, etc. The software may be an operating system, and the core of the operating system is a kernel. The kernel is the basis of the operation of the operating system, is responsible for managing the processes, the memories, the device drivers, the files and the network system of the system, and determines the performance and the stability of the system.
In the field of computer application technology, devices using embedded systems are increasingly used. Generally, the upgrading frequency of the kernel in the embedded device is high, the upgrading requirements of different types of embedded devices on the kernel are different, and the upgrading requirements of the kernel of the same type of embedded device are also different.
However, the existing kernel upgrading method is relatively fixed, so that the kernel upgrading method lacks certain flexibility. To address this problem, embodiments of the present disclosure provide a kernel upgrade method, which is described below with reference to specific embodiments.
Fig. 1 is a flowchart of a kernel upgrade method provided in an embodiment of the present disclosure. The method can be applied to the application scenario shown in fig. 2, where the application scenario includes a server 21 and a device to be upgraded 22, and the device to be upgraded 22 may specifically be a terminal, for example, a smart phone, a palm computer, a tablet computer, a wearable device with a display screen, a desktop computer, a notebook computer, an all-in-one machine, an intelligent home device, and the like. It can be understood that the kernel upgrade method provided by the embodiment of the present disclosure may also be applied in other scenarios.
The kernel upgrade method shown in fig. 1 is described below with reference to the application scenario shown in fig. 2, and the method includes the following specific steps:
s101, obtaining upgrading verification information in an upgrading packet.
The present disclosure provides a special upgrade package making tool, which may be deployed in the server 21 as shown in fig. 2, and the device 22 to be upgraded performs upgrade detection, and sends a request for downloading the upgrade package to the server 21 when it is detected that the upgrade is needed. After receiving the download request, the server 21 allows the device to be upgraded 22 to download the upgrade check information of the header portion of the package first, so as to obtain the upgrade check information of the upgrade package.
Optionally, the downloading manner includes File Transfer Protocol (ftp), simple File Transfer Protocol (tftp), hypertext Transfer Protocol (http), and the like, and different downloading manners may be selected according to a situation.
And S102, verifying the relevant information of the target kernel according to the upgrading verification information.
The upgrade check information includes related information of the target kernel, which may be version number, architecture, size of required storage space, name, etc. of the target kernel.
Further, according to the relevant information of the target kernel, the relevant information of the local operating system of the equipment to be upgraded is obtained, and the relevant information of the target kernel is compared with the relevant information of the operating system, so that whether the relevant information of the target kernel passes the verification or not is determined.
For example, taking the version number as an example, if the version number of the target kernel is 10.0, the version number of the device to be upgraded, which is obtained from the local operating system of the device to be upgraded, is also 10.0, the two version numbers are compared, and the two version numbers are the same, so that it is concluded that the upgrade is not needed, and the upgrade process is exited. In another case, if the version number of the target kernel is 9.0, the version number of the device to be upgraded, which is obtained from the local operating system of the device to be upgraded, is 10.0, the two version numbers are compared, it is concluded that the version of the kernel of the current device is newer than the version of the target kernel file, and the upgrading process is not required, and the upgrading process is exited.
The verification process in other aspects is similar to that of the version number. It can be understood that after the version number, the architecture, the size of the required storage space, the name, and the like are checked respectively, it can be determined that the relevant information of the target kernel passes the check. If the inspection is passed, the following steps are carried out; if the verification fails, the upgrading process is exited.
S103, under the condition that the relevant information of the target kernel is successfully verified, the upgrade package is obtained, wherein the upgrade package comprises the upgrade verification information, the target kernel file and the upgrade installation program.
The upgrade package is composed of upgrade check information and upgrade content. The upgrading content comprises a target kernel file and an upgrading installation program. Specifically, the upgrade package is downloaded under the condition that the relevant information of the target kernel is successfully verified, so that a target kernel file and an upgrade installation program are obtained.
As shown in fig. 2, in the case that the verification of the relevant information of the target kernel is successful, the device to be upgraded 22 downloads the whole upgrade package, where the whole upgrade package includes the upgrade verification information, the target kernel file, and the upgrade installation program. The upgrade check information in the whole upgrade package is a repeatedly downloaded part, and therefore, the upgrade check information can be deleted or not deleted. But here the target kernel file and the upgrade installer may be retrieved from the entire upgrade package.
And S104, installing the target kernel file at a preset position in the equipment to be upgraded by executing the upgrade installation program.
Specifically, the device 22 to be upgraded executes the upgrade installation program, the upgrade installation program reserves some interfaces, the upgrade installation program calls the interfaces in sequence when installing the kernel file, and after the interfaces are called in sequence, the target kernel file is installed at a preset position in the device 22 to be upgraded.
The method and the device for updating the target kernel file have the advantages that the updating verification information in the updating package is obtained, the relevant information of the target kernel is verified according to the updating verification information, the updating package is downloaded under the condition that the verification is successful, the target kernel file and the updating installation program are obtained, and the target kernel file is installed at the preset position in the device to be updated through the execution of the updating installation program. Because the upgrade verification information and the upgrade installation program are stored in the upgrade package, the upgrade package can be downloaded along with the upgrade package, so that the upgrade package can be self-verified and self-installed. Different from the existing upgrading verification logic and upgrading installation logic, the upgrading verification logic and the upgrading installation logic are solidified in equipment, and the codes of the upgrading verification logic and the upgrading installation logic are fixed, so that verification and installation can be performed only according to the established upgrading verification logic and the established upgrading installation logic. Therefore, the upgrade check information and the upgrade installation program are stored in the upgrade package, so that the kernel check and the kernel installation become more flexible, and the flexibility of the kernel upgrade method is improved.
In addition, because the embodiment of the disclosure downloads only the header part of the upgrade package when downloading for the first time, and does not download all the upgrade packages, the complete upgrade package is downloaded after the verification passes. The prior art directly downloads the whole upgrading package, and if the downloaded upgrading package is not matched, the upgrading package cannot be installed, the upgrading package needs to be downloaded again, and the time consumed by downloading is increased. Therefore, compared with the method for downloading the whole upgrade package for the first time in the prior art, the embodiment of the disclosure can reduce the downloading time and improve the downloading efficiency.
On the basis of the above embodiment, the upgrade check information includes an upgrade check program and related information of the target kernel; verifying the relevant information of the target kernel according to the upgrade verification information, comprising: and verifying the relevant information of the target kernel by executing the upgrading verification program.
As shown in fig. 3, the upgrade check information includes information about an upgrade check program and the target kernel. In this case, after the device to be upgraded 22 acquires the upgrade check information, the upgrade check program in the upgrade check information and the related information of the target kernel file may be obtained. The device to be upgraded 22 verifies the relevant information of the target kernel by executing the upgrade verification program, and the specific verification method may be to acquire the relevant information of the local operating system of the device to be upgraded according to the relevant information of the target kernel, and compare the relevant information of the target kernel with the relevant information of the operating system, thereby determining whether the relevant information of the target kernel passes the verification. If the two are the same, the verification is passed; if the two are different, the verification fails.
Optionally, the relevant information of the target kernel includes at least one of the following: the version information of the target kernel, the architecture information of the target kernel and the size of the storage space required to be occupied by the target kernel.
As shown in fig. 3, the upgrade check information includes information about an upgrade check program and the target kernel. Specifically, checking version information of the target kernel: the version information of the target kernel can be obtained from the related information of the target kernel, the version information of the old kernel is obtained from a local operating system of the equipment to be upgraded, the two version information are compared, if the version information of the two version information is the same, the conclusion is reached that the upgrading is not needed, and the upgrading process is quitted; and if the version of the kernel of the current equipment is newer than that of the target kernel file and does not need to be upgraded, exiting the upgrading process.
Checking the architecture information of the target kernel: obtaining the architecture information of an old kernel from a local operating system of equipment to be upgraded, obtaining the architecture information of a target kernel from the related information of the target kernel, then comparing the architecture information of the old kernel and the target kernel, and if the architecture information is the same, passing the verification; if the two pieces of architecture information are different, the verification fails.
Checking the size of the storage space occupied by the target kernel: the size of the storage space required to be occupied by the target kernel can be obtained from the related information of the target kernel, then the size of the storage space left in the local operating system of the equipment to be upgraded is detected, the size of the storage space left in the local operating system of the equipment to be upgraded is compared, and if the size of the storage space left in the equipment is larger than the storage space occupied by the target kernel file, the verification is passed; otherwise, the verification fails.
It can be understood that after the version information of the target kernel, the architecture information of the target kernel, the size of the storage space required to be occupied by the target kernel, and the like are checked, it can be determined that the relevant information of the target kernel passes the check. If the inspection is passed, the following steps are carried out; if the verification fails, the upgrading process is exited.
According to the method and the device for verifying the target kernel, the upgrading verification information in the upgrading packet is obtained, and the relevant information of the target kernel is verified according to the upgrading verification information. Wherein the relevant information of the target kernel comprises at least one of the following information: the version information of the target kernel, the architecture information of the target kernel and the size of the storage space required to be occupied by the target kernel. And under the condition of successful verification, downloading the upgrade package to obtain a target kernel file and an upgrade installation program, and further installing the target kernel file at a preset position in the equipment to be upgraded by executing the upgrade installation program. The related information of the target kernel comprises at least one of the following: the version information of the target kernel, the architecture information of the target kernel and the size of the storage space required to be occupied by the target kernel can be checked, so that the checking content is more flexible, and the flexibility of the kernel upgrading method is further improved.
On the basis of the above embodiment, by executing the upgrade installation program, before installing the target kernel file at the preset location of the device to be upgraded, the method further includes at least one of the following steps: modifying the name of the target kernel file into a preset name; setting the installation method of the target kernel file as a preset installation method; and setting the installation position of the target kernel file as the preset position.
For example, after the upgrade verification of the device to be upgraded 22 passes, before the upgrade installer is executed to install the target kernel file, an interface may appear on the device to be upgraded 22, and at least one command line may appear on the interface as follows:
please choose whether to modify the name of the target kernel file. If so, inputting a new name as a preset name, if not, keeping the default name as a kernel (kernel), and defaulting the target kernel file name as the kernel;
please select the installation method of the target kernel file. Options available for the installation method include at least the following: direct copy installation, a bare writing mode on a disk by using a device driver (dd) command, and a custom installation method. The device 22 to be upgraded may be installed by selecting some of the above methods, and it should be noted that when the user selects the custom installation method, the user is required to add the installation method to the corresponding command line. The installation method selected or customized by the user is called a preset installation method;
please select the installation location of the target kernel file. The options available for the mounting location include at least the following: hard disk, standard Flash (CF) card, mechanical disk, solid state disk, custom mounting location. The device 22 to be upgraded may be installed at any position, and after the installation position is determined, a partition needs to be selected, and a specific partition may appear after the user determines the installation position, and a corresponding partition may exist at the corresponding installation position. It should be noted that when the user selects a custom installation location, a reasonable location and partition need to be added to the corresponding command line. The installation position selected or customized by the user is called a preset installation position. Correspondingly, the step of installing the target kernel file at a preset position in the device to be upgraded by executing the upgrade installation program comprises the following steps: and installing the target kernel file with the preset name at the preset position in the equipment to be upgraded according to the preset installation method by executing the upgrade installation program.
Further, by executing the upgrade installation program, the installation program may call the content in the interface, an interface may appear on the device 22 to be upgraded, some command lines may appear on the interface, the upgrade installation program may call the command lines, change the name of the target kernel file to a preset name, and then install the target file to a preset installation position by using a preset installation method.
According to the method and the device for upgrading the kernel file, the upgrading installation program is executed by the device to be upgraded, the target kernel file is installed at the preset position in the device to be upgraded, and the user can select or customize the installation method and the installation position of the target kernel file, so that the target kernel file can be installed in a writing mode of the user and can also be installed at a position which the user wants, the user is provided with a choice, the kernel installation becomes flexible, the flexibility of the kernel upgrading method is improved, and the user experience is also improved.
Fig. 4 is a flowchart of a kernel upgrade method according to another embodiment of the present disclosure, and as shown in fig. 4, the method includes the following steps:
s401, downloading first encryption information corresponding to the upgrade check information in the upgrade package.
The present disclosure provides a special upgrade package making tool, which may be deployed in the server 21 as shown in fig. 2, and the device 22 to be upgraded performs upgrade detection, and sends a request for downloading the upgrade package to the server 21 when it is detected that the upgrade is needed. After receiving the download request, the server 21 allows the device to be upgraded 22 to download the upgrade check information of the header portion of the package first, so as to obtain the upgrade check information of the upgrade package. As shown in fig. 3, the upgrade package is composed of upgrade check information and upgrade content. The upgrade verification information is encrypted to form first encrypted information, and the upgrade content is encrypted to form second encrypted information. During upgrading, the device 22 to be upgraded downloads the first encryption information of the header part.
Optionally, the encryption Algorithm is asymmetric encryption, the encryption Algorithm includes but is not limited to RSA Public Key cryptosystem (RSA Algorithm), Digital Signature Algorithm (Digital Signature Algorithm, DSA Algorithm), and may also be other asymmetric encryption algorithms, the user may use its own private Key for encryption, the encryption private Key is not provided to the outside, others cannot make or modify the kernel upgrade package, and the security and integrity of the upgrade content are ensured.
S402, decrypting the first encrypted information to obtain the upgrade check information in the upgrade package.
In some embodiments, the device to be upgraded 22 decrypts the first encrypted information using a special decryption tool, and obtains the upgrade verification information after decryption.
And S403, verifying the relevant information of the target kernel according to the upgrading verification information.
Specifically, the implementation process and principle of S403 and S102 are consistent, and are not described herein again.
S404, downloading first encryption information corresponding to the upgrade verification information in the upgrade package and second encryption information of the target kernel file and the upgrade installation program under the condition that the related information of the target kernel is verified successfully.
As shown in fig. 3, the upgrade package is composed of upgrade check information and upgrade content. The upgrade verification information is first encrypted information after being encrypted, the upgrade content is second encrypted information after being encrypted, and the upgrade package is obtained by compressing the first encrypted information and the second encrypted information. Specifically, under the condition that the relevant information of the target kernel is successfully verified, first encryption information corresponding to the upgrade verification information in the upgrade package, and second encryption information of the target kernel file and the upgrade installation program are downloaded.
S405, the first encrypted information and the second encrypted information are respectively decrypted to obtain the upgrade package, and the upgrade package comprises the upgrade verification information, the target kernel file and the upgrade installation program.
In other embodiments, the device to be upgraded 22 decrypts the kernel upgrade package using a special decryption tool, where the decryption tool may decrypt the upgrade verification portion and the upgrade content portion of the kernel upgrade package separately, or may decrypt the kernel upgrade package integrally at a time, and obtain the entire upgrade package after decryption. The upgrade check information in the whole upgrade package is a repeatedly downloaded part, and therefore, the upgrade check information can be deleted or not deleted. But here the target kernel file and the upgrade installer may be retrieved from the entire upgrade package.
S406, the target kernel file is installed at a preset position in the equipment to be upgraded by executing the upgrade installation program.
Specifically, the implementation process and principle of S406 and S104 are consistent, and are not described herein again.
The upgrading verification information and the upgrading content in the upgrading packet are respectively encrypted to obtain corresponding first encryption information and second encryption information. And the equipment to be upgraded decrypts the first encrypted information by using a special decryption tool to obtain the upgrade verification information in the upgrade package. And verifying the relevant information of the target kernel according to the upgrade verification information, downloading first encryption information corresponding to the upgrade verification information in the upgrade package and second encryption information of the target kernel file and the upgrade installation program under the condition that the relevant information of the target kernel is successfully verified, and respectively decrypting the first encryption information and the second encryption information to obtain the upgrade package, wherein the upgrade package comprises the upgrade verification information, the target kernel file and the upgrade installation program. And then the equipment to be upgraded executes the upgrade installation program, and the target kernel file is installed at a preset position in the equipment to be upgraded. Because the upgrade package is encrypted, the security is increased. In the prior art, the plaintext transmission of the target kernel file has the risk of being intercepted and cracked, or being implanted after being tampered to damage a system or steal new logic of the system. Therefore, compared with the prior art, the upgrade package is encrypted, so that the upgrade package is not easy to crack and tamper, and the security of the upgrade package in transmission is guaranteed.
Fig. 5 is a flowchart of a kernel upgrade method according to another embodiment of the present disclosure, and as shown in fig. 5, the method includes the following steps:
s501, downloading the upgrade verification information of the upgrade package.
Specifically, the implementation process and principle of S501 and S401 are consistent, and are not described herein again.
S502, decrypting the upgrade verification information of the upgrade package.
In some embodiments, the device to be upgraded 22 decrypts the encrypted upgrade check information using a special decryption tool, and obtains the upgrade check information after decryption.
S503, executing the decrypted upgrade checking program, and determining whether checking of the relevant information of the target kernel is successful, if so, executing S504, otherwise, executing S508.
And executing the decrypted upgrade check program, wherein the specific operation is to check the related information of the target kernel according to the upgrade check information. The checking process and principle are consistent with the implementation process and principle of S102, and are not described herein again. If the check is passed, executing the following steps S504 and the steps after S504; if the verification fails, step S508 is performed.
S504, downloading the whole upgrade package.
As shown in fig. 3, the upgrade package is composed of upgrade check information and upgrade content. The upgrade verification information is first encrypted information after being encrypted, the upgrade content is second encrypted information after being encrypted, and the upgrade package is obtained by compressing the first encrypted information and the second encrypted information. Specifically, under the condition that the relevant information of the target kernel is successfully verified, first encryption information corresponding to the upgrade verification information in the upgrade package, and second encryption information of the target kernel file and the upgrade installation program are downloaded.
And S505, calling an unpacking tool to decrypt the upgrade package.
As shown in fig. 2, the device to be upgraded 22 decrypts the kernel upgrade package by using a special decryption tool, where the decryption tool may decrypt the upgrade verification portion and the upgrade content portion of the kernel upgrade package separately, or may decrypt the kernel upgrade package integrally at a time, and obtain the entire upgrade package after decryption, so as to obtain the target kernel file and the installation program.
And S506, executing the decrypted kernel installation program.
Specifically, the implementation process and principle of S506 and S104 are consistent, and are not described herein again.
And S507, restarting the system after the installation is finished.
After the upgrade is completed, an interface is popped up on the equipment. A prompt appears on its interface: the upgrade is complete and the option is to restart immediately or later. When the equipment is selected to be restarted immediately, the equipment can be restarted immediately; when selected for later reboot, the device will automatically reboot on idle.
And S508, finishing upgrading.
And after the system is restarted, ending the kernel upgrading process.
The method and the device for updating the target kernel file have the advantages that the updating verification information in the updating package is obtained, the relevant information of the target kernel is verified according to the updating verification information, the updating package is downloaded under the condition that the verification is successful, the target kernel file and the updating installation program are obtained, and the target kernel file is installed at the preset position in the device to be updated through the execution of the updating installation program. Because the upgrade verification information and the upgrade installation program are stored in the upgrade package, the upgrade package can be downloaded along with the upgrade package, so that the upgrade package can be self-verified and self-installed. Different from the existing upgrading verification logic and upgrading installation logic, the upgrading verification logic and the upgrading installation logic are solidified in equipment, and the codes of the upgrading verification logic and the upgrading installation logic are fixed, so that verification and installation can be performed only according to the established upgrading verification logic and the established upgrading installation logic. Therefore, the upgrade check information and the upgrade installation program are stored in the upgrade package, so that the kernel check and the kernel installation become more flexible, and the flexibility of the kernel upgrade method is improved.
In addition, because the embodiment of the disclosure downloads only the header part of the upgrade package when downloading for the first time, and does not download all the upgrade packages, the complete upgrade package is downloaded after the verification passes. The prior art directly downloads the whole upgrading package, and if the downloaded upgrading package is not matched, the upgrading package cannot be installed, the upgrading package needs to be downloaded again, and the time consumed by downloading is increased. Therefore, compared with the method for downloading the whole upgrade package for the first time in the prior art, the embodiment of the disclosure can reduce the downloading time and improve the downloading efficiency. In addition, the upgrade package is encrypted, so that the upgrade package is not easy to crack and tamper, and the safety of the upgrade package in transmission is guaranteed.
In addition, the upgrade package is encrypted, so that the upgrade package is not easy to crack and tamper, and the safety of the upgrade package in transmission is guaranteed.
Fig. 6 is a schematic structural diagram of a kernel upgrade apparatus according to an embodiment of the present disclosure. The kernel upgrading apparatus may be the device to be upgraded as described in the above embodiments, or the kernel upgrading apparatus may be a component or assembly in the device to be upgraded. The kernel upgrading apparatus provided in the embodiment of the present disclosure may execute the processing procedure provided in the embodiment of the kernel upgrading method, as shown in fig. 6, the kernel upgrading apparatus 60 includes: a first acquisition module 61, a verification module 62, a second acquisition module 63, and an installation module 64; the first obtaining module 61 is configured to obtain upgrade check information in the upgrade package; the checking module 62 is configured to check the relevant information of the target kernel according to the upgrade checking information; the second obtaining module 63 is configured to obtain the upgrade package under the condition that the relevant information of the target kernel is successfully verified, where the upgrade package includes the upgrade verification information, the target kernel file, and the upgrade installation program; the installation module 64 is configured to install the target kernel file at a preset position in the device to be upgraded by executing the upgrade installation program.
Optionally, the upgrade check information includes an upgrade check program and related information of the target kernel;
the checking module 62 is specifically configured to check the relevant information of the target kernel by executing the upgrade checking program.
Optionally, the relevant information of the target kernel includes at least one of the following: the version information of the target kernel, the architecture information of the target kernel and the size of the storage space required to be occupied by the target kernel.
Optionally, the kernel upgrading apparatus further includes: a modification module 65 and/or a setup module 66; the modifying module 65 is configured to modify the name of the target kernel file into a preset name before the installing module installs the target kernel file at a preset position in the device to be upgraded; the setting module 66 is configured to set the installation method of the target kernel file to a preset installation method and/or set the installation position of the target kernel file to a preset position before the installation module installs the target kernel file at the preset position in the device to be upgraded;
correspondingly, the installation module 64 is specifically configured to: and installing the target kernel file with the preset name at the preset position in the equipment to be upgraded according to the preset installation method by executing the upgrade installation program.
Optionally, the first obtaining module 61 includes: a first downloading unit 6101 and a first decrypting unit 6102. The first downloading unit 6101 is configured to download first encrypted information corresponding to the upgrade check information in the upgrade package; the first decryption unit 6102 is configured to decrypt the first encrypted information, so as to obtain the upgrade check information in the upgrade package.
Optionally, the second obtaining module 63 includes: a second download unit 6301, and a second decryption unit 6302. The second downloading unit 6301 is configured to download first encryption information corresponding to upgrade check information in the upgrade package, and second encryption information of the target kernel file and the upgrade installation program; the second decryption unit 6302 is configured to decrypt the first encrypted information and the second encrypted information respectively to obtain the upgrade package.
The kernel upgrading apparatus in the embodiment shown in fig. 6 may be used to execute the technical solutions in the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 7 is a schematic structural diagram of an embedded device according to an embodiment of the present disclosure. The embedded device may be a device to be upgraded as described in the above embodiments. The embedded device provided in the embodiment of the present disclosure may execute the processing flow provided in the embodiment of the kernel upgrade method, as shown in fig. 7, the embedded device 70 includes: memory 71, processor 72, computer programs and communication interface 73; wherein, the processor 72, the memory 71 and the communication interface 73 are connected by a communication bus; processor 72 is operative to execute one or more computer programs stored in memory 71; a computer program is stored in the memory 71 and is configured to be executed by the processor 72 for the kernel upgrade method as described above.
In addition, the embodiment of the present disclosure also provides a computer readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the kernel upgrade method described in the above embodiment.
Furthermore, the embodiments of the present disclosure also provide a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the computer program or instructions implement the kernel upgrade method as described above.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (14)
1. A method for kernel upgrade, the method comprising:
acquiring upgrade check information in an upgrade package;
verifying the relevant information of the target kernel according to the upgrading verification information;
under the condition that the relevant information of the target kernel is successfully verified, obtaining the upgrade package, wherein the upgrade package comprises the upgrade verification information, a target kernel file and an upgrade installation program;
and installing the target kernel file at a preset position in the equipment to be upgraded by executing the upgrade installation program.
2. The method of claim 1, wherein the upgrade check information includes information about an upgrade check program and the target kernel;
verifying the relevant information of the target kernel according to the upgrade verification information, comprising:
and verifying the relevant information of the target kernel by executing the upgrading verification program.
3. The method of claim 1 or 2, wherein the information related to the target kernel comprises at least one of:
the version information of the target kernel, the architecture information of the target kernel and the size of the storage space required to be occupied by the target kernel.
4. The method according to claim 1, wherein the target kernel file is installed in front of a preset location of a device to be upgraded by executing the upgrade installer, and the method further comprises at least one of the following steps:
modifying the name of the target kernel file into a preset name;
setting the installation method of the target kernel file as a preset installation method;
setting the installation position of the target kernel file as the preset position;
correspondingly, the step of installing the target kernel file at a preset position in the device to be upgraded by executing the upgrade installation program comprises the following steps:
and installing the target kernel file with the preset name at the preset position in the equipment to be upgraded according to the preset installation method by executing the upgrade installation program.
5. The method of claim 1, wherein obtaining upgrade check information in an upgrade package comprises:
downloading first encryption information corresponding to the upgrade verification information in the upgrade package;
and decrypting the first encrypted information to obtain the upgrade verification information in the upgrade package.
6. The method of claim 1, wherein obtaining the upgrade package comprises:
downloading first encryption information corresponding to upgrade check information in the upgrade package, and second encryption information of the target kernel file and the upgrade installation program;
and respectively decrypting the first encrypted information and the second encrypted information to obtain the upgrade package.
7. A kernel upgrade apparatus, comprising:
the first acquisition module is used for acquiring the upgrade check information in the upgrade package;
the verification module is used for verifying the related information of the target kernel according to the upgrading verification information;
the second obtaining module is used for obtaining the upgrade package under the condition that the relevant information of the target kernel is successfully verified, wherein the upgrade package comprises the upgrade verification information, the target kernel file and the upgrade installation program;
and the installation module is used for installing the target kernel file at a preset position in the equipment to be upgraded by executing the upgrade installation program.
8. The apparatus of claim 7, wherein the upgrade check information comprises information about an upgrade check program and the target kernel;
the verification module is specifically configured to:
and verifying the relevant information of the target kernel by executing the upgrading verification program.
9. The apparatus according to claim 7 or 8, wherein the information related to the target kernel comprises at least one of:
the version information of the target kernel, the architecture information of the target kernel and the size of the storage space required to be occupied by the target kernel.
10. The apparatus of claim 7, further comprising: a modification module and/or a setting module;
the modification module is used for modifying the name of the target kernel file into a preset name before the installation module installs the target kernel file at a preset position in the equipment to be upgraded;
the setting module is used for setting the installation method of the target kernel file as a preset installation method and/or setting the installation position of the target kernel file as the preset position before the installation module installs the target kernel file at the preset position in the equipment to be upgraded;
correspondingly, the installation module is specifically configured to:
and installing the target kernel file with the preset name at the preset position in the equipment to be upgraded according to the preset installation method by executing the upgrade installation program.
11. The apparatus of claim 7, wherein the first obtaining module comprises: a first downloading unit and a first decrypting unit;
the first downloading unit is used for downloading first encryption information corresponding to the upgrade check information in the upgrade package;
the first decryption unit is used for decrypting the first encrypted information to obtain the upgrade verification information in the upgrade package.
12. The apparatus of claim 7, wherein the second obtaining module comprises: a second download unit and a second decryption unit;
the second downloading unit is used for downloading first encryption information corresponding to the upgrade verification information in the upgrade package, and second encryption information of the target kernel file and the upgrade installation program;
the second decryption unit is configured to decrypt the first encrypted information and the second encrypted information respectively to obtain the upgrade package.
13. An embedded device, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-6.
14. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111044888.5A CN113703813A (en) | 2021-09-07 | 2021-09-07 | Kernel upgrading method, device, equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111044888.5A CN113703813A (en) | 2021-09-07 | 2021-09-07 | Kernel upgrading method, device, equipment and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113703813A true CN113703813A (en) | 2021-11-26 |
Family
ID=78660799
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111044888.5A Pending CN113703813A (en) | 2021-09-07 | 2021-09-07 | Kernel upgrading method, device, equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113703813A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114296740A (en) * | 2021-12-29 | 2022-04-08 | 奇安信科技集团股份有限公司 | Compiling method and device for product kernel file |
CN114915554A (en) * | 2022-04-08 | 2022-08-16 | 一汽解放汽车有限公司 | Remote upgrading method and device, computer equipment and storage medium |
CN115002186A (en) * | 2022-05-17 | 2022-09-02 | 深信服科技股份有限公司 | Network information acquisition method and device, electronic equipment and readable storage medium |
CN115098196A (en) * | 2022-05-30 | 2022-09-23 | 北京丁牛科技有限公司 | Verification method and device, electronic equipment and storage medium |
CN116243939A (en) * | 2023-05-11 | 2023-06-09 | 深圳市驰普科达科技有限公司 | Method and device for installing software, electronic equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104750527A (en) * | 2015-03-27 | 2015-07-01 | 广州快飞计算机科技有限公司 | Embedded system upgrading method and system |
CN106815031A (en) * | 2017-02-22 | 2017-06-09 | 百度在线网络技术(北京)有限公司 | Kernel module loading method and device |
WO2017190547A1 (en) * | 2016-05-06 | 2017-11-09 | 中兴通讯股份有限公司 | Method for upgrading apparatus, device, and configuration point |
CN108459866A (en) * | 2018-02-11 | 2018-08-28 | 广东美的厨房电器制造有限公司 | Upgrade method, device, computer equipment, program product and storage medium |
CN112379905A (en) * | 2020-11-20 | 2021-02-19 | 惠州Tcl移动通信有限公司 | Kernel upgrading method and device, terminal and storage medium |
CN112631632A (en) * | 2020-12-30 | 2021-04-09 | 北京天融信网络安全技术有限公司 | System upgrading method, framework, electronic equipment and readable storage medium |
-
2021
- 2021-09-07 CN CN202111044888.5A patent/CN113703813A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104750527A (en) * | 2015-03-27 | 2015-07-01 | 广州快飞计算机科技有限公司 | Embedded system upgrading method and system |
WO2017190547A1 (en) * | 2016-05-06 | 2017-11-09 | 中兴通讯股份有限公司 | Method for upgrading apparatus, device, and configuration point |
CN106815031A (en) * | 2017-02-22 | 2017-06-09 | 百度在线网络技术(北京)有限公司 | Kernel module loading method and device |
CN108459866A (en) * | 2018-02-11 | 2018-08-28 | 广东美的厨房电器制造有限公司 | Upgrade method, device, computer equipment, program product and storage medium |
CN112379905A (en) * | 2020-11-20 | 2021-02-19 | 惠州Tcl移动通信有限公司 | Kernel upgrading method and device, terminal and storage medium |
CN112631632A (en) * | 2020-12-30 | 2021-04-09 | 北京天融信网络安全技术有限公司 | System upgrading method, framework, electronic equipment and readable storage medium |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114296740A (en) * | 2021-12-29 | 2022-04-08 | 奇安信科技集团股份有限公司 | Compiling method and device for product kernel file |
CN114915554A (en) * | 2022-04-08 | 2022-08-16 | 一汽解放汽车有限公司 | Remote upgrading method and device, computer equipment and storage medium |
CN114915554B (en) * | 2022-04-08 | 2024-03-19 | 一汽解放汽车有限公司 | Remote upgrading method, device, computer equipment and storage medium |
CN115002186A (en) * | 2022-05-17 | 2022-09-02 | 深信服科技股份有限公司 | Network information acquisition method and device, electronic equipment and readable storage medium |
CN115098196A (en) * | 2022-05-30 | 2022-09-23 | 北京丁牛科技有限公司 | Verification method and device, electronic equipment and storage medium |
CN116243939A (en) * | 2023-05-11 | 2023-06-09 | 深圳市驰普科达科技有限公司 | Method and device for installing software, electronic equipment and storage medium |
CN116243939B (en) * | 2023-05-11 | 2023-07-21 | 深圳市驰普科达科技有限公司 | Method and device for installing software, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113703813A (en) | Kernel upgrading method, device, equipment and computer readable storage medium | |
US8874892B1 (en) | Assessing BIOS information prior to reversion | |
CN109214168B (en) | Firmware upgrading method and device | |
US9110679B1 (en) | Pre-boot management of drivers and programs | |
CN108845812B (en) | Plug-in updating method, device, computer equipment and storage medium | |
CN109828772B (en) | Thermal update method, operating system, terminal device, and storage medium | |
EP3125110A1 (en) | Software upgrade method and terminal | |
EP3399408B1 (en) | Information processing apparatus and computer readable storage medium | |
US20110258426A1 (en) | Booting and configuring a subsystem securely from non-local storage | |
WO2017071207A1 (en) | Application installation method, corresponding apparatus, and application installation system | |
CN107844306B (en) | Application program repairing method and device, storage medium and terminal | |
CN113541966A (en) | Authority management method, device, electronic equipment and storage medium | |
US20080222043A1 (en) | System and method for trans-vendor license registration and recovery | |
US10262309B1 (en) | Augmenting a BIOS with new programs | |
CN106569851B (en) | Application program processing method and device | |
CN114237722A (en) | System starting method, device, equipment and engineering vehicle | |
CN113094064A (en) | Gateway software module upgrading method, device, equipment and storage medium | |
CN107479923A (en) | Application program updating method, apparatus and display terminal | |
CN109428936B (en) | APP upgrading method, device, system, electronic equipment and storage medium | |
CN114143197A (en) | OTA (over the air) upgrading method, device and equipment of Internet of things equipment and readable storage medium | |
CN114253590A (en) | Encryption type differential upgrading method, device, equipment and medium for embedded software | |
CN112711430A (en) | ADB-based non-network equipment upgrading method and system and readable storage medium | |
KR100685314B1 (en) | The System for Auto-Upgrade of Mobile Terminal's software And Method thereof | |
CN111897562A (en) | Program upgrading method and device | |
KR100545095B1 (en) | Method of upgrading software in wireless communication terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20211126 |