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

By forwarding the firmware upgrade package in parallel on the switch and determining the upgrade completion status based on the status code, the high labor cost and inefficiency problems caused by manual operations in the prior art are solved, and efficient online firmware upgrades are achieved.

CN119759387APending Publication Date: 2025-04-04XIAN YIPU COMM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411717027.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The firmware upgrade method of the existing optical module loopback test module requires manual operation, resulting in high labor costs and low efficiency.

Method used

Connect to multiple electronic devices through the switch control port, respond to the firmware upgrade start command, forward the firmware upgrade package to multiple electronic devices in parallel, and determine the upgrade completion status based on the status code, and output the upgrade information.

Benefits of technology

The firmware upgrade of multiple electronic devices in parallel online has been realized, reducing manual participation, improving upgrade efficiency and reducing labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759387A_ABST
    Figure CN119759387A_ABST
Patent Text Reader

Abstract

The present application provides a firmware upgrade method, an electronic device, a storage medium and a program product, and relates to the field of firmware upgrade technology. The firmware upgrade method is applied to a switch, and the switch is connected to an electronic device through a control port. The method includes: responding to a firmware upgrade start instruction, forwarding a firmware upgrade package to multiple electronic devices in parallel, and the electronic device is used to respond to the firmware upgrade package, perform firmware upgrade based on the firmware upgrade package and return a status code; according to the status codes of the multiple electronic devices, determine whether the firmware upgrade package has completed the upgrade on the multiple electronic devices, and the status code is used to indicate that the electronic device has completed the firmware upgrade; when the firmware upgrade package has completed the upgrade in the multiple electronic devices, output the firmware upgrade information of the multiple electronic devices. The method is used to improve the efficiency of firmware upgrade while reducing labor costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In the field of electronic equipment and communication technology, firmware upgrade is an important method to optimize device performance, improve functions and fix security vulnerabilities. Optical module loopback test module (Loopback) is widely used in fields such as network testing, and its stable operation and function update are crucial to the development of related industries. With the continuous advancement of technology, people's requirements for the convenience and efficiency of optical module loopback test module firmware upgrade are also increasing.

[0003] At present, it is usually necessary to use a fixture and upgrade the optical module loopback test module firmware through the serial port. The specific steps are as follows: first, insert the optical module loopback test module into the fixture; then, connect the serial port pin of the fixture to the Universal Serial Bus (USB) to the serial port module; then, connect the USB to the serial port module to the computer; then, run the burning program on the computer and load the optical module loopback test module firmware; then manually power on and off the optical module loopback test module and perform a hard reset; finally, wait for the firmware upgrade to complete. However, this upgrade method has the following problems: high labor cost and low efficiency. Summary of the invention

[0004] The present application provides a firmware upgrade method, an electronic device, a storage medium, and a program product to achieve the effect of reducing labor costs and improving efficiency.

[0005] In a first aspect, the present application provides a firmware upgrade method, which is applied to a switch, the switch is connected to an electronic device through a control port, and the firmware upgrade method includes:

[0006] In response to the firmware upgrade start instruction, the firmware upgrade package is forwarded in parallel to multiple electronic devices, and the electronic devices are used to respond to the firmware upgrade package, perform firmware upgrade based on the firmware upgrade package and return a status code;

[0007] Determining whether the firmware upgrade package has completed upgrading on the multiple electronic devices according to the status codes of the multiple electronic devices, where the status codes are used to indicate that the firmware upgrade of the electronic devices has been completed;

[0008] When the firmware upgrade package has been upgraded in multiple electronic devices, the firmware upgrade information of the multiple electronic devices is output.

[0009] In a possible implementation, forwarding the firmware upgrade package to multiple electronic devices in parallel includes:

[0010] Divide the firmware upgrade package to obtain multiple upgrade data packages;

[0011] Multiple upgrade data packets are forwarded to multiple electronic devices in parallel.

[0012] In a possible implementation, determining whether the firmware upgrade package has completed upgrading on the multiple electronic devices according to the status codes of the multiple electronic devices includes:

[0013] Obtaining status codes of any upgrade data packet in multiple electronic devices;

[0014] Determining whether the upgrade data packet has completed the upgrade based on the status codes of the plurality of electronic devices;

