WO2013139084A1 - 批量升级网络设备的方法及装置 - Google Patents

批量升级网络设备的方法及装置 Download PDF

Info

Publication number
WO2013139084A1
WO2013139084A1 PCT/CN2012/075946 CN2012075946W WO2013139084A1 WO 2013139084 A1 WO2013139084 A1 WO 2013139084A1 CN 2012075946 W CN2012075946 W CN 2012075946W WO 2013139084 A1 WO2013139084 A1 WO 2013139084A1
Authority
WO
WIPO (PCT)
Prior art keywords
upgrade
network device
network
upgraded
list
Prior art date
Application number
PCT/CN2012/075946
Other languages
English (en)
French (fr)
Inventor
张毅
赵宇
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2013139084A1 publication Critical patent/WO2013139084A1/zh

Links

Classifications

    • 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/0889Techniques to speed-up the configuration process
    • 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

Definitions

  • the present invention relates to the field of computer communication technologies, and in particular, to a method and an apparatus for mass upgrading network devices. Background technique
  • Network devices such as switches, routers, packet transport network (PTN) transport devices, etc.
  • PDN packet transport network
  • the network device upgrade generally includes:
  • the network management server transmits the latest version to the device
  • the network when the network device needs to be restarted during the upgrade process, the network may be interrupted, so that the next-level network device serially connected to the restart network device downloads the version from the network management server, and the like. Was interrupted.
  • the method for upgrading the network device in large quantities includes the following two types: 1.
  • the upgraded version and the upgrade command of the network device are sent to the network device at one time, and the network device completes the upgrade by itself; 2.
  • Each step of the upgrade process is performed. It is the network management server that interacts with the device.
  • the advantage is that the network management server knows immediately if it fails.
  • the above two methods still have the following problems: In the first method, after the upgrade error occurs, the network management server cannot monitor the specific problematic device once the network is interrupted; in the second method, the network device parallel upgrade between the upgrade groups cannot be played. Maximum parallel efficiency; can't intuitively show which network devices need to be upgraded, which The network device is being upgraded, which step to upgrade and which network device upgrade failed; The user cannot easily select the network device to be upgraded.
  • the main object of the present invention is to provide a method for upgrading a network device in batches, to improve the efficiency of upgrading the network device, and to visually display the upgrade status of the network device and flexibly select the network device to be upgraded.
  • the present invention provides a method for batch upgrading a network device, including:
  • the method further includes: separately creating and initializing the traversed device list for each network device group, and establishing a separate extension for each network device group Park map.
  • the method further comprises: determining a type of the upgrade device, and grouping the network devices.
  • the generating an optimal directed upgrade map for the last upgraded network device according to the connection relationship of the network devices in the topology map includes:
  • the shortest path between the currently obtained network device from the list of predecessor devices to the last upgraded network device is used as the optimal directed upgrade map.
  • the upgrading the network device according to the optimal directed upgrade map includes:
  • the network device in the set of leaf nodes is placed in the thread pool, and the upgrade operation of the network device is performed concurrently.
  • the performing the upgrade operation of the network device concurrently includes:
  • the present invention also provides an apparatus for batch upgrading a network device, including: a selected module, an optimal upgrade directed graph generation module, and an upgrade module;
  • the selected module is configured to select at least one device in the topology map as the last upgraded network device and notify the optimal upgrade directed graph generation module to provide a topology map for the optimal upgrade directed graph generation module; a graph generating module, configured to receive a notification of the last upgraded network device sent by the selected module, and generate an optimal upgrade for the last upgraded network device according to the connection relationship of each network device in the topology map of the selected module To the figure, the network device in the optimal upgrade directed graph is added to the traversed device list, and the optimal upgrade directed graph is sent to the upgrade module;
  • the upgrade module is configured to upgrade the network device according to the optimal upgrade directed graph sent by the optimal upgrade directed graph generation module.
  • the device further includes: a list creation module, configured to respectively create and initialize a traversed device list for each network device group, and respectively establish a topology map for each network device group, and the initialized traversed device list and topology The map is sent to the selected module;
  • a list creation module configured to respectively create and initialize a traversed device list for each network device group, and respectively establish a topology map for each network device group, and the initialized traversed device list and topology The map is sent to the selected module;
  • the selected module is further configured to receive the traversed device list and the topology map sent by the list creation module.
  • the device further includes: an input module, configured to determine a type of the upgraded device, and group the network devices, and send the network device group to the list creation module;
  • the list creation module is further configured to receive a network device packet sent by the input module.
  • the optimal upgrade directed graph generating module further includes: a set generating unit, a determining unit, and a selecting unit; wherein
  • a set generating unit configured to use the last upgraded network device as the currently selected device, add a network device directly connected to the currently selected device and not in the traversed device list, to the device set, and send the device set to the determining unit ;
  • a determining unit configured to receive a device set sent by the set generating unit or the selected unit, determine whether the number of network devices in the device set is greater than zero, and send the determining result and the device set to the selected unit;
  • a selecting unit configured to receive a judgment result and a device set sent by the determining unit, and if the result of the determination is that the number of network devices in the device set is greater than zero, sequentially adding the network device in the device set to the current selected device
  • the predecessor device list and the traversed device list are added to the succeeded device list corresponding to the network device in the device set; the device set is used as the added device set, and the network device in the added device set is sequentially used as The currently selected device, the network device directly connected to the currently selected device and not in the traversed device list is added to the device set, and the device set is sent to the judging unit; if not greater than zero, the currently obtained pre-drive device list is obtained.
  • the shortest path between the empty network device and the last upgraded network device is used as the optimal directed upgrade map.
  • the upgrade module includes: a thread pool creation unit, a statistics unit, a leaf node collection generation unit, and an upgrade unit;
  • a thread pool creation unit configured to create a thread pool for performing device upgrade in parallel, and notify the statistics unit to start counting network devices to be upgraded;
  • the statistic unit is configured to receive, after receiving the notification from the thread pool creation unit, the statistics of the network device to be upgraded, and the all the devices to be upgraded in the topology map of the optimal upgrade directed graph generation module, and notify the leaf node set generation unit Start generating collections;
  • a leaf node set generating unit configured to receive a notification of starting to generate a set sent by the statistic unit, and sequentially traverse the optimal concurrent upgrade map in the topology map of the optimal upgrade directed graph generating module,
  • the leaf node device of the upgrade map is placed in a leaf node set, where the leaf node device refers to a network device whose predecessor device list is empty, and sends the leaf node set to the upgrade module;
  • An upgrade unit configured to receive a leaf node set sent by a leaf node set generation unit, The network device in the leaf node set is placed in the thread pool, and the device upgrade operation is performed concurrently.
  • the upgrading unit is specifically configured to create an upgraded network device statistic variable and a synchronization control lock, initialize the upgraded statistic variable to zero, and perform an upgrade of the network device in the thread pool;
  • the method and device for batch upgrading network devices use a topology map in a network server to traverse a topology map to generate an optimal directed upgrade map, and use the optimal directed upgrade graph to upgrade the network by using a multi-thread concurrent method.
  • the device implements more efficient batch network device upgrade, improves the efficiency of upgrading the network device, and intuitively displays the upgrade status of the network device and flexibly selects the network device to be upgraded.
  • FIG. 1 is a flow chart of steps of a method for mass upgrading a network device according to the present invention
  • FIG. 2 is a network layout diagram of an embodiment of the present invention
  • FIG. 3 is a connection relationship table of devices in a topology diagram according to an embodiment of the present invention.
  • FIG. 4 is a flow chart of a step in another embodiment of a method for batch upgrading a network device according to the present invention.
  • FIG. 5 is a flow chart of steps in another embodiment of a method for batch upgrading a network device according to the present invention
  • FIG. 6 is a flowchart of generating an optimal directed upgrade map according to a connection relationship of devices in a topology map according to an embodiment of a method for batch upgrading a network device according to the present invention
  • FIG. 7 is a flowchart of upgrading a network device according to an optimal upgrade directed graph according to an embodiment of a method for batch upgrading a network device according to the present invention
  • FIG. 8 is a flowchart of concurrently performing a device upgrade operation in a method for batch upgrading a network device according to the present invention
  • FIG. 9 is a schematic structural diagram of an apparatus for mass-upgrading a network device according to the present invention
  • FIG. 10 is a schematic structural diagram of another embodiment of a device for mass-upgrading a network device according to the present invention.
  • FIG. 11 is a schematic structural diagram of another embodiment of a device for batch upgrading a network device according to the present invention.
  • FIG. 12 is a schematic structural diagram of an optimal upgrade directed graph generation module in an apparatus embodiment of a batch upgrade network device according to the present invention.
  • FIG. 13 is a schematic structural diagram of an upgrade module in an apparatus embodiment of a batch upgrade network device according to the present invention.
  • the present invention utilizes the data structure of the topology map to display the location relationship, the connection relationship, and the device state of the network device in a grouping manner.
  • the topology map can be set in the network management server, and can also be set to be dedicated to the management network.
  • the present invention will be described below by taking the network management server as an example.
  • the topology map defines the graph nodes in a recursively defined manner, and specifically includes the following parts:
  • Basic properties of the device such as device name, device type, Internet Protocol (IP) address of the device, network connection configuration of the device (such as Telenet configuration), and upgrade status (including waiting for upgrade, upgrading, success, or failure) Waiting for upgrade status);
  • IP Internet Protocol
  • a grouping attribute such as a device list of the group, whether it is an identification variable of the group
  • Device connection relationship such as a list of device nodes directly connected to the device (predecessor device list and subsequent device list), where:
  • a list of predecessor devices that is, a device set that is directly connected to the device and can be upgraded only after the device is upgraded.
  • the device uses the tree structure description
  • the list of subsequent devices that is, the device set that is directly connected to the device and can be upgraded only after the device is upgraded.
  • the device uses the tree structure description.
  • FIG. 1 is a schematic diagram of a method for batch upgrading a network device according to an embodiment of the present invention, which specifically includes:
  • Step S100 Select at least one network device in the topology map as the last upgraded network device.
  • the selection may be: the network directly connected to the network management server is selected as the last upgraded network device.
  • the number of network devices directly connected to the network management server may be one or several.
  • the network management server selects at least one network device and performs the upgrade operation during the upgrade of the device.
  • Step S200 Generate an optimal upgrade directed graph for the last upgraded network device according to the connection relationship of the network devices in the topology map, and add the network device in the optimal upgrade directed graph to the traversed device list.
  • the traversed device list is a network device that records the best upgraded directed graph, and prevents the device from being added cyclically, causing an algorithm to circulate.
  • FIG. 2 is A network device connection diagram in an embodiment
  • FIG. 3 is a connection relationship table of network devices in the topology diagram, specifically including a list of precursor devices and a list of subsequent devices.
  • the device A, device B, and device C are empty, the successor devices are device D, and the device D precursor devices are device A, device B, and device.
  • the successor device is device E; the predecessor device of device E is D, and the successor device is empty.
  • the network device with the predecessor device list in Figure 3 is the leaf node, and the last upgraded network device is used as the root node, from the leaf.
  • the node-to-root node generates an optimal upgrade directed graph according to the connection relationship table of the network device; wherein the optimal upgrade directed graph is to select a network device with each pre-drive device list being empty to the last upgraded network device The shortest path.
  • Step S300 Upgrade the network device according to the optimal upgrade directed graph.
  • the optimal upgrade directed graph first upgrade the network device whose predecessor device list is empty, and then upgrade the subsequent network device of the network device whose empty predecessor device list is empty, and so on, until the optimal upgrade and the last upgraded network.
  • device For example, referring to Figure 2, according to the optimal upgrade directed graph, first upgrade the leaf node device A, device B, and device C, and then upgrade device D. After the device D upgrade is complete, upgrade the root node device E.
  • step S400 is further included: separately creating and initializing a traversed device list for each network device group, and establishing a topology map for each network device group separately.
  • the establishing the topology map is a prior art, and is not mentioned here.
  • Step S500 Determine the type of the upgrade device, and group the network devices.
  • the upgrade plan is created according to the actual situation, and the device types and groupings to be upgraded are selected according to the upgrade plan, which are all existing technologies, for example:
  • the network devices in the group are set as devices to be upgraded, according to the upgrade.
  • Requirements Set the network devices that do not need to be upgraded to not upgrade; or set the network devices in the group to not upgrade by default. Select the devices that need to be upgraded according to the upgrade requirements.
  • the optimal upgrade directed graph is generated according to the connection relationship of the network devices in the topology map for the last upgraded network device. As shown in FIG. 6, the method includes:
  • Step S210 The last upgraded network device is used as the currently selected device, and the network device directly connected to the currently selected device and not in the traversed device list is added to the device set.
  • the device directly connected to the currently selected device that is, the device in the device connection relationship list of the topology structure
  • the device that has traversed the device list is not added to the device collection.
  • Step S220 determining whether the number of network devices in the device set is greater than zero. If it is greater than zero, step S230 is performed; otherwise, the shortest path between the currently obtained network device from the list of predecessor devices being empty to the last upgraded network device is performed. As an optimal directed upgrade map.
  • Step S230 Add the network device in the device set to the list of the predecessor device corresponding to the currently selected device and the traversed device list, and add the currently selected device to the subsequent device list corresponding to the network device in the device set.
  • Step S240 The device set is used as an added device set, and the network device in the added device set is sequentially used as the currently selected device, and the network device directly connected to the currently selected device and not in the traversed device list is added to the device device.
  • the device collection returns to step S220.
  • step S300 specifically includes:
  • Step S310 Create a thread pool for performing device upgrade in parallel
  • Step S320 Count all network devices to be upgraded in the topology map
  • Step S330 sequentially traversing the optimal concurrent upgrade maps in the topology map, and the leaf node device of the optimal directed upgrade graph is sequentially Put in a collection of leaf nodes;
  • the leaf node device refers to a device whose predecessor device list is empty
  • Step S340 Put the leaf node device in the leaf node set into a thread pool for performing device upgrade in parallel, and concurrently perform an upgrade operation of the leaf node device; After step S340 is completed, the thread pool for performing device upgrade in parallel is turned off.
  • step S340 the concurrently performing the upgrading operation of the leaf node device includes:
  • Step S341 Create an upgraded network device statistic variable and a synchronization control lock, initialize the upgraded network device statistic variable to zero, and perform an upgrade of the network device in the thread pool for performing device upgrade in parallel;
  • the upgrading of the network device in the thread pool for performing the device upgrade in parallel is performed, including: checking before the network device is upgraded, backing up the network device data, etc., in this embodiment, in the topology diagram
  • the device node color currently being executed is yellow, indicating that the network device is being upgraded.
  • Step S342 Acquire a synchronization control lock, add 1 to the upgraded network device statistic variable, and modify the corresponding device upgrade status according to the network device upgrade result;
  • the synchronization control lock is acquired, and the updated network device statistic variable is incremented by one, and the corresponding device upgrade status is modified according to the network device upgrade result; otherwise, the current determination is continued. Is there a network device that has been upgraded?
  • the upgrade status of the corresponding device is modified according to the network device upgrade result: if the upgrade is successful, the upgrade status in the basic attribute of the device is modified to be successful; otherwise, the modification is failed.
  • Step S343 determining whether the list of subsequent devices of the network device that has been upgraded is empty, if yes, executing step S3431, otherwise, performing step S3432;
  • Step S3431 determining whether the upgraded network device statistic variable is equal to the total number of network devices to be upgraded, and if yes, releasing the synchronization control lock and closing the thread pool for performing device upgrade in parallel, ending the processing flow; otherwise, releasing the synchronous control lock, End the process.
  • Step S3432 traversing the successor device list, obtaining a second device set that has been upgraded by the pre-drive device, determining whether the number of network devices in the second device set is greater than zero, and if greater than zero, The synchronous control lock is released, and the devices in the second device set are sequentially placed in the thread pool for performing the device upgrade in parallel, and the process returns to step S341; otherwise, the synchronous control lock is directly released and the processing flow is ended.
  • the method for batch upgrading a network device uses a topology map in a network server to traverse a topology map to generate an optimal directed upgrade map, and uses the optimal directed upgrade tree to upgrade a network device by using a multi-thread concurrent method. Achieve more efficient batch network equipment upgrades and improve work efficiency.
  • the present invention further provides an apparatus for batch upgrading a network device, including: a selected module 100, an optimal upgrade directed graph generating module 200, and an upgrade module 300;
  • the selected module 100 is configured to select at least one device in the topology map as the last upgraded network device and notify the optimal upgrade directed graph generation module 200 to provide a topology map for the optimal upgrade directed graph generation module 200.
  • the selected module 100 is specifically configured to use the device directly connected to the network management server as the last upgraded network device.
  • the number of devices directly connected to the network management server may be one or several.
  • the network management server accepts at least one device selected by the user, and finally performs an upgrade operation during the process of upgrading the device.
  • the optimal upgrade directed graph generation module 200 is configured to receive the notification of the last upgraded network device sent by the selected module 100, and according to the connection relationship of each network device in the topology map of the selected module 100, the last upgraded The network device generates an optimal upgrade directed graph, adds the network device in the optimal upgrade directed graph to the traversed device list, and sends the optimal upgrade directed graph to the upgrade module 300.
  • FIG. 2 is a network connection diagram in an embodiment
  • FIG. 3 is a connection relationship table of devices in the topology diagram, specifically including a list of predecessor devices and a list of subsequent devices.
  • the device A, device B, and device C are the precursor devices.
  • Empty, the successor devices are all devices D; the predecessor devices of device D are device A, device B, and device C, and the successor device is device E; the predecessor device of device E is D, and the successor device is empty.
  • the optimal upgrade directed graph generating module 200 is specifically configured to use the device with the predecessor device list as the leaf node, and the last upgraded network device as the root node, and the leaf node to the root node according to each device.
  • the connection relationship table generates an optimal upgrade directed graph.
  • the optimal directed graph ensures that the path from each device to the last upgraded network device is the shortest, making the concurrent upgrade time the shortest, so that the network device can be quickly upgraded.
  • the upgrade module 300 is configured to upgrade the network device according to the optimal upgrade directed graph sent according to the optimal upgrade directed graph generation module 200.
  • the upgrade module 300 is specifically configured to upgrade the leaf node device A, the device B, and the device C at the same time, and then upgrade the device D. After the device D is upgraded, the root node device E is upgraded, so that all the topology maps are completed. Upgrade of the device.
  • the apparatus provided by the present invention further includes: a list creating module 400, configured to respectively create and initialize a traversed device list for each network device group, and respectively establish a topology for each network device grouping
  • the selected traversed device list and the topology map are sent to the selected module 100.
  • the selected module 100 is further configured to receive the traversed device list and topology sent by the list creating module 400.
  • the apparatus provided by the present invention further includes: an input module 500, configured to determine a type of the upgrade device, and group the network devices, and send the network device in groups.
  • the list creation module 400 is configured to receive the network device group sent by the input module 500.
  • the optimal upgrade directed graph generating module 200 includes: a set generating unit 210, a determining unit 220, and a selecting unit 230; among them,
  • a collection generating unit 210 configured to use the last upgraded network device as the currently selected device, a network device directly connected to the currently selected device and not in the traversed device list is added to the device set, and the device set is sent to the determining unit 220;
  • the set generation unit 210 finds the network device connected to the last upgrade (that is, the device in the topology device connection relationship list) according to the device connection relationship, and is not already A device that traverses the device list, added to the device collection.
  • the determining unit 220 is configured to receive the device set sent by the set generating unit 210 or the selected unit 230, determine whether the number of network devices in the device set is greater than zero, and send the determination result and the device set to the selecting unit 230;
  • the selecting unit 230 is configured to receive the judgment result and the device set sent by the determining unit 220. If the result of the determination is that the number of network devices in the device set is greater than zero, the network device in the device set is sequentially added to the currently selected device.
  • Corresponding predecessor device list and traversed device list adding the currently selected device to a subsequent device list corresponding to the network device in the device set; using the device set as the added device set, and sequentially adding the network in the added device set As the currently selected device, the device directly connects to the device set that is directly connected to the currently selected device and does not traverse the device list, and sends the device set to the determining unit 220; if not greater than zero, the current obtained device
  • the shortest path between the network device from the empty device list to the last upgraded network device is used as the optimal directed upgrade map.
  • the upgrade module 300 includes: a thread pool creation unit 310, a statistics unit 320, a leaf node set generation unit 330, and an upgrade unit 340;
  • the notification statistics unit 320 starts to count the network devices to be upgraded
  • the statistic unit 320 is configured to receive, after receiving the notification from the thread pool creation unit 310, that the network device to be upgraded is started to be counted, and all the devices to be upgraded in the topology map of the optimal upgrade directed graph generation module are notified, and the leaf node set is notified.
  • the generating unit 330 starts generating a set;
  • the leaf set generation unit 330 is configured to receive the start generation set sent by the statistics unit 320. After the notification, the optimal concurrent upgrade map in the topology map of the optimal upgrade directed graph generation module is sequentially traversed, and the leaf node device of each of the optimal directed upgrade graphs is put into the leaf node set, The leaf node device refers to a network device whose predecessor device list is empty, and sends the leaf node set to the upgrade module 340;
  • the upgrading unit 340 is configured to receive the leaf node set sent by the leaf node set generating unit 330, put the network device in the leaf node set into the thread pool, and perform a device upgrading operation concurrently.
  • the upgrading unit 340 is specifically configured to create an upgraded network device statistic variable and a synchronization control lock, initialize the upgraded statistic variable to zero, perform an upgrade of the network device in the thread pool, acquire the synchronous control lock, according to the network.
  • the device upgrade result modifies the corresponding device status, and adds 1 to the upgraded network device variable; determines whether the subsequent device list of the network device that has been upgraded is empty. If it is empty, it determines whether the upgraded network device statistical variable is equal to The total number of network devices to be upgraded, if yes, release the synchronization control lock and close the thread pool; if not, traverse the subsequent device list to obtain the second device set that the predecessor device has completed upgrading, and determine the second device set. Whether the number of devices in the device is greater than zero, and if so, the devices in the second device set are sequentially placed in the thread pool to recursively complete the device upgrade.
  • the apparatus for batch upgrading a network device uses a topology map in a network server to traverse a topology map to generate an optimal directed upgrade map, and uses the optimal directed upgrade tree to upgrade a network device by using a multi-thread concurrent method. Achieve more efficient batch network equipment upgrades and improve work efficiency.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明涉及一种批量升级网络设备的方法,包括:选定拓扑图中至少一个网络设备作为最后升级的网络设备;根据拓扑图内各网络设备的连接关系为所述最后升级的网络设备生成最优升级有向图,将最优升级有向图中的网络设备加入已遍历设备列表;依据所述最优升级有向图升级网络设备。本发明还提供一种批量升级网络设备的装置,采用本发明能提高升级网络设备的效率,以及直观的显示出网络设备的升级状态并灵活的选择所要升级的网络设备。

