Firmware upgrade method, computer program product, device and storage medium

By judging and switching link status during firmware upgrade process, the problem of integrating burn APIs in the existing technology increases development difficulty and cost, and a more stable and reliable firmware upgrade process is achieved.

CN119127265BActive Publication Date: 2025-02-25INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411606230.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-02-25
Estimated Expiration
2044-11-12

AI Technical Summary

Technical Problem

The existing technology needs to integrate the burn API of each chip during the firmware upgrade process, which increases the development difficulty and cost, and cannot effectively avoid the risks of data loss and system downtime.

Method used

By judging the link status between the main control chip and the external chip, if the link is idle, add the link and switch to another link, allowing the substrate management controller to directly access the external chip for firmware upgrade, avoiding dependence on different Chip burn API.

Benefits of technology

It improves the stability and reliability of firmware upgrades, reduces the difficulty of code development and product costs, and avoids the risks of data loss and system downtime.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127265B_ABST
    Figure CN119127265B_ABST
Patent Text Reader

Abstract

The present application relates to a firmware upgrade method, computer program product, device and storage medium. The method includes obtaining the state of the first link in response to receiving a first firmware upgrade signal, the first link connecting the main control chip and the external chip of the main control chip; if the first link is in an idle state, the first link is locked and a second firmware upgrade signal is returned to the baseboard management controller; in response to the baseboard management controller receiving the second firmware upgrade signal, the baseboard management controller controls the main control chip to send a first control signal to the multiplexer to control the multiplexer to switch to the second link, the second link connecting the baseboard management controller and the external chip of the main control chip; the baseboard management controller obtains the configuration file in the external chip through the second link to perform a firmware upgrade, and the configuration file includes a burning code. The use of this method can improve the reliability of firmware upgrades.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of chip upgrade technology, and in particular to a firmware upgrade method, computer program product, device and storage medium. Background Art

[0002] With the development of society, informatization has gradually covered all areas of society. As a carrier of data processing and data storage, the server is also highly integrated internally. In order to achieve a certain function, discrete devices are usually not used to build modules, but integrated chips are used with simple peripherals to achieve it. Usually, these dedicated chips have more complex functions or customizable functions, so they are externally equipped with EEPROM (electrically erasable programmable read-only memory) or FLASH (electrically erasable programmable read-only memory) to store configuration files or firmware for startup or work calls. However, when the configuration file or firmware needs to be adjusted or modified, the configuration file or firmware needs to be upgraded.

[0003] In the related technology, the serial port or interface of these chips is usually used to call the chip's special burning program to modify or upgrade, or the BMC is connected to a dedicated chip, and the modified configuration file or firmware is first pushed to the chip's RAM (random access memory) through I2C, and then the chip's burning API (application programming interface) is called to burn the configuration file or firmware in the RAM to the chip's EEPROM or FLASH. However, each chip has a specific burning API. In order to burn different chips, the BMC needs to integrate the burning APIs of various chips in the code, which not only increases the difficulty of BMC development, but also the generated BMC burning file is also very large, requiring the BMC to be configured with a larger external FLASH to store the firmware, greatly increasing the cost of the product. Summary of the invention

[0004] Based on this, it is necessary to provide a firmware upgrade method, computer program product, device and storage medium that can improve the reliability of firmware upgrade in order to solve the above technical problems.

[0005] In order to solve the above technical problems, in a first aspect, a firmware upgrade method is provided, the method comprising:

[0006] In response to receiving the first firmware upgrade signal, obtaining the state of the first link, the first link connecting the main control chip and the external chip of the main control chip;

[0007] If the first link is in an idle state, locking the first link and returning a second firmware upgrade signal to the baseboard management controller;

[0008] In response to the baseboard management controller receiving the second firmware upgrade signal, the baseboard management controller controls the main control chip to send a first control signal to the multiplexer to control the multiplexer to switch to the second link, and the second link conducts the baseboard management controller and the external chip of the main control chip;

[0009] The baseboard management controller obtains the configuration file in the external chip through the second link to perform firmware upgrade, and the configuration file includes the burning code.

[0010] In one embodiment, in response to receiving the first firmware upgrade signal, obtaining the state of the first link includes:

[0011] In response to the baseboard management controller receiving the firmware upgrade request, the baseboard management controller sends a first firmware upgrade signal to the main control chip, where the first firmware upgrade signal is a low level signal;

[0012] In response to the main control chip receiving the first firmware upgrade signal, determining whether there is data to be transmitted on the first link;

[0013] If the first link has data to transmit, the first link is considered to be in working state;

[0014] If the first link has no data to transmit, it is considered that the first link is in an idle state.

[0015] In one embodiment, if the first link is in an idle state, locking the first link and returning a second firmware upgrade signal to the baseboard management controller includes:

[0016] If the first link is in an idle state, a locking instruction is triggered to lock the first link so that the first link remains in an idle state within a preset time period, and a second firmware upgrade signal is returned to the baseboard management controller, where the second firmware upgrade signal is a high level signal.

[0017] In one embodiment, the second link includes a second transmission line and a third transmission line. In response to the baseboard management controller receiving the second firmware upgrade signal, the baseboard management controller controls the main control chip to send a first control signal to the multiplexer to control the multiplexer to switch to the second link. The external chip that connects the baseboard management controller and the main control chip through the second link includes:

[0018] In response to the baseboard management controller receiving the second firmware upgrade signal returned by the main control chip, the baseboard management controller sends a first control signal to the multiplexer, where the first control signal is a high level signal;

[0019] In response to the multiplexer receiving the first control signal, the multiplexer switches to the second transmission line corresponding to the second pin, so that the baseboard management controller transmits data with the external chip of the main control chip through the second transmission line and the third transmission line.

[0020] In one embodiment, the baseboard management controller obtains the configuration file in the external chip through the second link to perform firmware upgrade, including:

[0021] In response to the baseboard management controller acquiring the configuration file in the external chip, the configuration file is parsed to obtain firmware upgrade data and burning code;

[0022] Perform firmware upgrade based on firmware upgrade data and burning code.

[0023] In one embodiment, the first link includes a first transmission line and a third transmission line, and after the baseboard management controller obtains the configuration file in the external chip through the second link to perform a firmware upgrade, the following steps are performed:

[0024] In response to the baseboard management controller performing a firmware upgrade on the configuration file in the plug-in chip, the baseboard management controller sends a second control signal to the multiplexer, where the second control signal is a low level signal;

[0025] In response to the multiplexer receiving the second control signal, the multiplexer switches to the first transmission line corresponding to the first pin, so that the main control chip transmits data with the external chip of the main control chip through the first transmission line and the third transmission line.

[0026] In one embodiment, there are multiple firmware upgrade requests, and the method further includes:

[0027] Generate a timestamp according to the generation time of each firmware upgrade request;

[0028] Obtain a configuration file download package and a firmware upgrade request level carried by each firmware upgrade request, wherein the configuration file download package includes a configuration file start position and a configuration file length;

[0029] Determine the firmware upgrade comprehensive priority of each firmware upgrade request according to a preset comprehensive priority calculation formula, a timestamp, a firmware upgrade request level, a configuration file start position, and a configuration file length;

[0030] Each firmware upgrade request is sent to a baseboard management controller for processing according to the level of the firmware upgrade comprehensive priority of each firmware upgrade request.

[0031] In one embodiment, determining the firmware upgrade comprehensive priority of each firmware upgrade request according to a preset comprehensive priority calculation formula, a timestamp, a firmware upgrade request level, a configuration file start position, and a configuration file length includes:

[0032] Obtain a first weight value corresponding to the timestamp, a second weight value corresponding to the start position of the configuration file, and a third weight value corresponding to the length of the configuration file;

[0033] Calculate the firmware upgrade comprehensive priority of each firmware upgrade request based on a preset comprehensive priority calculation formula, a first weight value, a firmware upgrade request level, a second weight value, and a third weight value;

[0034] The preset comprehensive priority calculation formula is as follows:

[0035] ,

[0036] in, represents the comprehensive firmware upgrade priority corresponding to the i-th firmware upgrade request, represents the first weight value corresponding to the i-th firmware upgrade request, Indicates the firmware upgrade request level corresponding to the i-th firmware upgrade request, represents the second weight value corresponding to the i-th firmware upgrade request, represents the third weight value corresponding to the i-th firmware upgrade request, and n is the total number of firmware upgrade requests.

