A Method, System, Electronic Device and Storage Medium for Batch Upgrading of Switches

Through the breadth-first search strategy and multicast model, batch upgrade of switches is achieved, which solves the problem of excessive network load during switch upgrades, and reduces redundant traffic and network resource consumption.

CN116319311BActive Publication Date: 2025-07-04武汉迈威通信股份有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211091966.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-07
Publication Date
2025-07-04
Estimated Expiration
2042-09-07

AI Technical Summary

Technical Problem

When the switch is upgraded in batches, the network load is too heavy, and the existing unicast method leads to high pressure on information sources and network bandwidth.

Method used

The breadth-first search strategy is used to obtain the switch upgrade coefficient, join the multicast group in batches, and build a forwarding path through the multicast model to achieve multicast upgrade.

Benefits of technology

Reduces redundant traffic, reduces network load of multicast source equipment, and improves network resource utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116319311B_ABST
    Figure CN116319311B_ABST
Patent Text Reader

Abstract

The present invention provides a method, system, electronic device and storage medium for batch upgrading of switches. The method includes: the multicast source obtains the upgrade coefficients of all switches to be upgraded based on the breadth-first search strategy; the switches to be upgraded with the same upgrade coefficient are added to a preset multicast group in batches from largest to smallest; a forwarding path between the multicast source and the preset multicast group is constructed based on a preset multicast model; and the upgrade file is sent to each switch to be upgraded through the forwarding path so that each switch to be upgraded can be upgraded. The present invention obtains the level where each switch to be upgraded in the network is located as the upgrade coefficient through the breadth-first search strategy, and dynamically adds the switches to be upgraded to the multicast group based on the same upgrade coefficient. By directly establishing a dedicated multicast forwarding path between the receiver and the multicast source, the batch upgrading of switches can be completed with the least network resources, reducing the network load of the multicast source device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technologies, and more particularly, to a method, a system, an electronic device, and a storage medium for batch upgrading of switches. Background Art

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

[0003] With the rapid development of Internet technologies, switch devices have become indispensable electronic devices in our daily lives. When a switch is upgraded, since the current upgrade of the switch adopts the unicast method, that is to say, if there are N switches in the network that need to be upgraded, the source device that provides the upgrade file needs to establish independent information transmission channels with the N switches respectively, and send independent information copies to each switch. At this time, the amount of information transmitted in the network is proportional to the number of switches to be upgraded. When the number of switches to be upgraded is large, the source device needs to send multiple copies of the same content information to different switches, which will cause a great deal of pressure on the information source and the network bandwidth. Therefore, how to reduce the network load during the batch upgrade of switches is an urgent problem to be solved. Summary of the Invention

[0004] In view of the technical problems existing in the prior art, the present invention provides a method, a system, an electronic device, and a storage medium for batch upgrading of switches, so as to solve the problem of how to reduce the network load during the batch upgrade of switches.

[0005] According to a first aspect of the present invention, there is provided a method for batch upgrading of switches, including:

[0006] A multicast source obtains upgrade coefficients of all switches to be upgraded based on a breadth-first search strategy;

[0007] The switches to be upgraded with the same upgrade coefficient are added to a preset multicast group in batches from largest to smallest;

[0008] A forwarding path between the multicast source and the preset multicast group is constructed based on a preset multicast model;

[0009] The upgrade file is sent to each switch to be upgraded through the forwarding path, so that each switch to be upgraded can be upgraded.

[0010] Based on the above technical solutions, the present invention can also be improved as follows.

[0011] Optionally, the step in which the multicast source obtains the upgrade coefficients of all switches to be upgraded based on the breadth-first search strategy includes:

[0012] Construct the nodes of all switches in the current network topology into an adjacency list structure;

[0013] Set the upgrade coefficients for the node data layer by layer based on the breadth-first search strategy until the setting for all switches to be upgraded is completed.

[0014] Optionally, the step of setting the upgrade coefficients for the node data layer by layer based on the breadth-first search strategy includes:

[0015] Store the multicast source in a preset first-in-first-out queue;

[0016] When the preset first-in-first-out queue is not empty, take out the elements in the preset first-in-first-out queue one by one;

[0017] When the element has unvisited adjacent nodes, set the access mark and upgrade coefficient of the adjacent node according to a preset rule and put it into the preset first-in-first-out queue until the upgrade coefficient setting for the node data is completed.

[0018] Optionally, the step of adding the switches to be upgraded with the same upgrade coefficient to a preset multicast group in descending order of batches includes:

[0019] Batch the switches to be upgraded according to the upgrade coefficients, divide those with the same upgrade coefficient into the same batch, and obtain multiple batches of switches to be upgraded with different batches;

[0020] Send a group entry instruction to the multiple batches of switches to be upgraded in descending order of batches, so that all switches to be upgraded dynamically join the preset multicast group according to the group entry instruction.

[0021] Optionally, the step of constructing a forwarding path between the multicast source and the preset multicast group based on a preset multicast model further includes:

[0022] Each switch to be upgraded sends a report message to its corresponding upstream switch;

[0023] When the group address in the report message is within the range of the preset multicast group address, the upstream switch constructs a preset multicast model and sends a subscription message to the multicast source hop by hop to obtain the forwarding path between the multicast source and the preset multicast group.

[0024] Optionally, the step of sending the upgrade file to each switch to be upgraded through the forwarding path includes:

[0025] The multicast source sends the upgrade file to each switch to be upgraded through the forwarding path based on the multicast routing protocol.

[0026] Optionally, after the step of sending the upgrade file to each switch to be upgraded through the forwarding path to enable each switch to be upgraded, the method includes:

[0027] After each switch to be upgraded completes the upgrade, it dynamically leaves the preset multicast group.

[0028] According to a second aspect of the present invention, there is provided a system for batch upgrading switches, including:

[0029] A coefficient acquisition module, configured to acquire the upgrade coefficients of all switches to be upgraded based on a breadth-first search strategy;

[0030] A batch joining module, configured to join the switches to be upgraded with the same upgrade coefficients into a preset multicast group in descending order of batches;

[0031] A path construction module, configured to construct a forwarding path between the multicast source and the preset multicast group based on a preset multicast model;

[0032] A file upgrade module, configured to send the upgrade file to each switch to be upgraded through the forwarding path to enable each switch to be upgraded.

[0033] According to a third aspect of the present invention, there is provided an electronic device, including a memory and a processor, where the processor is configured to implement the steps of any one of the switch batch upgrade methods in the first aspect when executing a computer management program stored in the memory.

[0034] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium, on which a computer management program is stored, and the computer management program is configured to implement the steps of any one of the switch batch upgrade methods in the first aspect when executed by a processor.

[0035] A method, system, electronic device, and storage medium for batch upgrading of switches provided by the present invention. The method includes: the multicast source obtains the upgrade coefficients of all switches to be upgraded based on the breadth-first search strategy; the switches to be upgraded with the same upgrade coefficient are added to a preset multicast group in batches from largest to smallest; a forwarding path between the multicast source and the preset multicast group is constructed based on a preset multicast model; and the upgrade file is sent to each switch to be upgraded through the forwarding path, so that each switch to be upgraded can be upgraded. The present invention traverses the switches in the entire network topology through the breadth-first search strategy, thereby obtaining the level where each switch to be upgraded in the network is located as the upgrade coefficient, and dynamically adding the switches to be upgraded to the multicast group based on the same upgrade coefficient. By directly establishing a dedicated multicast forwarding path between the receiver and the multicast source, the upgrade file can be sent to the switches to be upgraded with the least network resources, completing the batch upgrade of the switches, greatly reducing the generation of redundant traffic, and reducing the network load of the multicast source device. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a flowchart of a method for batch upgrading of switches provided by the present invention;

[0037] Figure 2 It is a schematic diagram of an existing unicast transmission method;

[0038] Figure 3 It is a schematic diagram of the data transmission method of the multicast switch provided by the present invention;