Description

技术领域
本发明涉及计算机通信技术领域, 具体是一种批量升级网络设备的方 法及装置。 背景技术
网络设备(例如交换机、 路由器、 分组传送网 (PTN, Packet Transport Network )传输设备等)存在大批量升级的需求。
所述网络设备升级通常包括:
1、 升级前检查, 即检查设备是否满足升级条件;
2、 备 备原有数据;
3、 网络管理服务器向设备传输最新版本;
4、 设备重新启动加载最新版本;
5、 新旧版本兼容性处理。
但是, 上述网络设备升级方法中, 当网络设备在升级的过程中需要重 启时, 可能会导致网络中断, 使得处于与重启网络设备串行连接的下一级 网络设备从网络管理服务器下载版本等步骤被打断。
因此, 提出大批量升级网络设备的方法, 包括以下两种: 一、 将网络 设备的升级版本及升级命令一次性发送到网络设备, 由网络设备自己完成 升级; 二、 升级过程的每个步骤都是网络管理服务器与设备交互, 优点是 一旦出错网络管理服务器就立即知道。 但是, 上述两种方法仍然存在以下 问题: 方法一中, 升级出错后, 一旦造成网络中断, 网络管理服务器无法 监控到具体出现问题的设备; 方法二中, 升级组间的网络设备并行升级不 能发挥最大的并行效率; 无法直观的显示出哪些网络设备需要升级、 哪些 网络设备正在升级、 升级执行到哪个步骤以及哪些网络设备升级失败; 无 法让用户方便的选择所要升级的网络设备。
可见, 目前已有的升级网络设备的方法, 无法提高升级网络设备的效 率, 以及无法直观的显示出网络设备的升级状态并灵活的选择所要升级的 网络设备。 发明内容
本发明的主要目的是提供一种批量升级网络设备的方法, 以提高升级 网络设备的效率, 以及直观的显示出网络设备的升级状态并灵活的选择所 要升级的网络设备。
本发明提出一种批量升级网络设备的方法, 包括:
选定拓朴图中至少一个网络设备作为最后升级的网络设备;
根据拓朴图内各网络设备的连接关系为所述最后升级的网络设备生成 最优升级有向图, 将最优升级有向图中的网络设备加入已遍历设备列表; 依据所述最优升级有向图升级网络设备。
优选地, 所述选定拓朴图中至少一个设备作为最后升级的网络设备之 前, 该方法还包括: 为各个网络设备分组分别创建并初始化已遍历设备列 表, 以及为各个网络设备分组分别建立拓朴图。
优选地, 所述创建并初始化已遍历设备列表之前, 该方法还包括: 确 定升级设备的类型, 将网络设备分组。
优选地, 所述根据拓朴图内各网络设备的连接关系为最后升级的网络 设备生成最优有向升级图, 包括:
将最后升级的网络设备作为当前选定设备, 将与当前选定设备直接相 连且不在所述已遍历设备列表中的网络设备添加至设备集合;
判断设备集合中网络设备的数量是否大于零, 若大于零, 则依次将设 备集合中的网络设备加入所述当前选定设备对应的前驱设备列表和已遍历 设备列表, 将所述当前选定设备加入设备集合中网络设备对应的后继设备 列表; 将所述设备集合作为已添加设备集合, 依次将已添加设备集合中的 网络设备作为当前选定设备, 将与当前选定设备直接相连且不在已遍历设 备列表中的网络设备添加至设备集合, 继续判断设备集合中网络设备的数 量是否大于零
若不大于零, 则将当前获得的从前驱设备列表为空的网络设备到最后 升级的网络设备之间的最短路径作为最优有向升级图。
优选地, 所述依据最优有向升级图升级网络设备, 包括:
创建用于并行执行设备升级的线程池;
统计拓朴图内所有待升级的网络设备;
依次遍历拓朴图内各所述最优并发升级图, 将各所述最优有向升级图 的叶子结点设备放入叶子结点集合, 所述叶子结点设备是指前驱设备列表 为空的网络设备;
将所述叶子结点集合中的网络设备放入所述线程池, 并发执行网络设 备的升级操作。
优选地, 所述并发执行网络设备的升级操作, 包括:
创建已升级网络设备统计变量以及同步控制锁, 初始化所述已升级统 计变量为零, 执行所述线程池内网络设备的升级;
获取所述同步控制锁, 根据网络设备升级结果修改对应设备状态, 并 将所述已升级网络设备变量加 1 ;
判断正已完成升级的网络设备的后继设备列表是否为空, 若为空, 则 判断已升级网络设备统计变量是否等于待升级的网络设备的总数, 若是, 则释放同步控制锁并关闭线程池;
若不为空, 则遍历所述后继设备列表获取到前驱设备已完成升级的第 二设备集合, 判断第二设备集合中设备的数量是否大于零, 若是, 则依次 将所述第二设备集合中的设备放入线程池内递归完成设备升级。 本发明还提出一种批量升级网络设备的装置, 包括: 选定模块、 最优 升级有向图生成模块和升级模块; 其中,
选定模块, 用于选定拓朴图中至少一个设备作为最后升级的网络设备 并通知最优升级有向图生成模块, 为最优升级有向图生成模块提供拓朴图; 最优升级有向图生成模块, 用于接收选定模块发来的所述最后升级的 网络设备的通知, 根据选定模块的拓朴图内各网络设备的连接关系为最后 升级的网络设备生成最优升级有向图, 将最优升级有向图中的网络设备加 入已遍历设备列表, 将最优升级有向图发给升级模块;
升级模块, 用于依据最优升级有向图生成模块发来的所述最优升级有 向图升级网络设备。
所述装置还包括: 列表创建模块, 用于为各个网络设备分组分别创建 并初始化已遍历设备列表, 以及为各个网络设备分组分别建立拓朴图, 将 所述初始化的已遍历设备列表及拓朴图发送给选定模块;
相应的, 所述选定模块, 还用于接收列表创建模块发来的已遍历设备 列表及拓朴图。
优选地, 所述装置还包括: 输入模块, 用于确定升级设备的类型, 及 将网络设备分组, 将网络设备分组发送给列表创建模块;
相应的, 所述列表创建模块, 还用于接收输入模块发来的网络设备分 组。
优选地, 所述最优升级有向图生成模块还包括: 集合生成单元、 判断 单元和选定单元; 其中,
集合生成单元, 用于将最后升级的网络设备作为当前选定设备, 将与 当前选定设备直接相连且不在所述已遍历设备列表中的网络设备添加至设 备集合, 将设备集合发送给判断单元; 判断单元, 用于接收集合生成单元或选定单元发来的设备集合, 判断 所述设备集合中网络设备的数量是否大于零, 将判断结果及设备集合发给 选定单元;
选定单元, 用于接收判断单元发来的判断结果和设备集合, 若判断结 果为设备集合中网络设备的数量大于零, 则依次将设备集合中的网络设备 加入所述当前选定设备对应的前驱设备列表和已遍历设备列表, 将所述当 前选定设备加入设备集合中网络设备对应的后继设备列表; 将所述设备集 合作为已添加设备集合, 依次将已添加设备集合中的网络设备作为当前选 定设备, 将与当前选定设备直接相连且不在已遍历设备列表中的网络设备 添加至设备集合, 将设备集合发送给判断单元; 若不大于零, 则将当前获 得的从前驱设备列表为空的网络设备到最后升级的网络设备之间的最短路 径作为最优有向升级图。
优选地, 所述升级模块包括: 线程池创建单元、 统计单元、 叶子结点 集合生成单元和升级单元; 其中,
线程池创建单元, 用于创建用于并行执行设备升级的线程池后, 通知 统计单元开始统计待升级的网络设备;
统计单元, 用于收到线程池创建单元发来的开始统计待升级的网络设 备的通知后, 统计最优升级有向图生成模块中拓朴图内所有待升级设备, 通知叶子节点集合生成单元开始生成集合;
叶子结点集合生成单元, 用于接收统计单元发来的开始生成集合的通 知后, 依次遍历最优升级有向图生成模块中拓朴图内所述最优并发升级图, 将各所述最优有向升级图的叶子结点设备放入叶子结点集合, 所述叶子结 点设备是指前驱设备列表为空的网络设备, 将所述叶子节点集合发送给升 级模块;
升级单元, 用于接收叶子结点集合生成单元发来的叶子节点集合, 将 所述叶子结点集合中的网络设备放入所述线程池, 并发执行设备升级操作。 优选地, 所述升级单元, 具体用于创建已升级网络设备统计变量以及 同步控制锁, 初始化所述已升级统计变量为零, 执行所述线程池内网络设 备的升级;
获取所述同步控制锁, 根据网络设备升级结果修改对应设备状态, 并 将所述已升级网络设备变量加 1 ;
判断正已完成升级的网络设备的后继设备列表是否为空, 若为空, 则 判断已升级网络设备统计变量是否等于待升级的网络设备的总数, 若是, 则释放同步控制锁并关闭线程池;
若不为空, 则遍历所述后继设备列表获取到前驱设备已完成升级的第 二设备集合, 判断第二设备集合中设备的数量是否大于零, 若是, 则依次 将所述第二设备集合中的设备放入线程池内递归完成设备升级。
本发明提供的批量升级网络设备的方法及装置, 利用网络服务器中拓 朴图, 遍历拓朴图生成最优有向升级图, 并利用该最优有向升级图采用多 线程并发的方法升级网络设备, 实现更为高效地批量网络设备升级, 提高 升级网络设备的效率, 以及直观的显示出网络设备的升级状态并灵活的选 择所要升级的网络设备。 附图说明
图 1为本发明提供的批量升级网络设备的方法实施例的步骤流程图; 图 2为本发明实施例中的网络布局图;
图 3为本发明实施例中拓朴图内各设备的连接关系表;
图 4为本发明提供的批量升级网络设备的方法另一实施例中的步骤流 程图;
图 5 为本发明提供的批量升级网络设备的方法另一实施例中的步骤流 程图; 图 6为本发明提供的批量升级网络设备的方法实施例中根据拓朴图内 各设备的连接关系生成最优有向升级图的流程图;
图 7 为本发明提供的批量升级网络设备的方法实施例中依据最优升级 有向图升级网络设备的流程图;
图 8 为本发明提供的批量升级网络设备的方法实施例中并发执行设备 升级操作的流程图;
图 9为本发明提供的批量升级网络设备的装置实施例的结构示意图; 图 10为本发明提供的批量升级网络设备的装置另一实施例中的结构示 意图;
图 11为本发明提供的批量升级网络设备的装置另一实施例中的结构示 意图;
图 12为本发明提供的批量升级网络设备的装置实施例中最优升级有向 图生成模块的结构示意图;
图 13为本发明提供的批量升级网络设备的装置实施例中升级模块的结 构示意图。
本发明目的的实现、 功能特点及优点将结合实施例, 参照附图做进一 步说明。 具体实施方式 为了使本发明的目的、 技术方案及优点更加清楚明白, 以下结合附图 及实施例, 对本发明进行进一步详细说明。 应当理解, 此处所描述的具体 实施例仅仅用以解释本发明, 并不用于限定本发明。
本发明利用拓朴图的数据结构, 采用分组分层的方式展示网络设备的 位置关系、 连接关系以及设备状态, 该拓朴图可以设置于网络管理服务器 内, 还可以设置于专门用于管理网络设备升级的设备中, 以下将以网络管 理服务器为例对本发明进行说明。 在本发明实施例中, 拓朴图采用递归定义的方式定义图结点, 具体包 含以下部分的内容:
1、 设备的基本属性, 例如设备名、 设备类型、 设备的互联网协议(IP, Internet Protocol )地址、 设备的网络连接配置(例如 Telenet配置) 以及升 级状态 (包括等待升级、 正在升级、 成功或者失败等升级状态);
2、 分组属性, 例如本分组的设备列表、 是否是分组的标识变量;
3、 设备连接关系, 例如与设备直接连接的设备结点列表(前驱设备列 表以及后继设备列表), 其中:
前驱设备列表, 即包含与本设备直接相连, 并且只有在其升级后, 本 设备才能升级的设备集合, 设备采用本树结点结构描述;
后继设备列表, 即包含与本设备直接相连, 且只有在本设备升级后, 其才能升级的设备集合, 设备采用本树结点结构描述。
图 1 为本发明一实施例提供的一种批量升级网络设备的方法, 具体包 括:
步骤 S100:选定拓朴图中至少一个网络设备作为最后升级的网络设备。 这里, 所述选定可以为: 由网络管理服务器将与其直接连接的网络设 备选为最后升级的网络设备。 在具体的实施例中, 与网络管理服务器直接 连接的网络设备可以为一个, 也可以为若干个。 网络管理服务器选定至少 一个网络设备, 在升级设备过程中最后进行升级操作。
步骤 S200: 根据拓朴图内各网络设备的连接关系为最后升级的网络设 备生成最优升级有向图, 将最优升级有向图中的网络设备加入已遍历设备 列表。
这里, 所述已遍历设备列表为记录已加入最优升级有向图的网络设备, 防止设备被循环加入, 造成算法死循环。
所述拓朴图内各网络设备的连接关系参照图 2以及图 3, 其中, 图 2为 一实施例中的网络设备连接图, 图 3 为拓朴图内网络设备的连接关系表, 具体包括前驱设备列表以及后继设备列表。 以图 3 中最后升级的网络设备 为设备 E为例, 设备 A、 设备 B以及设备 C的前驱设备为空, 后继设备均 为设备 D; 设备 D的前驱设备为设备 A、 设备 B以及设备( , 后继设备为 设备 E; 设备 E的前驱设备为 D, 后继设备为空。 将图 3中前驱设备列表 为空的网络设备作为叶子结点, 将最后升级的网络设备作为根结点, 从叶 子结点至根节点依照网络设备的连接关系表生成最优升级有向图; 其中, 所述最优升级有向图为选取每台前驱设备列表为空的网络设备到最后升级 的网络设备之间的最短路径。
步骤 S300: 依据最优升级有向图升级网络设备。
具体的, 依据最优升级有向图, 先升级前驱设备列表为空的网络设备, 再升级上述前驱设备列表为空的网络设备的后续网络设备, 以此类推, 直 至最优升级最后升级的网络设备。 比如, 参照图 2, 依照最优升级有向图, 先同时升级叶子结点设备 A、 设备 B以及设备 C, 再升级设备 D, 设备 D 升级结束后, 再升级根结点设备 E。
参照图 4, 上述步骤 S100之前, 还包括步骤 S400: 为各个网络设备分 组分别创建并初始化已遍历设备列表, 以及为各个网络设备分组分别建立 拓朴图。 其中, 所述建立拓朴图为现有技术, 这里不 #丈赞述。
在前述实施例的基础上, 参照图 5, 在上述步骤 S400之前, 还包括: 步骤 S500: 确定升级设备的类型, 将网络设备分组。
具体的, 根据实际情况创建升级计划, 根据所述升级计划选定需要升 级的设备类型及分组, 均为现有技术, 例如: 默认将分组内的网络设备都 设置为需要升级的设备, 根据升级需求, 将不需要升级的网络设备设置为 不升级; 或者默认将分组内的网络设备都设置为不升级, 根据升级需求, 选中需要进行升级的设备。 进一步的, 上述步骤 S200中, 所述根据拓朴图内各网络设备的连接关 系为最后升级的网络设备生成最优升级有向图, 如图 6所示, 包括:
步骤 S210: 将最后升级的网络设备作为当前选定设备, 将与当前选定 设备直接相连且不在已遍历设备列表中的网络设备添加至设备集合。
具体的, 根据设备连接关系, 找到与当前选定设备直接相连(即在拓 朴结构的设备连接关系列表中的设备) 并且不在已遍历设备列表的设备, 添加至设备集合。
步骤 S220: 判断设备集合中网络设备的数量是否大于零, 若大于零, 则执行步骤 S230; 否则, 将当前获得的从前驱设备列表为空的网络设备到 最后升级的网络设备之间的最短路径作为最优有向升级图。
步骤 S230: 依次将设备集合中的网络设备加入所述当前选定设备对应 的前驱设备列表和已遍历设备列表, 将所述当前选定设备加入设备集合中 网络设备对应的后继设备列表。
步骤 S240: 将所述设备集合作为已添加设备集合, 依次将已添加设备 集合中的网络设备作为当前选定设备, 将与当前选定设备直接相连且不在 已遍历设备列表中的网络设备添加至设备集合, 返回步骤 S220。
如图 7所示, 步骤 S300具体包括:
步骤 S310: 创建用于并行执行设备升级的线程池;
步骤 S320: 统计拓朴图内所有待升级的网络设备;
具体的, 统计拓朴图内所有最优升级有向图中等待升级的网络设备; 步骤 S330: 依次遍历拓朴图内各最优并发升级图, 将最优有向升级图 的叶子结点设备放入叶子结点集合;
其中, 叶子结点设备是指前驱设备列表为空的设备;
步骤 S340: 将叶子结点集合中的叶子结点设备放入用于并行执行设备 升级的线程池, 并发执行叶子结点设备的升级操作; 步骤 S340完成后, 关闭用于并行执行设备升级的线程池。
进一步的, 参照图 8, 步骤 S340中, 所述并发执行叶子结点设备的升 级操作包括:
步骤 S341 : 创建已升级网络设备统计变量以及同步控制锁, 初始化已 升级网络设备统计变量为零, 执行用于并行执行设备升级的线程池内网络 设备的升级;
这里, 所述执行用于并行执行设备升级的线程池内网络设备的升级为 级, 包括: 网络设备升级前的检查、 网络设备数据的备份等操作, 在本实 施例中, 在拓朴图中将当前正在执行的设备结点颜色标识为黄色, 表示网 络设备正在升级。
步骤 S342: 获取同步控制锁, 将已升级网络设备统计变量加 1, 根据 网络设备升级结果修改对应的设备升级状态;
具体的, 实时判断当前是否有网络设备已完成升级, 若有, 则获取同 步控制锁, 将已升级网络设备统计变量加一, 根据网络设备升级结果修改 对应的设备升级状态; 否则, 继续判断当前是否有网络设备已完成升级。
这里, 所述根据网络设备升级结果修改对应设备升级状态为: 升级成 功, 则将设备基本属性中的升级状态修改为成功; 否则, 修改为失败。
步骤 S343: 判断已完成升级的网络设备的后继设备列表是否为空, 若 为空, 则执行步骤 S3431 , 否则, 执行步骤 S3432;
步骤 S3431 :判断已升级网络设备统计变量是否等于待升级的网络设备 的总数, 若是, 则释放同步控制锁并关闭用于并行执行设备升级的线程池, 结束处理流程; 否则, 释放同步控制锁, 结束处理流程。
步骤 S3432: 遍历后继设备列表, 获取到前驱设备已完成升级的第二设 备集合, 判断第二设备集合中网络设备的数量是否大于零, 若大于零, 则 释放同步控制锁, 依次将第二设备集合中的设备放入用于并行执行设备升 级的线程池内, 返回步骤 S341 ; 否则, 直接释放同步控制锁并结束处理流 程。
本发明提供的批量升级网络设备的方法, 利用网络服务器中拓朴图, 遍历拓朴图生成最优有向升级图, 并利用该最优有向升级树采用多线程并 发的方法升级网络设备, 实现更为高效地批量网络设备升级, 提高工作效 率。
参照图 9, 本发明还提出一种批量升级网络设备的装置, 包括: 选定模 块 100、 最优升级有向图生成模块 200、 升级模块 300; 其中,
选定模块 100,用于选定拓朴图中至少一个设备作为最后升级的网络设 备并通知最优升级有向图生成模块 200,为最优升级有向图生成模块 200提 供拓朴图。
在串行升级的过程中, 设备的升级存在着先后顺序, 升级过程中设备 需要重启, 从而导致网络中断。 为避免由于中断而导致无法完成设备升级, 在本发明中, 所述选定模块 100, 具体用于将与网络管理服务器直接连接的 设备作为最后升级的网络设备。 在具体的实施例中, 与网络管理服务器直 接连接的设备可以为一个, 也可以为若干个。 网络管理服务器接受用户选 择的至少一个设备, 在升级设备过程中最后进行升级操作。
最优升级有向图生成模块 200,用于接收选定模块 100发来的所述最后 升级的网络设备的通知, 根据选定模块 100的拓朴图内各网络设备的连接 关系为最后升级的网络设备生成最优升级有向图, 将最优升级有向图中的 网络设备加入已遍历设备列表, 将最优升级有向图发给升级模块 300。
请参照图 2以及图 3, 图 2为一实施例中的网络连接图, 图 3为拓朴图 内设备的连接关系表, 具体包括前驱设备列表以及后继设备列表。 以最后 升级的网络设备为设备 E为例, 设备 A、 设备 B以及设备 C的前驱设备为 空, 后继设备均为设备 D; 设备 D的前驱设备为设备 A、 设备 B以及设备 C, 后继设备为设备 E; 设备 E的前驱设备为 D, 后继设备为空。
所述最优升级有向图生成模块 200,具体用于将前驱设备列表为空的设 备作为叶子结点, 将最后升级的网络设备作为根结点, 从叶子结点至根节 点依照各设备的连接关系表生成最优升级有向图。 该最优有向图保证每台 设备到最后升级的网络设备的路径是最短的, 使得并发升级的时间最短, 从而能够快速升级网络设备。
升级模块 300,用于依照依据最优升级有向图生成模块 200发来的所述 最优升级有向图升级网络设备。
所述升级模块 300,具体用于先同时升级叶子结点设备 A、设备 B以及 设备 C, 再升级设备 D, 设备 D升级结束后, 升级根结点设备 E, 从而完 成对拓朴图中所有设备的升级。
参照图 10, 在另一实施例中, 本发明提出的装置还包括: 列表创建模 块 400, 用于为各个网络设备分组分别创建并初始化已遍历设备列表, 以及 为各个网络设备分组分别建立拓朴图, 将所述初始化的已遍历设备列表及 拓朴图发送给选定模块 100; 相应的, 所述选定模块 100, 还用于接收列表 创建模块 400发来的已遍历设备列表及拓朴图。
请参照图 11, 在前述实施例的基础上, 另一实施例中, 本发明提出的 装置还包括:输入模块 500,用于确定升级设备的类型,及将网络设备分组, 将网络设备分组发送给列表创建模块 400;相应的,所述列表创建模块 400, 还用于接收输入模块 500发来的网络设备分组。
更为具体的, 请参照图 12, 图 9为本发明实施例中提供的装置中, 所 述最优升级有向图生成模块 200包括: 集合生成单元 210、判断单元 220以 及选定单元 230; 其中,
集合生成单元 210, 用于将最后升级的网络设备作为当前选定设备, 将 与当前选定设备直接相连且不在所述已遍历设备列表中的网络设备添加至 设备集合, 将设备集合发送给判断单元 220;
以选定的设备为最后升级的网络设备为例, 集合生成单元 210根据设 备连接关系, 找到与最后升级的网络设备相连(即在拓朴结构的设备连接 关系列表中的设备), 并且不在已遍历设备列表的设备, 添加至设备集合。
判断单元 220,用于接收集合生成单元 210或选定单元 230发来的设备 集合, 判断所述设备集合中网络设备的数量是否大于零, 将判断结果及设 备集合发给选定单元 230;
选定单元 230, 用于接收判断单元 220发来的判断结果和设备集合, 若 判断结果为设备集合中网络设备的数量大于零, 则依次将设备集合中的网 络设备加入所述当前选定设备对应的前驱设备列表和已遍历设备列表, 将 所述当前选定设备加入设备集合中网络设备对应的后继设备列表; 将所述 设备集合作为已添加设备集合, 依次将已添加设备集合中的网络设备作为 当前选定设备, 将与当前选定设备直接相连且不在已遍历设备列表中的网 络设备添加至设备集合, 将设备集合发送给判断单元 220; 若不大于零, 则 将当前获得的从前驱设备列表为空的网络设备到最后升级的网络设备之间 的最短路径作为最优有向升级图。
参照图 13,在本实施例中所述升级模块 300包括:线程池创建单元 310、 统计单元 320、 叶子结点集合生成单元 330以及升级单元 340; 其中,
线程池创建单元 310, 用于创建并行执行设备升级的线程池后, 通知统 计单元 320开始统计待升级的网络设备;
统计单元 320,用于收到线程池创建单元 310发来的开始统计待升级的 网络设备的通知后, 统计最优升级有向图生成模块中拓朴图内所有待升级 设备, 通知叶子节点集合生成单元 330开始生成集合;
叶子集合生成单元 330,用于接收统计单元 320发来的开始生成集合的 通知后, 依次遍历最优升级有向图生成模块中拓朴图内所述最优并发升级 图, 将各所述最优有向升级图的叶子结点设备放入叶子结点集合, 所述叶 子结点设备是指前驱设备列表为空的网络设备, 将所述叶子节点集合发送 给升级模块 340;
升级单元 340,用于接收叶子结点集合生成单元 330发来的叶子节点集 合, 将所述叶子结点集合中的网络设备放入所述线程池, 并发执行设备升 级操作。
所述升级单元 340,具体用于创建已升级网络设备统计变量以及同步控 制锁, 初始化所述已升级统计变量为零, 执行所述线程池内网络设备的升 级; 获取所述同步控制锁, 根据网络设备升级结果修改对应设备状态, 并 将所述已升级网络设备变量加 1;判断正已完成升级的网络设备的后继设备 列表是否为空, 若为空, 则判断已升级网络设备统计变量是否等于待升级 的网络设备的总数, 若是, 则释放同步控制锁并关闭线程池; 若不为空, 则遍历所述后继设备列表获取到前驱设备已完成升级的第二设备集合, 判 断第二设备集合中设备的数量是否大于零, 若是, 则依次将所述第二设备 集合中的设备放入线程池内递归完成设备升级。
本发明提供的批量升级网络设备的装置, 利用网络服务器中拓朴图, 遍历拓朴图生成最优有向升级图, 并利用该最优有向升级树采用多线程并 发的方法升级网络设备, 实现更为高效地批量网络设备升级, 提高工作效 率。
以上仅为本发明的较佳实施例而已, 并不用以限制本发明, 凡在本发 明的精神和原则之内所作的任何修改、 等同替换和改进等, 均应包含在本 发明的保护范围之内。

Claims

权利要求书
1、 一种批量升级网络设备的方法, 其特征在于, 该方法包括: 选定拓朴图中至少一个网络设备作为最后升级的网络设备;
根据拓朴图内各网络设备的连接关系为所述最后升级的网络设备生成 最优升级有向图, 将最优升级有向图中的网络设备加入已遍历设备列表; 依据所述最优升级有向图升级网络设备。
2、 根据权利要求 1所述的方法, 其特征在于, 所述选定拓朴图中至少 一个设备作为最后升级的网络设备之前, 该方法还包括: 为各个网络设备 分组分别创建并初始化已遍历设备列表, 以及为各个网络设备分组分别建 立拓朴图。
3、 根据权利要求 2所述的方法, 其特征在于, 所述创建并初始化已遍 历设备列表之前, 该方法还包括: 确定升级设备的类型, 将网络设备分组。
4、 根据权利要求 1所述的方法, 其特征在于, 所述根据拓朴图内各网 络设备的连接关系为最后升级的网络设备生成最优有向升级图, 包括: 将最后升级的网络设备作为当前选定设备, 将与当前选定设备直接相 连且不在所述已遍历设备列表中的网络设备添加至设备集合;
判断设备集合中网络设备的数量是否大于零, 若大于零, 则依次将设 备集合中的网络设备加入所述当前选定设备对应的前驱设备列表和已遍历 设备列表, 将所述当前选定设备加入设备集合中网络设备对应的后继设备 列表; 将所述设备集合作为已添加设备集合, 依次将已添加设备集合中的 网络设备作为当前选定设备, 将与当前选定设备直接相连且不在已遍历设 备列表中的网络设备添加至设备集合, 继续判断设备集合中网络设备的数 量是否大于零;
若不大于零, 则将当前获得的从前驱设备列表为空的网络设备到最后 升级的网络设备之间的最短路径作为最优有向升级图。
5、 根据权利要求 1所述的方法, 其特征在于, 所述依据最优有向升级 图升级网络设备, 包括:
创建用于并行执行设备升级的线程池;
统计拓朴图内所有待升级的网络设备;
依次遍历拓朴图内各所述最优并发升级图, 将各所述最优有向升级图 的叶子结点设备放入叶子结点集合, 所述叶子结点设备是指前驱设备列表 为空的网络设备;
将所述叶子结点集合中的网络设备放入所述线程池, 并发执行网络设 备的升级操作。
6、 根据权利要求 5所述的方法, 其特征在于, 所述并发执行网络设备 的升级操作, 包括:
创建已升级网络设备统计变量以及同步控制锁, 初始化所述已升级统 计变量为零, 执行所述线程池内网络设备的升级;
获取所述同步控制锁, 根据网络设备升级结果修改对应设备状态, 并 将所述已升级网络设备变量加 1 ;
判断正已完成升级的网络设备的后继设备列表是否为空, 若为空, 则 判断已升级网络设备统计变量是否等于待升级的网络设备的总数, 若是, 则释放同步控制锁并关闭线程池;
若不为空, 则遍历所述后继设备列表获取到前驱设备已完成升级的第 二设备集合, 判断第二设备集合中设备的数量是否大于零, 若是, 则依次 将所述第二设备集合中的设备放入线程池内递归完成设备升级。
7、 一种批量升级网络设备的装置, 其特征在于, 包括: 选定模块、 最 优升级有向图生成模块和升级模块; 其中,
选定模块, 用于选定拓朴图中至少一个设备作为最后升级的网络设备 并通知最优升级有向图生成模块, 为最优升级有向图生成模块提供拓朴图; 最优升级有向图生成模块, 用于接收选定模块发来的所述最后升级的 网络设备的通知, 根据选定模块的拓朴图内各网络设备的连接关系为最后 升级的网络设备生成最优升级有向图, 将最优升级有向图中的网络设备加 入已遍历设备列表, 将最优升级有向图发给升级模块;
升级模块, 用于依据最优升级有向图生成模块发来的所述最优升级有 向图升级网络设备。
8、 根据权利要求 7所述的装置, 其特征在于, 所述装置还包括: 列表 创建模块, 用于为各个网络设备分组分别创建并初始化已遍历设备列表, 以及为各个网络设备分组分别建立拓朴图, 将所述初始化的已遍历设备列 表及拓朴图发送给选定模块;
相应的, 所述选定模块, 还用于接收列表创建模块发来的已遍历设备 列表及拓朴图。
9、 根据权利要求 7所述的装置, 其特征在于, 所述装置还包括: 输入 模块, 用于确定升级设备的类型, 及将网络设备分组, 将网络设备分组发 送给列表创建模块;
相应的, 所述列表创建模块, 还用于接收输入模块发来的网络设备分 组。
10、 根据权利要求 9所述的装置, 其特征在于, 所述最优升级有向图 生成模块还包括: 集合生成单元、 判断单元和选定单元; 其中,
集合生成单元, 用于将最后升级的网络设备作为当前选定设备, 将与 当前选定设备直接相连且不在所述已遍历设备列表中的网络设备添加至设 备集合, 将设备集合发送给判断单元;
判断单元, 用于接收集合生成单元或选定单元发来的设备集合, 判断 所述设备集合中网络设备的数量是否大于零, 将判断结果及设备集合发给 选定单元; 选定单元, 用于接收判断单元发来的判断结果和设备集合, 若判断结 果为设备集合中网络设备的数量大于零, 则依次将设备集合中的网络设备 加入所述当前选定设备对应的前驱设备列表和已遍历设备列表, 将所述当 前选定设备加入设备集合中网络设备对应的后继设备列表; 将所述设备集 合作为已添加设备集合, 依次将已添加设备集合中的网络设备作为当前选 定设备, 将与当前选定设备直接相连且不在已遍历设备列表中的网络设备 添加至设备集合, 将设备集合发送给判断单元; 若不大于零, 则将当前获 得的从前驱设备列表为空的网络设备到最后升级的网络设备之间的最短路 径作为最优有向升级图。
11、 根据权利要求 10所述的装置, 其特征在于, 所述升级模块包括: 线程池创建单元、 统计单元、 叶子结点集合生成单元和升级单元; 其中, 线程池创建单元, 用于创建用于并行执行设备升级的线程池后, 通知 统计单元开始统计待升级的网络设备;
统计单元, 用于收到线程池创建单元发来的开始统计待升级的网络设 备的通知后, 统计最优升级有向图生成模块中拓朴图内所有待升级设备, 通知叶子节点集合生成单元开始生成集合;
叶子结点集合生成单元, 用于接收统计单元发来的开始生成集合的通 知后, 依次遍历最优升级有向图生成模块中拓朴图内所述最优并发升级图, 将各所述最优有向升级图的叶子结点设备放入叶子结点集合, 所述叶子结 点设备是指前驱设备列表为空的网络设备, 将所述叶子节点集合发送给升 级模块;
升级单元, 用于接收叶子结点集合生成单元发来的叶子节点集合, 将 所述叶子结点集合中的网络设备放入所述线程池, 并发执行设备升级操作。
12、 根据权利要求 11所述的装置, 其特征在于,
所述升级单元, 具体用于创建已升级网络设备统计变量以及同步控制 锁, 初始化所述已升级统计变量为零, 执行所述线程池内网络设备的升级; 获取所述同步控制锁, 根据网络设备升级结果修改对应设备状态, 并 将所述已升级网络设备变量加 1;
判断正已完成升级的网络设备的后继设备列表是否为空, 若为空, 则 判断已升级网络设备统计变量是否等于待升级的网络设备的总数, 若是, 则释放同步控制锁并关闭线程池;
若不为空, 则遍历所述后继设备列表获取到前驱设备已完成升级的第 二设备集合, 判断第二设备集合中设备的数量是否大于零, 若是, 则依次 将所述第二设备集合中的设备放入线程池内递归完成设备升级。
PCT/CN2012/075946 2012-03-20 2012-05-23 批量升级网络设备的方法及装置 WO2013139084A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210074685.5A CN103327038B (zh) 2012-03-20 2012-03-20 批量升级网络设备的方法及装置
CN201210074685.5 2012-03-20

Publications (1)

Publication Number Publication Date
WO2013139084A1 true WO2013139084A1 (zh) 2013-09-26

Family

ID=49195568

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/075946 WO2013139084A1 (zh) 2012-03-20 2012-05-23 批量升级网络设备的方法及装置

Country Status (2)

Country Link
CN (1) CN103327038B (zh)
WO (1) WO2013139084A1 (zh)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103763336B (zh) * 2013-11-29 2017-04-12 北京中启智源数字信息技术有限责任公司 一种面向复杂网络架构的软件更新方法
CN104065512A (zh) * 2014-06-30 2014-09-24 国家电网公司 一种电力通信光传输设备告警快速处理方法
CN105159745A (zh) * 2015-08-21 2015-12-16 北京星网锐捷网络技术有限公司 虚拟交换架构vsf系统升级的方法、装置及设备
CN105610627A (zh) * 2016-01-11 2016-05-25 上海斐讯数据通信技术有限公司 一种网络设备升级的方法及设备
CN108990107B (zh) * 2017-06-02 2021-06-22 华为技术有限公司 数据传输方法及设备
CN108762792A (zh) * 2018-06-21 2018-11-06 普联技术有限公司 网络设备升级方法、升级服务器、终端设备及存储介质
WO2021003677A1 (zh) * 2019-07-09 2021-01-14 华为技术有限公司 一种分布式系统中的业务升级方法、装置及分布式系统
CN112039736A (zh) * 2020-08-14 2020-12-04 深圳市欧瑞博科技股份有限公司 智能设备的升级方法、装置、智能家居系统及电子设备

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101951369A (zh) * 2010-09-14 2011-01-19 太仓市同维电子有限公司 基于自动发现的终端批量升级方法及其系统
CN102291742A (zh) * 2011-08-18 2011-12-21 中兴通讯股份有限公司 无线路由设备的版本更新方法及装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098279B (zh) * 2006-06-30 2010-10-13 李涛 分布式动态拓扑系统、构建方法以及应用在其中的终端设备
CN100562159C (zh) * 2007-04-23 2009-11-18 中兴通讯股份有限公司 无线通信系统中级联方式连接的被管理模块的升级方法
CN101394337B (zh) * 2007-09-21 2012-11-07 华为技术有限公司 基于p2p的网络节点间消息路由的方法、系统及装置

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101951369A (zh) * 2010-09-14 2011-01-19 太仓市同维电子有限公司 基于自动发现的终端批量升级方法及其系统
CN102291742A (zh) * 2011-08-18 2011-12-21 中兴通讯股份有限公司 无线路由设备的版本更新方法及装置

Also Published As

Publication number Publication date
CN103327038B (zh) 2016-06-22
CN103327038A (zh) 2013-09-25

Similar Documents

Publication Publication Date Title
WO2013139084A1 (zh) 批量升级网络设备的方法及装置
CN108549580B (zh) 自动部署Kubernetes从节点的方法及终端设备
JP5488178B2 (ja) データ管理プログラム及び方法、並びにノード装置
US8429255B1 (en) Determining reorder commands for remote reordering of policy rules
JP4210155B2 (ja) 遠隔的に装置を監視する監視システム、方法及びコンピュータプログラム
US20160308759A1 (en) Flow table matching method and apparatus, and openflow switching system
JP2004030642A (ja) 監視される機器に関する機器オブジェクトを作成することで遠隔的に機器を監視する方法及び装置
WO2014032519A1 (zh) 云环境中虚拟机软件管理的方法、系统及设备
JP4585944B2 (ja) パケット通信装置
CN110166299B (zh) Sdn控制器配置恢复方法及装置
WO2015143794A1 (zh) 制作、升级方法及服务器、终端、升级系统和存储介质
WO2013063950A1 (zh) 多模通信设备的巡检方法和系统
CN108900421A (zh) 一种分布式存储系统的拓扑结构生成方法、装置及系统
WO2013075488A1 (zh) 网元升级方法及装置
CN106537840A (zh) 用于网络设备管理的系统和方法
CN114185577A (zh) 配置管理系统、配置管理方法、服务器及存储介质
JP2004005692A (ja) 遠隔的に監視される機器に複数のベンダ支援を与える方法及び装置
WO2016116013A1 (zh) 软件升级方法和系统
WO2011160497A1 (zh) 一种snmp代理上管理信息库的升级方法和系统
WO2015131523A1 (zh) 数据查询方法、系统及计算机存储介质
WO2020010906A1 (zh) 操作系统os批量安装方法、装置和网络设备
CN112436950B (zh) 基于udp广播发现局域网内设备的方法
JP6683049B2 (ja) 情報処理装置、情報処理方法、情報処理システム及びプログラム
EP3043521A1 (en) Method and device for sending crossover command
CN103138958B (zh) 一种网管标准接口的实现方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12871714

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12871714

Country of ref document: EP

Kind code of ref document: A1