[0037] In one embodiment, sending each firmware upgrade request to the baseboard management controller for processing according to the level of the firmware upgrade comprehensive priority of each firmware upgrade request includes:

[0038] Adding each firmware upgrade request to a processing queue according to the level of each firmware upgrade comprehensive priority, wherein the firmware upgrade request with a high firmware upgrade comprehensive priority level is located at the head of the processing queue, and the firmware upgrade request with a low firmware upgrade comprehensive priority level is located at the tail of the processing queue;

[0039] Each firmware upgrade request is sent to the baseboard management controller for processing in sequence according to the order of each firmware upgrade request in the processing queue.

[0040] In one embodiment, the configuration file includes a first configuration file and a second configuration file, and the method includes:

[0041] Obtain firmware upgrade data, perform hash calculation on the firmware upgrade data, and obtain a target hash value;

[0042] Selecting a target hash value within a preset range as a secret key, encrypting the firmware upgrade data based on the secret key, and obtaining a first configuration file;

[0043] Obtain the burning code, divide the burning code, and obtain multiple burning code segments;

[0044] Use the signature tool to generate a digital signature for each burned code segment;

[0045] Assigning an authentication function to each burning code segment, and encapsulating each burning code segment and a data signature of each burning code to obtain a second configuration file;

[0046] Obtaining the secret key, the data signature, and the first value of the authentication function respectively, and generating a configuration file identifier according to the product of the secret key, the data signature, and the first value of the authentication function;

[0047] The first configuration file and the second configuration file are combined into a configuration file, and the configuration file and the configuration file identifier are written into the upgrade area of ​​the plug-in chip.

[0048] In one embodiment, the plug-in chip further includes an encryption area, the encryption area includes a first encryption area and a second encryption area, and the method further includes:

[0049] Obtaining a secret key corresponding to the firmware upgrade data, and storing the secret key corresponding to the firmware upgrade data in the first encryption area;

[0050] The data signature and the authentication function corresponding to each burning code segment are obtained, and the data signature and the authentication function corresponding to each burning code segment are stored in the second encryption area.

[0051] In one of the embodiments, the baseboard management controller obtains the configuration file in the external chip through the second link to perform firmware upgrade, further comprising:

[0052] The baseboard management controller obtains the secret key corresponding to the firmware upgrade data, the data signature corresponding to each burned code segment, and the authentication function from the encryption area of ​​the external chip;

[0053] Obtain the secret key, the data signature, and the first value of the authentication function respectively, calculate the product of the secret key, the data signature, and the first value of the authentication function, and generate a check value;

[0054] Get the configuration file identifier and determine whether the configuration file identifier is consistent with the verification value;

[0055] If they are consistent, the configuration file verification is considered successful, and the baseboard management controller performs a firmware upgrade according to the configuration file.

[0056] In order to solve the above technical problem, in a second aspect, a computer program product is provided, including a computer program, characterized in that when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0057] In order to solve the above technical problem, in the third aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: the processor implements the steps of the method described in the first aspect when executing the computer program.

[0058] In order to solve the above technical problem, in a fourth aspect, the present application 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 method described in the first aspect are implemented.

[0059] Different from the related art, in this application, in response to receiving the first firmware upgrade signal, the state of the first link is obtained; if the first link is in an idle state, the first link is locked, the first link conducts the main control chip and the external chip of the main control chip, and returns the second firmware upgrade signal to the baseboard management controller; in response to the baseboard management controller receiving the second firmware upgrade signal, the baseboard management controller controls the main control chip to send a first control signal to the multiplexer to control the multiplexer to switch to the second link, and the second link conducts the baseboard management controller and the external chip of the main control chip; the baseboard management controller obtains the configuration file in the external chip through the second link to perform firmware upgrade, and the configuration file includes the burning code. In this way, by first judging the state of the first link and then controlling the multiplexer to switch different links when the first link is in an idle state, the stability of the firmware upgrade can be improved, and the configuration file in the external chip can be obtained for firmware upgrade, which can avoid integrating the burning API of different main control chips in the baseboard management controller, greatly reducing the difficulty of code development, and the method of this application can improve the reliability of firmware upgrade. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 It is a structural diagram of firmware upgrade in the related art;

[0061] Figure 2 It is a structural diagram of firmware upgrade in another related technology;

[0062] Figure 3 A schematic diagram of a firmware upgrade structure in an embodiment;

[0063] Figure 4 It is a structural schematic diagram of firmware upgrade in another embodiment;

[0064] Figure 5 It is a structural diagram of firmware upgrade in another embodiment;

[0065] Figure 6 A flowchart of a firmware upgrade method in an embodiment;

[0066] Figure 7 is a structural block diagram of a firmware upgrade device in an embodiment;

[0067] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

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

[0069] With the development of society, informatization has gradually covered all areas of society. People's daily lives are increasingly inseparable from information and data. Especially with the development of cloud computing, big data, and AI, the information explosion requires servers as carriers for data processing and data storage. The server is also highly integrated. In order to achieve a certain function, discrete devices are usually not used to build modules, but integrated chips are used with simple peripherals to achieve it. For example, if you want to realize the PCIE to USB function, use the PCIE to USB Controller chip (PCIE interface control chip); if you want to expand PCIE, use the PCIE Switch chip (FCIE switch chip); if you want to achieve SAS expansion, use the SAS Expander chip (SAS expansion chip), etc. Usually these dedicated chips or MCUs (microcontroller units) have more complex functions or customizable functions, so they will be externally equipped with EEPROM (electrically erasable programmable read-only memory) or FLASH (electrically erasable programmable read-only memory) to store configuration files or firmware for startup or work. The configuration files or firmware can be customized, and they also need to be adjusted and modified when there are problems, so they have to face the problem of upgrading the configuration files or firmware.

[0070] See also Figure 1,Related technology 1: On the PCB (printed circuit board), the IC main control chip is connected to the external EEPROM (electrically erasable programmable read-only memory) chip through I2C, or connected to the external FLASH (electrically erasable programmable read-only memory) chip through SPI (serial peripheral interface). The EEPROM or FLASH chip stores the configuration file or firmware of the IC main control chip. In the field environment, connect the computer through the serial port tool or JTAG burner at one end, and connect the UART (a universal serial data bus) or JTAG interface (a serial interface standard) of the IC main control chip at the other end. The configuration file or firmware in the EEPROM or FLASH outside the IC main control chip can be updated through the burning program on the computer.

[0071] However, the implementation method of the above-mentioned related technology 1 can only implement firmware upgrades in the on-site environment, and cannot be upgraded remotely. It also relies on the burning program on the computer. The burning programs of different IC master controllers are different, and it is necessary to switch between different burning programs, which affects the timeliness of burning and is inefficient.

[0072] See also Figure 2 ,Related technology 2: On the PCB (printed circuit board), the IC main control chip is connected to the external EEPROM chip through I2C, or to the external FLASH chip through SPI. The EEPROM or FLASH chip stores the configuration file or firmware of the IC main control chip. In addition, the BMC (baseboard management controller) on the PCB is also interconnected with the IC main control chip through I2C. You can log in to the BMC remotely, and then push the modified configuration file or firmware to the RAM of the IC main control chip through the BMC's I2C. Then the BMC code calls the chip's burning API to burn the configuration file or firmware in the RAM to the chip's EEPROM or SPI FLASH through I2C or SPI.

[0073] However, in the implementation of the above-mentioned related technology 2, each chip has a specific burning API. In order to burn different chips, the BMC needs to integrate the burning APIs of various chips in the code, which increases the difficulty of BMC development; and because the burning APIs of various chips need to be integrated, the generated BMC burning file is very large, and the BMC needs to be configured with a larger external FLASH to store the firmware, which greatly increases the cost of the product.

[0074] That is, in the related art, there are two ways to upgrade the configuration files or firmware of these MCUs or dedicated chips. The first is to call the chip's dedicated burning program through the uart serial port or Jtag interface of these chips to modify or upgrade, but this method is only suitable for the on-site environment and not suitable for remote upgrades. The second method is that the BMC has an I2C connection to the MCU or dedicated chip, first push the modified configuration file or firmware to the chip's RAM through I2C, and then call the chip's burning API to burn the configuration file or firmware in the RAM to the chip's EEPROM or SPI FLASH. Although this method does not require an on-site environment and can be upgraded remotely through the BMC, each chip has a specific burning API. In order to burn different chips, the BMC needs to integrate the burning APIs of various chips in the code, which not only increases the difficulty of BMC development, but also the generated BMC burning file is also very large, requiring the BMC to be configured with a larger external FLASH to store the firmware, greatly increasing the cost of the product.

