Upgrading file generation method, upgrading method, equipment and readable storage medium

By obtaining and verifying the image files and client information in the system management mode during the SRU upgrade process, and generating encrypted signature upgrade files, the system downtime caused by using different versions of files is solved, and the security and reliability of SRU upgrades are improved. sex.

CN119248317APending Publication Date: 2025-01-03INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411382042.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

During the SRU upgrade process, using Capsule files of different versions or projects on the same platform causes the system to crash and the upgrade is unsafe, which makes it difficult for the existing technology to effectively solve this problem.

Method used

By obtaining the image files in the system management mode, firmware version information supported by the client and upgrade project information, generating an upgrade file containing verification information, and performing encryption signature verification, ensuring the security and effectiveness of the upgrade file on the platform.

Benefits of technology

It effectively avoids system downtime caused by using upgrade files of different versions of the same platform, improves the security of SRU upgrades, and ensures the reliability and accuracy of the upgrade process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248317A_ABST
    Figure CN119248317A_ABST
Patent Text Reader

Abstract

The invention discloses an upgrade file generation method, an upgrade method, equipment and a readable storage medium, which are applied to the technical field of computers, and the upgrade file generation method comprises the following steps: acquiring a mirror image file in a system management mode; the mirror image file is a mirror image file of a driving program or a mirror image file of a system management mode function; obtaining firmware version information and upgrade item information supported by the client; obtaining an upgrading file according to the mirror image file, the firmware version information and the upgrading item information; and sending the upgrading file to the client to enable the client to upgrade the drive program or the system management mode function based on the upgrading file. According to the method and the device, the problem of system crash caused by SRU upgrading errors is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an upgrade file generation method and an upgrade method, device and a readable storage medium. Background Art

[0002] SRU upgrade refers to entering SMM (System Management Mode) by triggering SMI (System Management Interrupt), calling the BIOS (Basic Input Output System) resident program to load the Capsule file and perform the update after parsing.

[0003] Generally, different versions or projects on the same platform will use the same key to create a Capsule (encapsulation format for firmware updates) file. At this time, the BIOS will consider the Capsule file to be legal when performing signature verification, and then perform the upgrade. Due to the differences in SMM (System Management Mode) memory allocation and driver implementation in different versions, as well as the differences in program implementation in the project, if Capsule files of different versions / projects on the same platform are used for SRU upgrades, it will cause system downtime and serious accidents.

[0004] Therefore, how to ensure the safe upgrade of SRU is a technical problem that needs to be solved urgently. Summary of the invention

[0005] In view of this, the object of the present invention is to provide an upgrade file generation method and an upgrade method, device and readable storage medium, which solve the problem of unsafe SRU upgrade in the prior art.

[0006] In order to solve the above technical problems, the present invention provides a method for generating an upgrade file, comprising:

[0007] Obtaining an image file in a system management mode; the image file is an image file of a driver or an image file of a system management mode function;

[0008] Get the firmware version information and upgrade project information supported by the client;

[0009] Obtaining an upgrade file according to the image file, the firmware version information and the upgrade project information;

[0010] The upgrade file is sent to the client, so that the client upgrades the driver or the system management mode function based on the upgrade file.

[0011] On the one hand, obtaining an upgrade file according to the image file, the firmware version information and the upgrade project information includes:

[0012] Execute the packaging script to package the image file to generate an initial upgrade file;

[0013] Reserving a portion of the area in the initial upgrade file as a verification information area;

[0014] The firmware version information and the upgrade project information are added to the verification information area to obtain the upgrade file.

[0015] On the one hand, it also includes:

[0016] When the firmware version information and / or upgrade item information supported by the client changes, the upgrade file is updated based on the changed firmware version information and / or upgrade item information.

[0017] On the one hand, before obtaining the upgrade file according to the image file, the firmware version information and the upgrade project information, it also includes:

[0018] Performing an integrity check on the image file to obtain an integrity check code for the image file;

[0019] Encrypt the image file using a symmetric encryption key to obtain a first upgrade file;

[0020] Generate a digital signature according to the first upgrade file and the symmetric encryption key;

[0021] Encrypting the digital signature according to the asymmetric encryption key to obtain an encrypted digital signature;

[0022] Correspondingly, obtaining the upgrade file according to the image file, the firmware version information and the upgrade project information includes:

[0023] The upgrade file is generated according to the integrity check code, the encrypted digital signature, the firmware version information and the upgrade project information.

[0024] The present invention also provides an upgrading method, comprising:

[0025] Obtain the upgrade file including the image file, firmware version information and upgrade project information;