[0039] Figure 4 It is a flowchart of switch traversal based on the breadth search strategy provided by the present invention;

[0040] Figure 5 It is a schematic diagram of the construction of the multicast forwarding path provided by the present invention;

[0041] Figure 6 It is a schematic diagram of the structure of a system for batch upgrading of switches provided by the present invention;

[0042] Figure 7 It is a schematic diagram of the hardware structure of a possible electronic device provided by the present invention;

[0043] Figure 8 It is a schematic diagram of the hardware structure of a possible computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0044] The following combines the drawings and embodiments to further describe in detail the specific embodiments of the present invention. The following embodiments are used to illustrate the present invention, but are not used to limit the scope of the present invention.

[0045] Figure 1The flowchart of a method for batch upgrading of switches provided by the present invention is as follows Figure 1 as shown, the method includes:

[0046] Step S100: The multicast source obtains the upgrade coefficients of all switches to be upgraded based on the breadth-first search strategy;

[0047] It should be noted that the execution subject of the method in this embodiment can be a computer terminal device with data processing, network communication, and program running functions, such as a computer, a tablet computer, etc.; it can also be a server device with the same or similar functions, or a cloud server with similar functions. This embodiment does not limit this. For the sake of understanding, this embodiment and the following embodiments will be described by taking the server device as an example.

[0048] It can be understood that the above upgrade coefficients can be coefficients used to identify the upgrade order of switches to be upgraded, and they can be set according to the levels of the current network where the switches are located.

[0049] Step S200: Add the switches to be upgraded with the same upgrade coefficient to a preset multicast group in descending order of batches;

[0050] It should be noted that the above preset multicast group can be a multicast group address range specified by the multicast source, and its specification method can be the default setting when the multicast source device leaves the factory, or can be configured by the administrator. This embodiment does not limit this.

[0051] Step S300: Build a forwarding path between the multicast source and the preset multicast group based on a preset multicast model;

[0052] It should be noted that the above construction of the forwarding path can be completed based on the shortest path tree.

[0053] It can be understood that the above preset multicast model can be an SSM (Source-Specific Multicast) model, which can be implemented by borrowing some technologies of PIM-SM. The SSM model provides a solution for source-specific multicast, and maintains the relationship between switches to be upgraded and multicast routers through IGMP v3 (carrying the source address S and the multicast address G).

[0054] Step S400: Send the upgrade file to each switch to be upgraded through the forwarding path, so that each switch to be upgraded can be upgraded.

[0055] It can be understood that, based on the deficiencies in the background art, an embodiment of the present invention proposes a method for batch upgrading of switches. The method includes: the multicast source obtains the upgrade coefficients of all switches to be upgraded based on the breadth-first search strategy; the switches to be upgraded with the same upgrade coefficients are added to a preset multicast group in batches from largest to smallest; a forwarding path between the multicast source and the preset multicast group is constructed based on a preset multicast model; and the upgrade file is sent to each switch to be upgraded through the forwarding path, so that each switch to be upgraded can be upgraded. In the present invention, the switches in the entire network topology are traversed through the breadth-first search strategy, so as to obtain the level where each switch to be upgraded is located in the network as the upgrade coefficient, and the switches to be upgraded are dynamically added to the multicast group based on the same upgrade coefficient. By directly establishing a dedicated multicast forwarding path between the receiver and the multicast source, the upgrade file can be sent to the switches to be upgraded using the least network resources, completing the batch upgrade of the switches, greatly reducing the generation of redundant traffic, and reducing the network load of the multicast source device.

[0056] In a possible embodiment, the step in which the multicast source obtains the upgrade coefficients of all switches to be upgraded based on the breadth-first search strategy includes:

[0057] Step S101: Construct all switches in the current network topology into node data in an adjacency list structure;

[0058] Step S102: Based on the breadth-first search strategy, set the upgrade coefficients for the node data layer by layer until the setting of all switches to be upgraded is completed.

