Equipment firmware management method, equipment, storage medium and product

By determining the target operating mode and main firmware partition of the bus switch device, stable upgrade and automatic synchronization of device firmware are achieved, solving the problems of unstable and time-consuming upgrades in the existing technology, and improving management efficiency.

CN119356761AActive Publication Date: 2025-01-24INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411889955.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-01-24
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

In the prior art, the firmware upgrade of equipment is unstable and takes a long time. Especially in the firmware management process of different modes of PCIe Switch, the management upgrade process is cumbersome and even requires disassembly for upgrading.

Method used

By determining the main firmware partition corresponding to the target operating mode of the bus switch equipment, the current firmware is loaded to enter the target operation mode, and in the mode, it synchronizes the current firmware to the spareware partition to complete the firmware management process.

Benefits of technology

The stability and efficiency of equipment firmware upgrades have been achieved, the operation steps are reduced, the automation efficiency of equipment management is improved, and restarting and human intervention are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356761A_ABST
    Figure CN119356761A_ABST
Patent Text Reader

Abstract

The invention discloses an equipment firmware management method, equipment, a storage medium and a product, and relates to the technical field of firmware management, and the method comprises the steps: determining a main firmware partition corresponding to a target operation mode of bus switch equipment; the main firmware partition is a main firmware partition in preset main and standby firmware partitions; the bus switch equipment is switch equipment of a high-speed serial computer expansion bus; loading the current firmware stored in the main firmware partition, and starting the bus switch equipment to enter a target operation mode; and after entering the target operation mode, if the version information of the current firmware is inconsistent with the version information of the firmware stored in the standby firmware partition, synchronizing the current firmware to the standby firmware partition to complete the firmware management process. In this way, after the device enters the operation mode through the device firmware stored in the main firmware partition, the device firmware of the main firmware partition is synchronized to the standby firmware partition, normal starting is guaranteed, partition firmware synchronization is achieved, and the firmware management efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of firmware management, and in particular to a device firmware management method, device, storage medium and product. Background Art

[0002] The current firmware management method for bus switch devices is relatively simple. For example, for the firmware upgrade of PCIe Switch (peripheral component interconnect express, high-speed serial computer expansion bus standard; Switch, switch device), it is just a simple verification of the firmware to be upgraded and then written to the backup partition. When the next restart is started, the new fw (firmware) is used to start and the partitions are actively swapped. If you want to ensure that both partitions are the latest version, you need to upgrade twice and restart twice. If the firmware of different modes of PCIe Switch is involved, the corresponding management and upgrade process is more cumbersome, because the hardware mode (base mode) only has register parameters and no software logic, so it is completely different from the synthetic mode, and it must be burned offline. Once this mode needs to be used for debugging or upgrading, it is more cumbersome and even requires disassembly. The base mode firmware upgrade through BMC (Baseboard Management Controller) is not stable enough and takes a long time.

[0003] It can be seen that how to conveniently manage device firmware is a problem that needs to be solved by those skilled in the art. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide a device firmware management method, device, storage medium and product, which can solve the problem that the device firmware upgrade is unstable and time-consuming.

[0005] To solve the above technical problems, in a first aspect, an embodiment of the present invention provides a device firmware management method, comprising:

[0006] Determine a main firmware partition corresponding to a target operation mode of a bus switch device; the main firmware partition is a main firmware partition in a mutually primary and standby firmware partition corresponding to the target operation mode pre-set in the bus switch device; the bus switch device is a switch device of a high-speed serial computer expansion bus;

[0007] Loading the current firmware stored in the main firmware partition to start the bus switch device to enter the corresponding target operation mode through the current firmware;

[0008] After entering the target operation mode, if the version information of the current firmware and the firmware stored in the backup firmware partition in the bus switch device are inconsistent, the current firmware is synchronized to the backup firmware partition to complete the firmware management process of the bus switch device.

[0009] Optionally, determining a main firmware partition corresponding to a target operating mode of the bus switch device includes:

[0010] Determine the target operation mode of the bus switch device by the board part number or the cable presence information; the target operation mode is a hardware mode or a synthetic mode;

[0011] Determine the main firmware partition corresponding to the target operating mode at the current moment.

[0012] Optionally, before determining the main firmware partition corresponding to the target operating mode of the bus switch device, the method further includes:

[0013] When performing an upgrade operation on the device firmware stored in the bus switch device, a consistency check is performed on the firmware type corresponding to the received firmware upgrade command and the firmware type corresponding to the received new device firmware to obtain a first check result;

[0014] When the first verification result indicates that the verification is passed, writing the new device firmware into the backup firmware partition at the current moment;