[0026] Verifying the upgrade project information and the firmware version information of the upgrade file according to the current upgrade project information and the currently supported firmware version information;

[0027] If the verification passes, the driver program or the system management mode function is upgraded according to the image file.

[0028] On the one hand, the upgrade file also includes file structure information, valid identification information, identity information, key and signature information;

[0029] Accordingly, before verifying the upgrade project information and the firmware version information of the upgrade file according to the current upgrade project information and the currently supported firmware version information, the method further includes:

[0030] Determine whether the upgrade file is an upgrade file in the system management mode according to the file structure information;

[0031] If yes, then verify the validity of the upgrade file according to the valid identification information;

[0032] If the validity check passes, the upgrade file is subjected to identity verification according to the identity information;

[0033] If the identity verification is passed, the legitimacy of the upgrade file is verified based on the key and signature information;

[0034] If the legality check passes, the step of verifying the upgrade project information and the firmware version information of the upgrade file according to the current upgrade project information and the currently supported firmware version information is executed.

[0035] On the one hand, the upgrade project information and the firmware version information of the upgrade file are verified according to the current upgrade project information and the currently supported firmware version information, including:

[0036] Formulate a version information range according to the currently supported version information;

[0037] If the firmware version information of the upgrade file is within the version information range, the firmware version information verification passes;

[0038] If the firmware version information of the upgrade file is not within the version information range, the firmware version information verification fails;

[0039] If the current project information is consistent with the project information of the upgrade file, the project information verification passes.

[0040] On the one hand, after the driver or the system management mode function is upgraded according to the image file, it also includes:

[0041] Restart the server and check whether the system starts normally;

[0042] If it starts normally, check whether there are any error prompts or abnormal information, and whether the hardware can work normally;

[0043] If there is no error message or abnormal information, and the hardware can work normally, check the system information or related log files to determine whether the upgrade is successful;

[0044] If it fails, restore based on the backup data.

[0045] The present invention also provides an upgrade file generation device, comprising:

[0046] An image file acquisition module, used to acquire an image file in a system management mode; the image file is an image file of a driver or an image file of a system management mode function;

[0047] An information acquisition module is used to obtain the firmware version information and upgrade project information supported by the client;

[0048] An upgrade file determination module, used to obtain an upgrade file according to the image file, the firmware version information and the upgrade project information;

[0049] The sending module is used to send the upgrade file to the client, so that the client upgrades the driver or the system management mode function based on the upgrade file.

[0050] The present invention also provides an upgrading device, comprising:

[0051] An upgrade file acquisition module is used to acquire upgrade files including image files, firmware version information and upgrade project information;

[0052] A verification module, used to verify the upgrade project information and the firmware version information of the upgrade file according to the current upgrade project information and the currently supported firmware version information;

[0053] The upgrade module is used to upgrade the driver program or the system management mode function according to the image file if the verification is passed.

[0054] The present invention also provides an electronic device, comprising:

[0055] Memory for storing computer programs;

[0056] A processor is used to implement the steps of the above method when executing the computer program.

[0057] The present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0058] The present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the above method when executed by a processor.

[0059] It can be seen from the above technical scheme that the present invention obtains the image file in the system management mode; the image file is the image file of the driver or the image file of the system management mode function; obtains the firmware version information and upgrade project information supported by the client; obtains the upgrade file according to the image file, the firmware version information and the upgrade project information; and sends the upgrade file to the client, so that the client upgrades the driver or the system management mode function based on the upgrade file. The beneficial effect of the present invention is that the present invention imports the firmware version information and the upgrade project information supported by the client into the upgrade file at the same time, so that when the client receives the upgrade file, it determines whether the upgrade file is safe to upgrade on the platform by verifying the firmware version information and the upgrade project information, avoiding the problem of system downtime caused by using different versions of upgrade files on the same platform for upgrading, and the problem of upgrade errors caused by using different upgrade projects on the same platform for upgrading, thereby greatly improving the security of SRU upgrades.

[0060] In addition, the present invention also provides an upgrade file generation device, an upgrade method, an upgrade device, an electronic device and a medium, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0062] Figure 1 A flowchart of a method for generating an upgrade file provided by an embodiment of the present invention;

[0063] Figure 2 An example flow chart of an upgrade file generation method provided by an embodiment of the present invention;

[0064] Figure 3 A flowchart of an upgrade method provided by an embodiment of the present invention;

[0065] Figure 4 An example flow chart of an upgrade file verification method provided by an embodiment of the present invention;

[0066] Figure 5 A flowchart of a method for verifying firmware version information and upgrade project information provided by an embodiment of the present invention;

[0067] Figure 6 A schematic diagram of the structure of an upgrade file generation device provided by an embodiment of the present invention;

