Switch firmware one-key upgrading method, device and equipment and readable storage medium

By generating a composite software package suite and performing decompression verification, one-click upgrade of switch firmware is achieved, which solves the problems of cumbersome and error-prone traditional upgrade methods, and improves the upgrade efficiency and accuracy.

CN119105794APending Publication Date: 2024-12-10ZIGUANG HENGYUE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411250457.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

Traditional switch firmware upgrade methods are cumbersome and error-prone, which is particularly troublesome for user and manufacturer management, especially when multiple firmware needs to be upgraded.

Method used

By generating and using a composite package suite, all types of firmware required for the switch to be upgraded are compressed into one package, decompressed and verified, and one-click upgrades are achieved to avoid repeated upgrades and waste of resources.

Benefits of technology

Simplifies the switch firmware upgrade process, reduces version management problems, ensures the integrity and accuracy of firmware data, and improves user experience and manufacturer management efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119105794A_ABST
    Figure CN119105794A_ABST
Patent Text Reader

Abstract

The invention provides a switch firmware one-key upgrading method, device and equipment and a readable storage medium, and the method comprises the steps: carrying out the decompression and verification of a target composite software package suite needed by all to-be-upgraded firmware of a to-be-upgraded switch, and obtaining a verification result, the target composite software package suite is one of multiple composite software package suite, and the multiple composite software package suite is obtained by compressing all types of firmware, needing to be upgraded, of the same version of the to-be-upgraded switch into one composite software package suite through a packaging tool in the process of generating the firmware of the to-be-upgraded switch by executing the script; and according to the verification result, carrying out one-key upgrading on the related firmware of the switch to be upgraded. By means of the method, the effect of the one-key upgrading process of the switch firmware can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of switch upgrades, and in particular to a method, apparatus, device, and readable storage medium for one-click upgrade of switch firmware. Background Art

[0002] At present, with the rise of various enterprise networks, the application scenarios of switches are increasing, which will also respond to the problem of switch upgrades. The traditional way to upgrade switch firmware is to upgrade them one by one.

[0003] The traditional upgrade method itself is not a problem for people who are familiar with the device. However, for users, the operation is cumbersome and prone to errors. It is not very user-friendly. For manufacturers, each firmware upgrade requires the corresponding supporting firmware to be upgraded together. Sometimes, multiple firmwares need to be upgraded, which is a troublesome thing for manufacturers to manage.

[0004] Therefore, how to implement a one-click upgrade process for switch firmware is a technical problem that needs to be solved. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a method for one-click upgrade of switch firmware. The technical solution of the embodiments of the present application can achieve the effect of the one-click upgrade process of the switch firmware.

[0006] In a first aspect, an embodiment of the present application provides a method for one-click upgrading of switch firmware, comprising decompressing and verifying a target composite software package suite required for all firmware to be upgraded of the switch to be upgraded, and obtaining a verification result, wherein the target composite software package suite is one of multiple composite software package suites, and the multiple composite software package suites are obtained by compressing all types of firmware required to be upgraded for the same version of the switch to be upgraded into one composite software package suite by a packaging tool during the process of executing a script to generate the firmware of the switch to be upgraded; according to the verification result, the relevant firmware of the switch to be upgraded is upgraded with one click.

[0007] In the above embodiment of the present application, the user can use a pre-compressed composite software package suite to upgrade the device. The device will automatically decompress it into multiple version files and use these version files to upgrade the device, thereby reducing the version management problem between startup software packages. This method can achieve the effect of a one-click upgrade process for the switch firmware.

[0008] In some embodiments, before decompressing and verifying the target composite software package suite required for all firmware to be upgraded of the switch to be upgraded to obtain the verification result, it also includes: in the process of executing the script to generate the firmware of the switch to be upgraded, compressing all types of firmware that need to be upgraded for the same version of the switch to be upgraded into a composite software package suite by a packaging tool to obtain multiple composite software package suites, wherein the multiple composite software package suites include the target composite software package suite.

[0009] In the above embodiment of the present application, before upgrading the switch firmware, the switch firmware script of the same version can be compressed into a composite software package suite, and the script data in the composite software package suite can be directly obtained when upgrading the switch firmware to achieve one-click upgrade.