[0075] In order to solve the above technical problems, in one embodiment, the present application provides a firmware upgrade device, specifically Figure 3 , Figure 3 The firmware upgrade device provided in the invention includes a main control chip (IC main control), a baseboard management controller (BMC), a multiplexer (MUX) and an EEPROM (electrically erasable programmable read-only memory). The main control chip is connected to the baseboard management controller. The first end of the multiplexer is connected to the main control chip and the baseboard management controller through a transmission line (I2C), and the second end of the multiplexer is connected to an external chip (EEPROM) of the main control chip through a transmission line (I2C).

[0076] See also Figure 4 , Figure 4 The firmware upgrade device provided in the invention includes a main control chip (IC main control), a baseboard management controller (BMC), a multiplexer (MUX) and FLASH (electrically erasable programmable read-only memory). The main control chip is connected to the baseboard management controller. The first end of the multiplexer is connected to the main control chip and the baseboard management controller through a transmission line (SPI), and the second end of the multiplexer is connected to an external chip (FLASH) of the main control chip through a transmission line (SPI).

[0077] Understandably, Figure 3 as well as Figure 4 This is to distinguish different types of plug-in chips. Figure 3 as well as Figure 4It can be seen that different external chips correspond to different transmission lines, but the operating principles of firmware upgrades are the same. They all transmit signals between the main control chip and the baseboard manager, perform logical judgment, and control the multiplexer to switch the transmission lines, and then obtain the configuration file or firmware stored in the external chip for startup or work, and perform firmware upgrades based on the obtained configuration file or firmware.

[0078] In a specific implementation, if the external chip of the IC master is an EEPROM, that is, Figure 3 As shown, there is an I2C bus between the main control chip and the EEPROM, and a MUX (multiplexer) is added between the EEPROM and the main control chip. The first end of the EEPROM chip is connected to the second end of the MUX through the third transmission line (I2C), and the first end of the MUX is connected to the main control chip and the baseboard management controller through the first transmission line and the second transmission line respectively. This MUX is a 2 to 1 MUX, and the multiplexer can realize the switching between the first transmission line and the second transmission line on the side of the multiplexer close to the baseboard management controller and the main control chip, that is, the I2C on the left side of the selector in the figure (the I2C line between the IC master and the MUX or the I2C line between the BMC and the MUX) is switched to the I2C on the right side (the third transmission line to connect the multiplexer to the external chip), and the MUX can only switch one I2C Master at the same time.

[0079] If the IC main control plug-in chip is FLASH, that is, Figure 4 As shown, the transmission line between the main control chip and FLASH is an SPI bus, and a MUX is added between FLASH and the main control chip. The first end of the FLASH chip is connected to the second end of the MUX through the third transmission line (SPI), and the first end of the MUX is connected to the main control chip and the baseboard management controller through the first transmission line and the second transmission line respectively. This MUX is also a 2 to 1 MUX. The multiplexer can realize the switching between the first transmission line and the second transmission line on the side of the multiplexer close to the baseboard management controller and the main control chip, that is, the SPI on the left side of the selector in the figure (the SPI line between the IC main control and the MUX or the SPI line between the BMC and the MUX) is switched to the SPI on the right side (the third transmission line to connect the multiplexer to the external chip).

[0080] There are two GPIO interactions between BMC and the main control chip. The first firmware upgrade signal UPDATE_EN_N (valid at low level, high level by default) sent by BMC to IC main control is used to inform the I2C main control chip that the configuration file or firmware of the main control chip will be upgraded through BMC. The main control chip returns the second firmware upgrade signal UPDATE_LOCK (valid at high level, low level by default) to BMC. The function is that after the main control chip receives the UPDATE_EN_N sent by BMC and becomes low level, it will stop accessing and reading the peripheral EEPROM or FLASH to ensure that the I2C or SPI bus is locked to the idle state, where the idle state refers to the state of the system or device when it is not performing any tasks, that is, it is in an idle or unused state. Next, the second firmware upgrade signal UPDATE_LOCK signal returned to BMC becomes high level. The purpose of this design is to enhance the stability and reliability of BMC firmware upgrades and ensure that the I2C or SPI bus that the IC main control chip uses to access EEPROM or FLASH is in idle state and locked. Only then is the BMC allowed to switch the MUX channel, thus avoiding the situation where the BMC switches the MUX channel when there is still data activity on the I2C or SPI bus, resulting in data loss, which can even cause the system to crash.

[0081] There is a GPIO between BMC and MUX, which is sent by BMC to MUX. It is the control signal MUX_SEL, and its function is to control the switching of MUX. By default, MUX_SEL is at a low level, and the first end of MUX will switch to the first transmission line for data transmission with the main control chip by default, that is, the main control chip can normally access the plug-in chip connected to the second end of MUX. When BMC wants to upgrade the configuration file or firmware of the main control chip, after BMC receives the second firmware upgrade signal UPDATE_LOCK signal from the main control chip as a high level, BMC switches the control signal MUX_SEL to a high level. At this time, the first end of MUX will switch to the second transmission line for data transmission with the baseboard management controller, and BMC can directly access the plug-in chip. BMC can directly modify, read, write, and refresh the configuration file or firmware in the plug-in chip without relying on the burning API of the main control chip. In this way, the baseboard management controller only needs to develop a general burning code module for the plug-in chip, without having to care about what the main control chip is, and without having to integrate the burning APIs of different main control chips.

[0082] See also Figure 5 In the actual server circuit, there are usually multiple IC main control chips that need to upgrade EEPROM or FLASH, so the actual topology will be as follows Figure 5As shown, the I2C or SPI transmission line of each MUX is connected to the transmission line of the baseboard management controller in cascade, which is a daisy chain topology. At the same time, there are 2 GPIOs between each main control chip and the baseboard management controller, which are used to transmit the xth first firmware upgrade signal UPDATE_ENx_N and the xth second firmware upgrade signal UPDATE_LOCKx respectively. There is also 1 GPIO between each multiplexer and the baseboard management controller, which is used for the xth transmission control signal MUXx_SEL, where x can be the order of the firmware upgrade request to be executed.

[0083] In the case of cascading, the baseboard management controller will only upgrade the EEPROM or FLASH of one main control chip at the same time, and execute the corresponding firmware upgrade request in the order in which the host computer requests to upgrade the system firmware.

[0084] In one embodiment, Figure 6 As shown, a firmware upgrade method is provided, the method comprising the following steps:

[0085] Step 101, in response to receiving a first firmware upgrade signal, obtaining a state of a first link, the first link connecting a main control chip and an external chip of the main control chip.

[0086] Specifically, in response to the baseboard management controller receiving a firmware upgrade request, the baseboard management controller sends a first firmware upgrade signal to the main control chip, and the first firmware upgrade signal is a low-level signal; in response to the main control chip receiving the first firmware upgrade signal; it is determined whether the first link has data to be transmitted; if the first link has data to be transmitted, the first link is considered to be in a working state; if the first link has no data to be transmitted, the first link is considered to be in an idle state.

[0087] When the baseboard management controller receives a firmware upgrade request from a master chip of the host computer, the baseboard management controller will send the first firmware upgrade signal (UPDATE_EN_N shown in the figure) to the master chip through GPIO (pin). The firmware upgrade signal is a low-level signal. After the master chip receives the first firmware upgrade signal, the master chip will determine whether there is data transmission between the master chip and the external chip. For example, if the external chip is EEPROM, it will detect whether there is data transmission on the SPI transmission line. If the external chip is FLASH, it will detect whether there is data transmission on the I2C transmission line. If there is data transmission, it is in a waiting state. If there is no data transmission, the corresponding transmission line needs to be locked to ensure that when the subsequent link switching is performed, there is no data transmission in the link between the main control chip and the external chip, which enhances the stability and reliability of the system.