[0015] According to whether the multiple upgrade data packets have completed the upgrade, it is determined whether the firmware upgrade package has completed the upgrade on the multiple electronic devices.

[0016] In a possible implementation, after determining that the firmware upgrade package has an unfinished upgrade situation in multiple electronic devices, the method includes:

[0017] Determine the upgrade data package and corresponding electronic device that failed to be upgraded;

[0018] Determine whether to re-upgrade the upgrade data package that failed to be upgraded according to the upgrade configuration information.

[0019] In a possible implementation, the firmware upgrade method includes:

[0020] If the upgrade configuration information determines to re-upgrade the upgrade data packet that failed to be upgraded, forwarding the upgrade data packet that failed to be upgraded to the electronic device that failed to be upgraded;

[0021] According to the status code of the electronic device that failed to be upgraded, it is determined whether the upgrade data packet that failed to be upgraded is successfully re-upgraded on the electronic device that failed to be upgraded.

[0022] In a possible implementation, the firmware upgrade method further includes:

[0023] If the upgrade configuration information determines that the upgrade data packet that failed to be upgraded will not be re-upgraded, the port connected to the electronic device that failed to be upgraded is recorded, and the upgrade data packet that failed to be upgraded is determined to have completed upgrading.

[0024] In a possible implementation, forwarding the firmware upgrade package to multiple electronic devices in parallel includes:

[0025] Based on a complex programmable logic device (CPLD), the firmware upgrade package is forwarded to multiple electronic devices in parallel.

[0026] In a second aspect, the present application provides a firmware upgrade device, which is applied to a switch, and the switch is connected to an electronic device through a control port, and the firmware upgrade device includes:

[0027] A forwarding module, used to respond to the firmware upgrade start instruction, forward the firmware upgrade package to multiple electronic devices in parallel, and the electronic devices are used to respond to the firmware upgrade package, perform firmware upgrade based on the firmware upgrade package and return a status code;

[0028] A determination module, used to determine whether the firmware upgrade package has completed the upgrade on the multiple electronic devices according to the status codes of the multiple electronic devices, where the status codes are used to indicate that the electronic devices have completed the firmware upgrade;

[0029] The output module is used to output the firmware upgrade information of multiple electronic devices when the firmware upgrade package has been upgraded in multiple electronic devices.

[0030] In a possible implementation manner, the forwarding module is specifically used to:

[0031] Divide the firmware upgrade package to obtain multiple upgrade data packages;

[0032] Multiple upgrade data packets are forwarded to multiple electronic devices in parallel.

[0033] In a possible implementation manner, the determination module is specifically configured to:

[0034] Obtaining status codes of any upgrade data packet in multiple electronic devices;

[0035] Determining whether the upgrade data packet has completed the upgrade based on the status codes of the plurality of electronic devices;

[0036] According to whether the multiple upgrade data packets have completed the upgrade, it is determined whether the firmware upgrade package has completed the upgrade on the multiple electronic devices.

[0037] In a possible implementation manner, the determination module is further configured to:

[0038] Determine the upgrade data package and corresponding electronic device that failed to be upgraded;

[0039] Determine whether to re-upgrade the upgrade data package that failed to be upgraded according to the upgrade configuration information.

[0040] In a possible implementation manner, the determination module is further configured to:

[0041] If the upgrade configuration information determines to re-upgrade the upgrade data packet that failed to be upgraded, forwarding the upgrade data packet that failed to be upgraded to the electronic device that failed to be upgraded;

[0042] According to the status code of the electronic device that failed to be upgraded, it is determined whether the upgrade data packet that failed to be upgraded is successfully re-upgraded on the electronic device that failed to be upgraded.

[0043] In a possible implementation, the firmware upgrade device further includes a processing module, and the processing module is specifically configured to:

[0044] If the upgrade configuration information determines that the upgrade data packet that failed to be upgraded will not be re-upgraded, the port connected to the electronic device that failed to be upgraded is recorded, and the upgrade data packet that failed to be upgraded is determined to have completed upgrading.

[0045] In a possible implementation manner, the forwarding module is specifically used to:

[0046] Based on complex programmable logic devices, firmware upgrade packages are forwarded to multiple electronic devices in parallel.

[0047] In a third aspect, the present application provides an electronic device, including: a memory, a processor;