[0015] The master-slave relationship between the standby firmware partition written into the new device firmware and the related master firmware partition is swapped so that the device can be started by the new device firmware next time.

[0016] Optionally, if the operation mode of the bus switch device is a hardware mode, writing the new device firmware into the standby firmware partition at the current moment includes:

[0017] The new device firmware is written into the standby firmware partition corresponding to the hardware mode at the current moment, so as to complete the upgrade operation of the device firmware stored in the corresponding standby firmware partition.

[0018] Optionally, if the operation mode of the bus switch device is the synthesis mode, writing the new device firmware into the standby firmware partition at the current moment includes:

[0019] Determine a device operation mode corresponding to the new device firmware, and write the new device firmware into a backup firmware partition of the device operation mode at the current moment to complete an upgrade operation on the device firmware stored in the corresponding backup firmware partition; the device operation mode is the hardware mode or the synthetic mode.

[0020] Optionally, before loading the current firmware stored in the main firmware partition, the method further includes:

[0021] The current firmware stored in the main firmware partition is verified for validity and integrity to obtain a second verification result, so as to determine whether to load the current firmware according to the second verification result.

[0022] Optionally, determining whether to load the current firmware according to the second verification result includes:

[0023] If the second verification result indicates that the verification is passed, loading the current firmware;

[0024] If the second verification result indicates that the verification fails, the firmware stored in the backup firmware partition corresponding to the main firmware partition is loaded.

[0025] Optionally, before determining the main firmware partition corresponding to the target operating mode of the bus switch device, the method further includes:

[0026] Acquiring parameter information for device debugging firmware in a preset manner; the device debugging firmware is firmware that is pre-stored in a flash memory of a bus switch device and is used to start the bus switch device to enter a debugging mode;

[0027] If the parameter information indicates that the debug mode is enabled, the target firmware serial number in the parameter information is used to load the target debug firmware with the corresponding serial number from several debug firmwares pre-stored by the bus switch device to start the bus switch device to enter the debug mode.

[0028] Optionally, the obtaining parameter information for debugging firmware of the device in a preset manner includes:

[0029] Obtain corresponding parameter information through a pre-set command control unit for device debugging firmware;

[0030] Or, read parameter information for device debugging firmware that is pre-set at a preset position of the flash memory of the bus switch device.

[0031] Optionally, using the target firmware serial number in the parameter information to load the target debugging firmware with the corresponding serial number from a plurality of debugging firmwares pre-saved by the bus switch device includes:

[0032] Verifying the target debugging firmware that matches the target firmware serial number in the parameter information among the plurality of debugging firmwares pre-stored by the bus switch device, and obtaining a corresponding third verification result;

[0033] If the third verification result indicates passing, loading the target debugging firmware from the bus switch device;

[0034] If the third verification result indicates that the device fails, then the other debugging firmwares in the bus switch device except the target debugging firmware are sequentially loaded according to the firmware sequence number until the bus switch device is started to enter the debugging mode;

[0035] If the bus switch device cannot be started to enter the debugging mode after traversing all the debugging firmwares, the target operation mode of the bus switch device is set to the synthesis mode.

[0036] Optionally, the method further includes:

[0037] After the debugging task corresponding to the debugging mode is completed, the process jumps to the step of determining the main firmware partition corresponding to the target operating mode of the bus switch device.

[0038] Optionally, the method further includes:

[0039] Each operation information related to the firmware management of the bus switch device is recorded, and each operation information is cached in a preset log area, so that each operation information related to the firmware management can be directly queried in the preset log area.

[0040] In a second aspect, an embodiment of the present invention provides an electronic device, including:

[0041] Memory for storing computer programs;

[0042] The processor is used to execute the computer program to implement the steps of the device firmware management method as described above.

[0043] In a third aspect, an embodiment of the present invention 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 device firmware management method as described above are implemented.

[0044] In a fourth aspect, an embodiment of the present invention provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned device firmware management method when executed by a processor.

[0045] It can be seen from the above technical scheme that in this application, the main firmware partition corresponding to the target operation mode of the bus switch device is first determined; the main firmware partition is the main firmware partition in the mutually master-slave firmware partition corresponding to the target operation mode pre-set in the bus switch device; the bus switch device is a switch device of a high-speed serial computer expansion bus; then the current firmware saved in the main firmware partition is loaded to start the bus switch device to enter the corresponding target operation mode through the current firmware; after entering the target operation mode, if the version information of the current firmware and the firmware saved in the backup firmware partition in the bus switch device is inconsistent, the current firmware is synchronized to the backup firmware partition to complete the firmware management process of the bus switch device. In this way, the present application can directly synchronize the device firmware of the main firmware partition to the corresponding backup firmware partition after the device firmware saved in the main firmware partition enters the corresponding operation mode, which not only ensures that the device can be started normally, but also realizes the firmware synchronization of the main and backup firmware partitions, ensures the quality of firmware management and reduces the operation steps, and can improve the automation efficiency of device management. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0047] Figure 1 A schematic diagram of a hardware architecture of a device disclosed in this application;

