A firmware upgrade method, device, medium and program product

By performing two-way authentication on the server and firmware upgrade/downgrade device, the upgrade/downgrade mode is determined and corresponding instructions are generated, solving the problem that firmware upgrade/downgrade requires manual operation in the existing technology, and realizing automated and reliable firmware updates.

CN120631409BActive Publication Date: 2025-11-11INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511115763.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-11
Publication Date
2025-11-11
Estimated Expiration
2045-08-11

AI Technical Summary

Technical Problem

Existing server firmware upgrade and downgrade methods require manual operation and have a low degree of automation.

Method used

By performing two-way authentication on the server and firmware upgrade/downgrade device, the upgrade/downgrade mode is determined, and upgrade or downgrade instructions are generated based on the current version number or running status, enabling automatic or manual firmware upgrade/downgrade operations.

Benefits of technology

The automation of firmware updates has been improved, ensuring the reliability and accuracy of the update process, while a manual mode is provided to suit different needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120631409B_ABST
    Figure CN120631409B_ABST
Patent Text Reader

Abstract

The application discloses a firmware upgrading and downgrading method and device, a medium and a program product, relates to the technical field of servers, and comprises the following steps: performing bidirectional identity authentication on a server and a firmware upgrading and downgrading device, so as to ensure the authenticity of the identities of the server and the firmware upgrading and downgrading device and the credibility of both parties; when the upgrading and downgrading mode of the firmware upgrading and downgrading device is an automatic mode, generating an upgrading instruction or a downgrading instruction of the firmware according to a current version number or a current running state of the firmware, so as to solve the technical problem of low automation degree of firmware updating and achieve the technical effect of improving the automation degree of firmware updating; and when the upgrading and downgrading mode of the firmware upgrading and downgrading device is a manual mode, generating an upgrading instruction or a downgrading instruction of the firmware according to a user instruction, so as to enable firmware updating without triggering automatic upgrading and downgrading.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of server technology, and in particular to a firmware upgrade / downgrade method, device, medium, and program product. Background Technology

[0002] Firmware serves as the most fundamental, low-level working code of a system, crucial to server functionality and performance. Currently, most server firmware upgrade / downgrade methods rely on engineers manually upgrading / downgrading the firmware of each board and component individually using programming tools or system commands. For example: The first approach involves removing the corresponding chip already soldered onto the PCB, then using specific software and hardware to perform the firmware upgrade / downgrade, and finally resoldering the chip back onto the PCB; the second approach involves using specific software and inputting commands within the operating system to complete the firmware upgrade / downgrade when the server can boot into the operating system; the third approach involves logging into the PCB network of the server to be upgraded / downgraded via a third-party computer or server within the same network segment of the PCB management controller, and completing the firmware upgrade / downgrade on the network interface. All three of these approaches require manual operation and have low automation levels. Summary of the Invention

[0003] This application provides a firmware upgrade / downgrade method, device, medium, and program product to at least solve the problem that firmware updates require manual operation and have a low degree of automation in related technologies.

[0004] This application provides a firmware upgrade / downgrade method applied to a firmware upgrade / downgrade device connected to a server. The firmware upgrade / downgrade method includes: determining whether the server is powered on; in response to the server being powered on, performing two-way authentication on the server and the firmware upgrade / downgrade device to obtain a two-way authentication result; in response to the two-way authentication result being successful, determining the upgrade / downgrade mode of the firmware upgrade / downgrade device, wherein the upgrade / downgrade mode includes at least an automatic mode and a manual mode; in response to the upgrade / downgrade mode being automatic, obtaining the current version number of the firmware and generating an upgrade instruction based on the current version number, or determining the current running state of the firmware and generating a downgrade instruction based on the current running state, wherein the upgrade instruction and downgrade instruction include at least a target version number of the firmware; in response to the upgrade / downgrade mode being manual, receiving a user instruction and generating an upgrade instruction or a downgrade instruction based on the user instruction; and performing the corresponding upgrade or downgrade operation on the firmware according to the upgrade instruction or downgrade instruction to change the current version number of the firmware to the target version number.

[0005] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement a firmware upgrade / downgrade method comprising at least the following steps: determining whether a server is powered on; in response to the server being powered on, performing two-way authentication on the server and the firmware upgrade / downgrade device to obtain a two-way authentication result; in response to the two-way authentication result being successful, determining the upgrade / downgrade mode of the firmware upgrade / downgrade device, wherein the upgrade / downgrade mode includes at least an automatic mode and a manual mode; in response to the upgrade / downgrade mode being automatic, obtaining the current version number of the firmware and generating an upgrade instruction for the firmware based on the current version number, or determining the current running state of the firmware and generating a downgrade instruction for the firmware based on the current running state, wherein the upgrade instruction and the downgrade instruction include at least a target version number of the firmware; in response to the upgrade / downgrade mode being manual, receiving a user instruction and generating an upgrade instruction or a downgrade instruction for the firmware based on the user instruction; and performing a corresponding upgrade operation or downgrade operation on the firmware based on the upgrade instruction or the downgrade instruction to change the current version number of the firmware to the target version number.