[0048] Memory stores computer-executable instructions;

[0049] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0050] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed, they are used to implement the above first aspect and / or various possible implementations of the first aspect.

[0051] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed, implements the above first aspect and / or various possible implementations of the first aspect.

[0052] The firmware upgrade method, electronic device, storage medium and program product provided by the present application relate to the field of firmware upgrade technology. The firmware upgrade method is applied to a switch, and the switch is connected to an electronic device through a control port. The method includes: responding to a firmware upgrade start instruction, forwarding a firmware upgrade package in parallel to multiple electronic devices, and the electronic device is used to respond to the firmware upgrade package, perform firmware upgrade based on the firmware upgrade package and return a status code; according to the status codes of multiple electronic devices, determine whether the firmware upgrade package has completed the upgrade on multiple electronic devices, and the status code is used to characterize that the electronic device has completed the firmware upgrade; when the firmware upgrade package is completed in multiple electronic devices, output the firmware upgrade information of multiple electronic devices. The method forwards the firmware upgrade package to multiple electronic devices connected to the switch control port in parallel, reduces the complexity of connecting to a computer through a fixture in the prior art, and can simultaneously realize online firmware upgrade of multiple electronic devices, that is, improve the efficiency of firmware upgrade; then, according to the status codes of multiple electronic devices, determine whether the firmware upgrade package has completed the upgrade on multiple electronic devices, and when the firmware upgrade package is completed in multiple electronic devices, output the firmware upgrade information of multiple electronic devices, and no human participation is required in the entire firmware upgrade process, thereby reducing labor costs while improving the efficiency of firmware upgrade. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0054] Figure 1 A connection diagram of the firmware upgrade of the existing optical module loopback test module provided by the present application;

[0055] Figure 2 A schematic diagram of a system for implementing online parallel upgrade of optical module loopback test module firmware provided by the present application;

[0056] Figure 3 A schematic diagram of a firmware upgrade method is provided for an embodiment of the present application Figure 1 ;

[0057] Figure 4 A schematic diagram of a firmware upgrade method is provided for an embodiment of the present application Figure 2 ;

[0058] Figure 5 A schematic diagram of the structure of the firmware upgrade device provided in this application;

[0059] Figure 6 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application.

[0060] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0061] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0062] With the development of the data industry, the demand for switches is growing. As a test component of switches, the production capacity of optical module loopback test modules directly determines the shipment of switches.

[0063] At present, the firmware upgrade of the optical module loopback test module requires the use of a fixture and the upgrade of the optical module loopback test module firmware through the serial port. The existing optical module loopback test module firmware upgrade diagram can be referred to Figure 1 , Figure 1 A connection diagram for firmware upgrade of an existing optical module loopback test module provided in this application.

[0064] However, this firmware upgrade method has the following disadvantages: the optical module loopback test module needs to be connected to the fixture, and then connected to the computer through the fixture. This connection method will increase the risk of unstable line connection; manufacturing fixtures will increase costs; a single fixture can only upgrade one optical module loopback test module at a time, and this upgrade method will consume a lot of manpower and time; the operation steps are cumbersome, and it involves manually powering on and off the optical module loopback test module, which is easy for operators to make mistakes.

[0065] In response to the above problems, the present application provides a method for online parallel upgrading of electronic device firmware. The method forwards the firmware upgrade package in parallel to multiple electronic devices directly connected to the switch control port, thereby eliminating the step of using a jig, improving the stability of the line connection, and eliminating the cost of manufacturing the jig.

[0066] Furthermore, the present application provides a system capable of implementing online parallel upgrade of optical module loopback test module firmware. Figure 2 A schematic diagram of a system for implementing online parallel upgrade of optical module loopback test module firmware provided by this application. Figure 2As shown, the system includes a software development kit (SDK) program running on the switch system, a CPLD module, and an upgrade program running on the optical module loopback test module.

[0067] Among them, the SDK program refers to the software tools and libraries used to develop and manage network switches. The CPLD module serves as an agent in the upgrade system. The front end is connected to the SDK program, and the back-end control port is connected to the optical module loopback test module. The optical module loopback test module communicates with the CPLD module through the switch control port via I2C.