[0048] Figure 2 A flow chart of a device firmware management method disclosed in this application;

[0049] Figure 3 A flowchart of a specific device firmware management method disclosed in this application;

[0050] Figure 4 A schematic diagram of firmware partitioning disclosed in this application;

[0051] Figure 5 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] The terms "including" and "having" in the specification of the present invention and the above-mentioned drawings, as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.

[0054] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0055] It should be noted that the hardware architecture of the bus switch device in this application is as follows Figure 1 As shown, the bus switch device is connected to the processor in the high-speed bus network through the bus port, and the bus switch device can expand the port, and the expanded port can be connected to an external network card, hard disk, graphics processor, etc.; the bus port can be expanded through the bus switch device. Furthermore, the present application scheme can save the device firmware through the main and standby firmware partitions in the bus switch device; after entering the corresponding operation mode using the main firmware partition, the device firmware of the main firmware partition can be directly synchronized to the corresponding standby firmware partition, which not only ensures that the device can start normally, but also realizes the firmware synchronization of the main and standby firmware partitions, ensures the quality of firmware management and reduces the operation steps, which can improve the automation efficiency of device management.

[0056] like Figure 2 As shown, the embodiment of the present application discloses a device firmware management method, including:

[0057] Step S11, determine the main firmware partition corresponding to the target operating mode of the bus switch device; the main firmware partition is a main firmware partition in the firmware partitions that are pre-set in the bus switch device and correspond to the target operating mode and are mutually master-slave; the bus switch device is a switch device of a high-speed serial computer expansion bus.

[0058] In the embodiment of the present application, it can be understood that several firmwares corresponding to different operating modes are pre-set in the switch device of the high-speed serial computer expansion bus, and one operating mode can correspond to two firmware partitions that are primary and backup to each other; and the markings of the primary and backup firmware partitions are automatically switched in the device. For example, the first firmware partition at the previous moment is the primary firmware partition, and then the backup firmware partition represented by the corresponding second firmware partition is updated with firmware. After the firmware update is completed, the second firmware partition is automatically set as the primary firmware partition at the next moment, and the corresponding first firmware partition is the backup firmware partition at the next moment. Furthermore, when the device is started, it is necessary to determine the primary firmware partition corresponding to the target operating mode set for the bus switch device, so as to load the corresponding device firmware from the primary firmware partition.

[0059] In a specific embodiment, the determination of the main firmware partition corresponding to the target operating mode of the bus switch device may include: determining the target operating mode of the bus switch device through the board part number or the cable in-place information; the target operating mode is a hardware mode or a synthetic mode; and determining the main firmware partition corresponding to the target operating mode at the current moment. It is understandable that the switching of the hardware mode or synthetic mode corresponding to the device usually requires the replacement of the board part number or the cable. Therefore, when the device is started, the target operating mode of the bus switch device can be determined through the board part number or the cable in-place information, and no human intervention is required in the process; after determining the target operating mode, the firmware storage location (primary and standby firmware partitions) corresponding to the corresponding target operating mode is also automatically determined to determine the main firmware partition corresponding to the target operating mode of the device at the current moment.

[0060] In another specific embodiment, before determining the main firmware partition corresponding to the target operation mode of the bus switch device, the method may further include: when performing an upgrade operation on the device firmware stored in the bus switch device, performing a consistency check on the firmware type corresponding to the received firmware upgrade command and the firmware type corresponding to the received new device firmware to obtain a first check result; when the first check result indicates that the check is passed, writing the new device firmware into the standby firmware partition at the current moment; swapping the master-slave relationship between the standby firmware partition in which the new device firmware is written and the related main firmware partition, so that the device can be started by the new device firmware next time. Specifically, when the related device firmware is saved by the firmware partition, the device firmware corresponding to a certain operation mode of the device can be upgraded; first receiving a firmware upgrade command and the corresponding new device firmware, and then performing a consistency check on the firmware type corresponding to the firmware upgrade command and the firmware type corresponding to the new device firmware to obtain a first check result; only when the first check result indicates that the check is passed, the new device firmware can be written into the standby firmware partition corresponding to the corresponding operation mode of the device at the current moment; it can be understood that after writing the new device firmware, the relationship between the master and standby firmware partitions should be swapped, so that the new device firmware stored in the main firmware partition can be used to start the device next time.

