[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN111147314A - Switch upgrading method, device and storage medium - Google Patents

Switch upgrading method, device and storage medium Download PDF

Info

Publication number
CN111147314A
CN111147314A CN201911425048.6A CN201911425048A CN111147314A CN 111147314 A CN111147314 A CN 111147314A CN 201911425048 A CN201911425048 A CN 201911425048A CN 111147314 A CN111147314 A CN 111147314A
Authority
CN
China
Prior art keywords
switch
upgraded
upgrading
switches
ethernet
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.)
Pending
Application number
CN201911425048.6A
Other languages
Chinese (zh)
Inventor
冯伟
许胜众
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Fengrunda Technology Co ltd
Original Assignee
Shenzhen Fengrunda Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Fengrunda Technology Co ltd filed Critical Shenzhen Fengrunda Technology Co ltd
Priority to CN201911425048.6A priority Critical patent/CN111147314A/en
Publication of CN111147314A publication Critical patent/CN111147314A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0876Aspects of the degree of configuration automation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Automation & Control Theory (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention discloses a method for upgrading a switch, which comprises the following steps: acquiring identification information of a switch through an Ethernet two-layer protocol message, wherein the identification information of the switch is generated according to a physical address of the switch; determining a plurality of switches to be upgraded and corresponding files to be upgraded from the switches scanned by the Ethernet two-layer protocol message according to the identification information; and when a batch upgrading command is received, writing the file to be upgraded into corresponding local switches to be upgraded through an Ethernet two-layer protocol message so as to complete the upgrading operation of the switches to be upgraded. The invention also discloses a switch upgrading device and a computer readable storage medium. The invention realizes the batch upgrading of the switches through the Ethernet two-layer protocol according to the unique identification information of each switch, and improves the effect and efficiency of the batch upgrading of the switches.

Description

Switch upgrading method, device and storage medium
Technical Field
The present invention relates to the field of switch technologies, and in particular, to a switch upgrading method, a switch upgrading apparatus, and a computer-readable storage medium.
Background
With the continuous development of computer technology, the application range of network technology is becoming wider and wider, and as the core of ethernet-based devices such as computers, printers, servers and IP phones, higher requirements are also put forward on the forwarding performance of switches. Therefore, in order to improve the performance of the switch, a lot of different versions are derived from the switch with the same model, and the version of the switch needs to be upgraded when the application of the main switch cannot meet the application requirements.
However, the existing switch upgrading method mainly performs single upgrading through a webpage or a serial port, and cannot realize simultaneous upgrading of multiple devices. Under the condition that Ethernet-based equipment such as computers, printers, servers, IP telephones and the like is increased day by day, the application range of the switch is wider and wider, if only one switch is upgraded, the time and the labor are consumed, and the application requirements cannot be met in time; in addition, for the switches with the same outgoing IP, because it is difficult to distinguish and identify the switches with the same IP, it is inconvenient to establish communication connection with the corresponding switch device, so that it is difficult to upgrade the switches with the same IP in batches.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a switch upgrading method, a switch upgrading device and a computer readable storage medium, and aims to solve the problems that upgrading efficiency is low and the switches with the same factory IP are difficult to upgrade in batch due to the fact that simultaneous upgrading of multiple devices cannot be achieved in the prior art.
In order to achieve the above object, the present invention provides a method for upgrading a switch, the method comprising the steps of:
acquiring identification information of a switch through an Ethernet two-layer protocol message, wherein the identification information of the switch is generated according to a physical address of the switch;
determining a plurality of switches to be upgraded and corresponding files to be upgraded from the switches scanned by the Ethernet two-layer protocol message according to the identification information;
and when a batch upgrading command is received, writing the file to be upgraded into corresponding local switches to be upgraded through an Ethernet two-layer protocol message so as to complete the upgrading operation of the switches to be upgraded.
Optionally, the step of determining a plurality of switches to be upgraded and corresponding files to be upgraded in the switches scanned from the ethernet two-layer protocol packet according to the identification information includes:
acquiring the version information of the switch corresponding to the identification information through an Ethernet two-layer protocol message;
when the identification information is the same, comparing the acquired version information with version information prestored in the server to judge whether the version information is consistent;
determining a plurality of switches to be upgraded from the switches scanned by the Ethernet two-layer protocol message according to corresponding identification information when the version information is inconsistent;
and determining a corresponding file to be upgraded from the upgrade files prestored in the server according to the switch to be upgraded.
Optionally, when receiving a batch upgrade command, writing the file to be upgraded into the local of the corresponding multiple switches to be upgraded through an ethernet two-layer protocol packet, so as to complete the upgrade operation of the multiple switches to be upgraded, including:
when a batch upgrading command is received, determining a plurality of identification information of a switch corresponding to the batch upgrading command;
determining a plurality of target switches corresponding to the batch upgrading command from the switches to be upgraded according to the determined identification information;
and writing the corresponding files to be upgraded into the plurality of target switch local areas through Ethernet two-layer protocol messages so as to complete the upgrading operation of the plurality of target switch areas.
Optionally, after the step of determining a plurality of target switches corresponding to the batch upgrade command from the switches to be upgraded according to the determined identification information, the method includes:
judging whether the number of the target switches exceeds a preset number or not;
if yes, dividing the target switches into a plurality of target switches;
and writing the corresponding file to be upgraded into the plurality of target switch local areas in each batch through the Ethernet two-layer protocol message so as to finish the upgrading operation of the plurality of target switch areas in each batch.
Optionally, after the step of writing the file to be upgraded into the local areas of the plurality of switches to be upgraded through the ethernet two-layer protocol packet, the method includes:
judging whether the size of the files to be upgraded written into the local switches to be upgraded is larger than a first threshold value and smaller than a second threshold value;
if the number of the files to be upgraded is larger than the first threshold value and smaller than the second threshold value, judging that the files to be upgraded are written correctly, and finishing the upgrading operation of the corresponding switch according to the files to be upgraded which are written correctly;
and if the number of the files is smaller than the first threshold value or larger than the second threshold value, rewriting the corresponding files to be upgraded.
Optionally, after the step of writing the file to be upgraded into the local areas of the plurality of switches to be upgraded through the ethernet two-layer protocol packet, the method further includes:
writing the corresponding files to be upgraded into a plurality of local switches to be upgraded, controlling the corresponding switches to execute upgrading operation, and acquiring upgrading state information uploaded to a server by the switches through Ethernet two-layer protocol messages;
and determining the upgrading state of the corresponding switch according to the upgrading state information and the receiving time of the server for receiving the upgrading state information.
Optionally, after the step of determining the upgrade status of the corresponding switch according to the upgrade status information and the receiving time of the upgrade status information received by the server, the method includes:
when the switch receives a batch upgrading command and starts upgrading, judging whether a server receives upgrading state information reported by the switch within a first preset time;
if the server does not receive the upgrading state information within the first preset time or the received upgrading state information is upgrading failure information, judging that the corresponding switch is upgrading failed;
and when the received upgrade state information is upgrade success information, judging that the corresponding switch is upgraded successfully.
Optionally, after the step of determining whether the server receives the upgrade status information reported by the switch within the first preset time, the method includes:
and if the update request is not received, controlling the corresponding switch to send the update request after a second preset time, and ending the update request until the server receives the update state information reported by the switch.
In addition, in order to achieve the above object, the present invention further provides a switch upgrading apparatus, which includes a memory, a processor, and a switch upgrading program stored on the processor and operable on the processor, wherein the processor implements the steps of the switch upgrading method when executing the switch upgrading program.
Further, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a switch management program which, when executed by a processor, implements the steps of the switch management method as described above.
In the embodiment of the invention, the identification information of the switch is obtained through the Ethernet two-layer protocol message, a plurality of switches to be upgraded and corresponding files to be upgraded are determined from the switches scanned by the Ethernet two-layer protocol message according to the identification information, when a batch upgrading command is received, the files to be upgraded are written into the corresponding local areas of the switches to be upgraded through the Ethernet two-layer protocol message so as to complete the upgrading operation of the switches to be upgraded, the batch upgrading of the switches is realized through the Ethernet two-layer protocol, and the unique identification information of the switches is generated according to the physical addresses of the switches, so that the corresponding switches to be upgraded can be quickly found according to the unique identification information and subjected to batch upgrading, and the efficiency of the batch upgrading of the switches is improved.
Drawings
Fig. 1 is a schematic structural diagram of a switch upgrading apparatus in a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a first embodiment of the switch upgrade method of the present invention;
fig. 3 is a schematic flow chart of a second embodiment of the switch upgrading method of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Acquiring identification information of a switch through an Ethernet two-layer protocol message, wherein the identification information of the switch is generated according to a physical address of the switch; determining a plurality of switches to be upgraded and corresponding files to be upgraded from the switches scanned by the Ethernet two-layer protocol message according to the identification information; and when a batch upgrading command is received, writing the file to be upgraded into corresponding local switches to be upgraded through an Ethernet two-layer protocol message so as to complete the upgrading operation of the switches to be upgraded.
The existing upgrading method mainly carries out single upgrading through a webpage or a serial port, and for the switches with the same IP of a factory, because the switches with the same IP are difficult to distinguish and identify, the existing upgrading method is inconvenient to establish communication connection with corresponding switch equipment, so that the switches with the same IP are difficult to be upgraded in batches. Therefore, the invention provides a switch upgrading method, a switch upgrading device and a computer readable storage medium, wherein identification information of a switch is acquired through an Ethernet two-layer protocol message, the identification information of the switch is generated according to a physical address of the switch, a plurality of switches to be upgraded and corresponding files to be upgraded are determined from the switches scanned by the Ethernet two-layer protocol message according to the identification information, when a batch upgrading command is received, the files to be upgraded are written into the corresponding local areas of the switches to be upgraded through the Ethernet two-layer protocol message so as to complete upgrading operation of the switches to be upgraded, batch upgrading transmission is performed according to unique identification information of the switches based on the Ethernet two-layer protocol message instead of upgrading based on an IP address, and the problem that batch upgrading is difficult according to the IP address when the IP address is the same is avoided, the effect of upgrading the switch in batches can be improved, and the unique identification information is more favorable for finding the corresponding switch to be upgraded quickly to complete data transmission and upgrading operation, so that the efficiency of upgrading the switch in batches is improved.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a switch upgrading apparatus in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the switch upgrading apparatus may include: a communication bus 1002, a processor 1001, such as a CPU, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
It will be appreciated by those skilled in the art that the terminal architecture shown in fig. 1 does not constitute a limitation of the switch upgrading apparatus and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a switch upgrade program.
In the switch upgrading apparatus shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to invoke a switch upgrade program stored in the memory 1005 and perform the following operations:
acquiring identification information of a switch through an Ethernet two-layer protocol message, wherein the identification information of the switch is generated according to a physical address of the switch;
determining a plurality of switches to be upgraded and corresponding files to be upgraded from the switches scanned by the Ethernet two-layer protocol message according to the identification information;
and when a batch upgrading command is received, writing the file to be upgraded into corresponding local switches to be upgraded through an Ethernet two-layer protocol message so as to complete the upgrading operation of the switches to be upgraded.
Alternatively, the processor 1001 may call a switch upgrade program stored in the memory 1005, and further perform the following operations:
acquiring the version information of the switch corresponding to the identification information through an Ethernet two-layer protocol message;
when the identification information is the same, comparing the acquired version information with version information prestored in the server to judge whether the version information is consistent;
determining a plurality of switches to be upgraded from the switches scanned by the Ethernet two-layer protocol message according to corresponding identification information when the version information is inconsistent;
and determining a corresponding file to be upgraded from the upgrade files prestored in the server according to the switch to be upgraded.
Alternatively, the processor 1001 may call a switch upgrade program stored in the memory 1005, and further perform the following operations:
when a batch upgrading command is received, determining a plurality of identification information of a switch corresponding to the batch upgrading command;
determining a plurality of target switches corresponding to the batch upgrading command from the switches to be upgraded according to the determined identification information;
and writing the corresponding files to be upgraded into the plurality of target switch local areas through Ethernet two-layer protocol messages so as to complete the upgrading operation of the plurality of target switch areas.
Optionally, after the step of determining a plurality of target switches corresponding to the batch upgrade command from the switches to be upgraded according to the determined identification information, the processor 1001 invokes a switch upgrade program stored in the memory 1005, and performs the following operations:
judging whether the number of the target switches exceeds a preset number or not;
if yes, dividing the target switches into a plurality of target switches;
and writing the corresponding file to be upgraded into the plurality of target switch local areas in each batch through the Ethernet two-layer protocol message so as to finish the upgrading operation of the plurality of target switch areas in each batch.
Optionally, after the step of writing the file to be upgraded into the local areas of the corresponding multiple switches to be upgraded through the ethernet two-layer protocol packet, the processor 1001 may call the switch upgrade program stored in the memory 1005, and further perform the following operations:
judging whether the size of the files to be upgraded written into the local switches to be upgraded is larger than a first threshold value and smaller than a second threshold value;
if the number of the files to be upgraded is larger than the first threshold value and smaller than the second threshold value, judging that the files to be upgraded are written correctly, and finishing the upgrading operation of the corresponding switch according to the files to be upgraded which are written correctly;
and if the number of the files is smaller than the first threshold value or larger than the second threshold value, rewriting the corresponding files to be upgraded.
Optionally, after the step of writing the file to be upgraded into the local areas of the corresponding multiple switches to be upgraded through the ethernet two-layer protocol packet, the processor 1001 may call the switch upgrade program stored in the memory 1005, and further perform the following operations:
writing the corresponding files to be upgraded into a plurality of local switches to be upgraded, controlling the corresponding switches to execute upgrading operation, and acquiring upgrading state information uploaded to a server by the switches through Ethernet two-layer protocol messages;
and determining the upgrading state of the corresponding switch according to the upgrading state information and the receiving time of the server for receiving the upgrading state information.
Optionally, after the step of determining the upgrade status of the corresponding switch according to the upgrade status information and the receiving time of the upgrade status information received by the server, the processor 1001 may call a switch upgrade program stored in the memory 1005, and further perform the following operations:
when the switch receives a batch upgrading command and starts upgrading, judging whether a server receives upgrading state information reported by the switch within a first preset time;
if the server does not receive the upgrading state information within the first preset time or the received upgrading state information is upgrading failure information, judging that the corresponding switch is upgrading failed;
and when the received upgrade state information is upgrade success information, judging that the corresponding switch is upgraded successfully.
Optionally, after the step of determining whether the server receives the upgrade status information reported by the switch within the first preset time, the processor 1001 may call the switch upgrade program stored in the memory 1005, and further perform the following operations:
and if the update request is not received, controlling the corresponding switch to send the update request after a second preset time, and ending the update request until the server receives the update state information reported by the switch.
Referring to fig. 2, fig. 2 is a flowchart of a first embodiment of a switch upgrading method according to the present invention, in this embodiment, the switch upgrading method includes the following steps:
step S10: acquiring identification information of the switch through an Ethernet two-layer protocol message, wherein the identification information of the switch is generated according to a physical address of the switch;
according to the traditional switch upgrading scheme for upgrading the IP address based on the switch, when the IP addresses of the switches are the same (like the switches produced by a same manufacturer, the outgoing IP addresses of the switches are usually the same), if batch upgrading is carried out according to the IP addresses of the switches, when upgrading is abnormal in the upgrading process, the switch with the abnormal upgrading is difficult to determine according to the state information corresponding to the corresponding IP address reported by the switch, so that the abnormal information of the corresponding switch can be timely processed, and the like. Therefore, in this embodiment, before the switch is upgraded, the identification information of the switch is obtained through the ethernet two-layer protocol packet, where the identification information corresponds to each switch one to one and is unique identification information of each switch. The identification information of the switch is generated according to the physical address of the switch after the physical address of the switch is acquired. After the corresponding identification information is generated, when the switch is found through the scanning of the Ethernet two-layer protocol message, the identification information of the switch scanned through the Ethernet two-layer protocol message can be obtained. Before discovering the switch through the ethernet two-layer protocol message scanning, a local server supporting network transmission, such as a gateway or a three-layer switch, is deployed in a local area network where the switch is located, and then a server program is deployed on the server to support transmission based on the ethernet two-layer protocol, so that the switch can establish communication with the server through the ethernet two-layer protocol, the switch is discovered through the two-layer discovery message scanning, and after the corresponding switch receives the two-layer discovery message sent by the server, identification information of the switch reported to the server by the switch through an update message is acquired.
Step S20: determining a plurality of switches to be upgraded and corresponding files to be upgraded from the switches scanned by the Ethernet two-layer protocol message according to the identification information;
after the identification information of the switches is obtained, a plurality of switches to be upgraded and corresponding files to be upgraded can be determined from the switches scanned by the Ethernet two-layer protocol message according to the identification information. Specifically, while the identification information of the switch is obtained through the ethernet two-layer protocol packet, version information corresponding to the identification information may also be obtained, and the version information and the corresponding identification information are reported to the server together. After the identification information of the switch and the corresponding version information are reported to the server, because the version information corresponding to different identification information is prestored in the server, under the condition that the identification information is the same, the reported version information is matched with the version information prestored in the server, and whether the switch equipment corresponding to different identification information needs to be upgraded or not is judged according to the matching result. And determining corresponding identification information when the reported version information is consistent with the corresponding pre-stored version information according to the matching result, taking the identification information as target identification information, and determining the switch corresponding to the target identification information as the switch to be upgraded. After the target identification information and the corresponding switch to be upgraded are determined, the latest version information corresponding to different switches and the corresponding identification information are stored in the server in a correlated manner in advance, so that the files to be upgraded corresponding to the switches to be upgraded one by one can be determined according to the target identification information.
Step S30: and when a batch upgrading command is received, writing the file to be upgraded into corresponding local switches to be upgraded through an Ethernet two-layer protocol message so as to complete the upgrading operation of the switches to be upgraded.
When a batch upgrading command is received, according to the received batch upgrading command, a plurality of identification information corresponding to the batch upgrading command is determined, according to the identification information, a plurality of target switches to be upgraded corresponding to the batch upgrading command can be determined from the switches to be upgraded, and files to be upgraded corresponding to the target switches can be determined from the files to be upgraded.
On one hand, when a plurality of switches to be upgraded are upgraded in batch at the same time, the number of the supported switches to be upgraded at the same time is limited, after a plurality of target switches corresponding to the batch upgrading command are determined, whether the number of the target switches exceeds a preset number needs to be judged, and if the number of the target switches does not exceed the preset number, the corresponding files to be upgraded are directly written into the local areas of the target switches so as to finish the upgrading operation of the target switches; and if the number of the target switches exceeds the preset number, the preset number is used as a batch limit, and the target switches are subjected to batch processing to obtain a plurality of batches of target switches. The specific batch mode may be: equally dividing the target switches into a plurality of target switches of corresponding batches on the principle that the number of the switches of each batch does not exceed the preset number; or, on the basis of reaching the preset number, the target switch number of each batch is taken as the preset number to perform batch processing until the last batch (the number of the last batch may be less than the preset number), and so on. If the threshold value of the number of switches (that is, the preset number) supporting simultaneous batch upgrade is 256 in this embodiment, when there are 600 target switches, the 600 target switches may be divided into 3 batches, each batch has 200 target switches, or the 600 target switches may be divided into two batches of 256 switches and one batch of 88 switches, so as to obtain three batches of target switches. After the target switches are processed in batches to obtain a plurality of batches of switches to be upgraded, writing the corresponding files to be upgraded into the local areas of the target switches in each batch through Ethernet two-layer protocol messages so as to complete the upgrading operation of the target switches in each batch. If three batches of target switches are obtained through batch processing, according to the sequence of the first batch, the second batch and the third batch, firstly writing the corresponding files to be upgraded into the local part of the first batch of target switches through Ethernet two-layer protocol messages to complete the upgrading operation of the first batch of target switches, then writing the corresponding files to be upgraded into the local part of the second batch of target switches through Ethernet two-layer protocol messages to complete the batch upgrading of the second batch of target switches, and finally writing the corresponding files to be upgraded into the local part of the third batch of target switches through Ethernet two-layer protocol messages to complete the batch upgrading of the third batch of target switches. The batch can be determined according to the transmission distance, transmission rate, transmission effect and the like of the data.
On the other hand, after files to be upgraded corresponding to the target switches are determined from the files to be upgraded, the corresponding files to be upgraded can be written into the determined local switches to be upgraded through an Ethernet two-layer protocol message. The specific writing process may include: after the file to be upgraded is determined, performing sub-packet processing on the file to be upgraded according to file information (including file size) of the file to be upgraded to obtain a data packet corresponding to the file to be upgraded after sub-packet processing, determining an index number (serial number) of the data packet after sub-packet processing, requesting the corresponding data packet according to the index number (serial number) of the data packet in a mode of increasing the index number progressively (namely the serial number is increased from small to large), and sequentially writing the requested data packet into a corresponding local switch through an Ethernet two-layer protocol message; and when the index number is increased to be consistent with the packet number of the data packet, the writing of the corresponding file to be upgraded is finished.
In addition, after the file to be upgraded is written into the local of the corresponding plurality of switches to be upgraded through the ethernet two-layer protocol message, whether the written file to be upgraded is written correctly or not needs to be judged according to the size of the file to be upgraded written into the local of the switch, that is, whether the size of the file to be upgraded is larger than a first preset threshold and smaller than a second preset threshold or not is judged, if the size of the file to be upgraded is larger than the first preset threshold and smaller than the second preset threshold, the file to be upgraded is judged to be written correctly, and the upgrading operation of the corresponding switch is completed according to the file to be upgraded which is written correctly; in addition, when the size of the file written into the local to-be-upgraded file of the switch is smaller than a first preset threshold value or larger than a second preset threshold value, it is determined that the file to be upgraded is wrongly written, and the corresponding switch to be upgraded cannot be upgraded. And at the moment, generating feedback information for the file to be upgraded with the error, rewriting the corresponding file to be upgraded according to the feedback information, and after rewriting the corresponding file to be upgraded, finishing the upgrading operation on the corresponding switch according to the file to be upgraded which is locally written in the switch only when the rewritten file to be upgraded is larger than a first preset threshold value and smaller than a second preset threshold value.
In this embodiment, identification information of switches is obtained through an ethernet two-layer protocol packet, a plurality of switches to be upgraded and corresponding files to be upgraded are determined from the switches scanned by the ethernet two-layer protocol packet according to the identification information, and when a batch upgrade command is received, the files to be upgraded are written into a plurality of corresponding local switches to be upgraded through the ethernet two-layer protocol packet, so as to complete upgrade operations of the switches to be upgraded. The identification information is generated according to the physical address of the switch, is unique identification information of each switch device, is based on the identification information to perform connection communication to complete batch upgrading instead of performing connection communication based on the IP address of the switch, not only is batch upgrading realized, but also the difficulty in batch upgrading of the same exchange of factory IPs is avoided, and the upgrading efficiency of the switch and the reliability of batch upgrading are improved.
Referring to fig. 3, fig. 3 is a flowchart of a second embodiment of the switch upgrading method of the present invention, in this embodiment, the switch upgrading method includes the following steps:
step S11: acquiring identification information of a switch through an Ethernet two-layer protocol message, wherein the identification information of the switch is generated according to a physical address of the switch;
step S12: determining a plurality of switches to be upgraded and corresponding files to be upgraded from the switches scanned by the Ethernet two-layer protocol message according to the identification information;
step S13: when a batch upgrading command is received, writing the file to be upgraded into corresponding local switches to be upgraded through an Ethernet two-layer protocol message so that the switches to be upgraded execute upgrading operation, and acquiring upgrading state information uploaded to a server by the switches through the Ethernet two-layer protocol message;
step S14: and determining the upgrading state of the corresponding switch according to the upgrading state information and the receiving time of the server for receiving the upgrading state information.
In this embodiment, when a batch upgrade command is received, the file to be upgraded is written into the corresponding local switches to be upgraded through the ethernet two-layer protocol packet, so that the plurality of switches to be upgraded execute the upgrade operation, the switches also report the upgrade status information of each switch to be upgraded to the server one by one, and the upgrade status information uploaded to the server by the switches can be acquired through the ethernet two-layer protocol packet. According to the upgrade state information of the corresponding switch (namely, the upgrade state information obtained through the ethernet two-layer protocol message) received by the server and the receiving time of the upgrade state information, the upgrade state of the corresponding switch can be determined. The process of determining the upgrade status of the corresponding switch is as follows: starting a timer when a corresponding switch starts to be upgraded, judging whether the switch receives upgrade state information of the corresponding switch within first preset time, if the upgrade state information of the corresponding switch is received within the first preset time, continuously judging that the received upgrade state information is upgrade failure information, and if the received upgrade state information is the upgrade failure information, judging that the switch corresponding to the upgrade failure information fails to be upgraded; if the received upgrade state information is not upgrade failure information but upgrade success information, judging that the switch corresponding to the upgrade success information is upgraded successfully; if the upgrade state information of the corresponding switch is not received within the first preset time, if a network is disconnected in the upgrade process, the switch to be upgraded corresponding to the batch upgrade command and the switch which has already received the upgrade state information by the server can determine that the server does not receive the switch of the upgrade state information, and the switch which has not received the upgrade state information by the server is also determined as failed in upgrade. And only controlling the corresponding switch to continuously send the upgrading request after the corresponding switch receives the upgrading state information reported by the switch within the second preset time under the condition that the server does not receive the upgrading state information within the first preset time due to the conditions of network disconnection and the like until the server receives the upgrading state information reported by the switch, and ending the request. In addition, for the switch which fails to be upgraded, the server can correspondingly display the upgrading state information of the corresponding switch after receiving the upgrading state information, and the upgrading failure reason of the switch which fails to be upgraded can be determined according to the upgrading failure information displayed by the server and the receiving time of the upgrading state information, so that the user can process the switch according to the corresponding failure reason to complete the upgrading operation of the corresponding switch. If the corresponding reason of the upgrade failure can be determined to be file abnormality, verification failure and the like according to the upgrade failure information displayed by the server, and if the reason of the upgrade failure is the network disconnection condition in the process of the upgrade request and the like can be determined according to the receiving time of the upgrade state information received by the server.
In this embodiment, identification information of switches is obtained through an ethernet two-layer protocol message, a plurality of switches to be upgraded and corresponding files to be upgraded are determined from the switches scanned by the ethernet two-layer protocol message according to the identification information, when a batch upgrade command is received, the files to be upgraded are written into the local of the corresponding switches to be upgraded through the ethernet two-layer protocol message to complete upgrade operation of the switches to be upgraded, upgrade status information of each switch to be upgraded is reported to a server through the ethernet two-layer protocol message, the upgrade status of the corresponding switch is determined according to the upgrade status information received by the server and the receiving time of the upgrade status information received by the server, so that the reason of the upgrade failure is searched for the switch which fails to be upgraded, so that each switch to be upgraded corresponding to the batch upgrade command can smoothly complete the upgrade operation, the effect of upgrading the switches in batches is improved.
In addition, an embodiment of the present invention further provides a switch upgrading apparatus, where the switch upgrading apparatus includes a memory, a processor, and a switch upgrading program that is stored on the processor and is executable on the processor, and the processor implements the steps of the switch upgrading method when executing the switch upgrading program.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a switch upgrading program is stored on the computer-readable storage medium, and when executed by a processor, the switch upgrading program implements the steps of the switch upgrading method described above.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, a television, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A switch upgrade method, wherein the switch and a server establish communication via an ethernet layer two protocol, the switch upgrade method comprising the steps of:
acquiring identification information of a switch through an Ethernet two-layer protocol message, wherein the identification information of the switch is generated according to a physical address of the switch;
determining a plurality of switches to be upgraded and corresponding files to be upgraded from the switches scanned by the Ethernet two-layer protocol message according to the identification information;
and when a batch upgrading command is received, writing the file to be upgraded into corresponding local switches to be upgraded through an Ethernet two-layer protocol message so as to complete the upgrading operation of the switches to be upgraded.
2. The switch upgrading method according to claim 1, wherein the step of determining a plurality of switches to be upgraded and corresponding files to be upgraded from the switches scanned by the ethernet layer two protocol packet according to the identification information comprises:
acquiring the version information of the switch corresponding to the identification information through an Ethernet two-layer protocol message;
when the identification information is the same, comparing the acquired version information with version information prestored in the server to judge whether the version information is consistent;
determining a plurality of switches to be upgraded from the switches scanned by the Ethernet two-layer protocol message according to corresponding identification information when the version information is inconsistent;
and determining a corresponding file to be upgraded from the upgrade files prestored in the server according to the switch to be upgraded.
3. The switch upgrading method according to claim 2, wherein the step of writing the file to be upgraded into the corresponding plurality of switch locations to be upgraded through an ethernet two-layer protocol packet when receiving the batch upgrading command to complete the upgrading operation of the plurality of switches to be upgraded includes:
when a batch upgrading command is received, determining a plurality of identification information of a switch corresponding to the batch upgrading command;
determining a plurality of target switches corresponding to the batch upgrading command from the switches to be upgraded according to the determined identification information;
and writing the corresponding files to be upgraded into the plurality of target switch local areas through Ethernet two-layer protocol messages so as to complete the upgrading operation of the plurality of target switch areas.
4. The switch upgrading method according to claim 3, wherein the step of determining the target switches corresponding to the batch upgrading command from the switches to be upgraded according to the determined identification information is followed by:
judging whether the number of the target switches exceeds a preset number or not;
if yes, dividing the target switches into a plurality of target switches;
and writing the corresponding file to be upgraded into the plurality of target switch local areas in each batch through the Ethernet two-layer protocol message so as to finish the upgrading operation of the plurality of target switch areas in each batch.
5. The switch upgrade method according to claim 1, wherein after the step of writing the file to be upgraded into the corresponding plurality of switch locations to be upgraded via ethernet layer two protocol packets, the method includes:
judging whether the size of the files to be upgraded written into the local switches to be upgraded is larger than a first threshold value and smaller than a second threshold value;
if the number of the files to be upgraded is larger than the first threshold value and smaller than the second threshold value, judging that the files to be upgraded are written correctly, and finishing the upgrading operation of the corresponding switch according to the files to be upgraded which are written correctly;
and if the number of the files is smaller than the first threshold value or larger than the second threshold value, rewriting the corresponding files to be upgraded.
6. The switch upgrade method according to claim 1, wherein after the step of writing the file to be upgraded into the corresponding plurality of switch locations to be upgraded via an ethernet layer two protocol packet, the method further comprises:
writing the corresponding files to be upgraded into a plurality of local switches to be upgraded, controlling the corresponding switches to execute upgrading operation, and acquiring upgrading state information uploaded to a server by the switches through Ethernet two-layer protocol messages;
and determining the upgrading state of the corresponding switch according to the upgrading state information and the receiving time of the server for receiving the upgrading state information.
7. The switch upgrade method according to claim 6, wherein, after the step of determining the upgrade status of the corresponding switch according to the upgrade status information and a reception time at which the server receives the upgrade status information, the method comprises:
when the switch receives a batch upgrading command and starts upgrading, judging whether a server receives upgrading state information reported by the switch within a first preset time;
if the server does not receive the upgrading state information within the first preset time or the received upgrading state information is upgrading failure information, judging that the corresponding switch is upgrading failed;
and when the received upgrade state information is upgrade success information, judging that the corresponding switch is upgraded successfully.
8. The method for upgrading a switch according to claim 7, wherein the step of determining whether the server receives the upgrade status information reported by the switch within the first preset time is followed by:
and if the update request is not received, controlling the corresponding switch to send the update request after a second preset time, and ending the update request until the server receives the update state information reported by the switch.
9. A switch upgrade apparatus, comprising a memory, a processor, and a switch upgrade program stored on the memory and executable on the processor, wherein the processor implements the steps of the switch upgrade method according to any one of claims 1 to 8 when executing the switch upgrade program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a switch upgrade program, which, when executed by a processor, implements the steps of the switch upgrade method according to any one of claims 1-8.
CN201911425048.6A 2019-12-30 2019-12-30 Switch upgrading method, device and storage medium Pending CN111147314A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911425048.6A CN111147314A (en) 2019-12-30 2019-12-30 Switch upgrading method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911425048.6A CN111147314A (en) 2019-12-30 2019-12-30 Switch upgrading method, device and storage medium

Publications (1)

Publication Number Publication Date
CN111147314A true CN111147314A (en) 2020-05-12

Family

ID=70523192

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911425048.6A Pending CN111147314A (en) 2019-12-30 2019-12-30 Switch upgrading method, device and storage medium

Country Status (1)

Country Link
CN (1) CN111147314A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416796A (en) * 2020-12-03 2021-02-26 北京东土科技股份有限公司 Method and device for testing software upgrading
CN114531354A (en) * 2022-04-22 2022-05-24 北京金山云网络技术有限公司 Cluster upgrading method and device, cluster controller and server
CN114697312A (en) * 2022-03-07 2022-07-01 南京国电南自电网自动化有限公司 System and method for efficiently and safely upgrading switch software
CN115022170A (en) * 2022-05-31 2022-09-06 青岛海信宽带多媒体技术有限公司 Intelligent gateway and area upgrading control method thereof
CN115473808A (en) * 2022-08-25 2022-12-13 深圳市凯迪仕智能科技有限公司 Task execution method and related device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1414735A (en) * 2002-04-02 2003-04-30 华为技术有限公司 Data upgrading method of two-layer exchange equipment
CN102143229A (en) * 2011-03-31 2011-08-03 中兴通讯股份有限公司 Method and system for upgrading terminals in batches
CN103501288A (en) * 2013-09-17 2014-01-08 福建星网锐捷通讯股份有限公司 Method for achieving batch data upgrade on two-layer switching devices
CN105933133A (en) * 2015-10-13 2016-09-07 上海剑桥科技股份有限公司 Upgrade system and method for batch upgrading of network equipment with same IP
CN108900317A (en) * 2018-05-11 2018-11-27 深圳赤马通信技术有限公司 A method of multiple network equipment batch upgrade is given by Ethernet broadcast mode

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1414735A (en) * 2002-04-02 2003-04-30 华为技术有限公司 Data upgrading method of two-layer exchange equipment
CN102143229A (en) * 2011-03-31 2011-08-03 中兴通讯股份有限公司 Method and system for upgrading terminals in batches
CN103501288A (en) * 2013-09-17 2014-01-08 福建星网锐捷通讯股份有限公司 Method for achieving batch data upgrade on two-layer switching devices
CN105933133A (en) * 2015-10-13 2016-09-07 上海剑桥科技股份有限公司 Upgrade system and method for batch upgrading of network equipment with same IP
CN108900317A (en) * 2018-05-11 2018-11-27 深圳赤马通信技术有限公司 A method of multiple network equipment batch upgrade is given by Ethernet broadcast mode

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416796A (en) * 2020-12-03 2021-02-26 北京东土科技股份有限公司 Method and device for testing software upgrading
CN112416796B (en) * 2020-12-03 2023-11-17 北京东土科技股份有限公司 Software upgrading test method and device
CN114697312A (en) * 2022-03-07 2022-07-01 南京国电南自电网自动化有限公司 System and method for efficiently and safely upgrading switch software
CN114531354A (en) * 2022-04-22 2022-05-24 北京金山云网络技术有限公司 Cluster upgrading method and device, cluster controller and server
CN114531354B (en) * 2022-04-22 2022-08-23 北京金山云网络技术有限公司 Cluster upgrading method and device, cluster controller and server
CN115022170A (en) * 2022-05-31 2022-09-06 青岛海信宽带多媒体技术有限公司 Intelligent gateway and area upgrading control method thereof
CN115348173A (en) * 2022-05-31 2022-11-15 青岛海信宽带多媒体技术有限公司 Area upgrading control method for household intelligent gateway
CN115348173B (en) * 2022-05-31 2024-05-28 青岛海信宽带多媒体技术有限公司 Regional upgrade control method of intelligent gateway
CN115022170B (en) * 2022-05-31 2024-05-28 青岛海信宽带多媒体技术有限公司 Intelligent gateway and area upgrading control method thereof
CN115473808A (en) * 2022-08-25 2022-12-13 深圳市凯迪仕智能科技有限公司 Task execution method and related device

Similar Documents

Publication Publication Date Title
CN111147314A (en) Switch upgrading method, device and storage medium
KR102478442B1 (en) Method for setting pdu type, method for setting ue policy, and related entities
CN108039969B (en) Network automatic configuration method, device, system, storage medium and target computer
US8402132B2 (en) Method, system and device for device capabilities exchange
CN111356149A (en) Wireless network configuration method and device
JP2011034567A (en) Setting of terminal
WO2009097776A1 (en) System, device and method for achieving service upgrade
CN111130902B (en) Switch management method, device and storage medium
CN110300143B (en) Service switching processing method, related device and computer storage medium
CN112448873B (en) Binding method and device for equipment and computer readable storage medium
KR101139836B1 (en) Method and system for two-phase mechanism for discovering web services based management service
CN108063836A (en) Automatically configure method, laser marking system, terminal and the medium of IP address
EP2693691B1 (en) Method and apparatus for initializing gateway in device management system
CN103312708A (en) Lease file based IP (internet protocol) setting method and system
CN109408090B (en) Upgrading method of equipment software, data converter and readable storage medium
CN112351471A (en) Method for accessing device to gateway, gateway device and computer readable storage medium
CN113098722A (en) Multi-network card management method, device and computer readable storage medium
CN111130865B (en) Network equipment firmware batch upgrading method and system based on two-layer switching
CN112333062A (en) Control method and control device for household equipment and computer readable storage medium
CN110278558B (en) Message interaction method and WLAN system
CN108712298B (en) Network equipment upgrading method and device, network equipment and storage medium
CN111752576A (en) Forwarding system deployment method based on 5G data, terminal and storage medium
KR20040109977A (en) succeeding method of data in mobile
WO2016206399A1 (en) Communication equipment, device and software version upgrade method utilized in communication equipment
EP3001729B1 (en) Method and apparatus for selecting an ip type during roaming

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200512

RJ01 Rejection of invention patent application after publication