[0010] In some embodiments, based on the verification result, the relevant firmware of the switch to be upgraded is upgraded with one click, including: based on the verification result, when it is determined that the target composite software package suite has passed the verification, comparing whether the firmware version in the target composite software package suite is consistent with the version of all the firmware to be upgraded; screening the firmware to be upgraded that is inconsistent with the firmware version in the target composite software package suite and upgrading the relevant firmware, wherein the relevant firmware is part of or all of the firmware to be upgraded.

[0011] In the above embodiments of the present application, the firmware version in the target composite software package suite and the version of the firmware to be upgraded can be compared, and different versions of firmware can be upgraded with one click, which can achieve one-click upgrade while avoiding repeated upgrades and wasting resources.

[0012] In some embodiments, the target composite software package suite required for all firmware to be upgraded of the switch to be upgraded is decompressed and verified to obtain a verification result, including: decompressing the target composite software package suite to obtain all firmware data in the target composite software package suite; and verifying the integrity of all firmware data through a hash value file to obtain a verification result.

[0013] In the above-mentioned embodiments of the present application, the firmware data in the composite software package is verified by hash verification, so as to ensure that the complete firmware data can be obtained during the upgrade, thereby achieving accurate firmware upgrade.

[0014] In a second aspect, an embodiment of the present application provides a device for one-click upgrade of switch firmware, including:

[0015] The verification module is used to decompress and verify the target composite software package required by all the firmware to be upgraded of the switch to be upgraded, and obtain the verification result, wherein the target composite software package is one of multiple composite software packages, and the multiple composite software packages are obtained by compressing all types of firmware required to be upgraded for the same version of the switch to be upgraded into one composite software package by a packaging tool during the process of executing the script to generate the firmware of the switch to be upgraded;

[0016] The upgrade module is used to perform one-click upgrade of the relevant firmware of the switch to be upgraded according to the verification result.

[0017] Optionally, the device further comprises:

[0018] The compression module is used for the verification module to decompress and verify the target composite software package required by all the firmware to be upgraded of the switch to be upgraded, and before obtaining the verification result, in the process of executing the script to generate the firmware of the switch to be upgraded, compress all types of firmware required to be upgraded for the same version of the switch to be upgraded into a composite software package by a packaging tool to obtain multiple composite software package packages, wherein the multiple composite software package packages include the target composite software package package.

[0019] Optionally, the upgrade module is specifically used for:

[0020] According to the verification result, when it is determined that the target compound software package suite has passed the verification, the firmware version in the target compound software package suite is compared with the versions of all the firmware to be upgraded to see whether they are consistent;

[0021] The firmware to be upgraded that is inconsistent with the firmware version in the target composite software package is screened and the related firmware is upgraded, wherein the related firmware is part of or all of the firmware to be upgraded.

[0022] Optionally, the verification module is specifically used for:

[0023] Decompressing the target composite software package to obtain all firmware data in the target composite software package;

[0024] The integrity of all firmware data is verified through the hash value file to obtain the verification result.

[0025] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the method provided in the first aspect are performed.

[0026] In a fourth aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the method provided in the first aspect are performed.

[0027] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the embodiments of the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0029] Figure 1 A flowchart of a method for one-click upgrade of switch firmware provided in an embodiment of the present application;

[0030] Figure 2 A flowchart of a method for implementing a one-key upgrade of switch firmware provided in an embodiment of the present application;

[0031] Figure 3 A schematic block diagram of a device for one-key upgrade of switch firmware provided in an embodiment of the present application;

[0032] Figure 4 A schematic diagram of the structure of a device for one-click upgrade of switch firmware provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0034] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0035] First, some terms involved in the embodiments of the present application are explained to facilitate understanding by those skilled in the art.

[0036] Switch firmware is an executable program written into the switch, which determines the function and performance of the switch. Firmware is the device "driver" stored inside the device. Through firmware, the operating system can implement the operation of a specific machine according to the standard device driver. In hardware devices, firmware plays a vital role, because it is not only the soul of the hardware device, but also in some hardware devices, there is no other software except firmware, so the firmware determines the function and performance of the hardware device.

[0037] A composite software package suite is a software package with specific functions, a program or a group of programs used to complete a specific task. It can be divided into two categories: application software packages and system software packages. Application software packages are a collection of software designed to solve specific problems, while system software packages are the underlying system tools and libraries required to support the operation of application software.

[0038] U-Boot is an open source bootloader, mainly used for the startup process of embedded systems. It supports a variety of processor architectures and embedded platforms, has the functions of initializing hardware devices, loading operating system kernels and root file systems, and provides an interactive command line interface for users to configure, debug and maintain operations.