[0061] Further, in a specific embodiment, if the operation mode of the bus switch device is the hardware mode, writing the new device firmware into the standby firmware partition at the current moment may include: writing the new device firmware into the standby firmware partition corresponding to the hardware mode at the current moment, so as to complete the upgrade operation of the device firmware stored in the corresponding standby firmware partition. Specifically, when the operation mode of the bus switch device is the hardware mode, since the management function of the hardware mode is relatively simple compared to the management function of the synthetic mode, the new device firmware matching its own operation mode can be written into the standby firmware partition at the current moment in the hardware mode, so as to complete the upgrade operation of the device firmware stored in the standby firmware partition, and exchange the relationship between the main and standby firmware partitions, so as to use the new device firmware to enter the hardware mode of the device next time.

[0062] Correspondingly, if the operation mode of the bus switch device is the synthesis mode, writing the new device firmware into the standby firmware partition at the current moment may include: determining the device operation mode corresponding to the new device firmware, and writing the new device firmware into the standby firmware partition of the device operation mode at the current moment, so as to complete the upgrade operation of the device firmware stored in the corresponding standby firmware partition; the device operation mode is the hardware mode or the synthesis mode. Specifically, the synthesis mode has an on-chip management unit running, and has richer management functions. When the device is in the synthesis mode for firmware upgrade, it is necessary to determine the device operation mode (hardware mode or synthesis mode) corresponding to the received new device firmware, and then write the new device firmware into the standby firmware partition of the device operation mode at the current moment, complete the upgrade operation of the corresponding device firmware, and swap the relationship between the relevant main and standby firmware partitions, so that the new device firmware can be used to start the device to enter the corresponding operation mode next time.

[0063] Step S12: Load the current firmware stored in the main firmware partition to start the bus switch device to enter the corresponding target operation mode through the current firmware.

[0064] In an embodiment of the present application, after determining the main firmware partition corresponding to the bus switch device in the target operation mode through the above steps, the current firmware saved in the main firmware partition can be loaded to start the bus switch device to enter the corresponding target operation mode through the current firmware.

[0065] In a specific embodiment, before loading the current firmware saved by the main firmware partition, the method may further include: performing validity and integrity verification on the current firmware saved by the main firmware partition to obtain a second verification result, so as to determine whether to load the current firmware according to the second verification result. Specifically, before loading the current firmware saved by the main firmware partition, it is necessary to verify the validity and integrity of the current firmware to obtain a corresponding second verification result; and then determine whether to load the current firmware based on the second verification result.

[0066] Furthermore, the determination of whether to load the current firmware according to the second verification result may include: if the second verification result indicates that the verification has passed, then the current firmware is loaded; if the second verification result indicates that the verification has not passed, then the firmware stored in the backup firmware partition corresponding to the main firmware partition is loaded. Specifically, if the second verification result indicates that the verification has passed, then the current firmware can be directly loaded; if the second verification result indicates that the verification has not passed, it indicates that there is a security risk in the current firmware, and the startup process of the bus switch device should use the device firmware stored in the backup firmware partition.

[0067] Step S13: After entering the target operation mode, if the version information of the current firmware and the firmware stored in the backup firmware partition in the bus switch device are inconsistent, the current firmware is synchronized to the backup firmware partition to complete the firmware management process of the bus switch device.

[0068] In an embodiment of the present application, after the current firmware saved in the main firmware partition is loaded through the above steps and enters the corresponding target operation mode, it can be determined whether the firmware version information of the current firmware in the main firmware partition is consistent with the firmware version information of the device firmware saved in the corresponding backup firmware partition; if they are inconsistent, it means that the current firmware is the firmware obtained after the device firmware in the backup firmware partition is upgraded; at this time, the current firmware can normally start the device to enter the corresponding target operation mode, indicating that the upgraded firmware is correct, and the current firmware of the main firmware partition can be synchronized to the corresponding backup firmware partition to update the device firmware saved in the backup firmware partition, so that the device firmware can be automatically synchronized to complete the firmware management process of the bus switch device.