[0059] In a possible embodiment, the step of setting the upgrade coefficients for the node data layer by layer based on the breadth-first search strategy includes:

[0060] Step S1021: Deposit the multicast source into a preset first-in-first-out queue;

[0061] Step S1022: When the preset first-in-first-out queue is not empty, take out the elements in the preset first-in-first-out queue one by one;

[0062] Step S1023: When the element has unvisited adjacent nodes, set the access mark and upgrade coefficient of the adjacent nodes according to a preset rule, and put them into the preset first-in-first-out queue until the setting of the upgrade coefficients of the node data is completed.

[0063] In this embodiment, the upgrade coefficients of the switches in the network topology are set layer by layer through the breadth-first search strategy, so that the multicast source can construct a multicast group based on the above upgrade coefficients, and then realize multicast communication, greatly reducing the load of the multicast source device and the consumption of network resources.

[0064] In a possible implementation manner, the step of adding the switches to be upgraded with the same upgrade coefficient to a preset multicast group in descending order of batches includes:

[0065] Step S201: Batch all the switches to be upgraded according to the upgrade coefficient, and divide those with the same upgrade coefficient into the same batch to obtain multiple batches of switches to be upgraded with different batches;

[0066] Step S202: Send a group entry instruction to the multiple batches of switches to be upgraded according to the batches in descending order, so that all the switches to be upgraded dynamically join the preset multicast group according to the group entry instruction.

[0067] In a specific implementation, the multicast source notifies the switches to be upgraded with the same upgrade coefficient to dynamically join the same SSM designated source multicast group address (232.0.0.0 / 8) at the same time. The SSM multicast address identifies a set of receivers. All members who join this multicast group can receive the upgrade data sent by the source device.

[0068] In a possible implementation manner, the step of constructing a forwarding path between the multicast source and the preset multicast group based on the preset multicast model further includes:

[0069] Step S301: Each switch to be upgraded sends a report message to its corresponding upstream switch;

[0070] Step S302: When the group address in the report message is within the range of the preset multicast group address, the upstream switch constructs a preset multicast model and sends a subscription message to the multicast source hop by hop to obtain the forwarding path between the multicast source and the preset multicast group.

[0071] In a specific implementation, the switch to be upgraded is a receiver of multicast information (upgrade data). It reports its interest in the data from the multicast source S and sent to the multicast group G to the upstream (querying the unicast routing table) by means of a report message of IGMPv3 (carrying the source address S and the multicast address G). The upstream switch that receives this report message (querying the unicast routing table) first determines whether the group address in the message is within the range of the SSM group address. If it is within the range of the SSM group address, it constructs PIM-SSM and sends a subscription message (Subscribe Message) of the channel to the multicast source hop by hop.

[0072] In a possible implementation manner, the step of sending the upgrade file to each switch to be upgraded through the forwarding path includes:

[0073] Step S401: The multicast source sends the upgrade file to each switch to be upgraded through the forwarding path based on the multicast routing protocol.

[0074] It should be noted that the above forwarding path is composed of multiple network nodes on the shortest path. The above network nodes can be layer-3 switches (i.e., multicast routers) that support layer-3 multicast functions, which can not only provide multicast routing functions but also provide multicast group member management functions. At the same time, the switch itself can also be a member of the multicast group.

[0075] In this embodiment, by copying and distributing the upgrade file through the specified network nodes, the multicast source only needs to send one copy of the upgrade file, thus achieving one-to-many data distribution, and then realizing the batch upgrade of multiple switches to be upgraded, greatly reducing the CPU load of the multicast source and the consumption of network resources.

[0076] In a possible embodiment, after the step of sending the upgrade file to each switch to be upgraded through the forwarding path so that each switch to be upgraded can perform the upgrade, it includes:

[0077] Step S500: After each switch to be upgraded completes the upgrade, it dynamically leaves the preset multicast group.

[0078] In this embodiment, by having the upgraded switches leave the multicast group, the dynamic maintenance of the multicast group is realized, enabling switches with upgrade requirements to obtain the upgrade file from the multicast group in a timely manner to complete the upgrade, and then achieving the purpose of upgrading more switches in batches.