[0039] MD5MD5 (Message Digest Algorithm 5) files are files containing MD5 hash values, which are used to verify the integrity and consistency of files. It is a widely used hash algorithm that converts input data of any length into a 128-bit hash value. The characteristics of this algorithm include uniqueness and one-way irreversibility, that is, it is difficult for different input data to generate the same MD5 hash value, and once the data is hashed, it cannot be restored to the original data. An MD5 file is usually a text file that contains one or more MD5 hash values, each of which is associated with a specific file.

[0040] uImage is a kernel image file in a specific format created by the tool mkimage compiled by uboot. It is designed specifically for uboot. The uImage file is a 64-byte "header" added before zImage (a compressed kernel image file). This header contains information such as the kernel version, loading location, generation time, size, etc. This header information is located after 0x40 of the uImage file and is no different from zImage. uImage is mainly used to start the Linux kernel with uboot. It can choose the appropriate decompression method according to the actual situation. Whether it is compressed or uncompressed kernel image, it can be loaded and executed from the storage medium through specific commands (such as bootz or bootm).

[0041] CPLD firmware refers to the program or data stored in the CPLD (Complex Programmable Logic Device) chip. CPLD is a digital integrated circuit that users can construct logic functions according to their own needs. Its basic design method is to use the integrated development software platform, use schematics, hardware description language and other methods to generate the corresponding target file, and then transfer the code to the target chip through a download cable ("in-system" programming) to realize the designed digital system.

[0042] Switch means "switch" and is a network device used for forwarding electrical (optical) signals. It can provide an exclusive electrical signal path for any two network nodes connected to the switch. The most common switch is the Ethernet switch. Other common switches include telephone voice switches, fiber optic switches, etc.

[0043] PyInstaller: This is a cross-platform packaging tool that can package Python programs into independent executable files and supports operating systems such as Windows, Linux, and MacOS. PyInstaller is easy to use and only requires a simple command to complete the packaging process. The generated EXE file is relatively large.

[0044] cx_Freeze: It is also a commonly used Python packaging tool. Compared with PyInstaller, cx_Freeze is more flexible in managing external dependencies and supports some advanced features, such as multi-process support and automatic dependency analysis of Python standard libraries. cx_Freeze supports common operating systems such as Windows, Linux, and MacOS.

[0045] Py2exe: A tool specifically used to package Python programs into executable files, mainly for Windows platforms. Py2exe can package Python code, dependent modules, and the Python interpreter into an executable Windows application, which is convenient for running on machines that do not have a Python interpreter installed. Py2exe is a long-established Python packaging tool, and its stability and reliability are widely recognized.

[0046] PyOxidizer: This is a new packaging tool that supports packaging Python code into executable files and supports operating systems such as Windows, Linux, and Mac OS X. PyOxidizer is easy to use and has good portability, but there may be some instability issues.

[0047] PyMe: is a tool for generating web applications or system login interfaces in one click, and may also have packaging capabilities. However, more information is needed to confirm the specific functions and applicability of PyMe.

[0048] This application is applied to the scenario of switch upgrade. The specific scenario is to package the switch firmware script data of various versions in advance, and all the corresponding data can be directly obtained for upgrade during one-click upgrade.

[0049] At present, with the rise of various enterprise networks, switch application scenarios are increasing, and the issue of switch upgrades will also arise in response. The traditional way to upgrade switch firmware is to upgrade one by one. The traditional upgrade method itself is not a problem for people who are familiar with the device. However, for users, the operation is cumbersome and prone to errors. It is poor for users. For manufacturers, each firmware upgrade requires the corresponding supporting firmware to be upgraded together. Sometimes there are multiple firmwares that need to be upgraded, which is a more troublesome thing for manufacturers to manage.

[0050] To this end, the present application obtains a verification result by decompressing and verifying the target composite software package required for all the firmware to be upgraded of the switch to be upgraded, wherein the target composite software package is one of multiple composite software packages, and the multiple composite software packages are obtained by compressing all types of firmware required to be upgraded for the same version of the switch to be upgraded into one composite software package by a packaging tool during the process of executing a script to generate the firmware of the switch to be upgraded; according to the verification result, the relevant firmware of the switch to be upgraded is upgraded with one click. The user can use the pre-compressed composite software package to upgrade the device, and the device will automatically decompress it into multiple version files and use these version files to upgrade the device, thereby reducing the version management problem between the startup software packages. This method can achieve the effect of the one-click upgrade process of the switch firmware.