[0068] Figure 7 A schematic diagram of the structure of an upgrading device provided by an embodiment of the present invention;

[0069] Figure 8 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0070] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0071] First, several nouns involved in the present invention are analyzed:

[0072] BIOS: Basic Input Output System, basic input output system.

[0073] OEM: Original Equipment Manufacturer.

[0074] BMC: Baseboard Management Controller, baseboard management controller.

[0075] SMM: System Management Mode, system management mode.

[0076] SMI: System Management Interrupt, system management interrupt.

[0077] SRU (SMM Runtime Update): triggers SMI to enter SMM to execute code or update SMM driver. SRU updates some SMM code by calling the resident program of BIOS in SMM mode under the operating system. From the communication perspective, SRU upgrade methods are divided into two different methods: In-Band (IB) and Out-Of-Band (OOB). From the perspective of upgrade content, SRU upgrade methods include SCI upgrade and SDU upgrade.

[0078] Capsule file: encapsulates the SRU image file and adds a header (the header information of a structure or data structure) as an in-band or out-of-band upgrade file.

[0079] IB mode: Use tools under OS (Operating System) to call ACPI (Advanced Configuration and Power Interface) methods to apply for resources according to different instructions to enter SMM, call the resident program of BIOS to copy the Capsule file to SMM, parse, check and execute the Capsule file, so as to execute the code under SMM or update the driver under SMM.

[0080] OOB mode: The Capsule file is sent to the BMC, which then transmits the file and instructions to the runtime program of the BIOS through the MMBI (memory bus interface), and then parses, verifies, and executes the Capsule file in the SMM.

[0081] SCI (SMM Code Injection): Triggers the SMI handler to load or execute new input code, which can be referred to as system management mode code injection, injecting additional code into SMM to achieve specific functions or purposes. This operation may involve modifying the code of the SMM firmware or software to add new features or fix known problems. SCI upgrades are mainly solved by directly executing the code in the Capsule file in SMM mode, thereby indirectly modifying those registers that are usually read-only in the OS environment without entering SMM mode, so that known problems of some chips such as CPU / PCH (central processing unit / platform control center) can be solved online without re-flashing the BIOS or restarting to take effect.

[0082] SDU (SMM Driver Update): Triggers the SMI handler to update the driver under SMM, which can be referred to as the system management mode driver update. SDU upgrade mainly updates the driver defined in the BIOS code under SMM by executing the Capsule file in SMM mode, so that these drivers defined under SMM can be updated online without updating the BIOS code and restarting the system, and can take effect immediately.

[0083] It should be noted that the similarities between SCI upgrade and SDU upgrade are that both need to be implemented by executing Capsule files under the operating system or BMC, and the structure of Capsule files is the same; the differences are that the code generation and code expression of Capsule files are different, and the upgrade processes are also different.

[0084] Please refer to Figure 1 , Figure 1 A flowchart of a method for generating an upgrade file provided by an embodiment of the present invention. The method may include:

[0085] S101: Acquire an image file in a system management mode; the image file is an image file of a driver or an image file of a system management mode function.

[0086] It should be noted that the image file in the system management mode in this embodiment refers to the SRU image file, that is, the image file corresponding to the SRU upgrade. It is understandable that there are two ways to upgrade the SRU, namely, the SDU upgrade and the SCI upgrade. Correspondingly, the SRU image file can be a driver image file (ie, the SDU image file) or a system management mode function image file (ie, the SCI image file). SDU mainly focuses on driver updates and compatibility issues; SCI mainly focuses on the expansion and optimization of SMM functions. In this embodiment, the generated SDU or SCI image file can be obtained from the build directory of the BIOS (a directory for storing files related to the compilation and construction process).

[0087] S102: Obtain firmware version information and upgrade project information supported by the client.

[0088] It should be noted that the firmware version information in this embodiment refers to the BIOS version information, and the upgrade project information refers to the project information of the project to be upgraded. Under the same platform, there may be multiple projects and multiple BIOS versions. The purpose of this step is to obtain the BIOS version information supported by the client and the project information of the project to be upgraded.

[0089] S103: Obtain an upgrade file according to the image file, firmware version information and upgrade project information.

[0090] It should be noted that the upgrade file in this embodiment refers to a Capsule file. When the Capsule file is generated by encrypting and encapsulating the image file, the firmware version information and the upgrade project information are simultaneously imported into the Capsule file, so that the Capsule file contains the firmware version information and the upgrade project information.

[0091] Further, obtaining the upgrade file according to the image file, the firmware version information and the upgrade project information may specifically include the following steps:

[0092] Execute the packaging script to package the image file to generate the initial upgrade file;