[0079] To further illustrate the working principle of the batch upgrade of switches in the embodiments of the present invention, refer to Figure 2 , Figure 2 is a schematic diagram of the existing unicast transmission method; in Figure 2 , the upgrade of the switch adopts the unicast method, that is, if there are N switches in the network that need to be upgraded, the source device providing the upgrade file needs to establish independent information transmission channels with the N switches respectively and send independent information copies to each switch. At this time, the amount of information transmitted in the network is proportional to the number of switches to be upgraded. When the number of switches to be upgraded is large, the source device needs to send multiple copies of the same content information to different switches, which will cause great pressure on the source device and the network bandwidth. Therefore, the unicast transmission method is not conducive to the batch sending of upgrade data, that is, the traditional switch upgrade method is not conducive to the remote batch upgrade of switches.

[0080] To solve the above problems of traditional switch upgrades, the present invention provides a method for batch upgrading switches, refer to Figure 3 , Figure 3Schematic diagram of the multicast switch data transmission method provided by the present invention. In Figure 3 the source device (the multicast source running the network management system) uses a search strategy to traverse all switches to be upgraded, obtains the upgrade system of each switch, and batches and upgrades the switches in descending order of the upgrade coefficient, that is, first upgrades the switch with the system of k, and then upgrades the switch with the upgrade coefficient of k-1 until the switch with the coefficient of 1 is upgraded. After the upgrade is completed, the upgrade coefficient of the successfully upgraded switch can be set to -1, indicating that the switch has been upgraded.

[0081] In Figure 3 the source device notifies the switches to be upgraded with the same upgrade coefficient to dynamically join the same SSM designated source multicast group address (232.0.0.0 / 8) at the same time. In the embodiment of the present invention, the SSM multicast address is used to identify a set of receivers. All members who join this multicast group can receive the upgrade data sent by the source device. The source device only needs to send a copy of the upgrade data to this multicast group. With the help of the multicast routing protocol, a multicast distribution tree is established. The transmitted upgrade data starts to be replicated and distributed at the network node as far away from the multicast source as possible. The multicast router in the network replicates and forwards the upgrade file according to the distribution of the members in this multicast group. Finally, this information will be accurately sent to the switches to be upgraded. Among them, all switches that join the SSM multicast group become multicast group members. At this time, the maintenance of the member relationship is dynamic, and the switches that have completed the upgrade can leave the multicast group.

[0082] All upgrade operations of the above switches to be upgraded are controlled by the source device that provides the upgrade file. Among them, the process for the source device to obtain all switches to be upgraded can be as follows: set the source device at layer 0 with an upgrade coefficient of 0, the switches to be upgraded connected to it at layer 1 with an upgrade coefficient of 1, and so on. The upgrade coefficient of the switches to be upgraded at layer n is n. Abstract the network topology into an undirected graph, use the adjacency list as the data structure, each network node corresponds to a linked list, and what is stored is the node connected to this node by an edge. Use the breadth-first search strategy (Breadth First Search, BFS) to traverse the switches to be upgraded, advancing layer by layer in a carpet-like manner, first finding the closest to the source device, then the next closest, and searching outwards in turn until the entire network topology is traversed.

[0083] When setting the total number of switches in the entire network topology to num, the process of setting the upgrade coefficient for all switches using the breadth-first search strategy can be seen in Figure 4 , Figure 4 which is the flowchart of switch traversal based on the breadth search strategy provided by the present invention. In Figure 4First, initialize the first-in-first-out queue "queue", set the access flags of all nodes to false and the upgrade coefficients to -1. Then, add the source device "s" to the queue "queue" and set its access flag to true. When the queue "queue" is not empty, take out the first element in the queue "queue" and check whether it has unvisited adjacent nodes. When there are unvisited adjacent nodes, set the access flags and upgrade coefficients of the adjacent nodes and add them to the queue "queue" until all nodes are visited, so as to obtain the upgrade coefficients of the switches in the entire network topology, and further obtain the upgrade coefficients of all switches to be upgraded.