[0068] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0069] Figure 3 A schematic diagram of a firmware upgrade method is provided for an embodiment of the present application Figure 1 ,The firmware upgrade method is applied to a switch, which is connected to an electronic device through a control port. Figure 3 As shown, the firmware upgrade method includes:

[0070] S301, responding to a firmware upgrade start instruction, forwarding a firmware upgrade package to multiple electronic devices in parallel, the electronic devices are used to respond to the firmware upgrade package, perform firmware upgrade based on the firmware upgrade package and return a status code.

[0071] In this step, it can be understood that when the switch system receives the firmware upgrade instruction, it will respond to the instruction and forward the firmware upgrade package to multiple electronic devices in parallel. The source of the firmware upgrade package can be set according to actual needs, for example, the firmware upgrade package is obtained by the switch system from the local memory.

[0072] Furthermore, the electronic device is used to respond to the firmware upgrade package, and then upgrade the firmware of the electronic device based on the firmware upgrade package, and return a status code. The electronic device is directly connected to the switch control port, specifically: one control port of the switch is connected to one electronic device. This operation can save the step of using a jig, improve the stability of the line connection, and save the cost of manufacturing the jig.

[0073] Furthermore, the type of the electronic device can be set according to actual needs, and the embodiment of the present application does not limit this. Optionally, the electronic device is an optical module loopback test module.

[0074] S302: Determine whether the firmware upgrade package has completed upgrading on the multiple electronic devices according to status codes of the multiple electronic devices, where the status code is used to indicate that the firmware upgrade of the electronic device has been completed.

[0075] In this step, it can be understood that the firmware upgrade package is determined to be upgraded on multiple electronic devices based on the status codes returned by the multiple electronic devices in S301, which means that the status code of the electronic device is used to indicate that the electronic device has completed the firmware upgrade.

[0076] S303: When the firmware upgrade package has been upgraded in multiple electronic devices, output the firmware upgrade information of the multiple electronic devices.

[0077] In this step, it can be understood that only when the firmware upgrade package has completed the upgrade in multiple electronic devices, the firmware upgrade information of multiple electronic devices will be output. If the firmware upgrade package has not completed the firmware upgrade in any electronic device, the firmware upgrade information will not be output at this time, and corresponding processing needs to be performed on the electronic device that has not completed the firmware upgrade.

[0078] The output firmware upgrade information can be set according to the actual situation, such as outputting the firmware version number, upgrade reason, function improvement, compatibility description, etc.

[0079] Furthermore, the electronic device does not need to use a fixture and is directly connected to the switch control port. Therefore, the firmware upgrade method provided in the embodiment of the present application can complete the online upgrade directly on the switch.

[0080] The firmware upgrade method provided in the embodiment of the present application reduces the complexity of the prior art that requires connection to a computer through a fixture by forwarding the firmware upgrade package in parallel to multiple electronic devices connected to the switch control port, and can simultaneously realize online firmware upgrades for multiple electronic devices, that is, improve the efficiency of firmware upgrades; then, based on the status codes of the multiple electronic devices, it is determined whether the firmware upgrade package has completed the upgrade on the multiple electronic devices, and when the firmware upgrade package has completed the upgrade in the multiple electronic devices, the firmware upgrade information of the multiple electronic devices is output. No human intervention is required during the entire firmware upgrade process, thereby achieving the goal of reducing labor costs while improving the efficiency of firmware upgrades.

[0081] Based on the above embodiment, the firmware upgrade package is forwarded to multiple electronic devices in parallel, including: dividing the firmware upgrade package to obtain multiple upgrade data packets; and forwarding the multiple upgrade data packets in parallel to multiple electronic devices.

[0082] When forwarding the firmware upgrade package to multiple electronic devices in parallel, the firmware upgrade package needs to be divided in advance to obtain multiple upgrade data packets. Then the multiple upgrade data packets are forwarded to the multiple electronic devices in parallel. The specific implementation method of dividing the firmware upgrade package can be set according to actual needs.

[0083] For example, a 100-megabyte firmware upgrade package is divided into 10 upgrade data packets, wherein each upgrade data packet is 10 megabytes.

[0084] The embodiment of the present application divides a large firmware upgrade package into several smaller upgrade data packets. On the one hand, it can better adapt to the maximum transmission unit limitations of different networks and reduce the packet loss rate; on the other hand, smaller upgrade data packets are more flexible during transmission and can improve the utilization rate of network resources.