[0006] This application also provides a computer-readable storage medium storing a computer program, wherein when executed by a processor, the computer program implements a firmware upgrade / downgrade method including at least the following steps: determining whether the server is powered on; in response to the server being powered on, performing two-way authentication on the server and the firmware upgrade / downgrade device, and obtaining a two-way authentication result; in response to the two-way authentication result being successful, determining the upgrade / downgrade mode of the firmware upgrade / downgrade device, wherein the upgrade / downgrade mode includes at least an automatic mode and a manual mode; in response to the upgrade / downgrade mode being automatic, obtaining the current version number of the firmware and generating an upgrade instruction for the firmware based on the current version number, or determining the current running state of the firmware and generating a downgrade instruction for the firmware based on the current running state, wherein the upgrade instruction and the downgrade instruction include at least a target version number of the firmware; in response to the upgrade / downgrade mode being manual, receiving a user instruction and generating an upgrade instruction or a downgrade instruction for the firmware based on the user instruction; and performing a corresponding upgrade operation or downgrade operation on the firmware based on the upgrade instruction or the downgrade instruction to change the current version number of the firmware to the target version number.

[0007] This application also provides a computer program product, including a computer program that, when executed by a processor, implements a firmware upgrade / downgrade method comprising at least the following steps: determining whether the server is powered on; in response to the server being powered on, performing two-way authentication on the server and the firmware upgrade / downgrade device, and obtaining a two-way authentication result; in response to the two-way authentication result being successful, determining the upgrade / downgrade mode of the firmware upgrade / downgrade device, wherein the upgrade / downgrade mode includes at least an automatic mode and a manual mode; in response to the upgrade / downgrade mode being automatic, obtaining the current version number of the firmware and generating an upgrade instruction for the firmware based on the current version number, or determining the current running state of the firmware and generating a downgrade instruction for the firmware based on the current running state, wherein the upgrade instruction and the downgrade instruction include at least a target version number of the firmware; in response to the upgrade / downgrade mode being manual, receiving a user instruction and generating an upgrade instruction or a downgrade instruction for the firmware based on the user instruction; and performing a corresponding upgrade operation or downgrade operation on the firmware based on the upgrade instruction or the downgrade instruction to change the current version number of the firmware to the target version number.

[0008] This application implements two-way authentication for the server and firmware upgrade / downgrade device to ensure the authenticity of each other's identities and that both parties are trustworthy. When the firmware upgrade / downgrade device is in automatic mode, it generates upgrade or downgrade commands based on the current firmware version number or current running status, solving the technical problem of low automation in firmware updates and achieving the technical effect of improving the automation level of firmware updates. When the firmware upgrade / downgrade device is in manual mode, it generates upgrade or downgrade commands based on user instructions, enabling firmware updates even without triggering automatic upgrade / downgrade. Attached Figure Description

[0009] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0010] Figure 1 This is a flowchart illustrating a firmware upgrade / downgrade method in one embodiment;

[0011] Figure 2 This is a timing diagram of a firmware upgrade / downgrade method in one embodiment;

[0012] Figure 3 This is a structural block diagram of a firmware upgrade / downgrade system in one embodiment;

[0013] Figure 4This is a structural block diagram of the firmware upgrade / downgrade device in another embodiment;

[0014] Figure 5 This is a schematic diagram of the operation of the power module in the firmware upgrade / downgrade device in one embodiment;

[0015] Figure 6 This is a diagram of the internal structure of an electronic device in one embodiment. Detailed Implementation

[0016] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0017] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0018] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0019] In the first embodiment, such as Figure 1As shown, a firmware upgrade / downgrade method is provided, applied to a firmware upgrade / downgrade device connected to a server. The firmware upgrade / downgrade method includes: determining whether the server is powered on; in response to the server being powered on, performing two-way authentication on the server and the firmware upgrade / downgrade device to obtain a two-way authentication result; in response to the two-way authentication result being successful, determining the upgrade / downgrade mode of the firmware upgrade / downgrade device, wherein the upgrade / downgrade mode includes at least an automatic mode and a manual mode; in response to the upgrade / downgrade mode being automatic, obtaining the current version number of the firmware and generating an upgrade instruction based on the current version number, or determining the current running state of the firmware and generating a downgrade instruction based on the current running state, wherein the upgrade instruction and downgrade instruction include at least the target version number of the firmware; in response to the upgrade / downgrade mode being manual, receiving a user instruction and generating an upgrade instruction or a downgrade instruction based on the user instruction; and performing the corresponding upgrade operation or downgrade operation on the firmware according to the upgrade instruction or downgrade instruction to change the current version number of the firmware to the target version number.