[0069] In a specific embodiment, before determining the main firmware partition corresponding to the target operation mode of the bus switch device, the method may further include: obtaining parameter information for device debugging firmware in a preset manner; the device debugging firmware is a firmware pre-stored in the flash memory of the bus switch device for starting the bus switch device to enter the debugging mode; if the parameter information indicates that the debugging mode is enabled, the target firmware sequence number in the parameter information is used to load the target debugging firmware with the corresponding sequence number from the plurality of debugging firmware pre-stored by the bus switch device to start the bus switch device to enter the debugging mode. Specifically, when debugging the device at the problem site, the device may enter the debugging mode through the relevant device debugging firmware; it is necessary to pre-store a plurality of firmware for starting the device to enter the debugging mode in the flash memory of the device, and then obtain the relevant parameter information for the device debugging firmware in a preset manner, and the parameter information may be the location, sequence number and other information of the device debugging firmware; further, if the obtained parameter information indicates that the debugging mode is enabled, the target firmware sequence number in the parameter information may be used to load the target debugging firmware with the corresponding sequence number from the plurality of debugging firmware pre-stored by the bus switch device, so as to start the bus switch device to enter the corresponding debugging mode through the target debugging firmware.

[0070] Further, in a specific embodiment, the parameter information for the device debugging firmware obtained by the preset method may include: obtaining the corresponding parameter information by a command control unit preset for the device debugging firmware; or reading the parameter information for the device debugging firmware pre-set at a preset position of the flash memory of the bus switch device. Specifically, the parameter information corresponding to the device debugging firmware may be obtained by pre-setting the command control unit, receiving a command to load the corresponding debugging firmware; or, the parameter information corresponding to the device debugging firmware may be pre-set at a preset position of the flash memory of the device, and the parameter information of each debugging firmware may be saved in an unused area in the flash memory.

[0071] In a specific embodiment, using the target firmware serial number in the parameter information to load the target debugging firmware with the corresponding serial number from several debugging firmwares pre-saved in the bus switch device may include: verifying the target debugging firmware that matches the target firmware serial number in the parameter information among the several debugging firmwares pre-saved in the bus switch device to obtain a corresponding third verification result; if the third verification result indicates a pass, loading the target debugging firmware from the bus switch device; if the third verification result indicates a fail, sequentially loading the other debugging firmwares in the bus switch device except the target debugging firmware according to the firmware serial number until the bus switch device is started to enter the debugging mode; if the bus switch device cannot be started to enter the debugging mode after traversing each of the debugging firmwares, setting the target operation mode of the bus switch device to the synthetic mode. Specifically, if the parameter information indicates that the debug mode is enabled, it is necessary to verify the target debug firmware that matches the target firmware serial number in the parameter information in the debug firmware pre-saved in the bus switch device to obtain the corresponding third verification result; check whether the debug firmware has security risks. If the third verification result indicates that it passes, the target debug firmware can be directly loaded from the bus switch device to start the device to enter the corresponding debug mode; correspondingly, if the third verification result indicates that it fails, it means that the target debug firmware has security risks. At this time, other debug firmwares saved in the bus switch device can be loaded in sequence until the bus switch device is started to enter the corresponding debug mode. Furthermore, if all the debug firmware saved in the bus switch device fails the verification, the target operation mode of the bus switch device can be set to the synthesis mode to perform related management tasks as much as possible through the rich management functions in the synthesis mode.

[0072] In another specific embodiment, the method may further include: after the debugging task corresponding to the debugging mode is completed, jumping to the step of determining the main firmware partition corresponding to the target operation mode of the bus switch device. Specifically, after the bus switch device completes the relevant debugging task through its own debugging mode, it can reselect to enter other operation modes of the device to use the relevant firmware to start the device to enter the target operation mode.

[0073] In another specific embodiment, it may also include: recording various operation information related to the firmware management of the bus switch device, and caching each of the operation information through a preset log area, so as to directly query each of the operation information related to the firmware management in the preset log area. Specifically, in this embodiment, various operation information related to the firmware management of the bus switch device can be recorded, such as the operation information of firmware parameter delivery, abnormalities in firmware transmission, and firmware upgrade, so that subsequent staff can check the operation log; and various operation information related to firmware management can be directly cached through the preset log area, which is convenient for subsequent information query.

[0074] It can be seen that the present application can directly synchronize the device firmware of the main firmware partition to the corresponding standby firmware partition after the device enters the corresponding operation mode through the device firmware saved in the main firmware partition, which not only ensures that the device can start normally, but also realizes the firmware synchronization of the main and standby firmware partitions; it can be seen that the new version of the device firmware of the main firmware partition can check the device firmware in the standby firmware partition during the device initialization process. If the firmware versions of the device firmware saved in the main and standby firmware partitions are inconsistent, and firmware synchronization can be performed at present, the device can synchronize the new version of the device firmware of the main firmware partition to the corresponding standby firmware partition, and synchronize the new firmware to another partition without human intervention, ensuring that both firmware partitions are the latest and the same firmware, solving the problem that two operations and two restarts are required for production or online upgrades, greatly saving time and improving automation efficiency. In addition, several debugging firmware partitions are set up to facilitate on-site debugging and analysis, and the debugging firmware can be started through command control, which improves operational efficiency and friendliness. Furthermore, the present application can improve the efficiency and convenience of subsequent log inspections by separately recording and managing log classification.