[0085] Based on the above embodiment, determining whether the firmware upgrade package has completed the upgrade on multiple electronic devices according to the status codes of multiple electronic devices includes: obtaining the status code of any upgrade data packet on multiple electronic devices; determining whether the upgrade data packet has completed the upgrade based on the status codes of multiple electronic devices; and determining whether the firmware upgrade package has completed the upgrade on multiple electronic devices according to whether the multiple upgrade data packets have completed the upgrade.

[0086] In this embodiment, it can be understood that the determination of whether the firmware upgrade package has completed the upgrade on multiple electronic devices based on the status codes of multiple electronic devices described in S302 requires obtaining the status code of each upgrade data packet on multiple electronic devices, and then determining whether the corresponding upgrade data packet has completed the upgrade based on the acquired status code. Further, based on whether all upgrade data packets have completed the upgrade, it is determined whether the firmware upgrade package has completed the upgrade on multiple electronic devices, and based on whether the firmware upgrade package has completed the upgrade on multiple electronic devices, subsequent processing measures are determined. If it is determined that the firmware upgrade package has completed the upgrade on multiple electronic devices, the firmware upgrade information is output; if it is determined that the firmware upgrade package has not completed the upgrade on multiple electronic devices, the specific processing operation can be selected according to the actual situation.

[0087] The embodiment of the present application determines whether the upgrade data packet has completed the upgrade in multiple electronic devices to determine whether the firmware upgrade package has completed the upgrade in multiple electronic devices, which can improve the overall reliability and stability of the firmware upgrade method.

[0088] Furthermore, after determining that the firmware upgrade package has an unfinished upgrade in multiple electronic devices, it includes: determining the upgrade data package that failed to upgrade and the corresponding electronic device; determining whether to re-upgrade the upgrade data package that failed to upgrade according to the upgrade configuration information. This means that after determining that the firmware upgrade package has an unfinished upgrade in multiple electronic devices, it is necessary to determine the upgrade data package that failed to upgrade and the corresponding electronic device, and then determine whether it is necessary to re-upgrade the upgrade data package that failed to upgrade on the corresponding electronic device according to the upgrade configuration information. Among them, the upgrade configuration information can be set according to actual needs, for example, the upgrade configuration information is determined as the number of times the upgrade data package is re-upgraded.

[0089] The embodiment of the present application can improve the accuracy and flexibility of firmware upgrade by determining whether it is necessary to re-upgrade the upgrade data package that failed to upgrade on the corresponding electronic device according to the upgrade configuration information.

[0090] In one implementation, if the upgrade configuration information determines that the upgrade data packet that failed to be upgraded needs to be re-upgraded, the upgrade data packet that failed to be upgraded is forwarded to the electronic device that failed to be upgraded; and according to the status code of the electronic device that failed to be upgraded, it is determined whether the upgrade data packet that failed to be upgraded is successfully re-upgraded on the electronic device that failed to be upgraded. By retrying to upgrade the upgrade data packet that failed to be upgraded, the chance of successful upgrade can be increased.

[0091] In another implementation, if the upgrade configuration information determines that the upgrade data packet that failed to upgrade is not to be re-upgraded, the port connected to the electronic device that failed to upgrade is recorded, and the upgrade data packet that failed to upgrade is determined to have completed the upgrade. By recording the port connected to the electronic device that failed to upgrade, it is helpful to adjust the subsequent firmware upgrade strategy.

[0092] Based on the above embodiment, the method of forwarding the firmware upgrade package to multiple electronic devices in parallel as described in S301 includes: forwarding the firmware upgrade package to multiple electronic devices in parallel based on a complex programmable logic device.

[0093] Among them, complex programmable logic devices are integrated circuit chips that users can program according to their own needs to achieve specific logic functions. Therefore, complex programmable logic devices can achieve parallel forwarding of firmware upgrade packages through their internal programmable logic circuits.

[0094] The embodiments of the present application use complex programmable logic devices to achieve reliable data transmission within a short distance, ensuring that the firmware upgrade package can be accurately delivered to each electronic device, thereby realizing firmware upgrade operations on multiple electronic devices.

[0095] Furthermore, the firmware upgrade package can be forwarded to multiple electronic devices in parallel based on the I2C (Inter-Integrated Circuit) communication method.