[0020] Specifically, two-way authentication is performed on the server and the firmware upgrade / downgrade device to ensure the authenticity of each other's identities and that both parties are trustworthy. When the firmware upgrade / downgrade device is in automatic mode, it generates firmware upgrade or downgrade commands based on the current firmware version number or current running status, solving the technical problem of low automation in firmware updates and achieving the technical effect of improving the automation level of firmware updates. When the firmware upgrade / downgrade device is in manual mode, it generates firmware upgrade or downgrade commands based on user instructions, so that firmware can be updated even without triggering automatic upgrade / downgrade.

[0021] In specific implementation, such as Figure 2 As shown, in response to the server being powered on, a connection is established between the firmware upgrade / downgrade device and the server baseboard management controller via the integrated circuit bus. Upon successful connection establishment, based on the baseboard management controller, two-way authentication is performed on both the server and the firmware upgrade / downgrade device, and a firmware update operation is performed. Two-way authentication between the server and the firmware upgrade / downgrade device can be performed using an elliptic curve digital signature algorithm.

[0022] Further, determining whether the server is powered on includes: obtaining the server's current voltage value and comparing the current voltage value with a preset voltage range, wherein the preset voltage range includes at least a first voltage range, a second voltage range, and a third voltage range; determining that the server is powered on in response to the current voltage value being within the first voltage range; determining that the server is in standby mode in response to the current voltage value being within the second voltage range; and determining that the server is powered off or in a fault state in response to the current voltage value being within the third voltage range.

[0023] In practice, for example, if the current voltage is within the range of 11.4V~12.6V; 4.75V~5.25V; or 3.14V~3.46V, the server is in a powered-on state; if the current voltage is within the range of 4.75V~5.25V, the server is in a standby state; if the current voltage is less than 1V, the server is in a powered-off state or a fault state, such as power failure, power supply failure, motherboard short circuit protection triggering, or the baseboard management controller detecting a serious abnormality, such as overvoltage / undervoltage.

[0024] Furthermore, two-way authentication is performed on the server and the firmware upgrade / downgrade device to obtain a two-way authentication result, including: generating a server authentication command and sending the server authentication command to the server, while simultaneously receiving a device authentication command generated by the server; performing authentication according to the device authentication command, obtaining a device authentication result, and returning the device authentication result to the server, while simultaneously receiving a server authentication result returned by the server; in response to both the device authentication result and the server authentication result being successful, determining the two-way authentication result as successful; in response to both the device authentication result and / or the server authentication result failing, determining the two-way authentication result as failed.

[0025] Specifically, by performing two-way authentication on the server and firmware upgrade / downgrade device, the authenticity of each other's identities is ensured, ensuring that both parties are trustworthy and establishing an end-to-end trust chain.

[0026] Further, determining the upgrade / downgrade mode of the firmware upgrade / downgrade device includes: acquiring an upgrade / downgrade mode flag in the firmware upgrade / downgrade device, wherein the value of the upgrade / downgrade mode flag includes at least a first target value and a second target value; in response to the value of the upgrade / downgrade mode flag being the first target value, determining that the upgrade / downgrade mode of the firmware upgrade / downgrade device is an automatic mode; and in response to the value of the upgrade / downgrade mode flag being the second target value, determining that the upgrade / downgrade mode of the firmware upgrade / downgrade device is a manual mode.

[0027] Specifically, by setting the upgrade / downgrade mode flag of the firmware upgrade / downgrade device, when the value is set to the first target value, the upgrade / downgrade mode is automatic; when the value is set to the second target value, the upgrade / downgrade mode is manual. This enables the generation of firmware upgrade / downgrade commands, while also covering the situation where automatic upgrade / downgrade is not triggered, but the firmware needs to be upgraded / downgraded according to user requirements, allowing for manual upgrade / downgrade.

[0028] In practice, the first target value is 0, and the second target value is 1.

[0029] Further, obtaining the current firmware version number and generating a firmware upgrade instruction based on the current version number includes: obtaining the current firmware version number in the server and the firmware version information database in the firmware upgrade / downgrade device, wherein the version information database includes at least multiple firmware files and firmware upgrade policy flags, and the upgrade policy flags have values ​​including at least a first target value and a second target value; determining a target version number based on the current version number and the upgrade policy flags, wherein the target version number is greater than the current version number; comparing the target version number with the version numbers corresponding to multiple firmware files to obtain the target firmware file corresponding to the target version number; and generating a firmware upgrade instruction based on the target firmware file.

[0030] Further, based on the current version number and the upgrade strategy flag, the target version number is determined, including: in response to the upgrade strategy flag being a first target value, determining the firmware version upgrade strategy as a step-by-step upgrade, and determining the next level version number of the current firmware version number as the target version number; in response to the upgrade strategy flag being a second target value, determining the firmware version upgrade strategy as a cross-level upgrade, and determining the latest version number of the firmware as the target version number.

[0031] Specifically, by setting an upgrade policy flag, the target version number is made to meet the upgrade policy of the corresponding firmware manufacturer, thus preventing the upgraded firmware from failing to function properly.