[0084] Among them, the "visited" array is used to record the access status of switches to avoid repeated access. If the switch "q" has been visited, then "visited[q]" is set to true, otherwise it is set to false. "queue" is a queue with the feature of first-in-first-out, and queues are used in algorithms for level-order traversal. Since breadth-first search visits switches layer by layer, only after all switches in the k-th layer are visited can the switches in the (k + 1)-th layer be visited. When visiting the switches in the k-th layer, the switches in the k-th layer need to be recorded so that the switches in the (k + 1)-th layer can be found through the switches in the k-th layer later. The "factor" array is used to record the layer where each visited switch is located and save it as the upgrade coefficient of each switch. First, the switches in the k-th layer are upgraded (the upgrade coefficient is k), then the switches in the (k - 1)-th layer are upgraded (the upgrade coefficient is k - 1), and so on, until the switches in the first layer are upgraded (the upgrade coefficient is 1).

[0085] Since in the multicast protocol, the switches to be upgraded are only interested in the upgrade information sent by a specified information source (a specific multicast source) and do not receive information sent by other sources. The present invention uses the multicast address range of the SSM model (the SSM group address range reserved by IANA is 232.0.0.0 / 8) to provide a transmission service that can specify the multicast source at the receiving end and directly establish a dedicated multicast forwarding path between the receiver and the multicast source.

[0086] Among them, the SSM model can be implemented by borrowing some technologies of PIM-SM. The SSM model provides a solution for source-specific multicast and maintains the relationship between the switches to be upgraded and the multicast routers through IGMP v3 (carrying the source address "S" and the multicast address "G"). The receiver already knows the specific location of the multicast source, and the multicast group that the receiver is ready to join belongs to the SSM group address range. Refer to Figure 5 , Figure 5 which is a schematic diagram of the multicast forwarding path construction provided by the present invention. As shown in Figure 5As shown in the figure, the switch to be upgraded is the receiver of multicast information (upgrade data). It reports to the upstream (querying the unicast routing table) that it is interested in the data from multicast source S and destined for multicast group G by means of an IGMP v3 report message (carrying source address S and multicast address G). The upstream switch (querying the unicast routing table) that receives this report message first determines whether the group address in the message is within the SSM group address range. If it is within the SSM group address range, it constructs PIM-SSM and sends a subscription message (Subscribe Message) for the channel to the multicast source hop by hop. SG entries are created on all routers along the way (SG is also called "multicast source group", which is usually used to represent multicast packets sent from multicast source S to multicast group G. Here, "S" represents a specific multicast source S, and "G" represents a specific multicast group G), thus constructing an SPT (Shortest Path Tree) rooted at the multicast source and with the receiver as the leaf in the network. This SPT is the transmission channel for upgrade data in PIM-SSM. In PIM-SSM, the concept of "channel" is used to represent the multicast group, and the concept of "subscription message" is used to represent the join message.

[0087] In the embodiment of the present invention, since the upgrade data information to be transmitted is upgraded in the way from the switch farthest from the source device to the nearer ones, when the number of switches to be upgraded increases, it will not cause an increase in the load of the source device and a significant increase in network resource consumption. Therefore, it can reduce the load on the CPUs of the source device and network devices, reduce the generation of redundant traffic, and at the same time use fewer network resources to achieve point-to-multiple switch upgrades.

[0088] Please refer to Figure 6 , Figure 6 which is a schematic diagram of a system structure for batch upgrade of switches provided by an embodiment of the present invention. As Figure 6 shown, a system for batch upgrade of switches includes a coefficient acquisition module 100, a batch addition module 200, a path construction module 300, and a file upgrade module 400, where:

[0089] The coefficient acquisition module 100 is used to obtain the upgrade coefficients of all switches to be upgraded based on the breadth-first search strategy; the batch addition module 200 is used to add the switches to be upgraded with the same upgrade coefficient to a preset multicast group in descending order of batches; the path construction module 300 is used to construct a forwarding path between the multicast source and the preset multicast group based on a preset multicast model; the file upgrade module 400 is used to send the upgrade file to each switch to be upgraded through the forwarding path so that each switch to be upgraded can be upgraded.

[0090] It can be understood that a switch batch upgrade system provided by the present invention corresponds to the switch batch upgrade methods provided in the foregoing embodiments. The relevant technical features of the switch batch upgrade system can refer to the relevant technical features of the switch batch upgrade methods, which will not be elaborated here.

[0091] Please refer to Figure 7 , Figure 7 which is a schematic diagram of an embodiment of an electronic device provided by an embodiment of the present invention. As Figure 7 shown, an embodiment of the present invention provides an electronic device, including a memory 1310, a processor 1320, and a computer program 1311 stored in the memory 1310 and executable on the processor 1320. When the processor 1320 executes the computer program 1311, the following steps are implemented:

[0092] The multicast source obtains the upgrade coefficients of all switches to be upgraded based on the breadth-first search strategy; the switches to be upgraded with the same upgrade coefficients are added to a preset multicast group in descending order of batches; a forwarding path between the multicast source and the preset multicast group is constructed based on a preset multicast model; and the upgrade file is sent to each switch to be upgraded through the forwarding path, so that each switch to be upgraded can be upgraded.

[0093] Please refer to Figure 8 , Figure 8 which is a schematic diagram of an embodiment of a computer-readable storage medium provided by the present invention. As Figure 8 shown, this embodiment provides a computer-readable storage medium 1400, on which a computer program 1411 is stored. When the computer program 1411 is executed by a processor, the following steps are implemented:

[0094] The multicast source obtains the upgrade coefficients of all switches to be upgraded based on the breadth-first search strategy; the switches to be upgraded with the same upgrade coefficients are added to a preset multicast group in descending order of batches; a forwarding path between the multicast source and the preset multicast group is constructed based on a preset multicast model; and the upgrade file is sent to each switch to be upgraded through the forwarding path, so that each switch to be upgraded can be upgraded.

[0095] A method, system, and storage medium for batch upgrading of switches provided by an embodiment of the present invention. The method includes: a multicast source obtaining upgrade coefficients of all switches to be upgraded based on a breadth-first search strategy; adding the switches to be upgraded with the same upgrade coefficient to a preset multicast group in batches from largest to smallest; constructing a forwarding path between the multicast source and the preset multicast group based on a preset multicast model; and sending an upgrade file to each switch to be upgraded through the forwarding path so that each switch to be upgraded can perform the upgrade. The present invention traverses switches in the entire network topology through a breadth-first search strategy to obtain the level where each switch to be upgraded is located in the network as the upgrade coefficient, and dynamically adds the switches to be upgraded to the multicast group based on the same upgrade coefficient. By directly establishing a dedicated multicast forwarding path between the receiver and the multicast source, the upgrade file can be sent to the switches to be upgraded using the least amount of network resources, completing the batch upgrade of the switches, greatly reducing the generation of redundant traffic, and reducing the network load of the multicast source device.

[0096] It should be noted that in the above embodiments, the descriptions of each embodiment have their own focuses. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0097] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0098] The present invention is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded computer, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0099] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction means that implements the function specified in one or more processes and / or blocks Figure 1 in the process Figure 1 or processes and / or blocks

[0100] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, such that a series of operational steps are performed on the computer or other programmable apparatus to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable apparatus provide steps for implementing the function specified in one or more processes and / or blocks Figure 1 in the process Figure 1 or processes and / or blocks

[0101] Although the preferred embodiments of the present invention have been described, additional changes and modifications can be made by those skilled in the art once they learn of the basic inventive concept. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications that fall within the scope of the present invention

[0102] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations

Claims