[0088] Optionally, the type of the external chip of the main control chip can be obtained, and the transmission line can be determined by the type of the external chip, that is, the first link can be determined, and it can be judged whether the first link has data to be transmitted, and then the status of the first link can be determined. If the first link has data to be transmitted, the first link is considered to be in a working state; if the first link has no data to be transmitted, the first link is considered to be in an idle state.

[0089] Step 102: If the first link is in an idle state, lock the first link and return a second firmware upgrade signal to the baseboard management controller.

[0090] Specifically, if the first link is in an idle state, a locking instruction is triggered to lock the first link so that the first link remains in an idle state within a preset time period, and a second firmware upgrade signal is returned to the baseboard management controller, where the second firmware upgrade signal is a high level signal.

[0091] Exemplarily, when it is determined that the first link is in an idle state, a locking instruction is triggered, and the first link is locked so that the first link remains in an idle state within a preset time period. The preset time period here can be a time period from the locking time to the end of the firmware upgrade request. When the locking is completed, the main control chip returns a second firmware upgrade signal (UPDATE_LOCK shown in the figure) to the baseboard management controller, and the second firmware upgrade signal is a high-level signal.

[0092] Step 103, in response to the baseboard management controller receiving the second firmware upgrade signal, the baseboard management controller controls the main control chip to send a first control signal to the multiplexer to control the multiplexer to switch to the second link, and the second link connects the baseboard management controller and the external chip of the main control chip.

[0093] Specifically, in response to the baseboard management controller receiving the second firmware upgrade signal returned by the main control chip, the baseboard management controller sends a first control signal to the multiplexer, and the first control signal is a high-level signal; in response to the multiplexer receiving the first control signal, the multiplexer switches to the second transmission line corresponding to the second pin, so that the baseboard management controller transmits data with the external chip of the main control chip through the second transmission line and the third transmission line.

[0094] Exemplarily, after the baseboard management controller receives the second firmware upgrade signal returned by the main control chip and changes to a high level, the baseboard management controller sends a first control signal (MUX_SEL high-level signal) to the multiplexer (MUX) that controls the I2C or SPI bus of the main control chip, and the multiplexer switches the second pin close to the side of the baseboard management controller, and switches the first transmission line between the main control chip and the multiplexer corresponding to the original first pin to the second transmission line between the baseboard management controller and the multiplexer corresponding to the second pin for data transmission. In this way, the baseboard management controller can directly communicate with the external chip of the main control chip through the second transmission line, so that the baseboard management controller can obtain the configuration file in the external chip.

[0095] Step 104: The baseboard management controller obtains a configuration file in the external chip through the second link to perform a firmware upgrade, where the configuration file includes a burning code.

[0096] Specifically, in response to the baseboard management controller acquiring the configuration file in the external chip, the configuration file is parsed to obtain firmware upgrade data and a burning code; and the firmware upgrade is performed based on the firmware upgrade data and the burning code.

[0097] For example, the baseboard management controller can obtain the configuration file in the external chip, which includes firmware upgrade data and burning code. In this way, the baseboard management controller can burn and refresh the firmware of the external chip (EEPROM or FLASH) of the IC main control chip x external based on the burning code, that is, the universal EEPROM or FLASH burning code module to achieve firmware upgrade. In this way, the baseboard management controller code does not need to integrate the burning API of different main control chips, and the size of the generated burning file is greatly reduced. The baseboard management controller does not need to be equipped with a large external chip to store the configuration file, which greatly reduces the cost of the product.

[0098] In one embodiment, after the baseboard management controller obtains the configuration file in the external chip through the second link to perform a firmware upgrade, it includes: in response to the baseboard management controller performing a firmware upgrade on the configuration file in the external chip, the baseboard management controller sends a second control signal to the multiplexer, and the second control signal is a low-level signal; in response to the multiplexer receiving the second control signal, the multiplexer switches to the first transmission line corresponding to the first pin, so that the main control chip transmits data to the external chip of the main control chip through the first transmission line and the third transmission line.

[0099] Exemplarily, in the present application, after the baseboard management controller completes burning of the external chip and firmware of the main control chip, the baseboard control manager will send a second control signal to the multiplexer, and the second control signal is a low-level signal. The multiplexer receives the second control signal (MUX_SEL) set to a low level sent by the baseboard manager, and the multiplexer switches to the first transmission line corresponding to the first pin, so that the main control chip can transmit data with the external chip of the main control chip through the first transmission line and the third transmission line (the transmission line between the multiplexer and the external chip), so as to switch the second transmission line between the baseboard management controller and the multiplexer corresponding to the second pin to the first transmission line between the main control chip and the multiplexer corresponding to the original first pin for data transmission, and return to the initial state. The baseboard management controller continues to wait for the firmware upgrade request sent by the host computer.

[0100] In one embodiment, there are multiple firmware upgrade requests, and the firmware upgrade method also includes: generating a timestamp according to the generation time of each firmware upgrade request, and obtaining a first weight value corresponding to the timestamp; obtaining a configuration file download package and a firmware upgrade request level carried by each firmware upgrade request, the configuration file download package including a configuration file starting position and a configuration file length; obtaining a second weight value of the configuration file starting position and a third weight value corresponding to the configuration file length; determining the firmware upgrade comprehensive priority of each firmware upgrade request according to a preset comprehensive priority calculation formula, the first weight value corresponding to each firmware upgrade request, the firmware upgrade request level, the second weight value and the third weight value; adding each firmware upgrade request to a processing queue according to the level of each firmware upgrade comprehensive priority, wherein a firmware upgrade request with a high level of firmware upgrade comprehensive priority is located at the head of the processing queue, and a firmware upgrade request with a low level of firmware upgrade comprehensive priority is located at the tail of the processing queue; giving priority to firmware upgrade requests with a high level of comprehensive priority; and sending each firmware upgrade request to the baseboard management controller for processing in sequence according to the order of each firmware upgrade request in the processing queue.

[0101] Specifically, the firmware upgrade request level can be set as needed, such as the importance of the host computer that initiates the firmware upgrade request, the firmware that needs to be upgraded first, and other factors. The starting position of the configuration file and the length of the configuration file represent the complexity of the configuration file processing. In this application, the influence of factors such as timestamp, configuration file starting position, configuration file length, firmware upgrade request level, etc. on the firmware upgrade request is taken into account. A preset comprehensive priority calculation formula can be set according to different influencing factors, and the firmware upgrade comprehensive priority of each firmware upgrade request is calculated according to the preset comprehensive priority calculation formula. The firmware upgrade request is sent to the baseboard management controller for execution in sequence according to the level of the firmware upgrade comprehensive priority of each firmware upgrade request, which can scientifically improve the efficiency of the firmware upgrade.

[0102] The preset comprehensive priority calculation formula is as follows:

[0103] ,

[0104] in, represents the comprehensive firmware upgrade priority corresponding to the i-th firmware upgrade request, represents the first weight value corresponding to the i-th firmware upgrade request, Indicates the firmware upgrade request level corresponding to the i-th firmware upgrade request, represents the second weight value corresponding to the i-th firmware upgrade request, represents the third weight value corresponding to the i-th firmware upgrade request, and n is the total number of firmware upgrade requests.

[0105] In a feasible implementation, the application can also obtain the association between the firmware to be upgraded and other firmware to be upgraded corresponding to other firmware upgrade requests, traverse the firmware to be upgraded corresponding to each firmware upgrade request, and when the firmware to be upgraded has an association with any other firmware to be upgraded, the other firmware to be upgraded that has an association with the firmware to be upgraded is set as a group. For example, assuming that after the firmware to be upgraded of any group is upgraded, the firmware upgrade can be performed on the other firmware to be upgraded in the same group according to the comprehensive priority of the firmware upgrade corresponding to the other firmware to be upgraded in the same group. By considering the dependency between multiple firmware to be upgraded when performing multi-firmware upgrade control, the reliability of multi-firmware upgrade can be effectively improved, avoiding the problem of upgrade failure or system abnormality caused by the dependency between the upgraded firmware.