[0093] In the initial upgrade file, some area is reserved as the verification information area;

[0094] Add the firmware version information and upgrade project information to the verification information area to obtain the upgrade file.

[0095] Specifically, the image file is encapsulated to obtain the initial upgrade file; at the same time, a location for adding firmware version information and upgrade project information is reserved, and it is added to the verification information area to obtain an in-band and out-of-band upgrade file. This embodiment can add the upgrade project information and BIOS version information to the generation of the Capsule file by adding a Header (the header information of a structure or data structure). For details, please refer to Figure 2 First, call python (a high-level programming language) to execute the GenerateCapsule script to generate a Capsule file and generate a structure of the header information of the encapsulated data packet according to the Capsule file structure, such as FmpCapsuleHeader (the structure is located at the beginning of the data packet and contains the information of the entire data packet), FmpAuthHeader (the structure is located after the FmpCapsuleHeader structure and contains the information of data packet authentication) and FmpPayloadHeader (the structure is located after the FmpAuthHeader structure and contains the actual data content); secondly, add two new fields to the FmpPayloadHeader structure: one is used to store the size of OemHeader (a structure or class used to store OEM (Original Equipment Manufacturer) specific information), and the other is used to store the content of OemBuffer (a buffer used to store OEM-related data, such as firmware version information and project version information); finally, update the upgrade project information and BIOS version information to the Size area and Oembuffer area of ​​OemHeader.

[0096] S104: Send the upgrade file to the client, so that the client upgrades the driver or the system management mode function based on the upgrade file.

[0097] It should be noted that the client in this embodiment refers to the client platform. The client obtains the upgrade file from the client platform. When the upgrade file passes the firmware version information and upgrade project information verification, the corresponding SRU upgrade can be performed. When the SRU image file in the upgrade file is an SCI image file, the SCI upgrade is performed; when the SRU image file in the upgrade file is an SDU image file, the SDU upgrade is performed.

[0098] Furthermore, the method may further include the following steps:

[0099] When the firmware version information and / or upgrade item information supported by the client changes, the upgrade file is updated based on the changed firmware version information and / or upgrade item information.

[0100] Specifically, when it is found that the content of the verification information has changed, the firmware version information and / or the upgrade project information in the upgrade file is updated in a timely manner, so that the upgrade based on the upgrade file can ensure the upgrade security.

[0101] Furthermore, before obtaining the upgrade file according to the above image file, firmware version information and upgrade project information, the following steps may also be included:

[0102] Perform integrity check on the image file to obtain the integrity check code of the image file;

[0103] Encrypt the image file using a symmetric encryption key to obtain a first upgrade file;

[0104] Generate a digital signature according to the first upgrade file and the symmetric encryption key;

[0105] Encrypting the digital signature according to the asymmetric encryption key to obtain an encrypted digital signature;

[0106] Accordingly, obtaining the upgrade file according to the image file, the firmware version information and the upgrade project information may specifically include the following steps:

[0107] Generate an upgrade file based on the integrity check code, encrypted digital signature, firmware version information and upgrade project information.

[0108] Specifically, the integrity check algorithm can be used to operate on the image file to generate an integrity check code, and the image file can be encrypted using a symmetric encryption key, and then the digital signature can be encrypted using an asymmetric key. This double encryption method can better ensure the security of the image file, and based on the integrity check, it can be determined that the image file in the upgrade file is complete. When the client is upgraded based on the upgrade file later, it can also verify the integrity of the image file in the upgrade file based on the integrity check code, and determine to use a complete and secure image file for the upgrade.

[0109] The upgrade file generation method provided by the embodiment of the present invention is applied, by obtaining the image file in the system management mode; the image file is the image file of the driver or the image file of the system management mode function; obtaining the firmware version information and upgrade project information supported by the client; obtaining the upgrade file according to the image file, the firmware version information and the upgrade project information; sending the upgrade file to the client, so that the client upgrades the driver or the system management mode function based on the upgrade file. This method imports the firmware version information and the upgrade project information supported by the client into the upgrade file at the same time, so that when the client receives the upgrade file, it determines whether the upgrade file is safe to upgrade on the platform by verifying the firmware version information and the upgrade project information, avoiding the problem of system downtime caused by using different versions of upgrade files on the same platform for upgrading, and the problem of upgrade errors caused by using different upgrade projects on the same platform for upgrading, greatly improving the security of SRU upgrade.

[0110] Please refer to Figure 3 , Figure 3 A flowchart of an upgrade method provided by an embodiment of the present invention. The method may include:

[0111] S201: Acquire an upgrade file including an image file, firmware version information, and upgrade project information.