[0032] In practice, if the firmware upgrade strategy is to upgrade step by step, and the firmware version number is from v1.0 to v1.3 to v1.8 to v2.0, and the current version number is v1.3, then the target version number is v1.8.

[0033] Further, determining the current operating state of the firmware and generating a firmware downgrade instruction based on the current operating state includes: determining the current operating state of the firmware; in response to a compatibility error or stability issue occurring in the current operating state, obtaining the current version number of the firmware in the server and the firmware version information database in the firmware upgrade / downgrade device, wherein the version information database includes at least multiple firmware files and a firmware downgrade policy flag, and the value of the downgrade policy flag includes at least a first target value and a second target value; determining a target version number based on the current version number and the downgrade policy flag, wherein the target version number is less than the current version number; comparing the target version number with the version numbers corresponding to multiple firmware files to obtain the target firmware file corresponding to the target version number; and generating a firmware downgrade instruction based on the target firmware file.

[0034] Furthermore, based on the current version number and the downgrade policy flag, the target version number is determined, including: in response to the downgrade policy flag being a first target value, determining the firmware version downgrade policy as a step-by-step downgrade, and determining the previous version number of the current firmware version number as the target version number; in response to the downgrade policy flag being a second target value, determining the firmware version downgrade policy as a prohibited downgrade, and generating alarm information indicating that the server has encountered a compatibility error or stability problem.

[0035] Specifically, by setting a downgrade policy flag, the target version number is made to meet the downgrade policy of the corresponding firmware manufacturer, so as to avoid the downgraded firmware from not being able to run properly.

[0036] Furthermore, the value of the downgrade strategy flag includes at least a third target value. The firmware upgrade / downgrade method further includes: in response to the downgrade strategy flag being a third target value, determining the firmware version downgrade strategy as a cross-level downgrade, and determining the previous level version number of the current firmware version number as the first intermediate version number; performing a downgrade operation on the firmware based on the first intermediate version number, and determining the current running state of the firmware; in response to a compatibility error or stability problem occurring in the current running state, determining the previous level version number of the first intermediate version number of the firmware as the second intermediate version number; performing a downgrade operation on the firmware based on the second intermediate version number, and determining the current running state of the firmware; in response to the current running state being a normal state, determining the second intermediate version number as the target version number; in response to a compatibility error or stability problem occurring in the current running state, determining the previous level version number of the second intermediate version number of the firmware as the third intermediate version number, and performing a downgrade operation on the firmware based on the third intermediate version number, until the current running state of the firmware is a normal state.

[0037] Specifically, downgrading is mainly to make the firmware version compatible with other firmware versions on the server. Therefore, when the downgrading policy flag includes a third target value, and the downgrading policy flag being a third target value indicates that the firmware version downgrading policy is a cross-level downgrading, incompatibility between the downgraded firmware and other firmware on the server can be avoided by downgrading step by step.

[0038] In practice, the third target value is 2.

[0039] Further, the firmware downgrade operation based on the first intermediate version number includes: comparing the first intermediate version number with the version numbers corresponding to multiple firmware files to obtain the first intermediate firmware file corresponding to the first intermediate version number; generating a first downgrade instruction for the firmware based on the first intermediate firmware file; and performing a corresponding downgrade operation on the firmware based on the first downgrade instruction to change the current version number of the firmware to the first intermediate version number.

[0040] Furthermore, generating firmware upgrade instructions or firmware downgrade instructions based on user instructions includes: obtaining the target version number in the user instructions and the firmware version information database in the firmware upgrade / downgrade device, wherein the version information database includes at least multiple firmware files; comparing the target version number with the version numbers corresponding to the multiple firmware files to obtain the target firmware file corresponding to the target version number; and generating firmware upgrade instructions or firmware downgrade instructions based on the target firmware file.

[0041] Furthermore, based on the target firmware file, an upgrade instruction or a downgrade instruction for the firmware is generated, including: obtaining the current version number of the firmware and comparing the current version number with the target version number; in response to the current version number being less than the target version number, generating an upgrade instruction for the firmware based on the target firmware file; in response to the current version number being greater than the target version number, generating a downgrade instruction for the firmware based on the target firmware file.

[0042] In addition, upgrade and downgrade instructions include at least the expected update time period. The firmware upgrade / downgrade method also includes: obtaining the size of the target firmware file and determining the expected update duration of the target firmware file based on the size of the target firmware file; obtaining multiple idle time periods of the firmware and calculating the corresponding multiple idle durations based on the multiple idle time periods; comparing the multiple idle durations with the expected update duration; in response to the current idle duration being greater than the expected update duration, determining the idle time period corresponding to the current idle duration as the pending update time period; sorting the multiple pending update time periods from largest to smallest according to the idle duration, and determining the expected update time period based on the first-ranked pending update time period, wherein the first-ranked pending update time period includes the expected update time period; in response to multiple idle durations being less than or equal to the expected update duration, determining the start update time in the expected update time period of the firmware based on the user selection.