[0096] Among them, the I2C (Inter-Integrated Circuit) communication method is a serial communication protocol commonly used in electronic devices. It adopts a master-slave architecture, usually with one master device controlling multiple slave devices. Based on the I2C communication method, the firmware upgrade package is forwarded to multiple electronic devices in parallel, which means that by utilizing the characteristics of the I2C bus, the master device can send firmware upgrade data to multiple slave devices at the same time.

[0097] In the I2C communication mode, forwarding the firmware upgrade package to multiple electronic devices in parallel means that the firmware upgrade package can be sent to multiple devices at the same time instead of upgrading them one by one. This can improve the upgrade efficiency and save time.

[0098] Next, taking the optical module loopback test module as an example, it is explained how to use the firmware upgrade method provided in the embodiment of the present application. Among them, the optical module loopback test module is widely used to test the switch port signal, and the common models are 200G, 400G, and 800G. Figure 4 A schematic diagram of a firmware upgrade method is provided for an embodiment of the present application Figure 2 .like Figure 4 As shown, the method comprises the following steps:

[0099] Start the SDK program, and the SDK program sends an upgrade start instruction to the complex programmable logic device CPLD module, so that the CPLD module enters the firmware upgrade mode;

[0100] The CPLD module forwards the received upgrade start instruction to multiple electronic devices connected to the switch control port, so that the multiple electronic devices enter the firmware upgrade mode;

[0101] The SDK divides the firmware upgrade package into multiple upgrade data packets, and performs the following processing for any upgrade data packet: sending the upgrade data packet to the CPLD module; the CPLD module forwards the received upgrade data packet to multiple electronic devices in parallel based on I2C communication, wherein the electronic devices are used to respond to the firmware upgrade package, perform firmware upgrade based on the firmware upgrade package and return a status code; the CPLD module determines whether the upgrade data packet is successfully upgraded based on the status codes of the multiple electronic devices collected;

[0102] When the upgrade data packet is successfully upgraded, the next upgrade data packet is sent to the CPLD module, and the upgrade data packet forwarding operation is repeated, otherwise an error message is output;

[0103] When the upgrade data package fails to be upgraded, the CPLD module determines whether to re-upgrade the failed upgrade data package according to the configuration information in the SDK program;

[0104] When the configuration information in the SDK program determines that the upgrade data packet that failed to be upgraded needs to be re-upgraded, the upgrade data packet that failed to be upgraded is forwarded to the electronic device that failed to be upgraded, and the status code of the electronic device that failed to be upgraded is collected; and it is determined whether the upgrade data packet that failed to be upgraded is successfully re-upgraded according to the status code of the electronic device that failed to be upgraded;

[0105] When the configuration information in the SDK program determines that the upgrade data packet that failed to be upgraded is not to be re-upgraded, the port connected to the electronic device that failed to be upgraded is recorded, and the upgrade data packet that failed to be upgraded is determined as having completed the upgrade;

[0106] When multiple upgrade data packets are successfully upgraded, the firmware upgrade information is output, and the CPLD module and the SDK program are both exited from the firmware upgrade mode, wherein the CPLD module is notified by the SDK program to exit the firmware upgrade mode.

[0107] One thing that needs to be explained is that both the SDK program and the CPLD module are deployed in the switch.

[0108] In summary, the embodiment of the present application uses SDK as in-band management software to intuitively and clearly reflect the firmware upgrade status, which facilitates management while reducing operation complexity; by using the CPLD module as an upgrade agent, the optical module loopback test module can be upgraded online in parallel, reducing labor costs and greatly improving firmware upgrade efficiency.

[0109] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0110] The firmware upgrade device is applied to the switch, and the switch is connected to the electronic device through the control port. Figure 5 A schematic diagram of the structure of the firmware upgrade device provided in this application, such as Figure 5 As shown, the firmware upgrade device 500 provided in this embodiment includes:

[0111] The forwarding module 501 is used to respond to the firmware upgrade start instruction and forward the firmware upgrade package to multiple electronic devices in parallel. The electronic devices are used to respond to the firmware upgrade package, perform firmware upgrade based on the firmware upgrade package and return a status code;