[0112] It should be noted that the upgrade file in this embodiment refers to a Capsule file, which imports the firmware version information (BIOS version information) and the upgrade project information. Among them, the image file refers to the SRU image file, and according to the different contents of the corresponding Capsule file in the SRU upgrade method, the image file in the Capsule file can be divided into an SCI image file or an SDU image file.

[0113] S202: Verify the upgrade project information and the firmware version information of the upgrade file according to the current upgrade project information and the currently supported firmware version information.

[0114] Specifically, before the SRU is upgraded, the BIOS will verify the upgrade project information and the firmware version information of the Capsule file. This embodiment does not limit the order of the verification.

[0115] Furthermore, the upgrade file may also include file structure information, valid identification information, identity information, key and signature information; accordingly, before verifying the upgrade project information and firmware version information of the upgrade file according to the current upgrade project information and the currently supported firmware version information, the following steps may also be included:

[0116] Determine whether the upgrade file is an upgrade file in the system management mode according to the file structure information;

[0117] If yes, then the validity of the upgrade file is verified based on the valid identification information;

[0118] If the validity check passes, the upgrade file is verified based on the identity information;

[0119] If the identity verification is passed, the upgrade file will be verified for legitimacy based on the key and signature information;

[0120] If the legality check passes, the step of verifying the upgrade project information and the firmware version information of the upgrade file according to the current upgrade project information and the currently supported firmware version information is executed.

[0121] Specifically, please refer to Figure 4 . When the user executes the upgrade command of the Capsule file under the in-band OS or the out-of-band BMC, the SMI interrupt is triggered to copy the Capsule file to the SMM, and the file structure information of the Capsule file is parsed. According to the file structure information, it is determined whether the upgrade file is the Capsule file of the SRU; according to the valid identification information, it is determined whether the upgrade file is valid, that is, the validity of the FMP (Firmware Package, a packaged file containing firmware image, metadata and other related files, that is, the upgrade file) is checked; according to the identity information, the upgrade file is verified to determine whether the upgrade file is the upgrade file of the SDU or SCI, and through the above-mentioned layer-by-layer verification, it is determined that the upgrade file is the upgrade file of the SDU or SCI. Subsequently, the legitimacy of the upgrade file is verified, and the legitimacy can be specifically verified through the key and signature information. In this embodiment, before verifying the upgrade project information and the firmware version information, the upgrade file is verified by identity verification, validity verification, and legitimacy verification. In this way, the security of the SRU upgrade can be further improved by verifying the integrity of the upgrade file.

[0122] Furthermore, before determining whether the upgrade file is an upgrade file in the system management mode according to the file structure information, the following steps may also be included:

[0123] When receiving an upgrade command, the upgrade command is parsed to obtain user identity information;

[0124] Use access control lists and user identity information to determine whether the upgrade command is valid;

[0125] If valid, the step of determining whether the upgrade file is an upgrade file in the system management mode according to the file structure information is executed;

[0126] If invalid, exit this upgrade.

[0127] It should be noted that the user identity information of this embodiment refers to data used to identify and verify the identity of the user. These data may include user names, passwords, digital certificates, biometric features (such as fingerprints or facial recognition), etc. The access control list defines which users or system processes have the right to perform upgrade operations. By matching the parsed identity information with the access control list, the system can determine whether the user currently requesting the upgrade has sufficient permissions to perform the upgrade operation. Considering that the SRU upgrade is an online upgrade, the security level of the upgrade is higher and has a greater impact on the system, so the present embodiment also provides user identity information verification. Such an upgrade verification method based on user identity information helps to ensure that only authorized users can perform upgrade operations, thereby improving the security of the upgrade.

[0128] By setting an access control list to limit the upgrade permissions of the SRU, unauthorized modifications or attacks can be prevented to improve the security of the upgrade.

[0129] Further, the above-mentioned verification of the upgrade project information and the firmware version information of the upgrade file according to the current upgrade project information and the currently supported firmware version information may specifically include the following steps:

[0130] Formulate the version information range based on the currently supported version information;

[0131] If the firmware version information of the upgrade file is within the version information range, the firmware version information verification passes;

[0132] If the firmware version information of the upgrade file is not within the version information range, the firmware version information verification fails;

[0133] If the current project information is consistent with the project information in the upgrade file, the project information verification passes.