[0051] In the embodiment of the present application, the execution subject can be a switch firmware one-click upgrade device in the switch firmware one-click upgrade system. In actual applications, the switch firmware one-click upgrade device can be electronic devices such as terminal devices and servers, which is not limited here.

[0052] Combine the following Figure 1 The method for one-click upgrade of switch firmware in an embodiment of the present application is described in detail.

[0053] Please see Figure 1 , Figure 1 A flowchart of a method for one-click upgrade of switch firmware provided in an embodiment of the present application, such as Figure 1 The switch firmware one-click upgrade methods shown include:

[0054] Step 110: decompress and verify the target composite software package required by all firmware to be upgraded of the switch to be upgraded, and obtain a verification result.

[0055] The target composite software package suite is one of multiple composite software package suites, which includes script upgrade related data of different firmware under the version required by the user. The multiple composite software package suites are obtained by compressing all types of firmware required to be upgraded for the same version of the switch to be upgraded into one composite software package suite through a packaging tool during the process of executing the script to generate the firmware of the switch to be upgraded. The switch can be a telephone voice switch, an optical fiber switch, etc., or any network device for forwarding electrical (optical) signals. The firmware to be upgraded can be one or more executable programs written into the switch. The target composite software packages required for all the firmware to be upgraded can be formulated in the app (application) or uboot according to user needs.

[0056] In some embodiments of the present application, before decompressing and verifying the target composite software package required by all the firmware to be upgraded of the switch to be upgraded and obtaining the verification result, Figure 1 The method shown also includes: in the process of executing the script to generate the firmware of the switch to be upgraded, all types of firmware that need to be upgraded for the same version of the switch to be upgraded are compressed into a compound software package suite by a packaging tool to obtain multiple compound software package suites, wherein the multiple compound software package suites include the target compound software package suite.

[0057] In the above process, before upgrading the switch firmware, the switch firmware script of the same version can be compressed into a composite software package suite, and the script data in the composite software package suite can be directly obtained when upgrading the switch firmware to achieve one-click upgrade.

[0058] The process of executing the script to generate the firmware of the switch to be upgraded can be the process of the relevant technicians programming the switch firmware, and the process of upgrading the switch with one click can be realized by the user through the script edited by the relevant personnel. The packaging tool can be PyInstaller, cx_Freeze, Py2exe, PyOxidizer and PyMe, etc. A composite software package includes script data of the same version but different firmware.

[0059] In some embodiments of the present application, the target composite software package suite required for all firmware to be upgraded of the switch to be upgraded is decompressed and verified to obtain a verification result, including: decompressing the target composite software package suite to obtain all firmware data in the target composite software package suite; verifying the integrity of all firmware data through a hash value file to obtain a verification result.

[0060] In the above process, the present application verifies the firmware data in the composite software package suite by means of hash verification, which can ensure that complete firmware data can be obtained during the upgrade and achieve accurate firmware upgrade.

[0061] Among them, decompressing the target composite software package suite can be realized by using a tool with relevant decompression script data. The integrity of all firmware data can be verified by the hash value file to obtain the verification result. The integrity of all firmware data can be judged by using MD5 and other verification. By calculating the hash value of each firmware data, a unique identifier can be generated to verify the integrity of all firmware data. If any changes are made to all firmware data during transmission or storage, its hash value will change. Therefore, the integrity of the data can be determined by comparing the total hash value of all firmware data with the original total hash value.

[0062] Step 120: According to the verification result, the firmware of the switch to be upgraded is upgraded with one click.

[0063] The related firmware may be all the firmware in the switch to be upgraded, or the firmware selected by the user to be upgraded in the switch to be upgraded, or the firmware selected by the system that is inconsistent in version or not the latest version.

[0064] In some embodiments of the present application, based on the verification result, the relevant firmware of the switch to be upgraded is upgraded with one click, including: based on the verification result, when it is determined that the target composite software package suite has passed the verification, comparing whether the firmware version in the target composite software package suite is consistent with the version of all the firmware to be upgraded; screening the firmware to be upgraded that is inconsistent with the firmware version in the target composite software package suite and performing relevant firmware upgrades, wherein the relevant firmware is part of or all of the firmware to be upgraded.