[0043] Specifically, updating the firmware while the user is using it will interrupt the user's ongoing tasks. Therefore, to make firmware updates more user-friendly, the update time is scheduled during the firmware's idle time period, or the update is started from the user's selected start time.

[0044] In practice, the firmware's idle time period can be any of the day's idle time periods. For example, typically 0:00-4:00, 12:00-13:00, and 23:00-24:00 each day. If the firmware's estimated update time is 2 hours, then 0:00-4:00 is determined as the estimated update time period. If the firmware's estimated update time is 4.5 hours, and the update cannot be completed within one day, considering that 23:00-24:00 on the first day and 0:00-4:00 on the second day are consecutive time periods, then 23:00-4:00 can also be determined as the estimated update time period.

[0045] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0046] In the second embodiment, a firmware upgrade / downgrade device is provided, applied to a firmware upgrade / downgrade system, the firmware upgrade / downgrade system including a server, such as... Figure 3 As shown, the firmware upgrade / downgrade device connects to the server via a universal serial bus interface located on the server, such as... Figure 4 As shown, the firmware upgrade / downgrade device includes: a core controller module, used to establish a connection between the firmware upgrade / downgrade device and the server through the integrated circuit bus signal in the universal serial bus interface, used to monitor the server information fed back by the integrated circuit bus in real time, wherein the server information includes voltage information, used to convert the real-time acquired server information into data, and transmit the server information to the graphics data controller; a graphics data controller module, used to receive the server information transmitted by the core controller module, and after converting and processing the server information, transmit it to the graphics data display module; a graphics data display module, used to display the server information transmitted by the graphics data controller; a universal serial bus interface on the firmware upgrade / downgrade device side, used to output the server information acquired by the core controller module to an external receiving end or local storage space in real time, used for troubleshooting the core controller module, and for driver debugging and burning; a universal serial bus module, used to convert the asynchronous serial signal of the core controller into a universal serial signal, and report the core controller information to the server through the universal serial bus interface; as shown. Figure 5As shown, the power module converts the voltage obtained through the universal serial bus connector into the operating voltage of other modules in the firmware upgrade / downgrade device; the first storage module stores multiple firmware files corresponding to the firmware; the second storage module caches working data in real time while the core controller module is working, and stores the firmware files obtained by the core controller module from the first storage module during the firmware upgrade / downgrade process, so that the server baseboard management controller can perform upgrade / downgrade based on the firmware files in the second storage module; the button module switches the upgrade / downgrade mode of the core controller module; the light group module displays the current status of the firmware upgrade / downgrade device. When the firmware upgrade / downgrade device is working, green indicates that the firmware upgrade / downgrade device is working normally, and red indicates that the firmware upgrade / downgrade device has malfunctioned. When the firmware upgrade / downgrade is completed, green indicates that the firmware upgrade / downgrade was successful, and red indicates that the firmware upgrade / downgrade failed. When the firmware upgrade / downgrade device is only used to display server information, green indicates that the server is working, red indicates that the server is faulty, and off indicates that the firmware upgrade / downgrade device is in standby or non-powered state.

[0047] Table 1 Configuration information in the first storage module

[0048]

[0049] ① The Head and Magic Num fields mark the beginning and end of the configuration information, respectively. A 4-byte check ensures that the first storage module has correctly burned the firmware information. ② The Version field contains the version information of the configuration information. The baseboard management controller program checks the version in the configuration information. When the configuration information space changes, it adapts and is compatible with lower version configuration spaces through the version information. ③ The Type field is used to further identify the firmware information, achieving accurate adaptation to various firmware scenarios.

[0050] Table 2. Meaning of different bit positions in the Type field

[0051]

[0052] Bit0: Check if the firmware has been signed. If signed, the signature's validity needs to be verified again. Bit1: The baseboard management controller's internal storage module uses the low byte by default. This bit is used to adjust the byte order of the information read by the firmware. Bit2: The baseboard management controller has both primary and backup storage modules. This bit is used to determine the target storage module location for firmware upgrades. Bit3: Used to confirm whether the system needs to be restarted after the firmware upgrade.

[0053] ④ Chip field: This information is configured to notify the baseboard management controller which memory chip in the basic input / output system, baseboard management controller, and programmable logic controller should be upgraded; ⑤ Public Key field and Md5 field: The public key and message digest algorithm are used to verify the legality and integrity of the firmware; ⑥ Data Loc field and Data Length field: These two fields are used to locate the position and size of the firmware in the storage module.

[0054] In practical implementation, after the baseboard management controller completes the mounting of the first storage module via the universal serial link, it reads the first 46 bytes of the first storage module as configuration information. The baseboard management controller program completes the initialization operation before firmware upgrade by parsing the configuration information. The baseboard management controller reads the firmware content through the firmware's location information, decrypts the firmware using the public key to ensure the data source is normal, and decrypts the firmware again using the baseboard management controller's private key to ensure that the firmware has not been illegally tampered with and to guarantee the firmware's legitimacy. By performing a message digest algorithm verification on the firmware and comparing it with the standard value in the configuration information, the integrity of the firmware data is ensured, and data burning anomalies during the firmware burning process are avoided.