[0134] For details, please refer to Figure 5 . By parsing the Capsule file in the SMM memory, the file structure information of the Capsule file is obtained, and the FmpPayloadHeader structure is further found, and the size and data information of the Oem area are parsed, and the parsed data is sorted and converted to obtain the upgrade project information and BIOS version information. The BIOS obtains the current project information and the currently supported BIOS version information range from the specified storage area, and compares them with the upgrade project information in the upgrade file to determine whether they are consistent. If they are consistent, continue, otherwise directly return an error; determine whether the BIOS version information in the upgrade file is within the currently supported BIOS version information range. If it is within the range, continue, otherwise directly return an error to end this update. Finally, restore the scene and exit SMM mode.

[0135] S203: If the verification passes, the driver program or the system management mode function is upgraded according to the image file.

[0136] Specifically, only after the upgrade project information and the firmware version information are verified, can the SRU upgrade be performed based on the image file in the Capsule file.

[0137] Furthermore, after the driver or the system management mode function is upgraded according to the image file, the following steps may also be included:

[0138] Restart the server and check whether the system starts normally;

[0139] If it starts normally, check whether there are any error prompts or abnormal information, and whether the hardware can work normally;

[0140] If there is no error message or abnormal information, and the hardware can work normally, check the system information or related log files to determine whether the upgrade is successful;

[0141] If it fails, restore based on the backup data.

[0142] Specifically, after the upgrade is performed based on the image file, the embodiment needs to check whether the upgrade is successful. Whether the upgrade is wrong can be ensured by checking whether the server restart is successful, whether an error message pops up, and whether the hardware can work normally, and finally checking the system information or log file to determine whether it is successful. It is understandable that before the upgrade, important data needs to be backed up, such as system configuration files, driver lists, system status, etc., in case an error occurs during the upgrade process, resulting in the upgrade failure, and the system crashes and data cannot be restored. At this time, recovery can be performed based on the backup data.

[0143] The upgrade method provided by the embodiment of the present invention is applied, by obtaining an upgrade file including an image file, firmware version information and upgrade project information; verifying the upgrade project information and firmware version information of the upgrade file according to the current upgrade project information and the currently supported firmware version information; if the verification passes, the driver or system management mode function is upgraded according to the image file. This method determines whether the upgrade file is safe to upgrade on the platform by verifying the firmware version information and the upgrade project information, avoiding the problem of system downtime caused by upgrading with upgrade files of different versions on the same platform, and the problem of upgrade errors caused by upgrading with different upgrade projects on the same platform, greatly improving the security of SRU upgrades.

[0144] The following is an introduction to an upgrade file generation device provided by an embodiment of the present invention. The upgrade file generation device described below and the upgrade file generation method described above can be referenced to each other.

[0145] Please refer to Figure 6 , Figure 6 A schematic diagram of a structure of an upgrade file generation device provided by an embodiment of the present invention may include:

[0146] The image file acquisition module 100 is used to acquire an image file in the system management mode; the image file is an image file of a driver or an image file of a system management mode function;

[0147] The information acquisition module 200 is used to acquire the firmware version information and upgrade project information supported by the client;

[0148] An upgrade file determination module 300, configured to obtain an upgrade file according to the image file, the firmware version information and the upgrade project information;

[0149] The sending module 400 is used to send the upgrade file to the client, so that the client upgrades the driver or the system management mode function based on the upgrade file.

[0150] Based on the above embodiment, the upgrade file determination module 300 may include:

[0151] An initial upgrade file generating unit, used for executing a packaging script to package the image file to generate an initial upgrade file;

[0152] A verification information area reservation unit, used to reserve a part of the area in the initial upgrade file as a verification information area;

[0153] An upgrade file generating unit is used to add the firmware version information and the upgrade project information to the verification information area to obtain the upgrade file.

[0154] Based on the above embodiment, the upgrade file generating device may further include:

[0155] The upgrade file update module is used to update the upgrade file based on the changed firmware version information and / or upgrade project information when the firmware version information and / or upgrade project information supported by the client changes.

[0156] Based on the above embodiment, the upgrade file generation module may further include:

[0157] An integrity check module, used to perform an integrity check on the image file to obtain an integrity check code for the image file;

[0158] A first encryption module, used to encrypt the image file by using a symmetric encryption key to obtain a first upgrade file;

[0159] A digital signature generation module, used to generate a digital signature according to the first upgrade file and the symmetric encryption key;

[0160] A second encryption module, used to encrypt the digital signature according to the asymmetric encryption key to obtain an encrypted digital signature;

[0161] Accordingly, the upgrade file determination module 300 specifically includes:

[0162] An upgrade file determination unit is used to generate the upgrade file according to the integrity check code, the encrypted digital signature, the firmware version information and the upgrade project information.

[0163] It should be noted that the order of the modules and units in the above-mentioned upgrade file generation device can be changed without affecting the logic.