[0112] A determination module 502 is used to determine whether the firmware upgrade package has completed the upgrade on the multiple electronic devices according to the status codes of the multiple electronic devices, where the status code is used to indicate that the firmware upgrade of the electronic device has been completed;

[0113] The output module 503 is used to output the firmware upgrade information of the multiple electronic devices when the firmware upgrade package has been upgraded in the multiple electronic devices.

[0114] In a possible implementation, the forwarding module 501 is specifically configured to: divide the firmware upgrade package to obtain multiple upgrade data packets; and forward the multiple upgrade data packets in parallel to multiple electronic devices.

[0115] In one possible implementation, the determination module 502 is specifically used to: obtain the status code of any upgrade data packet in multiple electronic devices; determine whether the upgrade data packet has completed the upgrade based on the status codes of multiple electronic devices; and determine whether the firmware upgrade package has completed the upgrade on multiple electronic devices based on whether multiple upgrade data packets have completed the upgrade.

[0116] In a possible implementation, the determination module 502 is further used to: determine an upgrade data package that has failed to be upgraded and a corresponding electronic device; and determine whether to re-upgrade the upgrade data package that has failed to be upgraded according to the upgrade configuration information.

[0117] In a possible implementation, the determination module 502 is also used for: if the upgrade configuration information determines that the upgrade data packet that failed to upgrade needs to be re-upgraded, then the upgrade data packet that failed to upgrade is forwarded to the electronic device that failed to upgrade; and based on the status code of the electronic device that failed to upgrade, determining whether the upgrade data packet that failed to upgrade is successfully re-upgraded on the electronic device that failed to upgrade.

[0118] In a possible implementation, the firmware upgrade device also includes a processing module (not shown), which is specifically used to: if the upgrade configuration information determines that the upgrade data packet that failed to upgrade will not be re-upgraded, record the port connected to the electronic device that failed to upgrade, and determine the upgrade data packet that failed to upgrade as completed.

[0119] In a possible implementation, the forwarding module 501 is specifically configured to: forward the firmware upgrade package to multiple electronic devices in parallel based on a complex programmable logic device.

[0120] Furthermore, the forwarding module can be executed through the CPLD module, that is, the CPLD module is used to respond to the firmware upgrade startup instruction and forward the firmware upgrade package to multiple electronic devices in parallel. The electronic devices are used to respond to the firmware upgrade package, perform firmware upgrade based on the firmware upgrade package and return a status code.

[0121] The determination module can be executed by a CPLD module, that is, the CPLD module is used to determine whether the firmware upgrade package has completed the upgrade on multiple electronic devices according to the status codes of the multiple electronic devices, and the status code is used to indicate that the electronic device has completed the firmware upgrade.

[0122] The output module can be executed by the SDK program, that is, the SDK program is used to output the firmware upgrade information of multiple electronic devices when the firmware upgrade package has completed the upgrade in multiple electronic devices.

[0123] The firmware upgrade device provided in this embodiment can execute the method provided in the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.

[0124] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the processing module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.

[0125] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element to allocate program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0126] Figure 6 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 6As shown, the electronic device 600 provided in the embodiment of the present application may include: a processor 601, and a memory 602 connected to the processor in communication, wherein:

[0127] Memory stores computer-executable instructions;

[0128] The processor executes the computer-executable instructions stored in the memory to implement the method described in the foregoing method embodiment.

[0129] It should be understood that the processor 601 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or the processor can be any conventional processor, etc. The steps of the method disclosed in the application can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor. The memory 602 may include a high-speed random access memory (RAM), and may also include non-volatile storage NVM (non-volatile memory), such as at least one disk storage, and can also be a USB flash drive, a mobile hard disk, a read-only memory, a disk or an optical disk, etc.

[0130] Optionally, the electronic device 600 may further include a communication interface 603. In a specific implementation, if the communication interface 603, the memory 602 and the processor 601 are implemented independently, the communication interface 603, the memory 602 and the processor 601 may be interconnected through a bus and communicate with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.

[0131] Optionally, in a specific implementation, if the communication interface 603, the memory 602 and the processor 601 are integrated on a chip, the communication interface 603, the memory 602 and the processor 601 can communicate through an internal interface.

[0132] An embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed, they are used to implement the method described in any of the aforementioned embodiments.