[0055] For specific limitations regarding the firmware upgrade / downgrade device, please refer to the limitations of the firmware upgrade / downgrade method above, which will not be repeated here. Each module in the aforementioned firmware upgrade / downgrade device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in the electronic device, or stored in software in the memory of the electronic device, so that the processor can call and execute the corresponding operations of each module.

[0056] In a third embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps: determining whether a server is powered on; in response to the server being powered on, performing two-way authentication on the server and a firmware upgrade / downgrade device to obtain a two-way authentication result; in response to a successful two-way authentication result, determining the upgrade / downgrade mode of the firmware upgrade / downgrade device, wherein the upgrade / downgrade mode includes at least an automatic mode and a manual mode; in response to the upgrade / downgrade mode being automatic, obtaining the current version number of the firmware and generating an upgrade instruction based on the current version number, or determining the current running state of the firmware and generating a downgrade instruction based on the current running state, wherein the upgrade instruction and downgrade instruction include at least a target version number of the firmware; in response to the upgrade / downgrade mode being manual, receiving a user instruction and generating an upgrade instruction or a downgrade instruction based on the user instruction; and performing a corresponding upgrade or downgrade operation on the firmware based on the upgrade instruction or downgrade instruction to change the current version number of the firmware to the target version number.

[0057] When the program instructions are read and executed by one or more processors, they can also perform operations corresponding to the steps in the above method embodiments, as described above, and will not be repeated here. Reference Figure 6 This exemplifies the architecture of an electronic device, which may include a processor 610, a video display adapter 611, a disk drive 612, an input / output interface 613, a network interface 614, and a memory 620. The processor 610, video display adapter 611, disk drive 612, input / output interface 613, network interface 614, and memory 620 can communicate with each other via a communication bus 630.

[0058] The processor 610 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to achieve the technical solution provided in this application.

[0059] The memory 620 can be implemented as a read-only memory (ROM), random access memory (RAM), static storage device, dynamic storage device, etc. The memory 620 can store an operating system 621 for controlling the operation of the electronic device 600, and a basic input / output system (BIOS) 622 for controlling the low-level operations of the electronic device 600. Additionally, it can store a web browser 623, data storage management 624, and an icon / font processing system 625, etc. The aforementioned icon / font processing system 625 can be the application program that specifically implements the aforementioned steps in this embodiment. In summary, when implementing the technical solution provided in this application through software or firmware, the relevant program code is stored in the memory 620 and executed by the processor 610.

[0060] Input / output interface 613 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, speakers, vibrators, indicator lights, etc.

[0061] Network interface 614 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0062] Bus 630 includes a pathway for transmitting information between various components of the device, such as processor 610, video display adapter 611, disk drive 612, input / output interface 613, network interface 614, and memory 620.

[0063] In addition, the electronic device 600 can also obtain information on specific claim conditions from a virtual resource object claim condition information database (not shown in the figure) for use in condition judgment.

[0064] It should be noted that although the above-described electronic device 600 only shows a processor 610, a video display adapter 611, a disk drive 612, an input / output interface 613, a network interface 614, a memory 620, and a bus 630, in specific implementations, the electronic device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the solution of this application, and does not necessarily include all the components shown in the figures.

[0065] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause an electronic device (which may be a personal computer, cloud server, or network device, etc.) to execute the methods of various embodiments or some parts of the embodiments of this application.

[0066] In a fourth embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it performs the following steps: determining whether the server is powered on; in response to the server being powered on, performing two-way authentication on the server and the firmware upgrade / downgrade device, and obtaining a two-way authentication result; in response to the two-way authentication result being successful, determining the upgrade / downgrade mode of the firmware upgrade / downgrade device, wherein the upgrade / downgrade mode includes at least an automatic mode and a manual mode; in response to the upgrade / downgrade mode being automatic, obtaining the current version number of the firmware and generating an upgrade instruction for the firmware based on the current version number, or determining the current running state of the firmware and generating a downgrade instruction for the firmware based on the current running state, wherein the upgrade instruction and the downgrade instruction include at least the target version number of the firmware; in response to the upgrade / downgrade mode being manual, receiving a user instruction and generating an upgrade instruction or a downgrade instruction for the firmware based on the user instruction; and performing a corresponding upgrade operation or downgrade operation on the firmware based on the upgrade instruction or the downgrade instruction for the firmware to change the current version number of the firmware to the target version number.

[0067] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0068] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0069] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application.