[0075] like Figure 3 As shown, the embodiment of the present application discloses a device firmware management method, which specifically includes:

[0076] It can be seen that when the PCIe Switch is started, it can determine whether the parameter setting information indicates that the debug firmware is enabled; on the one hand, when the debug firmware is not enabled, the GPIO (General-purpose input / output) pin can be used to control the device to load the firmware address of the firmware corresponding to the target operating mode; firmware partitions are added to the device in advance to store the base mode firmware and the synthetic mode firmware respectively; among them, the base mode firmware can also be updated when the device is in the synthetic mode of operation, and the target operating mode only needs to be switched to the base mode when restarting. For the update process of the main and standby or dual partition firmware, after the device uses the new version of the device firmware to update the device firmware in the standby firmware partition at the current moment, the upgrade version is marked in the standby firmware partition, and then the relationship between the main and standby firmware partitions is swapped, so that the firmware partition carrying the upgrade version mark can be used as the main firmware partition when the device is started next time, and the new version of the device firmware of the main firmware partition is used to start the device to enter the corresponding operating mode. When the new version of the device firmware is loaded and initialized by the device, the device firmware saved in the corresponding backup firmware partition (the main firmware partition before the firmware upgrade) can be checked at the same time. If the versions of the two device firmwares are inconsistent, the new version of the device firmware in the main firmware partition can be synchronized to the backup firmware partition. If there is no firmware upgrade or update for the main and backup firmware partitions, the device firmware of the main firmware partition when the device was last started can be directly used, and the device can be started using the firmware of the original partition.

[0077] On the other hand, when debugging the firmware at the problem site, the debug firmware needs to be enabled through the set parameter information; specifically, the device can be optimized in two aspects. One is to add a module that is controlled and managed by commands, and accept commands to enable the debug module; the other is to reserve the debug fw (debug firmware) area using the unused area of ​​the device flash (flash memory). When the firmware needs to be updated to locate the problem, multiple debug firmware can be updated to the debug fw area, and the debug firmware serial number for the next startup can be set. When the next startup is started, the debug firmware saved in the corresponding area can be pulled up according to the parameter information in the flash; and when the debug function is turned on, the automatic synchronization function of the partition firmware is turned off. After the debugging task is completed, the debugging mode can be turned off through commands, and the previous regular partition (hardware mode or synthesis mode) can be restored. The relevant debug firmware can be selected to be erased or retained through commands. Furthermore, if there is a security risk in the debugging firmware, the device can be started into the synthesis mode, and the relevant tasks can be performed through the rich management functions of the synthesis mode. It should be pointed out that any operation information related to the firmware management of the device can be recorded as a corresponding operation log for staff to check and review.

[0078] In a specific embodiment, the firmware management process of the device involves four modules, namely, the Boot Loader module, the firmware management module, the external control management module, and the log recording module. Among them, the Boot Loader module can guide the firmware to load the firmware, and judge whether the debug fw module is enabled by reading the parameter information at the fixed position of the device flash; if it is enabled, the corresponding serial number address in the debug fw area is loaded according to the serial number in the parameter. If it is not enabled, the GPIO pin information is read to judge whether it is the base fw or synthetic mode area. Before executing the loading of the corresponding address, the BootLoader checks the validity and integrity of fw. If it is abnormal, it switches to the backup partition. Specifically, according to the actual situation, 4 normal firmware partitions can be set in the device, two of which are mutually active and standby partitions to store base mode firmware, and two of which are mutually active and standby partitions to store synthetic mode firmware; 6 debug fw partitions can be set. The first addresses of these 10 firmware partitions are fixed and written into the Boot Loader module. Each firmware partition is as follows Figure 4 shown.