[0106] In one embodiment, the configuration file of the present application includes a first configuration file and a second configuration file, and the method includes: obtaining firmware upgrade data, performing hash calculation on the firmware upgrade data, and obtaining a target hash value; selecting the target hash value within a preset range as a secret key, and encrypting the firmware upgrade data based on the secret key to obtain a first configuration file; obtaining a burning code, dividing the burning code, and obtaining a plurality of burning code segments; using a signature tool to generate a data signature for each burning code segment; assigning an authentication function to each burning code segment, and encapsulating each burning code segment and the data signature of each burning code to obtain a second configuration file; respectively obtaining the secret key, the data signature, and the first value of the authentication function, and generating a configuration file identifier according to the product of the secret key, the data signature, and the first value of the authentication function; merging the first configuration file and the second configuration file into a configuration file, and writing the configuration file and the configuration file identifier into the upgrade area of ​​the plug-in chip.

[0107] In the present application, the configuration file can be split into a first configuration file and a second configuration file, wherein the first configuration file is used to store information related to the firmware upgrade data, and the second configuration file is used to store information related to the burning code. The firmware upgrade data and the burning code are encrypted separately, which can reduce the possibility of the configuration file being stolen during data transmission and further improve the security of the firmware upgrade.

[0108] Specifically, firmware upgrade data can be obtained, features can be extracted for the firmware upgrade data, hash calculation can be performed based on the extracted features of the firmware upgrade data to obtain a target hash value, the target hash value of any character range can be selected as a secret key, the firmware upgrade data can be encrypted to obtain a first configuration file, and the firmware upgrade data can be encrypted with the secret key obtained by processing the features of the firmware upgrade data, thereby improving the accuracy of the verification.

[0109] The burning code can be divided into multiple sections according to the business function operation stage of the burning code. According to the size of each burning code section and the storage location in the plug-in chip, a signature tool is used to generate a data signature for each burning code section, an authentication function is assigned to each burning code section, and a mapping relationship between each burning code section and the authentication function is established. The authentication function here can be a business interface call function corresponding to each burning code section, and the signature authentication function is configured for the authentication function. When the second configuration file in the configuration file is subsequently verified, the data signature of the corresponding burning code can be verified by calling the authentication function of each burning code section to realize the verification of the second configuration file.

[0110] In addition to the upgrade area, the external chip of the present application also includes an encryption area, and the encryption area includes a first encryption area and a second encryption area. The method also includes: obtaining a secret key corresponding to the firmware upgrade data, and storing the secret key corresponding to the firmware upgrade data in the first encryption area; obtaining a data signature and an authentication function corresponding to each burned code segment, and storing the data signature and an authentication function corresponding to each burned code segment in the second encryption area.

[0111] In one embodiment, the baseboard management controller obtains the configuration file in the external chip through the second link to perform a firmware upgrade, and further includes: the baseboard management controller obtains the secret key corresponding to the firmware upgrade data, the data signature corresponding to each burned code segment, and the authentication function from the encryption area of ​​the external chip; obtains the secret key, the data signature, and the first value of the authentication function respectively, calculates the product of the secret key, the data signature, and the first value of the authentication function, and generates a check value; obtains the configuration file identifier, and determines whether the configuration file identifier is consistent with the check value; if they are consistent, it is considered that the configuration file verification is successful, and the baseboard management controller performs a firmware upgrade according to the configuration file.

[0112] The configuration file in the present application may include a configuration file identifier, which may be written to the starting position of the configuration file. The configuration file identifier of the configuration file may be the product of the first numerical value of the secret key corresponding to the data, the data signature corresponding to the burning code, and the authentication function, etc.

[0113] In the present application, an encryption area is set in the external chip to store the secret key corresponding to the firmware upgrade data, the data signature corresponding to the burning code, and the authentication function. When performing authentication later, the data in the encryption area can be parsed first to obtain the data signature and authentication function corresponding to the secret key burning code corresponding to the firmware upgrade data, and then the configuration file identifier in the upgrade area can be obtained. The configuration file is verified by judging whether the configuration file identifier matches the data signature and authentication function corresponding to the secret key burning code corresponding to the firmware upgrade data, thereby enhancing the security of the firmware upgrade.

[0114] It should be understood that although Figure 6 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 6 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed 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 part of the sub-steps or stages of other steps.

[0115] In one embodiment, Figure 7 As shown, a firmware upgrade device is provided, including: an acquisition module 20, a control module 21 and an upgrade module 22, wherein:

[0116] An acquisition module 20 is used to acquire a state of a first link in response to receiving a first firmware upgrade signal, the first link connecting the main control chip and the external chip of the main control chip;

[0117] The control module 21 is used for locking the first link if the first link is in an idle state, and returning a second firmware upgrade signal to the baseboard management controller; in response to the baseboard management controller receiving the second firmware upgrade signal, the baseboard management controller controls the main control chip to send a first control signal to the multiplexer to control the multiplexer to switch to the second link, and the second link conducts the baseboard management controller and the external chip of the main control chip;

[0118] The upgrade module 22 is used for the baseboard management controller to obtain the configuration file in the external chip through the second link to perform firmware upgrade, and the configuration file includes the burning code.

[0119] In one embodiment, another implementation of the firmware upgrade method that can be implemented by the above device includes the following specific steps:

[0120] In response to receiving the first firmware upgrade signal, acquiring the state of the first link includes:

[0121] In response to the baseboard management controller receiving the firmware upgrade request, the baseboard management controller sends a first firmware upgrade signal to the main control chip, where the first firmware upgrade signal is a low level signal;

[0122] In response to the main control chip receiving the first firmware upgrade signal, determining whether there is data to be transmitted on the first link;

[0123] If the first link has data to transmit, the first link is considered to be in working state;

[0124] If the first link has no data to transmit, it is considered that the first link is in an idle state.

[0125] In one embodiment, another implementation of the firmware upgrade method that can be implemented by the above device includes the following specific steps:

[0126] If the first link is in an idle state, locking the first link and returning a second firmware upgrade signal to the baseboard management controller includes:

[0127] If the first link is in an idle state, a locking instruction is triggered to lock the first link so that the first link remains in an idle state within a preset time period, and a second firmware upgrade signal is returned to the baseboard management controller, where the second firmware upgrade signal is a high level signal.

[0128] In one embodiment, another implementation of the firmware upgrade method that can be implemented by the above device includes the following specific steps:

[0129] The second link includes a second transmission line and a third transmission line. In response to the baseboard management controller receiving the second firmware upgrade signal, the baseboard management controller controls the main control chip to send a first control signal to the multiplexer to control the multiplexer to switch to the second link. The second link conducts the baseboard management controller and the external chip of the main control chip, including:

[0130] In response to the baseboard management controller receiving the second firmware upgrade signal returned by the main control chip, the baseboard management controller sends a first control signal to the multiplexer, where the first control signal is a high level signal;

[0131] In response to the multiplexer receiving the first control signal, the multiplexer switches to the second transmission line corresponding to the second pin, so that the baseboard management controller transmits data with the external chip of the main control chip through the second transmission line and the third transmission line.

[0132] In one embodiment, another implementation of the firmware upgrade method that can be implemented by the above device includes the following specific steps:

[0133] The baseboard management controller obtains the configuration file in the external chip through the second link to perform firmware upgrade, including:

[0134] In response to the baseboard management controller acquiring the configuration file in the external chip, the configuration file is parsed to obtain firmware upgrade data and burning code;

[0135] Perform firmware upgrade based on firmware upgrade data and burning code.

[0136] In one embodiment, another implementation of the firmware upgrade method that can be implemented by the above device includes the following specific steps:

[0137] The first link includes a first transmission line and a third transmission line. After the baseboard management controller obtains the configuration file in the external chip through the second link to perform a firmware upgrade, the following steps are performed:

[0138] In response to the baseboard management controller performing a firmware upgrade on the configuration file in the plug-in chip, the baseboard management controller sends a second control signal to the multiplexer, where the second control signal is a low level signal;

[0139] In response to the multiplexer receiving the second control signal, the multiplexer switches to the first transmission line corresponding to the first pin, so that the main control chip transmits data with the external chip of the main control chip through the first transmission line and the third transmission line.

[0140] In one embodiment, another implementation of the firmware upgrade method that can be implemented by the above device includes the following specific steps:

[0141] There are multiple firmware upgrade requests, and the method further includes:

[0142] Generate a timestamp according to the generation time of each firmware upgrade request, and obtain a first weight value corresponding to the timestamp;