[0070] In a fifth embodiment, a computer program product is provided, on which a computer program is stored. When the computer program is executed by a processor, it performs the following steps: determining whether the server is powered on; in response to the server being powered on, performing two-way authentication on the server and the firmware upgrade / downgrade device, and obtaining a two-way authentication result; in response to the two-way authentication result being successful, determining the upgrade / downgrade mode of the firmware upgrade / downgrade device, wherein the upgrade / downgrade mode includes at least an automatic mode and a manual mode; in response to the upgrade / downgrade mode being an automatic mode, obtaining the current version number of the firmware and generating an upgrade instruction for the firmware based on the current version number, or determining the current running state of the firmware and generating a downgrade instruction for the firmware based on the current running state, wherein the upgrade instruction and the downgrade instruction include at least the target version number of the firmware; in response to the upgrade / downgrade mode being a manual mode, receiving a user instruction and generating an upgrade instruction or a downgrade instruction for the firmware based on the user instruction; and performing a corresponding upgrade operation or downgrade operation on the firmware based on the upgrade instruction or the downgrade instruction for the firmware to change the current version number of the firmware to the target version number.

[0071] In a fifth embodiment, a computer program product is also provided, including a non-volatile computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it performs the following steps: determining whether the server is powered on; in response to the server being powered on, performing two-way authentication on the server and the firmware upgrade / downgrade device, and obtaining a two-way authentication result; in response to the two-way authentication result being successful, determining the upgrade / downgrade mode of the firmware upgrade / downgrade device, wherein the upgrade / downgrade mode includes at least an automatic mode and a manual mode; in response to the upgrade / downgrade mode being automatic, obtaining the current version number of the firmware and generating an upgrade instruction for the firmware based on the current version number, or determining the current running state of the firmware and generating a downgrade instruction for the firmware based on the current running state, wherein the upgrade instruction and the downgrade instruction include at least a target version number of the firmware; in response to the upgrade / downgrade mode being manual, receiving a user instruction and generating an upgrade instruction or a downgrade instruction for the firmware based on the user instruction; and performing a corresponding upgrade operation or downgrade operation on the firmware based on the upgrade instruction or the downgrade instruction to change the current version number of the firmware to the target version number.

[0072] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer program product, and when the computer program is executed, it can include the processes of the embodiments of the methods described above.

[0073] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0074] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application.

Claims

1. A firmware upgrade / downgrade method, applied to a firmware upgrade / downgrade device, wherein the firmware upgrade / downgrade device is connected to a server, characterized in that, The method includes: Determine whether the server is powered on; In response to the server being powered on, two-way authentication is performed on the server and the firmware upgrade / downgrade device to obtain the two-way authentication result; In response to the successful authentication result of the two-way authentication, the upgrade / downgrade mode of the firmware upgrade / downgrade device is determined, wherein the upgrade / downgrade mode includes at least an automatic mode and a manual mode; In response to the upgrade / downgrade mode being automatic, the current version number of the firmware is obtained, and an upgrade instruction for the firmware is generated based on the current version number; or the current running state of the firmware is determined, and a downgrade instruction for the firmware is generated based on the current running state, wherein the upgrade instruction and the downgrade instruction at least include the target version number of the firmware. In response to the upgrade / downgrade mode being manual mode, the system receives user instructions and generates firmware upgrade instructions or firmware downgrade instructions based on the user instructions. According to the firmware upgrade instruction or the firmware downgrade instruction, perform the corresponding upgrade operation or downgrade operation on the firmware to change the current version number of the firmware to the target version number; The step of determining the current running state of the firmware and generating a downgrade instruction for the firmware based on the current running state includes: Determine the current running state of the firmware; In response to a compatibility error or stability problem occurring in the current operating state, the current version number of the firmware in the server and the firmware version information library in the firmware upgrade / downgrade device are obtained. The version information library includes at least multiple firmware files of the firmware and a downgrade policy flag of the firmware. The value of the downgrade policy flag includes at least a first target value and a second target value. The target version number is determined based on the current version number and the downgrade strategy flag, wherein the target version number is less than the current version number; The target version number is compared with the version numbers corresponding to the plurality of firmware files to obtain the target firmware file corresponding to the target version number; The firmware downgrade instruction is generated based on the target firmware file.

2. The method according to claim 1, characterized in that, The step of determining whether the server is powered on includes: Obtain the current voltage value of the server and compare the current voltage value with a preset voltage range, wherein the preset voltage range includes at least a first voltage range, a second voltage range, and a third voltage range; In response to the current voltage value being within a first voltage range, it is determined that the server is in a power-on state; In response to the current voltage value being within the second voltage range, it is determined that the server is in standby mode; In response to the current voltage value being within the third voltage range, it is determined that the server is in a power-off state or a fault state.

3. The method according to claim 1, characterized in that, The step of performing two-way authentication on the server and the firmware upgrade / downgrade device to obtain the two-way authentication result includes: Generate a server authentication command and send the server authentication command to the server, while simultaneously receiving a device authentication command generated by the server; The device authentication is performed according to the device authentication instruction, the device authentication result is obtained, and the device authentication result is returned to the server. At the same time, the server authentication result returned by the server is received. Since both the device authentication result and the server authentication result are successful, the two-way authentication result is determined to be successful. In response to the failure of the device authentication result and / or the server authentication result, the two-way authentication result is determined to be an authentication failure.