[0065] In the above process, the present application can compare the firmware version in the target composite software package suite with the version of the firmware to be upgraded, and upgrade different versions of firmware with one click, which can achieve one-click upgrade while avoiding repeated upgrades and wasting resources.

[0066] Among them, the firmware to be upgraded that is consistent with the firmware version in the target composite software package can skip the upgrade to save time. The firmware version in the target composite software package and the firmware version to be upgraded can be determined by the version number or the similarity of the estimated data. After all the firmware to be upgraded is upgraded, it will automatically restart to take effect.

[0067] Optionally, before performing one-click upgrade on the related firmware of the switch to be upgraded, it is necessary to verify the firmware data corresponding to the uImage in the switch to be upgraded. When the firmware data corresponding to the uImage passes the verification, upgrade other firmware. For example, the upgrade of firmware such as uboot and cpld is a supporting upgrade for the normal execution of uImage. Therefore, the firmware data corresponding to the uImage needs to be verified.

[0068] Specifically, you can Figure 2 The implementation method of the one-click upgrade of the switch firmware shown is described in detail.

[0069] Please see Figure 2 , Figure 2 A flowchart of an implementation method for one-click upgrade of switch firmware provided in an embodiment of the present application, such as Figure 2 The implementation method of the switch firmware one-click upgrade shown includes:

[0070] Step 201: Formulate a composite software package to be upgraded in uboot or app.

[0071] Specifically: Select the target composite software package to be upgraded in uboot or app.

[0072] Step 202: Verify the composite software package.

[0073] Specifically: download the preset target composite software package and verify the firmware data.

[0074] Step 203: Check whether ulmage in the composite software package is valid.

[0075] Specifically: if it is valid, go to step 204; otherwise, go to step 205.

[0076] Step 204: Check whether the ulmage is the same as the original ulmage.

[0077] Specifically: check whether the ulmage version in the target composite software package is the same as the ulmage version in the switch to be upgraded. If they are the same, go to step 206; otherwise, go to step 207.

[0078] Step 205: Output an error prompt message and exit the software package upgrade operation.

[0079] Specific: Output error message and end the upgrade.

[0080] Step 206: Same as ulmage, jump out of the ulmage upgrade operation.

[0081] Step 207: Burn and upgrade ulmage.

[0082] Step 208: Check whether the ubool package in the composite software package exists.

[0083] Specifically: if yes, go to step 209; otherwise, go to step 214.

[0084] Step 209: Check whether the ubool package is valid.

[0085] Specifically: if it is valid, go to step 210; otherwise, go to step 211.

[0086] Step 210: Check whether the ubool package is the same as the original ubool.

[0087] Specifically: check whether the ubool version in the target composite software package is the same as the ubool version in the switch to be upgraded. If they are the same, proceed to step 212; otherwise, proceed to step 213.

[0088] Step 211: Print the information that uboot verification failed and exit the upgrade operation after prompting.

[0089] Step 212: The same as uboot, exit the uboot upgrade operation.

[0090] Step 213: Burn and upgrade ubool.

[0091] Step 214: Check whether the cpld package exists in the composite software package.

[0092] Specifically: if yes, go to step 215; otherwise, go to step 220.

[0093] Step 215: Check whether the cpld package is valid.

[0094] Specifically: if it is valid, go to step 216; otherwise, go to step 217.

[0095] Step 216: Check whether the cpld package is the same as the original cpld.

[0096] Specifically: check whether the cpld version in the target composite software package is the same as the cpld version in the switch to be upgraded. If they are the same, proceed to step 218; otherwise, proceed to step 219.

[0097] Step 217: Print the information of cpld verification failure and prompt, then exit the upgrade operation.

[0098] Step 218: The cpld is the same, and the cpld upgrade operation is exited.

[0099] Step 219: Burn and upgrade the cpld.

[0100] Step 220: Update completed, restart to take effect.

[0101] also, Figure 2 The specific methods and steps shown can be found in Figure 1 The method shown will not be described in detail here.

[0102] In the above Figure 1 In the process shown, the present application obtains a verification result by decompressing and verifying the target composite software package required for all the firmware to be upgraded of the switch to be upgraded, wherein the target composite software package is one of multiple composite software packages, and the multiple composite software packages are obtained by compressing all types of firmware required to be upgraded for the same version of the switch to be upgraded into one composite software package by a packaging tool during the process of executing a script to generate the firmware of the switch to be upgraded; according to the verification result, the relevant firmware of the switch to be upgraded is upgraded with one click. The user can use the pre-compressed composite software package to upgrade the device, and the device will automatically decompress it into multiple version files and use these version files to upgrade the device, thereby reducing the version management problem between the startup software packages. This method can achieve the effect of the one-click upgrade process of the switch firmware.