[0079] Furthermore, the firmware management module has two main functions. One is to verify the firmware during the firmware upgrade and write it to the corresponding area. If the upgrade is successful, the new firmware needs to be marked to ensure that it can be started from the new firmware position after restarting. In order to prevent the wrong flash, a firmware type can be added to the firmware update command, and a firmware type field is also added to the firmware header identifier. After receiving the upgrade command and the firmware file, the firmware management module verifies whether they match. If they do not match, it returns failure and does not write the corresponding firmware partition. Only when the verification is successful will the new firmware file be written to the corresponding firmware partition. In addition, base mode and synthetic mode do not need to carry position parameters. The two partitions are master and backup for each other, and the inactive partition (the backup firmware partition at the current moment) is automatically written. During the debug firmware upgrade process, the upgrade command needs to be executed with a serial number, and the firmware management module will write the firmware to the corresponding serial number position. The second is to determine whether to synchronize the dual partitions after the new firmware is started, and whether to synchronize the new firmware to the backup firmware partition. In this way, the main and backup firmware partitions can be updated at the same time, and it can also ensure that the startup will not be caused by the incompatibility of the new firmware. The backup firmware partition is actively synchronized after the new firmware is running.

[0080] Correspondingly, the external management control module is divided into two parts. The first part is to control the high and low levels of GPIO through CPLD (Complex Programmable Logic Device) to control the device to start in base mode or synthetic mode. This part uses CPLD control instead of command control like debug firmware, because the switching of base mode and synthetic mode usually requires changing PN (Part Number) or cables, and the hardware is different. CPLD can automatically determine the operating mode by judging the information such as the board PN or the cable in place, without human intervention, and the firmware save location is also automatically determined. The second part is to enable and set parameters in the firmware debug module. PCIe Switch provides two channels, in-band and out-of-band, to set the parameters related to firmware upgrades, and save them to the parameter setting area, so that they will not be lost when the power is off. Then, the logging module is a firmware-related log module added for the PCIe Switch firmware management function. It records the firmware parameter delivery, exceptions in firmware transmission, firmware and command parameter matching check exceptions, dual partition synchronization, abnormal processes, debug firmware switching, etc. for easy inspection. When searching for logs externally, the firmware-related logs can be classified and transmitted separately to avoid the problem of too many logs and difficult analysis.

[0081] It can be seen that in the embodiment of the present application, first, the synthetic mode and debug firmware are partitioned, and the location of loading each firmware partition is controlled by using CPLD and external management commands; firmware verification is performed by adding a type identifier to the device firmware header, and during the operation of the updated device firmware, it is checked whether dual partition synchronization is required, and the updated device firmware is synchronized to another firmware partition; this not only ensures that the device firmware can be started normally, but also performs dual partition firmware synchronization, ensuring quality and reducing operation steps, thereby improving automation efficiency. Firmware type classification can upgrade the base mode firmware when the software logic is running in the synthetic mode; if the base mode is to be run, only the GPIO pins need to be controlled during restart, which improves efficiency and reliability; PCIe Switch, as an intermediate device in the PCIe topology, requires more debug analysis and does not require frequent operation at the customer site. The debug firmware area can be opened to update multiple firmware at a time, and the startup firmware can be controlled by commands, which can improve efficiency and operation friendliness.

[0082] Furthermore, the present application also discloses an electronic device. Figure 5 is a structural diagram of an electronic device according to an exemplary embodiment. Figure 5The content in the description cannot be considered as any limitation on the scope of use of this application. The electronic device may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the device firmware management method disclosed in any of the above embodiments. In addition, the electronic device in this embodiment may specifically be an electronic computer.

[0083] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0084] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0085] The operating system 221 is used to manage and control various hardware devices on the electronic device and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the device firmware management method executed by the electronic device disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0086] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the device firmware management method disclosed above. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the above embodiments, and no further description will be given here.

[0087] Furthermore, the present application also discloses a computer program product, including a computer program / instruction, which implements the steps of the aforementioned device firmware management method when executed by a processor.

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

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

[0090] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0091] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0092] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A device firmware management method, characterized in that: include: Determine a main firmware partition corresponding to a target operation mode of a bus switch device; the main firmware partition is a main firmware partition in a mutually primary and standby firmware partition corresponding to the target operation mode pre-set in the bus switch device; the bus switch device is a switch device of a high-speed serial computer expansion bus; Loading the current firmware stored in the main firmware partition to start the bus switch device to enter the corresponding target operation mode through the current firmware; After entering the target operation mode, if the version information of the current firmware and the firmware stored in the backup firmware partition in the bus switch device are inconsistent, the current firmware is synchronized to the backup firmware partition to complete the firmware management process of the bus switch device.

2. The device firmware management method according to claim 1, characterized in that: The determining of the main firmware partition corresponding to the target operation mode of the bus switch device includes: Determine the target operation mode of the bus switch device by the board part number or the cable presence information; the target operation mode is a hardware mode or a synthetic mode; Determine the main firmware partition corresponding to the target operating mode at the current moment.