4. The method according to claim 1, characterized in that, Determining the upgrade / downgrade mode of the firmware upgrade / downgrade device includes: Obtain the upgrade / downgrade mode flag in the firmware upgrade / downgrade device, wherein the value of the upgrade / downgrade mode flag includes at least a first target value and a second target value; In response to the value of the upgrade / downgrade mode flag being a first target value, the upgrade / downgrade mode of the firmware upgrade / downgrade device is determined to be automatic mode; In response to the value of the upgrade / downgrade mode flag being a second target value, the upgrade / downgrade mode of the firmware upgrade / downgrade device is determined to be manual mode.

5. The method according to claim 1, characterized in that, The step of obtaining the current version number of the firmware and generating the firmware upgrade instruction based on the current version number includes: Obtain the current version number of the firmware in the server and the firmware version information database in the firmware upgrade / downgrade device, wherein the version information database includes at least multiple firmware files of the firmware and the upgrade strategy flag of the firmware, and the value of the upgrade strategy flag includes at least a first target value and a second target value. The target version number is determined based on the current version number and the upgrade strategy flag, wherein the target version number is greater than the current version number; The target version number is compared with the version numbers corresponding to the plurality of firmware files to obtain the target firmware file corresponding to the target version number; The firmware upgrade instructions are generated based on the target firmware file.

6. The method according to claim 5, characterized in that, The step of determining the target version number based on the current version number and the upgrade strategy flag includes: In response to the upgrade strategy flag being set to a first target value, the firmware version upgrade strategy is determined to be a step-by-step upgrade, and the next-level version number of the current firmware version number is determined as the target version number; In response to the upgrade strategy flag being set to a second target value, the firmware version upgrade strategy is determined to be a cross-level upgrade, and the latest version number of the firmware is determined as the target version number.

7. The method according to claim 1, characterized in that, Determining the target version number based on the current version number and the downgrade policy flag includes: In response to the value of the downgrade strategy flag being a first target value, the firmware version downgrade strategy is determined to be a step-by-step downgrade, and the previous first-level version number of the current firmware version number is determined as the target version number. In response to the value of the downgrade policy flag being a second target value, the firmware version downgrade policy is determined to be prohibited from downgrading, and an alarm message is generated indicating that the server has encountered a compatibility error or stability problem.

8. The method according to claim 1, characterized in that, The value of the degradation strategy flag includes at least a third target value, and the method further includes: In response to the value of the downgrade strategy flag being a third target value, the firmware version downgrade strategy is determined to be a cross-level downgrade, and the previous first-level version number of the current firmware version number is determined as the first intermediate version number. The firmware is downgraded based on the first intermediate version number, and the current running status of the firmware is determined. In response to a compatibility error or stability issue occurring in the current operating state, the old first-level version number of the firmware's first intermediate version number is determined as the second intermediate version number; The firmware is downgraded based on the second intermediate version number, and the current running status of the firmware is determined. In response to the current operating state being normal, the second intermediate version number is determined as the target version number; In response to a compatibility error or stability issue in the current operating state, the old first-level version number of the second intermediate version number of the firmware is determined as the third intermediate version number, and the firmware is downgraded according to the third intermediate version number until the current operating state of the firmware is normal.

9. The method according to claim 8, characterized in that, The step of downgrading the firmware based on the first intermediate version number includes: The first intermediate version number is compared with the version numbers corresponding to the plurality of firmware files to obtain the first intermediate firmware file corresponding to the first intermediate version number; Based on the first intermediate firmware file, generate the first downgrade instruction for the firmware; According to the first downgrade instruction of the firmware, the corresponding downgrade operation is performed on the firmware to change the current version number of the firmware to the first intermediate version number.

10. The method according to claim 1, characterized in that, The step of generating the firmware upgrade instruction or the firmware downgrade instruction according to the user instruction includes: Obtain the target version number in the user instruction and the firmware version information library in the firmware upgrade / downgrade device, wherein the version information library includes at least a plurality of firmware files of the firmware. The target version number is compared with the version numbers corresponding to the plurality of firmware files to obtain the target firmware file corresponding to the target version number; Based on the target firmware file, generate upgrade instructions or downgrade instructions for the firmware.

11. The method according to claim 10, characterized in that, The step of generating upgrade instructions or downgrade instructions for the firmware based on the target firmware file includes: Obtain the current version number of the firmware and compare the current version number with the target version number; In response to the current version number being less than the target version number, an upgrade instruction for the firmware is generated based on the target firmware file; In response to the current version number being greater than the target version number, a firmware downgrade instruction is generated based on the target firmware file.

12. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the firmware upgrade / downgrade method as described in any one of claims 1 to 11 when executing the computer program.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the firmware upgrade / downgrade method as described in any one of claims 1 to 11.

14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the firmware upgrade / downgrade method as described in any one of claims 1 to 11.

Citation Information

Patent Citations

  • Firmware upgrading method, system and device and medium

    CN117453260A

  • Method and device for upgrading software version of power distribution network robot and electronic equipment

    CN120447931A