[0103] Previous article Figure 1-Figure 2 Describes the one-click upgrade method for switch firmware. Figure 3-Figure 4 Describes the device for one-click upgrade of switch firmware.

[0104] Please refer to Figure 3 , is a schematic block diagram of a device 300 for one-key upgrade of switch firmware provided in an embodiment of the present application, and the device 300 may be a module, program segment or code on an electronic device. Figure 1 The method embodiment corresponds to and can be executed Figure 1 The various steps involved in the method embodiment and the specific functions of the device 300 can be found in the description below. To avoid repetition, the detailed description is appropriately omitted here.

[0105] Optionally, the device 300 includes:

[0106] The verification module 310 is used to decompress and verify the target composite software package required by all the firmware to be upgraded of the switch to be upgraded, and obtain a verification result, wherein the target composite software package is one of multiple composite software packages, and the multiple composite software packages are obtained by compressing all types of firmware required to be upgraded for the same version of the switch to be upgraded into one composite software package by a packaging tool during the process of executing the script to generate the firmware of the switch to be upgraded;

[0107] The upgrade module 320 is used to perform one-key upgrade on the relevant firmware of the switch to be upgraded according to the verification result.

[0108] Optionally, the device further comprises:

[0109] The compression module is used for the verification module to decompress and verify the target composite software package required by all the firmware to be upgraded of the switch to be upgraded, and before obtaining the verification result, in the process of executing the script to generate the firmware of the switch to be upgraded, compress all types of firmware required to be upgraded for the same version of the switch to be upgraded into a composite software package by a packaging tool to obtain multiple composite software package packages, wherein the multiple composite software package packages include the target composite software package package.

[0110] Optionally, the upgrade module 320 is specifically used for:

[0111] According to the verification result, when it is determined that the target compound software package suite has passed the verification, the firmware version in the target compound software package suite is compared with the versions of all the firmware to be upgraded to see whether they are consistent;

[0112] The firmware to be upgraded that is inconsistent with the firmware version in the target composite software package is screened and the related firmware is upgraded, wherein the related firmware is part of or all of the firmware to be upgraded.

[0113] Optionally, the verification module 310 is specifically used for:

[0114] Decompressing the target composite software package to obtain all firmware data in the target composite software package;

[0115] The integrity of all firmware data is verified through the hash value file to obtain the verification result.

[0116] Please refer to Figure 4 The structure schematic block diagram of a switch firmware one-key upgrade device provided in an embodiment of the present application, the device may include a memory 410 and a processor 420. Optionally, the device may also include: a communication interface 430 and a communication bus 440. The device is similar to the above Figure 1 The method embodiment corresponds to and can be executed Figure 1 The various steps involved in the method embodiment and the specific functions of the device can be found in the description below.

[0117] Specifically, the memory 410 is used to store computer-readable instructions.

[0118] Processor 420 is used to process the readable instructions stored in the memory and can execute Figure 1 The steps in the method.

[0119] The communication interface 430 is used for signaling or data communication with other node devices, for example, for communication with a server or a terminal, or for communication with other device nodes, but the embodiments of the present application are not limited thereto.

[0120] The communication bus 440 is used to realize direct connection and communication among the above components.

[0121] The communication interface 430 of the device in the embodiment of the present application is used to communicate signals or data with other node devices. The memory 410 can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The memory 410 can also be at least one storage device located away from the aforementioned processor. The memory 410 stores computer-readable instructions. When the computer-readable instructions are executed by the processor 420, the electronic device executes the aforementioned Figure 1The method process shown. The processor 420 can be used on the device 300 and used to perform the functions in the present application. Exemplarily, the above-mentioned processor 420 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and the embodiments of the present application are not limited thereto.

[0122] The present application also provides a readable storage medium, which, when executed by a processor, performs the following Figure 1 The method process in the method embodiment shown is executed by the electronic device.

[0123] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method, and will not be described in detail here.