[0143] Obtain a configuration file download package and a firmware upgrade request level carried by each firmware upgrade request, wherein the configuration file download package includes a configuration file start position and a configuration file length; obtain a second weight value of the configuration file start position and a third weight value corresponding to the configuration file length;

[0144] Determine the firmware upgrade comprehensive priority of each firmware upgrade request according to a preset comprehensive priority calculation formula, a first weight value corresponding to each firmware upgrade request, a firmware upgrade request level, a second weight value, and a third weight value;

[0145] Adding each firmware upgrade request to a processing queue according to the level of each firmware upgrade comprehensive priority, wherein the firmware upgrade request with a high firmware upgrade comprehensive priority level is located at the head of the processing queue, and the firmware upgrade request with a low firmware upgrade comprehensive priority level is located at the tail of the processing queue;

[0146] Sending each firmware upgrade request to the baseboard management controller for processing in sequence according to the order of each firmware upgrade request in the processing queue;

[0147] The preset comprehensive priority calculation formula is as follows:

[0148] ,

[0149] in, represents the comprehensive firmware upgrade priority corresponding to the i-th firmware upgrade request, represents the first weight value corresponding to the i-th firmware upgrade request, Indicates the firmware upgrade request level corresponding to the i-th firmware upgrade request, represents the second weight value corresponding to the i-th firmware upgrade request, represents the third weight value corresponding to the i-th firmware upgrade request, and n is the total number of firmware upgrade requests.

[0150] For the specific definition of the firmware upgrade device, please refer to the definition of the firmware upgrade method above, which will not be repeated here. Each module in the above-mentioned firmware upgrade device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0151] In one embodiment, the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the firmware upgrade methods provided by the above methods.

[0152] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data applied by the firmware upgrade method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a firmware upgrade method is implemented.

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

[0154] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0155] Step 101, in response to receiving a first firmware upgrade signal, obtaining a state of a first link, the first link connecting a main control chip and an external chip of the main control chip.

[0156] Step 102: If the first link is in an idle state, lock the first link and return a second firmware upgrade signal to the baseboard management controller.

[0157] Step 103, in response to the baseboard management controller receiving the second firmware upgrade signal, the baseboard management controller controls the main control chip to send a first control signal to the multiplexer to control the multiplexer to switch to the second link, and the second link connects the baseboard management controller and the external chip of the main control chip.

[0158] Step 104: The baseboard management controller obtains a configuration file in the external chip through the second link to perform a firmware upgrade, where the configuration file includes a burning code.

[0159] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0160] In response to receiving the first firmware upgrade signal, acquiring the state of the first link includes:

[0161] In response to the baseboard management controller receiving the firmware upgrade request, the baseboard management controller sends a first firmware upgrade signal to the main control chip, where the first firmware upgrade signal is a low level signal;

[0162] In response to the main control chip receiving the first firmware upgrade signal, determining whether there is data to be transmitted on the first link;

[0163] If the first link has data to transmit, the first link is considered to be in working state;

[0164] If the first link has no data to transmit, it is considered that the first link is in an idle state.

[0165] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0166] If the first link is in an idle state, locking the first link and returning a second firmware upgrade signal to the baseboard management controller includes:

[0167] If the first link is in an idle state, a locking instruction is triggered to lock the first link so that the first link remains in an idle state within a preset time period, and a second firmware upgrade signal is returned to the baseboard management controller, where the second firmware upgrade signal is a high level signal.

[0168] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0169] The second link includes a second transmission line and a third transmission line. In response to the baseboard management controller receiving the second firmware upgrade signal, the baseboard management controller controls the main control chip to send a first control signal to the multiplexer to control the multiplexer to switch to the second pin. The second link of the external chip that conducts the baseboard management controller and the main control chip based on the second pin includes:

[0170] In response to the baseboard management controller receiving the second firmware upgrade signal returned by the main control chip, the baseboard management controller sends a first control signal to the multiplexer, where the first control signal is a high level signal;

[0171] In response to the multiplexer receiving the first control signal, the multiplexer switches to the second transmission line corresponding to the second pin, so that the baseboard management controller transmits data with the external chip of the main control chip through the second transmission line and the third transmission line.

[0172] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0173] The baseboard management controller obtains the configuration file in the external chip through the second link to perform firmware upgrade, including:

[0174] In response to the baseboard management controller acquiring the configuration file in the external chip, the configuration file is parsed to obtain firmware upgrade data and burning code;

[0175] Perform firmware upgrade based on firmware upgrade data and burning code.

[0176] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0177] The first link includes a first transmission line and a third transmission line. After the baseboard management controller obtains the configuration file in the external chip through the second link to perform a firmware upgrade, the following steps are performed:

[0178] In response to the baseboard management controller performing a firmware upgrade on the configuration file in the plug-in chip, the baseboard management controller sends a second control signal to the multiplexer, where the second control signal is a low level signal;

[0179] In response to the multiplexer receiving the second control signal, the multiplexer switches to the first transmission line corresponding to the first pin, so that the main control chip transmits data with the external chip of the main control chip through the first transmission line and the third transmission line.

[0180] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0181] There are multiple firmware upgrade requests, and the method further includes:

[0182] Generate a timestamp according to the generation time of each firmware upgrade request;

[0183] Obtain a configuration file download package and a firmware upgrade request level carried by each firmware upgrade request, wherein the configuration file download package includes a configuration file start position and a configuration file length;

[0184] Determine the firmware upgrade comprehensive priority of each firmware upgrade request according to a preset comprehensive priority calculation formula, a timestamp, a firmware upgrade request level, a configuration file start position, and a configuration file length;

[0185] Each firmware upgrade request is sent to a baseboard management controller for processing according to the level of the firmware upgrade comprehensive priority of each firmware upgrade request.

[0186] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0187] The firmware upgrade comprehensive priority of each firmware upgrade request is determined according to the preset comprehensive priority calculation formula, timestamp, firmware upgrade request level, configuration file start position, and configuration file length, including:

[0188] Obtain a first weight value corresponding to the timestamp, a second weight value corresponding to the start position of the configuration file, and a third weight value corresponding to the length of the configuration file;

[0189] Calculate the firmware upgrade comprehensive priority of each firmware upgrade request based on a preset comprehensive priority calculation formula, a first weight value, a firmware upgrade request level, a second weight value, and a third weight value;

[0190] The preset comprehensive priority calculation formula is as follows:

[0191] ,

[0192] in, represents the comprehensive firmware upgrade priority corresponding to the i-th firmware upgrade request, represents the first weight value corresponding to the i-th firmware upgrade request, Indicates the firmware upgrade request level corresponding to the i-th firmware upgrade request, represents the second weight value corresponding to the i-th firmware upgrade request, represents the third weight value corresponding to the i-th firmware upgrade request, and n is the total number of firmware upgrade requests.

[0193] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0194] Sending each firmware upgrade request to the baseboard management controller for processing according to the level of the firmware upgrade comprehensive priority of each firmware upgrade request includes:

[0195] Adding each firmware upgrade request to a processing queue according to the level of each firmware upgrade comprehensive priority, wherein the firmware upgrade request with a high firmware upgrade comprehensive priority level is located at the head of the processing queue, and the firmware upgrade request with a low firmware upgrade comprehensive priority level is located at the tail of the processing queue;

[0196] Each firmware upgrade request is sent to the baseboard management controller for processing in sequence according to the order of each firmware upgrade request in the processing queue.

[0197] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0198] The configuration file includes a first configuration file and a second configuration file, and the method includes:

[0199] Obtain firmware upgrade data, perform hash calculation on the firmware upgrade data, and obtain a target hash value;

[0200] Selecting a target hash value within a preset range as a secret key, encrypting the firmware upgrade data based on the secret key, and obtaining a first configuration file;

[0201] Obtain the burning code, divide the burning code, and obtain multiple burning code segments;

[0202] Use the signature tool to generate a digital signature for each burned code segment;

[0203] Assigning an authentication function to each burning code segment, and encapsulating each burning code segment and a data signature of each burning code to obtain a second configuration file;

[0204] Obtaining a secret key, a data signature, and a first value of an authentication function respectively, and generating a configuration file identifier according to a product of the secret key, the data signature, and the first value of the authentication function;

[0205] The first configuration file and the second configuration file are combined into a configuration file, and the configuration file and the configuration file identifier are written into the upgrade area of ​​the plug-in chip.