[0164] The upgrade file generation device provided by the embodiment of the present invention is used to obtain the image file in the system management mode through the image file acquisition module 100; the image file is the image file of the driver or the image file of the system management mode function; the information acquisition module 200 is used to obtain the firmware version information and upgrade project information supported by the client; the upgrade file determination module 300 is used to obtain the upgrade file according to the image file, the firmware version information and the upgrade project information; the sending module 400 is used to send the upgrade file to the client, so that the client is upgraded based on the upgrade file driver or system management mode function. This device imports the firmware version information and upgrade project information supported by the client into the upgrade file at the same time, so that when the client receives the upgrade file, it determines whether the upgrade file is safe to upgrade on the platform by verifying the firmware version information and the upgrade project information, avoiding the problem of system downtime caused by using different versions of upgrade files on the same platform for upgrading, and the problem of upgrade errors caused by using different upgrade projects on the same platform for upgrading, greatly improving the security of SRU upgrade.

[0165] The following is an introduction to an upgrade device provided by an embodiment of the present invention. The upgrade device described below and the upgrade method described above can be referenced to each other.

[0166] Please refer to Figure 7 , Figure 7 A schematic diagram of a structure of an upgrading device provided in an embodiment of the present invention may include:

[0167] An upgrade file acquisition module 500 is used to acquire an upgrade file including an image file, firmware version information, and upgrade project information;

[0168] Verification module 600, used to verify the upgrade project information and firmware version information of the upgrade file according to the current upgrade project information and the currently supported firmware version information;

[0169] The upgrade module 700 is used to upgrade the driver program or the system management mode function according to the image file if the verification passes.

[0170] Based on the above embodiment, the upgrade file may further include: file structure information, valid identification information, identity information, key and signature information;

[0171] Correspondingly, the upgrading device may further include:

[0172] A file structure information verification module, used to determine whether the upgrade file is an upgrade file in the system management mode according to the file structure information;

[0173] A valid identification verification module, used for, if yes, performing validity verification on the upgrade file according to the valid identification information;

[0174] An identity verification module, configured to perform identity verification on the upgrade file according to the identity information if the validity verification passes;

[0175] A legitimacy verification module, used to perform a legitimacy verification on the upgrade file according to the key and signature information if the identity verification passes;

[0176] The upgrade project information and firmware version information verification module is used to execute the step of verifying the upgrade project information and firmware version information of the upgrade file according to the current upgrade project information and the currently supported firmware version information if the legality verification passes.

[0177] Based on the above embodiment, the verification module 600 may include:

[0178] A version information range determination unit, configured to formulate a version information range according to the currently supported version information;

[0179] A first firmware version information verification result unit, used for checking that the firmware version information passes if the firmware version information of the upgrade file is within the version information range;

[0180] A second firmware version information verification result unit, used for failing the firmware version information verification if the firmware version information of the upgrade file is not within the version information range;

[0181] The project information verification unit is used to verify that the project information passes if the current project information is consistent with the project information of the upgrade file.

[0182] Based on the above embodiment, the upgrading device may further include:

[0183] Restart module, used to restart the server and check whether the system starts normally;

[0184] The first checking module is used to check whether there is any error prompt or abnormal information and whether the hardware can work normally if the system starts normally;

[0185] The second checking module is used to check the system information or related log files to determine whether the upgrade is successful if there is no error prompt or abnormal information and the hardware can work normally;

[0186] The recovery module is used to recover based on the backup data if failure occurs.

[0187] It should be noted that the order of the modules and units in the above-mentioned upgrading device can be changed without affecting the logic.

[0188] The upgrade device provided by the embodiment of the present invention is used to obtain an upgrade file including an image file, firmware version information and upgrade project information through an upgrade file acquisition module 500; a verification module 600 is used to verify the upgrade project information and firmware version information of the upgrade file according to the current upgrade project information and the currently supported firmware version information; and an upgrade module 700 is used to upgrade the driver or system management mode function according to the image file if the verification passes. This device determines whether the upgrade file is safe to upgrade on the platform by verifying the firmware version information and the upgrade project information, avoiding the problem of system downtime caused by upgrading with upgrade files of different versions on the same platform, and the problem of upgrade errors caused by upgrading with different upgrade projects on the same platform, greatly improving the security of SRU upgrades.

[0189] Figure 8 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention is shown in FIG. Figure 8 As shown, the electronic equipment includes:

[0190] A memory 60, for storing computer programs;

[0191] The processor 61 is used to implement the upgrade file generation method and / or the steps of the upgrade method in the above-mentioned embodiment when executing a computer program.

[0192] The electronic device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer or a desktop computer.

