CN112118132A - Method, device and equipment for upgrading switch firmware and readable medium - Google Patents
Method, device and equipment for upgrading switch firmware and readable medium Download PDFInfo
- Publication number
- CN112118132A CN112118132A CN202010950979.4A CN202010950979A CN112118132A CN 112118132 A CN112118132 A CN 112118132A CN 202010950979 A CN202010950979 A CN 202010950979A CN 112118132 A CN112118132 A CN 112118132A
- Authority
- CN
- China
- Prior art keywords
- switch
- firmware
- upgrading
- address
- version information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
- 238000000034 method Methods 0.000 title claims abstract description 41
- 238000004590 computer program Methods 0.000 claims description 9
- 238000012360 testing method Methods 0.000 claims description 6
- 230000008569 process Effects 0.000 abstract description 6
- 230000007547 defect Effects 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 9
- 230000003287 optical effect Effects 0.000 description 4
- 238000013461 design Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/0813—Configuration setting characterised by the conditions triggering a change of settings
- H04L41/082—Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0876—Aspects of the degree of configuration automation
- H04L41/0886—Fully automatic configuration
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0889—Techniques to speed-up the configuration process
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Automation & Control Theory (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a method for upgrading switch firmware, which comprises the following steps: acquiring an ip address of the switch to be upgraded, and logging in the switch to be upgraded based on the ip address; acquiring version information of the firmware of the switch to be upgraded and judging whether the version information of the firmware is consistent with the preset version information; if the version information is inconsistent with the preset version information, setting an upgrading control bit to be in an upgrading state; and acquiring all the firmware with the upgrade control bit in the upgrade state, and upgrading the firmware. The invention also discloses an upgrading device of the switch firmware, computer equipment and a readable storage medium. The invention greatly improves the efficiency of the switch upgrading and reduces the failure rate of firmware upgrading by checking the firmware version and carrying out full-automatic upgrading operation. The defect that the switch cannot be automatically upgraded when leaving the factory is effectively overcome, and the problems that the version cannot be automatically checked and the upgrading can only be performed through manual checking in the use process of the machine are solved.
Description
Technical Field
The invention relates to the technical field of switches, in particular to a method, a device, equipment and a readable medium for upgrading switch firmware.
Background
Currently, there are many small and medium-sized enterprises using traditional switches of the Huashi, Huasan and Cisco brands, while large enterprises such as Google, Amazon and Facebook have started to take the lead to use white-brand switches. The former is programmable and the latter is not programmable, as compared to conventional switches. The biggest bright spot of the white-card switch is strong openness, that is, the operating system, software and other aspects of the white-card switch have more choices for users.
The current firmware upgrading of the switch is realized by manually setting BMC ip of each machine when the switch leaves a factory, and then writing ip addresses into a script one by one for batch burning; a user cannot automatically check whether the firmware version of the current machine is upgraded or not in use, the firmware version can be checked manually only when a new function needs to be introduced, and a manufacturer is contacted to arrange an engineer to carry out field upgrade, so that the problem that the upgrade cannot be carried out due to the fact that the difference between the firmware version used by a switch and the current latest firmware version is too large can exist, meanwhile, only a single machine can be upgraded one by one during field upgrade, the upgrade efficiency is low, and meanwhile, the upgrade failure caused by misoperation can easily occur.
Disclosure of Invention
In view of this, an object of the embodiments of the present invention is to provide a method, an apparatus, a device, and a readable medium for upgrading a switch firmware, which greatly improve the efficiency of upgrading the switch and reduce the failure rate of upgrading the firmware by checking the firmware version and performing full-automatic upgrading operation. The defect that the switch cannot be automatically upgraded when leaving the factory is effectively overcome, and the problems that the version cannot be automatically checked and the upgrading can only be performed through manual checking in the use process of the machine are solved.
Based on the above object, an aspect of the embodiments of the present invention provides a method for upgrading a switch firmware, including the following steps: acquiring an ip address of the switch to be upgraded, and logging in the switch to be upgraded based on the ip address; acquiring version information of the firmware of the switch to be upgraded and judging whether the version information of the firmware is consistent with the preset version information; if the version information is inconsistent with the preset version information, setting an upgrading control bit to be in an upgrading state; and acquiring all the firmware with the upgrade control bit in the upgrade state, and upgrading the firmware.
In some embodiments, obtaining an ip address of the switch to be upgraded, and logging in the switch to be upgraded based on the ip address includes: acquiring a port state of a serial port switch to judge whether a newly accessed switch exists; if the newly accessed switch exists, writing the newly accessed switch into a preset MAC address to access the test network; and allocating an ip address for the newly accessed switch, and logging in the switch based on the ip address.
In some embodiments, assigning an ip address to the newly accessed switch, and logging into the switch based on the ip address comprises: recording the allocated ip address in the current address pool as a first ip address pool; allocating ip addresses to the newly accessed switches, and recording the allocated ip addresses in the current address pool as a second ip address pool; and comparing the first ip address pool with the second ip address pool, and recording the newly added ip address of the second ip address pool compared with the first ip address pool as the ip address of the switch to be upgraded.
In some embodiments, obtaining an ip address of a switch to be upgraded, and logging in the switch to be upgraded based on the ip address includes: and checking the version of the switch every other preset period, and setting the switch with low firmware version as the switch to be upgraded.
In some embodiments, obtaining version information of the firmware of the switch to be upgraded and determining whether the version information of the firmware is consistent with the preset version information includes: and acquiring version numbers of the BMC, the CPLD and the BIOS of the switch to be upgraded, and judging whether the version numbers are consistent with a preset version number.
In some embodiments, if the version information is consistent with the preset version information, the upgrade control bit is set to a non-upgrade state.
In some embodiments, acquiring all firmware with the upgrade control bit in the upgrade state, and upgrading the firmware includes: acquiring firmware with an upgrade control bit in an upgrade state, and upgrading the firmware; judging whether the upgraded firmware version information is consistent with the preset version information again; and if the firmware version is consistent with the preset version information, setting the upgrading control bit to be in a non-upgrading state.
In another aspect of the embodiments of the present invention, an apparatus for upgrading a switch firmware is further provided, including: the login module is configured to acquire an ip address of the switch to be upgraded and login the switch to be upgraded based on the ip address; the judging module is configured to acquire version information of the firmware of the switch to be upgraded and judge whether the version information of the firmware is consistent with the preset version information; the setting module is configured to set the upgrading control bit to be in an upgrading state if the version information is inconsistent with the preset version information; and the upgrading module is configured to acquire all the firmware with the upgrading control bit in the upgrading state and upgrade the firmware.
In some embodiments, the login module is further configured to: acquiring a port state of a serial port switch to judge whether a newly accessed switch exists; if the newly accessed switch exists, writing the newly accessed switch into a preset MAC address to access the test network; and allocating an ip address for the newly accessed switch, and logging in the switch based on the ip address.
In some embodiments, the login module is further configured to: recording the allocated ip address in the current address pool as a first ip address pool; allocating ip addresses to the newly accessed switches, and recording the allocated ip addresses in the current address pool as a second ip address pool; and comparing the first ip address pool with the second ip address pool, and recording the newly added ip address of the second ip address pool compared with the first ip address pool as the ip address of the switch to be upgraded.
In some embodiments, the login module is further configured to: and checking the version of the switch every other preset period, and setting the switch with low firmware version as the switch to be upgraded.
In some embodiments, the determining module is further configured to: and acquiring version numbers of the BMC, the CPLD and the BIOS of the switch to be upgraded, and judging whether the version numbers are consistent with a preset version number.
In some embodiments, the setup module is further configured to: and if the version information is consistent with the preset version information, setting the upgrading control bit to be in a non-upgrading state.
In some embodiments, the upgrade module is further configured to: acquiring all firmware with an upgrade control bit in an upgrade state, and upgrading the firmware; judging whether the upgraded firmware version is consistent with the preset version information again; and if the firmware version information is consistent with the preset version information, setting the upgrading control bit to be in a non-upgrading state.
In another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method.
In a further aspect of the embodiments of the present invention, a computer-readable storage medium is also provided, in which a computer program for implementing the above method steps is stored when the computer program is executed by a processor.
The invention has the following beneficial technical effects: the firmware version is checked and fully-automatic upgrading operation is carried out, so that the efficiency of upgrading the switch is greatly improved, and the failure rate of upgrading the firmware is reduced. The defect that the switch cannot be automatically upgraded when leaving the factory is effectively overcome, and the problems that the version cannot be automatically checked and the upgrading can only be performed through manual checking in the use process of the machine are solved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
Fig. 1 is a schematic diagram of an embodiment of an upgrading method of switch firmware provided by the present invention;
fig. 2 is a schematic diagram of an embodiment of an upgrading apparatus for switch firmware provided by the present invention;
FIG. 3 is a schematic diagram of an embodiment of a computer device provided by the present invention;
FIG. 4 is a schematic diagram of an embodiment of a computer-readable storage medium provided by the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
In view of the above object, a first aspect of the embodiments of the present invention provides an embodiment of a method for upgrading a switch firmware. Fig. 1 is a schematic diagram illustrating an embodiment of a method for upgrading switch firmware provided by the present invention. As shown in fig. 1, the embodiment of the present invention includes the following steps:
s01, acquiring an ip address of the switch to be upgraded, and logging in the switch to be upgraded based on the ip address;
s02, acquiring the version information of the switch firmware to be upgraded and judging whether the version information of the firmware is consistent with the preset version information;
s03, if the version information is not consistent with the preset version information, setting the upgrade control bit to be in an upgrade state; and
and S04, acquiring all the firmware with the upgrade control bit in the upgrade state, and upgrading the firmware.
In this embodiment, the firmware of the white box switch mainly includes BMC, BIOS and CPLD. The BMC is an independent system independent from the CPU end NOS. The BMC has independent processor and memory and can independently run outside the NOS. After the NOS is down or the hardware fails, the BMC can still run and manage the NOS or diagnose the hardware resources; the basic input output system of BIOS, a standard firmware interface, has been widely adopted in the UEFI specification with the increasing product requirements. The primary function of the BIOS is to provide the lowest level, most direct hardware setup and control for the computer. In brief, the BIOS prepares all hardware related functions for the operating system, providing a possibility for the system to run; CPLD (Complex Programmable Logic device) is a short term for Complex PLD, a Logic element that is more Complex than PLD. The CPLD is a digital integrated circuit in which a user constructs logic functions according to his or her own needs. The basic design method is to generate corresponding target files by means of an integrated development software platform and methods such as schematic diagrams, hardware description languages and the like, and to transmit codes to a target chip through a download cable, so as to realize a designed digital system.
In the embodiment, there are two usage scenarios, namely, a newly-accessed machine firmware upgrade and a long-time running machine firmware update. And writing the newly generated ip address under the two scenes into the configuration file C. Triggering a switch login script, and automatically logging in the switch by using a newly generated BMC ip address in the configuration file C; after successful login, automatically executing a version acquisition command, acquiring the versions of the BMC, the CPLD and the BIOS, and putting the version numbers into corresponding configuration files D; acquiring version information of firmware in a firmware upgrading server, and putting the version number into a configuration file E; comparing versions of BMC, BIOS and CPLD; if the updating control bit is inconsistent with the updating control bit in the configuration file of the updating script, automatically modifying whether the updating control bit is updated or not according to the comparison result, modifying the updating control bit to be 1, and modifying the version number in the updating script according to the firmware version of the updating server, wherein the updating control bit is not updated and is written to be 0; after the configuration file is modified, automatically executing an upgrading script to upgrade a target machine; and after upgrading is finished, automatically executing the version acquisition command, acquiring the versions of the BMC, the CPLD and the BIOS, and putting the version numbers into the corresponding configuration files F.
In some embodiments of the present invention, obtaining an ip address of a switch to be upgraded, and logging in the switch to be upgraded based on the ip address includes: acquiring a port state of a serial port switch to judge whether a newly accessed switch exists; if the newly accessed switch exists, writing the newly accessed switch into a preset MAC address to access the test network; and allocating an ip address for the newly accessed switch, and logging in the switch based on the ip address.
In this embodiment, a newly accessed switch is connected to a serial port switch, a port of the serial port switch is changed from a down state to an up state, an MAC address burning server scans the port states of all serial port switches at regular time, checks whether the up port has been written into an MAC address in a specified range, if the MAC address is in the specified MAC address range, does not process the address, and if the MAC address is not in the specified MAC address range, randomly extracts an address from an unallocated MAC address database and burns the MAC address into a machine by using a burning command; and the DHCP server allocates a specific ip address to the BMC side of the switch according to the content of the chaddr field in the received DHCPdiscover message.
In some embodiments of the present invention, allocating an ip address to a newly accessed switch, and logging in the switch based on the ip address includes: recording the allocated ip address in the current address pool as a first ip address pool; allocating ip addresses to the newly accessed switches, and recording the allocated ip addresses in the current address pool as a second ip address pool; and comparing the first ip address pool with the second ip address pool, and recording the newly added ip address of the second ip address pool compared with the first ip address pool as the ip address of the switch to be upgraded.
In this embodiment, the MAC address is written into the server — the MAC address in the specified range is written, and the switch accesses the test network; the DHCP server records the allocated ip address A in the current DHCP address pool; the method comprises the steps that a switch acquires an ip address in a specified range; re-recording the allocated ip address B in the current DHCP address pool; and comparing the address pools A and B, and writing the newly generated address in the DHCP address pool B into the configuration file C.
In some embodiments of the present invention, obtaining an ip address of a switch to be upgraded, and logging in the switch to be upgraded based on the ip address includes: and checking the version of the switch every other preset period, and setting the switch with low firmware version as the switch to be upgraded.
In this embodiment, 30 days is a period, version check is performed every 30 days, and when the version is a low version, firmware upgrade is performed on the execution upgrade script; and the DHCP server writes the allocated ip address A in the current DHCP address pool into a configuration file C.
In some embodiments of the present invention, obtaining version information of a firmware of a switch to be upgraded and determining whether the version information of the firmware is consistent with a preset version information includes: and acquiring version numbers of the BMC, the CPLD and the BIOS of the switch to be upgraded, and judging whether the version numbers are consistent with a preset version number.
In some embodiments of the present invention, if the version information is consistent with the preset version information, the upgrade control bit is set to a non-upgrade state.
In some embodiments of the present invention, acquiring all firmware with an upgrade control bit in an upgrade state, and upgrading the firmware includes: acquiring firmware with an upgrade control bit in an upgrade state, and upgrading the firmware; judging whether the upgraded firmware version information is consistent with the preset version information again; and if the firmware version is consistent with the preset version information, setting the upgrading control bit to be in a non-upgrading state.
It should be particularly noted that, the steps in the embodiments of the method for upgrading the switch firmware described above may be intersected, replaced, added, or deleted, and therefore, these methods for upgrading the switch firmware that are transformed by reasonable permutation and combination should also belong to the scope of the present invention, and should not limit the scope of the present invention to the embodiments.
In view of the above object, a second aspect of the embodiments of the present invention provides an apparatus for upgrading a switch firmware. Fig. 2 is a schematic diagram illustrating an embodiment of an apparatus for upgrading switch firmware provided by the present invention. As shown in fig. 2, the embodiment of the present invention includes the following modules: the login module S11 is configured to acquire an ip address of the switch to be upgraded and login the switch to be upgraded based on the ip address; the judging module S12 is configured to acquire version information of the firmware of the switch to be upgraded and judge whether the version information of the firmware is consistent with the preset version information; a setting module S13 configured to set the upgrade control bit to the upgrade state if the version information is inconsistent with the preset version information; and an upgrade module S14 configured to acquire all firmware whose upgrade control bit is in an upgrade state, and upgrade the firmware.
In some embodiments of the invention, the login module S11 is further configured to: acquiring a port state of a serial port switch to judge whether a newly accessed switch exists; if the newly accessed switch exists, writing the newly accessed switch into a preset MAC address to access the test network; and allocating an ip address for the newly accessed switch, and logging in the switch based on the ip address.
In some embodiments of the invention, the login module S11 is further configured to: recording the allocated ip address in the current address pool as a first ip address pool; allocating ip addresses to the newly accessed switches, and recording the allocated ip addresses in the current address pool as a second ip address pool; and comparing the first ip address pool with the second ip address pool, and recording the newly added ip address of the second ip address pool compared with the first ip address pool as the ip address of the switch to be upgraded.
In some embodiments of the invention, the login module S11 is further configured to: and checking the version of the switch every other preset period, and setting the switch with low firmware version as the switch to be upgraded.
In some embodiments of the present invention, the determining module S12 is further configured to: and acquiring version numbers of the BMC, the CPLD and the BIOS of the switch to be upgraded, and judging whether the version numbers are consistent with a preset version number.
In some embodiments of the invention, the setup module S13 is further configured to: and if the version information is consistent with the preset version information, setting the upgrading control bit to be in a non-upgrading state.
In some embodiments of the invention, the upgrade module S14 is further configured to: acquiring all firmware with an upgrade control bit in an upgrade state, and upgrading the firmware; judging whether the upgraded firmware version is consistent with the preset version information again; and if the firmware version information is consistent with the preset version information, setting the upgrading control bit to be in a non-upgrading state.
In view of the above object, a third aspect of the embodiments of the present invention provides a computer device. Fig. 3 is a schematic diagram of an embodiment of a computer device provided by the present invention. As shown in fig. 3, an embodiment of the present invention includes the following means: at least one processor S21; and a memory S22, the memory S22 storing computer instructions S23 executable on the processor, the instructions when executed by the processor implementing the steps of the above method.
The invention also provides a computer readable storage medium. FIG. 4 is a schematic diagram illustrating an embodiment of a computer-readable storage medium provided by the present invention. As shown in fig. 4, the computer readable storage medium stores S31 a computer program that, when executed by a processor, performs the method as described above S32.
Finally, it should be noted that, as one of ordinary skill in the art can appreciate, all or part of the processes in the methods of the above embodiments may be implemented by instructing relevant hardware by a computer program, and the program of the method for upgrading the switch firmware may be stored in a computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. The storage medium of the program may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
Furthermore, the methods disclosed according to embodiments of the present invention may also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. Which when executed by a processor performs the above-described functions defined in the methods disclosed in embodiments of the invention.
Further, the above method steps and system elements may also be implemented using a controller and a computer readable storage medium for storing a computer program for causing the controller to implement the functions of the above steps or elements.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
In one or more exemplary designs, the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), floppy disk, blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.
Claims (10)
1. A method for upgrading switch firmware is characterized by comprising the following steps:
acquiring an ip address of a switch to be upgraded, and logging in the switch to be upgraded based on the ip address;
acquiring version information of the switch firmware to be upgraded and judging whether the version information of the firmware is consistent with preset version information or not;
if the version information is inconsistent with the preset version information, setting an upgrading control bit to be in an upgrading state; and
and acquiring all the firmware of which the upgrade control bit is in an upgrade state, and upgrading the firmware.
2. The method for upgrading the switch firmware according to claim 1, wherein the step of obtaining an ip address of the switch to be upgraded and logging in the switch to be upgraded based on the ip address comprises the steps of:
acquiring a port state of a serial port switch to judge whether a newly accessed switch exists;
if the newly accessed switch exists, writing the newly accessed switch into a preset MAC address to access the test network;
and allocating an ip address for the newly accessed switch, and logging in the switch based on the ip address.
3. The method for upgrading the firmware of the switch according to claim 2, wherein the step of allocating an ip address to the newly accessed switch and logging in the switch based on the ip address comprises:
recording the allocated ip address in the current address pool as a first ip address pool;
allocating ip addresses to the newly accessed switches, and recording the allocated ip addresses in the current address pool as a second ip address pool;
and comparing the first ip address pool with the second ip address pool, and recording the newly added ip address of the second ip address pool compared with the first ip address pool as the ip address of the switch to be upgraded.
4. The method for upgrading the switch firmware according to claim 1, wherein the step of obtaining an ip address of the switch to be upgraded and logging in the switch to be upgraded based on the ip address comprises the steps of:
and checking the version of the switch every other preset period, and setting the switch with low firmware version as the switch to be upgraded.
5. The method for upgrading the switch firmware according to claim 1, wherein the step of obtaining the version information of the switch firmware to be upgraded and judging whether the version information of the firmware is consistent with the preset version information comprises:
and acquiring the version numbers of the BMC, the CPLD and the BIOS of the switch to be upgraded, and judging whether the version numbers are consistent with a preset version number.
6. The method for upgrading switch firmware according to claim 1, further comprising:
and if the version information is consistent with the preset version information, setting the upgrading control bit to be in a non-upgrading state.
7. The method according to claim 1, wherein the obtaining of all the firmware with the upgrade control bit in the upgrade state and the upgrading of the firmware include:
acquiring the firmware of which the upgrading control bit is in an upgrading state, and upgrading the firmware;
judging whether the upgraded firmware version information is consistent with the preset version information again;
and if the firmware version is consistent with the preset version information, setting the upgrading control bit to be in a non-upgrading state.
8. An apparatus for upgrading switch firmware, comprising:
the login module is configured to acquire an ip address of the switch to be upgraded and login the switch to be upgraded based on the ip address;
the judging module is configured to acquire version information of the switch firmware to be upgraded and judge whether the version information of the firmware is consistent with preset version information;
the setting module is configured to set the upgrading control bit to be in an upgrading state if the version information is inconsistent with the preset version information; and
and the upgrading module is configured to acquire all the firmware of which the upgrading control bit is in an upgrading state and upgrade the firmware.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of any of the methods 1-7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010950979.4A CN112118132A (en) | 2020-09-11 | 2020-09-11 | Method, device and equipment for upgrading switch firmware and readable medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010950979.4A CN112118132A (en) | 2020-09-11 | 2020-09-11 | Method, device and equipment for upgrading switch firmware and readable medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112118132A true CN112118132A (en) | 2020-12-22 |
Family
ID=73803564
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010950979.4A Withdrawn CN112118132A (en) | 2020-09-11 | 2020-09-11 | Method, device and equipment for upgrading switch firmware and readable medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112118132A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113064722A (en) * | 2021-03-12 | 2021-07-02 | 山东英信计算机技术有限公司 | Display card resource allocation switching method and system |
CN113722212A (en) * | 2021-08-13 | 2021-11-30 | 苏州浪潮智能科技有限公司 | CPLD upgrade test method, device, equipment and medium |
CN114978938A (en) * | 2022-05-26 | 2022-08-30 | 西安易朴通讯技术有限公司 | Switch testing method, system and equipment |
CN117193819A (en) * | 2023-09-07 | 2023-12-08 | 迈胜医疗设备有限公司 | Radiation therapy system, firmware upgrade method, apparatus and related devices |
-
2020
- 2020-09-11 CN CN202010950979.4A patent/CN112118132A/en not_active Withdrawn
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113064722A (en) * | 2021-03-12 | 2021-07-02 | 山东英信计算机技术有限公司 | Display card resource allocation switching method and system |
CN113722212A (en) * | 2021-08-13 | 2021-11-30 | 苏州浪潮智能科技有限公司 | CPLD upgrade test method, device, equipment and medium |
CN113722212B (en) * | 2021-08-13 | 2023-07-14 | 苏州浪潮智能科技有限公司 | CPLD upgrading test method, device, equipment and medium |
CN114978938A (en) * | 2022-05-26 | 2022-08-30 | 西安易朴通讯技术有限公司 | Switch testing method, system and equipment |
CN117193819A (en) * | 2023-09-07 | 2023-12-08 | 迈胜医疗设备有限公司 | Radiation therapy system, firmware upgrade method, apparatus and related devices |
CN117193819B (en) * | 2023-09-07 | 2024-03-26 | 迈胜医疗设备有限公司 | Radiation therapy system, firmware upgrade method, apparatus and related devices |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112118132A (en) | Method, device and equipment for upgrading switch firmware and readable medium | |
CN111177043B (en) | Method, system, device and medium for accelerating reading of field replaceable unit information | |
CN110968477B (en) | Method, device and medium for acquiring backup BMC version information | |
CN108108174A (en) | Optical module and its method of firmware upgrade | |
CN107800730A (en) | The expansion method and device of a kind of virtual disk | |
CN112328268A (en) | Method, device and equipment for upgrading white box switch software and readable medium | |
CN111147340A (en) | Method, equipment and medium for carrying out networked access on CAN bus interface | |
CN114157639B (en) | Method, device and equipment for collecting information of intelligent network card of server and readable medium | |
CN111367560A (en) | Method, system, equipment and medium for expanding server function | |
CN114237519A (en) | Method, device, equipment and medium for migrating object storage data | |
CN104104701A (en) | Online service configuration updating method and system | |
CN111427777B (en) | SOL test method, system, equipment and medium | |
CN111813507A (en) | Method, system, equipment and medium for high availability of virtual machine based on sanlock | |
CN110427199B (en) | Method, equipment and readable medium for upgrading BMC and BIOS in matching manner | |
CN116483470A (en) | Method for acquiring configuration information, electronic equipment and medium | |
CN111130976B (en) | Method, equipment and medium for configuring virtual local area network of white box switch | |
JP2019145910A (en) | Communication terminal | |
CN108595292A (en) | A kind of optimization method of system, mobile terminal and computer storage media | |
CN114398213A (en) | Method, device and equipment for testing functions of solid state disk and storage medium | |
CN111008037A (en) | Code migration method, equipment and storage medium | |
CN111857744A (en) | Installation method, system, equipment and medium of super-fusion system | |
CN113821246A (en) | Software non-inductive incremental updating method, device, system and storage medium | |
CN111193818A (en) | Method, system, equipment and medium for obtaining IP address | |
CN111638896A (en) | Upgrading method, upgrading device, storage medium, processor and mobile terminal | |
CN111130861A (en) | Method and device for stateless automatic management of whole cabinet equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20201222 |