[0206] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0207] The external chip further includes an encryption area, the encryption area includes a first encryption area and a second encryption area, and the method further includes:

[0208] Obtaining a secret key corresponding to the firmware upgrade data, and storing the secret key corresponding to the firmware upgrade data in the first encryption area;

[0209] The data signature and the authentication function corresponding to each burning code segment are obtained, and the data signature and the authentication function corresponding to each burning code segment are stored in the second encryption area.

[0210] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0211] The baseboard management controller obtains the configuration file in the external chip through the second link to perform firmware upgrade, and further includes:

[0212] The baseboard management controller obtains the secret key corresponding to the firmware upgrade data, the data signature corresponding to each burned code segment, and the authentication function from the encryption area of ​​the external chip;

[0213] Obtain the secret key, the data signature, and the first value of the authentication function respectively, calculate the product of the secret key, the data signature, and the first value of the authentication function, and generate a check value;

[0214] Get the configuration file identifier and determine whether the configuration file identifier is consistent with the verification value;

[0215] If they are consistent, the configuration file verification is considered successful, and the baseboard management controller performs a firmware upgrade according to the configuration file.

[0216] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0217] Step 101, in response to receiving a first firmware upgrade signal, obtaining a state of a first link, the first link connecting a main control chip and an external chip of the main control chip.

[0218] Step 102: If the first link is in an idle state, lock the first link and return a second firmware upgrade signal to the baseboard management controller.

[0219] Step 103, in response to the baseboard management controller receiving the second firmware upgrade signal, the baseboard management controller controls the main control chip to send a first control signal to the multiplexer to control the multiplexer to switch to the second link, and the second link connects the baseboard management controller and the external chip of the main control chip.

[0220] Step 104: The baseboard management controller obtains a configuration file in the external chip through the second link to perform a firmware upgrade, where the configuration file includes a burning code.

[0221] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0222] In response to receiving the first firmware upgrade signal, acquiring the state of the first link includes:

[0223] In response to the baseboard management controller receiving the firmware upgrade request, the baseboard management controller sends a first firmware upgrade signal to the main control chip, where the first firmware upgrade signal is a low level signal;

[0224] In response to the main control chip receiving the first firmware upgrade signal, determining whether there is data to be transmitted on the first link;

[0225] If the first link has data to transmit, the first link is considered to be in working state;

[0226] If the first link has no data to transmit, it is considered that the first link is in an idle state.

[0227] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0228] If the first link is in an idle state, locking the first link and returning a second firmware upgrade signal to the baseboard management controller includes:

[0229] If the first link is in an idle state, a locking instruction is triggered to lock the first link so that the first link remains in an idle state within a preset time period, and a second firmware upgrade signal is returned to the baseboard management controller, where the second firmware upgrade signal is a high level signal.

[0230] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0231] The second link includes a second transmission line and a third transmission line. In response to the baseboard management controller receiving the second firmware upgrade signal, the baseboard management controller controls the main control chip to send a first control signal to the multiplexer to control the multiplexer to switch to the second pin. The second link of the external chip that conducts the baseboard management controller and the main control chip based on the second pin includes:

[0232] In response to the baseboard management controller receiving the second firmware upgrade signal returned by the main control chip, the baseboard management controller sends a first control signal to the multiplexer, where the first control signal is a high level signal;

[0233] In response to the multiplexer receiving the first control signal, the multiplexer switches to the second transmission line corresponding to the second pin, so that the baseboard management controller transmits data with the external chip of the main control chip through the second transmission line and the third transmission line.

[0234] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0235] The baseboard management controller obtains the configuration file in the external chip through the second link to perform firmware upgrade, including:

[0236] In response to the baseboard management controller acquiring the configuration file in the external chip, the configuration file is parsed to obtain firmware upgrade data and burning code;

[0237] Perform firmware upgrade based on firmware upgrade data and burning code.

[0238] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0239] The first link includes a first transmission line and a third transmission line. After the baseboard management controller obtains the configuration file in the external chip through the second link to perform a firmware upgrade, the following steps are performed:

[0240] In response to the baseboard management controller performing a firmware upgrade on the configuration file in the plug-in chip, the baseboard management controller sends a second control signal to the multiplexer, where the second control signal is a low level signal;

[0241] In response to the multiplexer receiving the second control signal, the multiplexer switches to the first transmission line corresponding to the first pin, so that the main control chip transmits data with the external chip of the main control chip through the first transmission line and the third transmission line.

[0242] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0243] There are multiple firmware upgrade requests, and the method further includes:

[0244] Generate a timestamp according to the generation time of each firmware upgrade request;

[0245] Obtain a configuration file download package and a firmware upgrade request level carried by each firmware upgrade request, wherein the configuration file download package includes a configuration file start position and a configuration file length;

[0246] Determine the firmware upgrade comprehensive priority of each firmware upgrade request according to a preset comprehensive priority calculation formula, a timestamp, a firmware upgrade request level, a configuration file start position, and a configuration file length;

[0247] Each firmware upgrade request is sent to a baseboard management controller for processing according to the level of the firmware upgrade comprehensive priority of each firmware upgrade request.

[0248] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0249] The firmware upgrade comprehensive priority of each firmware upgrade request is determined according to the preset comprehensive priority calculation formula, timestamp, firmware upgrade request level, configuration file start position, and configuration file length, including:

[0250] Obtain a first weight value corresponding to the timestamp, a second weight value corresponding to the start position of the configuration file, and a third weight value corresponding to the length of the configuration file;

[0251] Calculate the firmware upgrade comprehensive priority of each firmware upgrade request based on a preset comprehensive priority calculation formula, a first weight value, a firmware upgrade request level, a second weight value, and a third weight value;

[0252] The preset comprehensive priority calculation formula is as follows:

[0253] ,

[0254] in, represents the comprehensive firmware upgrade priority corresponding to the i-th firmware upgrade request, represents the first weight value corresponding to the i-th firmware upgrade request, Indicates the firmware upgrade request level corresponding to the i-th firmware upgrade request, represents the second weight value corresponding to the i-th firmware upgrade request, represents the third weight value corresponding to the i-th firmware upgrade request, and n is the total number of firmware upgrade requests.

[0255] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0256] Sending each firmware upgrade request to the baseboard management controller for processing according to the level of the firmware upgrade comprehensive priority of each firmware upgrade request includes:

[0257] Adding each firmware upgrade request to a processing queue according to the level of each firmware upgrade comprehensive priority, wherein the firmware upgrade request with a high firmware upgrade comprehensive priority level is located at the head of the processing queue, and the firmware upgrade request with a low firmware upgrade comprehensive priority level is located at the tail of the processing queue;

[0258] Each firmware upgrade request is sent to the baseboard management controller for processing in sequence according to the order of each firmware upgrade request in the processing queue.

[0259] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0260] The configuration file includes a first configuration file and a second configuration file, and the method includes:

[0261] Obtain firmware upgrade data, perform hash calculation on the firmware upgrade data, and obtain a target hash value;

[0262] Selecting a target hash value within a preset range as a secret key, encrypting the firmware upgrade data based on the secret key, and obtaining a first configuration file;

[0263] Obtain the burning code, divide the burning code, and obtain multiple burning code segments;

[0264] Use the signature tool to generate a digital signature for each burned code segment;

[0265] Assigning an authentication function to each burning code segment, and encapsulating each burning code segment and a data signature of each burning code to obtain a second configuration file;

[0266] Obtaining a secret key, a data signature, and a first value of an authentication function respectively, and generating a configuration file identifier according to a product of the secret key, the data signature, and the first value of the authentication function;

[0267] The first configuration file and the second configuration file are combined into a configuration file, and the configuration file and the configuration file identifier are written into the upgrade area of ​​the plug-in chip.

[0268] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0269] The external chip further includes an encryption area, the encryption area includes a first encryption area and a second encryption area, and the method further includes:

[0270] Obtaining a secret key corresponding to the firmware upgrade data, and storing the secret key corresponding to the firmware upgrade data in the first encryption area;

[0271] The data signature and the authentication function corresponding to each burning code segment are obtained, and the data signature and the authentication function corresponding to each burning code segment are stored in the second encryption area.

[0272] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0273] The baseboard management controller obtains the configuration file in the external chip through the second link to perform firmware upgrade, and further includes:

[0274] The baseboard management controller obtains the secret key corresponding to the firmware upgrade data, the data signature corresponding to each burned code segment, and the authentication function from the encryption area of ​​the external chip;

[0275] Obtain the secret key, the data signature, and the first value of the authentication function respectively, calculate the product of the secret key, the data signature, and the first value of the authentication function, and generate a check value;

[0276] Get the configuration file identifier and determine whether the configuration file identifier is consistent with the verification value;

[0277] If they are consistent, the configuration file verification is considered successful, and the baseboard management controller performs a firmware upgrade according to the configuration file.

[0278] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may 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 many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0279] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.

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

Claims

1. A firmware upgrade method, characterized in that: include: In response to receiving the first firmware upgrade signal, acquiring a state of a first link, the first link connecting the main control chip and the external chip of the main control chip; If the first link is in an idle state, locking the first link and returning a second firmware upgrade signal to the baseboard management controller; In response to the baseboard management controller receiving the second firmware upgrade signal, the baseboard management controller controls the main control chip to send a first control signal to the multiplexer to control the multiplexer to switch to a second link, and the second link conducts the baseboard management controller and the external chip of the main control chip; The baseboard management controller obtains the configuration file in the external chip through the second link to perform firmware upgrade, and the configuration file includes a burning code.

2. The method according to claim 1, characterized in that: In response to receiving the first firmware upgrade signal, obtaining the state of the first link includes: In response to the baseboard management controller receiving the firmware upgrade request, the baseboard management controller sends a first firmware upgrade signal to the main control chip, where the first firmware upgrade signal is a low level signal; In response to the main control chip receiving a first firmware upgrade signal; Determining whether the first link has data to be transmitted; If the first link has data to be transmitted, the first link is considered to be in a working state; If the first link has no data to transmit, it is considered that the first link is in an idle state.

3. The method according to claim 1, characterized in that If the first link is in an idle state, locking the first link and returning a second firmware upgrade signal to the baseboard management controller includes: If the first link is in an idle state, a locking instruction is triggered to lock the first link so that the first link remains in an idle state within a preset time period, and a second firmware upgrade signal is returned to the baseboard management controller, where the second firmware upgrade signal is a high level signal.

4. The method according to claim 1, characterized in that: The second link includes a second transmission line and a third transmission line. In response to the baseboard management controller receiving the second firmware upgrade signal, the baseboard management controller controls the main control chip to send a first control signal to the multiplexer to control the multiplexer to switch to the second link. The second link conducts the baseboard management controller and the external chip of the main control chip, including: In response to the baseboard management controller receiving the second firmware upgrade signal returned by the main control chip, the baseboard management controller sends a first control signal to the multiplexer, where the first control signal is a high level signal; In response to the multiplexer receiving the first control signal, the multiplexer switches to the second transmission line corresponding to the second pin, so that the baseboard management controller transmits data with the external chip of the main control chip through the second transmission line and the third transmission line.

5. The method according to claim 1, characterized in that The baseboard management controller acquires the configuration file in the external chip through the second link to perform firmware upgrade, including: In response to the baseboard management controller acquiring the configuration file in the external chip, the configuration file is parsed to obtain firmware upgrade data and burning code; The firmware is upgraded based on the firmware upgrade data and the burning code.

6. The method according to claim 1, characterized in that The first link includes a first transmission line and a third transmission line, and the baseboard management controller obtains the configuration file in the external chip through the second link to perform firmware upgrade, which includes: In response to the baseboard management controller performing a firmware upgrade on the configuration file in the external chip, the baseboard management controller sends a second control signal to the multiplexer, where the second control signal is a low level signal; In response to the multiplexer receiving the second control signal, the multiplexer switches to the first transmission line corresponding to the first pin, so that the main control chip transmits data with the external chip of the main control chip through the first transmission line and the third transmission line.

7. The method according to claim 1, characterized in that There are multiple firmware upgrade requests, and the method further includes: Generate a timestamp according to the generation time of each firmware upgrade request; Obtain a configuration file download package and a firmware upgrade request level carried by each firmware upgrade request, wherein the configuration file download package includes a configuration file start position and a configuration file length; Determine the firmware upgrade comprehensive priority of each firmware upgrade request according to a preset comprehensive priority calculation formula, the timestamp, the firmware upgrade request level, the configuration file starting position, and the configuration file length; Each firmware upgrade request is sent to a baseboard management controller for processing according to the level of the firmware upgrade comprehensive priority of each firmware upgrade request.

8. The method according to claim 7, characterized in that The step of determining the firmware upgrade comprehensive priority of each firmware upgrade request according to the preset comprehensive priority calculation formula, the timestamp, the firmware upgrade request level, the configuration file starting position, and the configuration file length includes: Obtaining a first weight value corresponding to the timestamp, a second weight value corresponding to the start position of the configuration file, and a third weight value corresponding to the length of the configuration file; Calculate the firmware upgrade comprehensive priority of each firmware upgrade request based on the preset comprehensive priority calculation formula, the first weight value, the firmware upgrade request level, the second weight value, and the third weight value; The preset comprehensive priority calculation formula is as follows: , in, represents the comprehensive firmware upgrade priority corresponding to the i-th firmware upgrade request, represents the first weight value corresponding to the i-th firmware upgrade request, Indicates the firmware upgrade request level corresponding to the i-th firmware upgrade request, represents the second weight value corresponding to the i-th firmware upgrade request, represents the third weight value corresponding to the i-th firmware upgrade request, and n is the total number of firmware upgrade requests.

9. The method according to claim 7, characterized in that: The step of sending each firmware upgrade request to a baseboard management controller for processing according to the level of the firmware upgrade comprehensive priority of each firmware upgrade request includes: adding each firmware upgrade request to a processing queue according to the level of each firmware upgrade comprehensive priority, wherein the firmware upgrade request with a high firmware upgrade comprehensive priority level is located at the head of the processing queue, and the firmware upgrade request with a low firmware upgrade comprehensive priority level is located at the tail of the processing queue; Each firmware upgrade request is sent to the baseboard management controller for processing in sequence according to the order of each firmware upgrade request in the processing queue.

10. The method according to claim 1, characterized in that The configuration file includes a first configuration file and a second configuration file, and the method includes: Obtain firmware upgrade data, and perform hash calculation on the firmware upgrade data to obtain a target hash value; Selecting a target hash value within a preset range as a secret key, encrypting the firmware upgrade data based on the secret key to obtain a first configuration file; Obtaining a burning code, and dividing the burning code to obtain a plurality of burning code segments; Use the signature tool to generate a digital signature for each burned code segment; Allocating an authentication function to each burning code segment, and encapsulating each burning code segment and a data signature of each burning code to obtain a second configuration file; Respectively obtaining the secret key, the data signature, and a first value of the authentication function, and generating a configuration file identifier according to a product of the secret key, the data signature, and the first value of the authentication function; The first configuration file and the second configuration file are combined into a configuration file, and the configuration file and the configuration file identifier are written into an upgrade area of ​​the plug-in chip.

11. The method according to claim 10, characterized in that The external chip further includes an encryption area, the encryption area includes a first encryption area and a second encryption area, and the method further includes: Obtaining a secret key corresponding to the firmware upgrade data, and storing the secret key corresponding to the firmware upgrade data in a first encryption area; A data signature and an authentication function corresponding to each burning code segment are obtained, and the data signature and the authentication function corresponding to each burning code segment are stored in the second encryption area.

12. The method according to claim 11, characterized in that The baseboard management controller acquires the configuration file in the external chip through the second link to perform firmware upgrade, and further includes: The baseboard management controller obtains the secret key corresponding to the firmware upgrade data, the data signature corresponding to each burning code segment, and the authentication function from the encryption area of ​​the external chip; Respectively obtain the secret key, the data signature, and the first value of the authentication function, calculate the product of the secret key, the data signature, and the first value of the authentication function, and generate a check value; Obtaining a configuration file identifier, and determining whether the configuration file identifier is consistent with the verification value; If they are consistent, it is considered that the configuration file verification is successful, and the baseboard management controller performs a firmware upgrade according to the configuration file.

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

14. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.

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

Citation Information

Patent Citations

  • Firmware upgrading method and device, chip and computer storage medium

    CN115729573A

  • Terminal equipment software upgrading method and device, equipment and computer readable medium

    CN116795406A