[0193] Among them, the processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 61 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the processor is a low-power processor for processing data in the standby state. In some embodiments, the processor 61 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 61 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0194] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 60 is at least used to store the following computer program 601, wherein, after the computer program is loaded and executed by the processor 61, it can implement the upgrade file generation method and / or the relevant steps of the upgrade method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 602 may include Windows, Unix, Linux, etc. Data 603 may include but is not limited to the upgrade file generation method and / or the relevant data of the upgrade method, etc.

[0195] In some embodiments, the electronic device may further include a display screen 62 , an input / output interface 63 , a communication interface 64 , a power supply 65 , and a communication bus 66 .

[0196] Those skilled in the art will understand that Figure 8 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure.

[0197] It is understandable that if the upgrade file generation method and / or the upgrade method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the current technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk, etc. Various media that can store program codes.

[0198] Based on this, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the upgrade file generation method and / or the upgrade method are implemented.

[0199] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0200] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0201] Finally, it should be noted that, in this article, relationships such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variations are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0202] The above is a detailed introduction to an upgrade file generation method and an upgrade method, device, equipment and readable storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for a general technician in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for generating an upgrade file, characterized in that: include: Get the image file in system management mode; The image file is an image file of a driver or an image file of a system management mode function; Get the firmware version information and upgrade project information supported by the client; Obtaining an upgrade file according to the image file, the firmware version information and the upgrade project information; The upgrade file is sent to the client, so that the client upgrades the driver or the system management mode function based on the upgrade file.

2. The upgrade file generation method according to claim 1, characterized in that: Obtaining an upgrade file according to the image file, the firmware version information and the upgrade project information, including: Execute the packaging script to package the image file to generate an initial upgrade file; Reserving a portion of the area in the initial upgrade file as a verification information area; The firmware version information and the upgrade project information are added to the verification information area to obtain the upgrade file.

3. The upgrade file generation method according to claim 1, characterized in that: Also includes: When the firmware version information and / or upgrade item information supported by the client changes, the upgrade file is updated based on the changed firmware version information and / or upgrade item information.

4. The upgrade file generation method according to claim 1, characterized in that: Before obtaining the upgrade file according to the image file, the firmware version information and the upgrade project information, the method further includes: Performing an integrity check on the image file to obtain an integrity check code for the image file; Encrypt the image file using a symmetric encryption key to obtain a first upgrade file; Generate a digital signature according to the first upgrade file and the symmetric encryption key; Encrypting the digital signature according to the asymmetric encryption key to obtain an encrypted digital signature; Correspondingly, obtaining the upgrade file according to the image file, the firmware version information and the upgrade project information includes: The upgrade file is generated according to the integrity check code, the encrypted digital signature, the firmware version information and the upgrade project information.

5. An upgrading method, characterized in that: include: Obtain the upgrade file including the image file, firmware version information and upgrade project information; Verifying the upgrade project information and the firmware version information of the upgrade file according to the current upgrade project information and the currently supported firmware version information; If the verification passes, the driver program or the system management mode function is upgraded according to the image file.

6. The upgrading method according to claim 5, characterized in that: The upgrade file also includes file structure information, valid identification information, identity information, key and signature information; Accordingly, before verifying the upgrade project information and the firmware version information of the upgrade file according to the current upgrade project information and the currently supported firmware version information, the method further includes: Determine whether the upgrade file is an upgrade file in the system management mode according to the file structure information; If yes, then verify the validity of the upgrade file according to the valid identification information; If the validity check passes, the upgrade file is subjected to identity verification according to the identity information; If the identity verification is passed, the legitimacy of the upgrade file is verified based on the key and signature information; If the legality check passes, the step of verifying the upgrade project information and the firmware version information of the upgrade file according to the current upgrade project information and the currently supported firmware version information is executed.

7. The upgrading method according to claim 5, characterized in that: Verifying the upgrade project information and the firmware version information of the upgrade file according to the current upgrade project information and the currently supported firmware version information includes: Formulate a version information range according to the currently supported version information; If the firmware version information of the upgrade file is within the version information range, the firmware version information verification passes; If the firmware version information of the upgrade file is not within the version information range, the firmware version information verification fails; If the current project information is consistent with the project information of the upgrade file, the project information verification passes.

8. The upgrading method according to claim 5, characterized in that: After the driver or the system management mode function is upgraded according to the image file, the method further includes: Restart the server and check whether the system starts normally; If it starts normally, check whether there are any error prompts or abnormal information, and whether the hardware can work normally; If there is no error message or abnormal information, and the hardware can work normally, check the system information or related log files to determine whether the upgrade is successful; If it fails, restore based on the backup data.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the method according to any one of claims 1 to 8 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.