1. A method for batch upgrading of a switch, characterized in that, The method includes: The multicast source obtains the upgrade coefficients of all switches to be upgraded based on the breadth - first search strategy; The switches to be upgraded with the same upgrade coefficient are added to a preset multicast group in batches from largest to smallest; A forwarding path between the multicast source and the preset multicast group is constructed based on a preset multicast model; The upgrade file is sent to each switch to be upgraded through the forwarding path so that each switch to be upgraded can be upgraded; The upgrade coefficient is the level where each switch to be upgraded is located in the network.

2. The method for batch upgrading of switches according to claim 1, wherein, The step where the multicast source obtains the upgrade coefficients of all switches to be upgraded based on the breadth - first search strategy includes: All switches in the current network topology are constructed into node data in an adjacency list structure; Based on the breadth - first search strategy, the upgrade coefficients are set layer by layer for the node data until the setting of all switches to be upgraded is completed.

3. The method for batch upgrading of switches according to claim 2, wherein The step of setting the upgrade coefficients layer by layer for the node data based on the breadth - first search strategy includes: The multicast source is stored in a preset first - in - first - out queue; When the preset first - in - first - out queue is not empty, the elements in the preset first - in - first - out queue are taken out one by one; When the element has unvisited adjacent nodes, the access mark and upgrade coefficient of the adjacent node are set according to preset rules and put into the preset first - in - first - out queue until the upgrade coefficient setting of the node data is completed.

4. The method for batch upgrading of switches according to claim 1, wherein The step of adding the switches to be upgraded with the same upgrade coefficient to a preset multicast group in batches from largest to smallest includes: The all switches to be upgraded are batched according to the upgrade coefficient, and those with the same upgrade coefficient are grouped into the same batch, obtaining multiple batches of switches to be upgraded with different batches; Group - entry instructions are sent to the multiple batches of switches to be upgraded according to the batches from largest to smallest so that all switches to be upgraded can dynamically join the preset multicast group according to the group - entry instructions.

5. The method for batch upgrading of switches according to claim 4, wherein The step of constructing a forwarding path between the multicast source and the preset multicast group based on a preset multicast model further includes: Each switch to be upgraded sends a report message to its corresponding upstream switch; When the group address in the report message is within the range of the preset multicast group address, the upstream switch constructs a preset multicast model and sends a subscription message to the multicast source hop - by - hop to obtain the forwarding path between the multicast source and the preset multicast group.

6. The method for batch upgrading of switches according to claim 1, wherein, The step of sending the upgrade file to each switch to be upgraded through the forwarding path includes: The multicast source sends the upgrade file to each switch to be upgraded through the forwarding path based on the multicast routing protocol.

7. The method for batch upgrading of a switch according to claim 1, characterized in that, After the step of sending the upgrade file to each switch to be upgraded through the forwarding path so that each switch to be upgraded can be upgraded, it includes: Each switch to be upgraded dynamically leaves the preset multicast group after completing the upgrade.

8. A batch upgrade system for switches, characterized in that, Includes A coefficient acquisition module for obtaining the upgrade coefficients of all switches to be upgraded based on the breadth - first search strategy; A batch addition module for adding the switches to be upgraded with the same upgrade coefficient to a preset multicast group in batches from largest to smallest; A path construction module, configured to construct a forwarding path between a multicast source and the preset multicast group based on a preset multicast model; A file upgrade module, configured to send an upgrade file to each switch to be upgraded through the forwarding path, so that each switch to be upgraded performs an upgrade.

9. An electronic device, characterized in that, It includes a memory and a processor, and the processor is configured to implement the steps of the switch batch upgrade method according to any one of claims 1-7 when executing a computer management program stored in the memory.

10. A computer-readable storage medium, characterized in that, A computer management program is stored thereon, and when the computer management program is executed by a processor, the steps of the switch batch upgrade method according to any one of claims 1-7 are implemented.

Citation Information

Patent Citations

  • Wireless Mesh network multicasting communication method of AC-AP (Access Controller-Access Point) framework

    CN102158812A

  • Multicast protocol-based data communication terminal automatic batch upgrading method and system

    CN111726235A