[0124] In summary, the embodiments of the present application provide a method, device, electronic device and readable storage medium for one-click upgrade of switch firmware, the method comprising: decompressing and verifying the target composite software package required for all the firmware to be upgraded of the switch to be upgraded, and obtaining the verification result, wherein the target composite software package is one of multiple composite software packages, and the multiple composite software packages are obtained by compressing all types of firmware required to be upgraded for the same version of the switch to be upgraded into one composite software package by a packaging tool during the process of executing a script to generate the firmware of the switch to be upgraded; according to the verification result, the related firmware of the switch to be upgraded is upgraded with one click. The effect of the process of one-click upgrade of the switch firmware can be achieved by this method.

[0125] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a part of the module, program segment or code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0126] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0127] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

[0128] The above are only embodiments of the present application and are not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0129] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0130] 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 existence of other identical elements in the process, method, article or device including the elements.

Claims

1. A method for one-click upgrade of switch firmware. It is characterized in that include: Decompressing and verifying the target composite software package required for all the firmware to be upgraded of the switch to be upgraded to obtain a verification result, wherein the target composite software package is one of multiple composite software packages, and the multiple composite software packages are obtained by compressing all types of firmware required to be upgraded for the same version of the switch to be upgraded into one composite software package by a packaging tool during the process of executing the script to generate the firmware of the switch to be upgraded; According to the verification results, the relevant firmware of the switch to be upgraded can be upgraded with one click.

2. The method according to claim 1, It is characterized in that Before decompressing and verifying the target composite software package required by all the firmware to be upgraded of the switch to be upgraded and obtaining the verification result, the method further includes: In the process of executing the script to generate the firmware of the switch to be upgraded, all types of firmware required to be upgraded for the same version of the switch to be upgraded are compressed into a compound software package suite by a packaging tool to obtain multiple compound software package suites, wherein the multiple compound software package suites include a target compound software package suite.

3. A method according to claim 1 or 2, It is characterized in that According to the verification results, the firmware of the switch to be upgraded is upgraded with one click, including: According to the verification result, when it is determined that the target compound software package suite has passed the verification, the firmware version in the target compound software package suite is compared with the versions of all the firmware to be upgraded to see whether they are consistent; The firmware to be upgraded that is inconsistent with the firmware version in the target composite software package is screened and the related firmware is upgraded, wherein the related firmware is part of or all of the firmware to be upgraded.

4. A method according to claim 1 or 2, It is characterized in that Decompress and verify the target composite software package required by all the firmware to be upgraded of the switch to be upgraded, and obtain the verification results, including: Decompressing the target composite software package to obtain all firmware data in the target composite software package; The integrity of all firmware data is verified through the hash value file to obtain the verification result.

5. A device for one-click upgrade of switch firmware, It is characterized in that include: The verification module is used to decompress and verify the target composite software package required by all the firmware to be upgraded of the switch to be upgraded, and obtain the verification result, wherein the target composite software package is one of multiple composite software packages, and the multiple composite software packages are obtained by compressing all types of firmware required to be upgraded for the same version of the switch to be upgraded into one composite software package by a packaging tool during the process of executing the script to generate the firmware of the switch to be upgraded; The upgrade module is used to perform one-click upgrade of the relevant firmware of the switch to be upgraded according to the verification result.

6. The device according to claim 5, It is characterized in that The device also includes: The compression module is used for the verification module to decompress and verify the target composite software package required by all the firmware to be upgraded of the switch to be upgraded, and before obtaining the verification result, in the process of executing the script to generate the firmware of the switch to be upgraded, compress all types of firmware required to be upgraded for the same version of the switch to be upgraded into a composite software package by a packaging tool to obtain multiple composite software package packages, wherein the multiple composite software package packages include the target composite software package package.

7. The device according to claim 5 or 6, It is characterized in that The upgrade module is specifically used for: According to the verification result, when it is determined that the target compound software package suite has passed the verification, the firmware version in the target compound software package suite is compared with the versions of all the firmware to be upgraded to see whether they are consistent; The firmware to be upgraded that is inconsistent with the firmware version in the target composite software package is screened and the related firmware is upgraded, wherein the related firmware is part of or all of the firmware to be upgraded.

8. The device according to claim 5 or 6, It is characterized in that The verification module is specifically used for: Decompressing the target composite software package to obtain all firmware data in the target composite software package; The integrity of all firmware data is verified through the hash value file to obtain the verification result.

9. An electronic device, It is characterized in that include: A memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in any one of the methods of claims 1 to 4 are executed.

10. A computer-readable storage medium, It is characterized in that include: A computer program, when the computer program is run on a computer, causes the computer to execute the method according to any one of claims 1 to 4.