3. The device firmware management method according to claim 2, characterized in that: Before determining the main firmware partition corresponding to the target operation mode of the bus switch device, the method further includes: When performing an upgrade operation on the device firmware stored in the bus switch device, a consistency check is performed on the firmware type corresponding to the received firmware upgrade command and the firmware type corresponding to the received new device firmware to obtain a first check result; When the first verification result indicates that the verification is passed, writing the new device firmware into the backup firmware partition at the current moment; The master-slave relationship between the standby firmware partition written into the new device firmware and the related master firmware partition is swapped so that the device can be started by the new device firmware next time.

4. The device firmware management method according to claim 3, characterized in that: If the operation mode of the bus switch device is the hardware mode, writing the new device firmware into the standby firmware partition at the current moment includes: The new device firmware is written into the standby firmware partition corresponding to the hardware mode at the current moment, so as to complete the upgrade operation of the device firmware stored in the corresponding standby firmware partition.

5. The device firmware management method according to claim 3, characterized in that: If the operation mode of the bus switch device is the synthesis mode, writing the new device firmware into the standby firmware partition at the current moment includes: Determine a device operation mode corresponding to the new device firmware, and write the new device firmware into a backup firmware partition of the device operation mode at the current moment to complete an upgrade operation on the device firmware stored in the corresponding backup firmware partition; the device operation mode is the hardware mode or the synthetic mode.

6. The device firmware management method according to claim 1, characterized in that: Before loading the current firmware stored in the main firmware partition, the method further includes: The current firmware stored in the main firmware partition is verified for validity and integrity to obtain a second verification result, so as to determine whether to load the current firmware according to the second verification result.

7. The device firmware management method according to claim 6, characterized in that: The determining whether to load the current firmware according to the second verification result includes: If the second verification result indicates that the verification is passed, loading the current firmware; If the second verification result indicates that the verification fails, the firmware stored in the backup firmware partition corresponding to the main firmware partition is loaded.

8. The device firmware management method according to claim 1, characterized in that: Before determining the main firmware partition corresponding to the target operation mode of the bus switch device, the method further includes: Acquiring parameter information for device debugging firmware in a preset manner; the device debugging firmware is firmware that is pre-stored in a flash memory of a bus switch device and is used to start the bus switch device to enter a debugging mode; If the parameter information indicates that the debug mode is enabled, the target firmware serial number in the parameter information is used to load the target debug firmware with the corresponding serial number from several debug firmwares pre-stored by the bus switch device to start the bus switch device to enter the debug mode.

9. The device firmware management method according to claim 8, characterized in that: The obtaining of parameter information for device debugging firmware in a preset manner includes: Obtain corresponding parameter information through a pre-set command control unit for device debugging firmware; Or, read parameter information for device debugging firmware that is pre-set at a preset position of the flash memory of the bus switch device.

10. The device firmware management method according to claim 8, characterized in that: The method of using the target firmware serial number in the parameter information to load the target debugging firmware with the corresponding serial number from a plurality of debugging firmwares pre-stored by the bus switch device includes: Verifying the target debugging firmware that matches the target firmware serial number in the parameter information among the plurality of debugging firmwares pre-stored by the bus switch device, and obtaining a corresponding third verification result; If the third verification result indicates passing, loading the target debugging firmware from the bus switch device; If the third verification result indicates that the device fails, then the other debugging firmwares in the bus switch device except the target debugging firmware are sequentially loaded according to the firmware sequence number until the bus switch device is started to enter the debugging mode; If the bus switch device cannot be started to enter the debugging mode after traversing all the debugging firmwares, the target operation mode of the bus switch device is set to the synthesis mode.

11. The device firmware management method according to claim 8, characterized in that: Also includes: After the debugging task corresponding to the debugging mode is completed, the process jumps to the step of determining the main firmware partition corresponding to the target operating mode of the bus switch device.

12. The device firmware management method according to any one of claims 1 to 11, characterized in that: Also includes: Each operation information related to the firmware management of the bus switch device is recorded, and each operation information is cached in a preset log area, so that each operation information related to the firmware management can be directly queried in the preset log area.

13. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the device firmware management method according to any one of claims 1 to 12.

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

15. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the device firmware management method according to any one of claims 1 to 12 are implemented.

Citation Information

Patent Citations

  • Main control board card for machine frame type equipment

    CN112965751A

  • PCIe Switch firmware upgrading method and related components

    CN115113891A

  • Firmware processing method, device and equipment and readable storage medium

    CN117950717A

  • Test system

    CN118918941A