[0133] It is understood that the computer readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable read only memory (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special computer.

[0134] An exemplary computer-readable storage medium is coupled to a processor so that the processor can read information from the computer-readable storage medium and write information to the computer-readable storage medium. Of course, the computer-readable storage medium can also be an integral part of the processor. The processor and the computer-readable storage medium can be located in an ASIC. Of course, the processor and the computer-readable storage medium can also exist in an electronic device as discrete components.

[0135] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a computer-readable storage medium, including a number of instructions for enabling an electronic device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application.

[0136] An embodiment of the present application also provides a computer program product, including a computer program, which implements the method described in any of the above embodiments when executed.

[0137] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.

[0138] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0139] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not 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.

[0140] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0141] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A firmware upgrade method, characterized in that: The firmware upgrade method is applied to a switch, the switch is connected to an electronic device via a control port, and the firmware upgrade method includes: In response to the firmware upgrade start instruction, forwarding the firmware upgrade package to the plurality of electronic devices in parallel, wherein the electronic devices are used to respond to the firmware upgrade package, perform firmware upgrade based on the firmware upgrade package and return a status code; Determining whether the firmware upgrade package has completed upgrading on the multiple electronic devices according to status codes of the multiple electronic devices, wherein the status codes are used to indicate that the firmware upgrade of the electronic devices has been completed; When the firmware upgrade package has completed upgrading in the plurality of electronic devices, the firmware upgrade information of the plurality of electronic devices is output.

2. The method according to claim 1, characterized in that The step of forwarding the firmware upgrade package to the plurality of electronic devices in parallel comprises: Dividing the firmware upgrade package to obtain multiple upgrade data packets; The multiple upgrade data packets are forwarded to the multiple electronic devices in parallel.

3. The method according to claim 2, characterized in that The step of determining, according to the status codes of the multiple electronic devices, whether the firmware upgrade package has completed upgrading on the multiple electronic devices comprises: Obtaining a status code of any of the upgrade data packets in the plurality of electronic devices; Determining whether the upgrade data packet has completed the upgrade based on the status codes of the multiple electronic devices; According to whether the multiple upgrade data packets have completed the upgrade, it is determined whether the firmware upgrade package has completed the upgrade on the multiple electronic devices.

4. The method according to claim 3, characterized in that After determining that the firmware upgrade package has an unfinished upgrade situation in the plurality of electronic devices, the method includes: Determine the upgrade data package and corresponding electronic device that failed to be upgraded; Determine whether to re-upgrade the upgrade data package that failed to be upgraded according to the upgrade configuration information.

5. The method according to claim 4, characterized in that include: If the upgrade configuration information determines to re-upgrade the upgrade data packet that failed to be upgraded, forwarding the upgrade data packet that failed to be upgraded to the electronic device that failed to be upgraded; According to the status code of the electronic device on which the upgrade fails, it is determined whether the upgrade data packet on which the upgrade fails is successfully re-upgraded on the electronic device on which the upgrade fails.

6. The method according to claim 4, characterized in that Also includes: If the upgrade configuration information determines that the upgrade data packet that failed to be upgraded is not to be re-upgraded, the port connected to the electronic device that failed to be upgraded is recorded, and the upgrade data packet that failed to be upgraded is determined to have completed upgrading.

7. The method according to any one of claims 1 to 6, characterized in that The step of forwarding the firmware upgrade package to the plurality of electronic devices in parallel comprises: Based on a complex programmable logic device (CPLD), the firmware upgrade package is forwarded to a plurality of electronic devices in parallel.

8. A firmware upgrade device, characterized in that: The firmware upgrade device is applied to a switch, and the switch is connected to the electronic device through a control port. The firmware upgrade device includes: A forwarding module, configured to respond to a firmware upgrade start instruction, forward a firmware upgrade package to a plurality of electronic devices in parallel, wherein the electronic devices are configured to respond to the firmware upgrade package, perform a firmware upgrade based on the firmware upgrade package, and return a status code; A determination module, configured to determine whether the firmware upgrade package has completed the upgrade on the multiple electronic devices according to status codes of the multiple electronic devices, wherein the status codes are used to indicate that the firmware upgrade of the electronic device has been completed; The output module is used to output the firmware upgrade information of the multiple electronic devices when the firmware upgrade package has completed the upgrade in the multiple electronic devices.

9. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed.