WO2020010906A1 - Method and device for operating system (os) batch installation, and network device - Google Patents

Method and device for operating system (os) batch installation, and network device Download PDF

Info

Publication number
WO2020010906A1
WO2020010906A1 PCT/CN2019/085448 CN2019085448W WO2020010906A1 WO 2020010906 A1 WO2020010906 A1 WO 2020010906A1 CN 2019085448 W CN2019085448 W CN 2019085448W WO 2020010906 A1 WO2020010906 A1 WO 2020010906A1
Authority
WO
WIPO (PCT)
Prior art keywords
network
network device
tree
topology
network topology
Prior art date
Application number
PCT/CN2019/085448
Other languages
French (fr)
Chinese (zh)
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 WO2020010906A1 publication Critical patent/WO2020010906A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation

Definitions

  • the present invention relates to the field of Internet technologies, and in particular, to a method, a device, and a network device for batch installation of an operating system OS.
  • OS operating systems
  • SP smart management operating system
  • IP Internet Protocol
  • the present application discloses a method, a device and a network device for batch installation of an operating system OS, which can solve the problem of long time consumption in the existing batch installation scheme of OS.
  • an embodiment of the present invention provides a method for batch installation of an operating system OS.
  • the method includes: a first network device determining a first tree composed of n network devices according to a multicast message sent by the n network devices; Network topology, where the first network device is any of the m network devices in the local area network that is running, n is less than or equal to m, m and n are positive integers, and the multicast message includes The attribute information of the network device is described; when the number of times that the first network device sends multicast messages to other network devices in the local area network meets a first threshold, determining the The network device where the root node is located, so that the network device where the root node of each tree network topology is located obtains the OS image and sends it to each network device in each tree network topology for OS installation.
  • the first network device may determine each tree network topology included in the local area network according to the multicast message sent by the n network devices, and then pass the network where the root node of each tree network topology is located.
  • the device sends the obtained OS image to each network device in each tree network topology, and then installs the OS in each network device. This can solve the time-consuming and bulky installation of the OS in the existing OS batch installation solution. The long problem improves the efficiency of OS batch installation.
  • the determining a network device where a root node of each tree network topology in at least one tree network topology of the local area network includes: when the local network includes the first tree, When at least two tree network topologies including the first network device topology and the second tree network topology include different network devices, the first network device receives the second network A first unicast message sent by a device, the first unicast message including a second tree network topology formed by a second network device, and the second network device is the m network devices except the first Another network device running outside the network device; the first network device determines that the network device where the root node of the first tree network topology is located and the network device where the root node of the second tree network topology is the two trees of the local area network respectively The network device where the respective root node is located in the network topology.
  • the first network device can determine two independent tree network topologies existing in the local area network, and then obtain the OS image through the network device where the respective root nodes of the two tree network topologies are located, and distribute the OS image
  • Each network device in a tree network topology performs OS installation, so that each independent tree network topology existing in the local area network can be quickly and accurately determined, thereby improving the efficiency of OS batch installation.
  • the determining a network device where a root node of each tree network topology in at least one tree network topology of the local area network includes:
  • the first tree network topology and the second tree network topology include at least one identical network device .
  • a first network device receives a first unicast message sent by a second network device, the first unicast message includes a second tree network topology formed by a second network device, and the second network device is the m network devices In addition to the first network device, another network device is already running.
  • the first network device may merge repeated network devices in the first tree network topology and the second tree network topology to generate a third tree network topology.
  • the network device where the root node of the third tree network topology is is The network device where the root node is located in the tree network topology of the local area network.
  • the first network device can merge or integrate different tree network topologies in which the same network device exists in the local area network to obtain a new tree network topology. Furthermore, the OS image is obtained according to the network device where the root node is located in the tree network topology, and the OS installation of each network device in the tree network topology is achieved. In this way, each independent tree network topology existing in the local area network can be quickly and accurately determined, thereby improving the efficiency of OS batch installation.
  • determining the network device where the root node of each tree network topology in at least one tree network topology of the local area network includes: when only the first tree network topology exists in the local area network At this time, the first network device may determine that the network device where the root node of the first tree network topology is located is the network device where the root node is located in the tree network topology of the local area network.
  • the determining, by the first network device according to a multicast message sent by the n network devices, a first tree network topology composed of n network devices includes: the first network device may A rule is to sort the multicast messages sent by n network devices to obtain a first tree network topology composed of n network devices.
  • the preset rule may be customized by the user or the system, for example, the attribute information in the respective multicast messages of the n network devices is arranged in the following priority order: the network rate> the memory size> the number of processors> The hard disk size> the device identification.
  • the first network device can arrange n network devices according to a preset rule to construct a first tree network topology, which can improve the efficiency and reliability of the tree network topology construction.
  • the method further includes: when the first network device in the first tree network topology is abnormal, updating the first tree network topology.
  • the tree network topology can be updated intelligently and in time to ensure the reliability and stability of the tree network topology and solve the traditional technology Due to the instability of the tree network topology, the OS installation of network devices is not successful.
  • the first tree network topology includes a root node, a leaf node, and a child node
  • the updating the first tree network topology includes: when the first network device is the first When the network device on which the root node is located in the tree network topology, the network device on which the child node connected under the first network device is located is updated to the network device on which the root node is located in the first tree network topology.
  • the first network device When the first network device is the network device where the intermediate node is located in the first tree network topology, the network device where the child node connected under the first network device is registered with the first network device corresponds to the first tree network topology Under the network device where the parent node is located; when the first network device is the network device where the leaf node in the first tree network topology is located, the first network device will perform a pruning process to delete it in the first tree network topology A leaf node corresponding to the first network device.
  • the method further includes: a device management system
  • the OM may send the intelligent management software SP to the m network devices according to the respective management Internet protocol IP addresses of the m network devices.
  • each of the m network devices can receive the SP and install the SP into the non-volatile memory of its own network device, so that subsequent network devices can use the SP to send multicast to other network devices in the local area network. Message.
  • the SP can be deployed to the network device in advance according to the management IP address of the network device, which facilitates the subsequent use of the SP of the network device to guide the automatic completion of the OS installation, thereby improving the convenience and efficiency of the OS installation.
  • the multicast message further includes first authentication information
  • the first network device determines, according to the multicast message sent by the n network devices, a first number composed of the n network devices.
  • a tree-like network topology includes: when the first network device successfully authenticates the first authentication message in the multicast messages sent by the n network devices, determining according to the multicast messages sent by the n network devices A first tree network topology formed by the n network devices.
  • the first authentication information may be obtained by processing attribute information in the multicast message by using a preset algorithm such as HMAC.
  • the authentication information in the multicast message sent by the network device is verified to verify whether the network device is a masquerading (illegal) device, and then decide whether to use the multicast message sent by the network device to Construct the corresponding tree network topology, which can improve the accuracy and reliability of the tree network topology construction.
  • the method further includes: when the first network device is running, obtaining a configuration IP address sent by a dynamic host configuration protocol DHCP device, and using the configuration IP address as a Service IP address.
  • the first network device is a network device where a root node of the first tree network topology is located, and the method further includes: the first network device sends an add request to a third network device
  • the adding request is used to request that the third network device be added to the network device where the parent node of the third network device is located.
  • the third network device and the first network device have the same version of the SP installed.
  • the third network device may send a registration request to the network device where the parent node of the third network device is located, where the registration request includes the network device and / or the network device where the parent node of the third network device is located.
  • the first network device is described.
  • the network device where the parent node of the third network device is located receives the registration request, and the network device where the parent node of the third network device in the registration request is located and / or the first network device is successfully authenticated.
  • a registration success response is sent to the third network device, and the registration success response is used to notify the third network device to stop sending a multicast message in the local area network.
  • the registration success response further includes a network device where the standby parent node of the third network device is located, that is, a network device where the grandparent node of the third network device is located.
  • the network device where the root node is located in the first tree network topology can send a registration message to add and register the network device where each node is located in the tree network topology, thereby realizing the first tree network topology. Fast build.
  • the first network device is a network device where a root node of a first tree network topology is located
  • the method further includes: the first network device sends an update request to a fourth network device, where the update request For requesting to update the version of the SP installed in the fourth network device to the version of the SP installed in the first network device; the fourth network device receives the update request, and if the version of the SP in the fourth network device is not updated Updating the version of the SP in the fourth network device to the version of the SP in the first network device according to the update request.
  • each network device included in each tree network topology in the local area network has or has the same version of SP software, and avoid some abnormal conditions during OS installation due to different SP versions in the network device. For example, each network device has a different OS installation time, and different error faults occur during installation, increasing the workload of maintenance personnel, and so on.
  • the present application provides a device for batch installation of OSs, which includes various modules for executing the method for batch installation of OSs in the first aspect or any possible implementation manner of the first aspect.
  • the present application provides a network device.
  • the network device includes a processor, a memory, a communication interface, and a bus.
  • the processor, the memory, and the communication interface are connected by a bus and complete communication with each other.
  • the memory is used to store computer execution instructions, and when the network device is running, the processor executes the computer execution instructions in the memory to use the hardware resources in the network device to perform the first aspect or any of the first aspect Operation steps of the method described in one possible implementation manner.
  • the present application provides a communication system.
  • the communication system includes at least one network device.
  • Each network device includes a processor, a memory, a communication interface, and a bus.
  • the processor, the memory, and the communication interface are connected by a bus.
  • the memory is used to store computer execution instructions, and when the network device is running, the processor executes the computer execution instructions in the memory to use hardware resources in the network device to execute the first.
  • the present application provides a computer-readable storage medium having instructions stored in the computer-readable storage medium, which when executed on a computer, causes the computer to execute the methods described in the above aspects.
  • the present application provides a computer program product containing instructions that, when run on a computer, causes the computer to perform the methods described in the above aspects.
  • FIG. 1 is a schematic structural diagram of a binary tree network topology provided in the conventional technology.
  • FIG. 2 is a schematic diagram of a network architecture according to an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of a method for batch installing an operating system OS according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a tree network topology according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of another tree network topology structure according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of another tree network topology structure according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of another tree network topology structure according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of a tree network topology update according to an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of another tree network topology update according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of another tree network topology update according to an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of another tree network topology structure according to an embodiment of the present invention.
  • FIG. 12 is a schematic structural diagram of a network device according to an embodiment of the present invention.
  • FIG. 13 is a schematic structural diagram of another network device according to an embodiment of the present invention.
  • Intelligent management operating system also known as tailored operating system or SP. It is a set of intelligent management tools installed on a network device (specifically a server), and is used to guide the network device to install (or deploy) an operating system OS. That is, the intelligent management operating system includes a programming file for guiding a network device to install an OS.
  • Hash Message Authentication Code (HMAC) algorithm also known as the HAMC algorithm.
  • HMAC Hash Message Authentication Code
  • Tree network topology It is a local area network topology similar to a bus topology.
  • the tree network topology can include two or more branches, and each branch can include one or more nodes.
  • the tree network topology involved in the embodiment of the present invention may be a binary tree network topology, that is, each branch includes two nodes.
  • Root node A node that has no parent node in a tree network topology.
  • Leaf node A node that has no child nodes in a tree-like network topology.
  • Intermediate node refers to a node with a parent node and a child node in the tree network topology, that is, a node other than the root node and the leaf node in the tree network topology.
  • Isolated node A node without a parent node and a child node in a tree network topology, that is, a separate and independent node in the tree network topology.
  • node A is the root node
  • nodes D, E, F, and G are leaf nodes
  • nodes B and C are intermediate nodes.
  • the node A is the parent node of the nodes B and C
  • the nodes B and C are the child nodes of the node A respectively.
  • Node B is the parent of nodes D and E
  • node C is the parent of nodes F and G.
  • Node A in the figure is also the grandparent node of nodes D, E, F, and G.
  • nodes D, E, F, and G are the grandchildren of node A, respectively.
  • the tree network topology is a logical structure, which can be stored in a specified file, database, or other storage form in the network device.
  • FIG. 2 it is a schematic diagram of a network framework of a communication system according to an embodiment of the present invention.
  • the schematic diagram of the network framework includes a management device, a mirrored storage device, one or more local area networks (three local area networks are taken as an example), and an intermediate device.
  • Each local area network includes one or more network devices (specifically, it can be a server, etc.).
  • a local area network includes m network devices, where m is a positive integer.
  • 192.168.1.X-192.168.3.X are the service IP addresses of the three LANs, respectively, which will not be described in detail here. among them:
  • Management equipment can also be called equipment management system OM. It is used to manage the network devices in each local area network, that is, to support the management of a large number of network devices.
  • Mirrored storage devices can also be called data source centers. It is used to store the operating system OS image, that is, to provide an OS image for installing OS on a network device, which is not described in detail in the embodiment of the present invention.
  • An intermediate device is used to implement data forwarding.
  • the intermediate device can be used to send information about the management device (such as configuration commands issued by the management device) to each network device in the local area network.
  • the information of the network device is reported to the management device and the like, which is not described in detail in the embodiment of the present invention.
  • the intermediate device may specifically include, but is not limited to, a switch, a router, or other devices for implementing data transmission.
  • Network equipment can be configured with multiple network IP addresses for transmitting management data and business data, respectively.
  • two network cards may be used to allocate different network segments according to a preset network plan.
  • the IP address used to transmit management data may be referred to as a management IP address
  • the IP address used to transmit business data may be referred to as a service IP address.
  • the network planning of the network equipment can be divided into management side and service side according to service requirements.
  • An iBMC system is deployed on the management side.
  • An SP is deployed on the service side to guide the network device to install an OS system.
  • the management device ie, the device management system OM
  • the management device may send an SP to the m network devices according to the management IP addresses of the m network devices in the local area network.
  • the SP can be written to or installed in its own hard disk or non-volatile memory. It is convenient for the SPs in subsequent network devices to obtain the OS image from the image storage device and guide the implementation of the OS. How to install the OS in a large number of network devices is described in detail below in the embodiments of the present invention.
  • FIG. 3 is a schematic flowchart of a method for batch installing an operating system OS provided by an embodiment of the present invention.
  • the method is applied in a local area network including m network devices, and each network device is pre-installed with an intelligent management operating system SP for guiding the network device to install a corresponding operating system OS.
  • the method shown in FIG. 3 includes the following implementation steps:
  • Step S102 The first network device determines a first tree network topology composed of the n network devices according to a multicast message sent by the n network devices, where the first network device is m network devices in a local area network.
  • n is less than or equal to m
  • n and m are positive integers
  • the multicast message includes information used to describe attributes of the network device.
  • any of the network devices may periodically (for example, every 5 s) send multicast in the local area network. Message.
  • any one network device can receive multicast messages sent by other network devices already running on the local area network.
  • n network devices When there are n running network devices in the local area network, one or more of the n network devices may periodically send multicast messages. Correspondingly, the one or more network devices may also receive multicast messages sent by other network devices in the local area network, and then construct a corresponding tree network topology according to the received multicast messages.
  • n is a positive integer less than or equal to m.
  • some network devices among the n running network devices in the local area network can construct a corresponding tree network topology according to the multicast message received by the network device.
  • each network device of the n running network devices in the local area network constructs a tree network topology.
  • n network devices can be constructed to obtain n tree network topologies.
  • the following uses the first network device as an example to explain in detail how the first network device constructs a first tree network topology based on the multicast message.
  • the first network device can periodically send multicast messages in the local area network.
  • the first network device may also receive multicast messages sent by other network devices already running in the local area network.
  • the first network device may construct and obtain a first tree network topology composed of the n network devices according to the multicast messages sent by the n network devices.
  • the n network devices may include the first network device, that is, the first network device may determine all the network devices according to the multicast message sent by itself and the received multicast messages sent by the n-1 network devices.
  • n is a positive integer greater than 1.
  • the n network devices may also be other network devices running in the local area network except the first network device, which is not limited in the embodiment of the present invention.
  • the multicast message includes attribute information, and the attribute information is information for describing attributes of the network device, such as a memory size, a hard disk size, a processor CPU number, a CPU operating speed, and a service IP address of the network device. , SP version, and device identification.
  • the device identifier is used to distinguish the network device, and may include, but is not limited to, a network device number, a universally unique identifier (UUID), and the like, which are not described in detail in the embodiment of the present invention.
  • the first network device may sort the n network devices according to attribute information in respective multicast messages of the n network devices according to a preset rule to obtain the first network device.
  • a tree network topology may be used to sort the n network devices according to attribute information in respective multicast messages of the n network devices according to a preset rule to obtain the first network device.
  • the preset rules are used for arranging network devices to generate corresponding network topologies.
  • the preset rules can be customized for users or the system.
  • the system can be set according to actual business requirements.
  • the preset rule is to arrange the network devices according to the priority of the attribute information, thereby generating the first tree network topology (specifically, a binary tree network topology).
  • the priority of the attribute information may be in the order of high to low: the network rate> the memory size> the number of processors> the hard disk size> the device identification.
  • the first network device A in the local area network receives multicast messages sent by five network devices (specifically, network devices B-F).
  • Network device A combines its own multicast messages with a total of 6 network device (specifically network device AF) multicast messages.
  • the priority is from highest to lowest according to the above.
  • the six network devices are sorted in order. It is assumed that the sorted network devices are: BFCADE.
  • the sorted network devices BE are sequentially filled into the binary tree in the order of the layer structure from top to bottom and from left to right (or from right to left) to obtain a binary tree network topology composed of these 6 network devices. (Ie tree network topology).
  • FIG. 4 shows a tree network topology obtained by filling the sorted network devices into a binary tree in the order from top to bottom and from left to right.
  • the network devices after startup can be constructed according to the topology construction principle of S102 to construct a corresponding tree network topology.
  • These tree network topologies may be the same or different, and the embodiments of the present invention are not described in detail and limited herein.
  • the configuration IP address sent by a dynamic host configuration protocol (DHCP) server can be obtained automatically through the network.
  • DHCP dynamic host configuration protocol
  • any one of the network devices may use the configured IP address as a service IP address of the any network device (that is, the SP deployed on the network device), which is convenient for subsequent service communication with other network devices through the service IP address.
  • the multicast message further includes first authentication information
  • the first authentication information is generated according to attribute information in a multicast message sent by the network device. Accordingly, in step S102, after receiving the multicast message sent by the n network devices, the first network device needs to verify the first authentication information in the multicast message of each of the n network devices. After the verification is successful, step S102 is performed to determine the first tree network topology according to the multicast message sent by the n network devices.
  • the first authentication information is obtained by the network device calculating attribute information of the network device according to a preset first algorithm, and the preset first algorithm is a user-side or system-side custom setting Algorithms, which may include but are not limited to HMAC algorithms and the like.
  • the network device may add the first authentication information to its own multicast message, so as to send it in the local area network in the future.
  • the multicast message is usually represented by a binary data packet, which is not described in detail in the embodiment of the present invention.
  • the first network device may process the attribute information in the multicast message according to a preset first algorithm to calculate and obtain Corresponding authentication information. Further, the authentication verification information is compared with the first authentication information in the multicast message. If the comparison is consistent, the multicast message sent by any one of the n network devices is authenticated. (Or verify) success. If the comparison is inconsistent, it means that the authentication of the multicast message sent by any one of the n network devices has failed. The multicast message sent by any one of the n network devices is unavailable, and this one can be discarded. Multicast message.
  • the first network device performs authentication on the first authentication information in the multicast message sent by the n network devices according to the foregoing authentication principle. After the first authentication information in the multicast message sent by the n network devices is successfully authenticated, step S102 is performed. Otherwise, after the first authentication information in the multicast message sent by any of the n network devices fails to be authenticated, the multicast sent by any of the n network devices may be discarded.
  • the message uses multicast messages sent by other network devices among the n network devices that have been successfully authenticated to construct the first tree network topology, which is not described in detail in this embodiment of the present invention.
  • each network device involved in the first tree network topology may be added to the first tree network topology. How network devices are added to the tree network topology is described in detail below.
  • the same network devices exist in the multiple tree network topologies.
  • the network devices may be added to the first in accordance with the chronological order of registration request sending. Send a registration request in a tree network topology. After the addition is complete, you can delete the network device that exists in other tree network topologies. The details will be described later.
  • Step S104 When the number of times that the first network device sends multicast messages to other network devices in the local area network meets a first threshold, determine a root of each tree network topology in at least one tree network topology of the local area network.
  • the network device where the node is located It is convenient for the network device where the root node of each tree network topology is located to obtain an OS image and send it to each network device in each tree network topology for OS installation.
  • the first threshold is set by a user or a system, and a specific numerical value may be different in different application scenarios.
  • the first threshold value may be Set it relatively large, such as 10/20 and so on.
  • the first threshold may be set to be relatively small for example, 3 and so on, the embodiments of the present invention are not described in detail and limited herein.
  • the first network device receives a first unicast message sent by a second network device
  • the second network device is another running network device other than the first network device among the m network devices, and the second network device constructs the second tree network topology, so The first tree network topology and the second tree network topology include different network devices.
  • the first network device determines that the network device where the root node of the first tree network topology is located and the network device where the root node of the second tree network topology is respectively two tree groups of the local area network The network devices where the respective root nodes are located in the network topology.
  • the first network device receives a first unicast message sent by a second network device
  • the second network device is another running network device other than the first network device among the m network devices, and the second network device constructs the second tree network topology, so The first tree network topology and the second tree network topology include at least one identical network device.
  • the first network device merges the duplicated network devices in the first tree network topology and the second tree network topology to generate a third tree network topology, where the root node of the third tree network topology is located
  • the network device is the network device where the root node is located in the tree network topology of the local area network.
  • the network devices after startup automatically construct a corresponding tree network topology.
  • the construction principle of the tree network topology refer to the related examples in the foregoing embodiments. Explain, I won't repeat them here.
  • a tree network topology is a subnet topology of another tree network topology.
  • the determination is implemented in S104, that is, determining the complete tree network topology existing in the local area network, and determining the root node of the tree network topology in the local area network.
  • S104 is explained by taking the construction of a tree network topology as an example after the first network device and the second network device in the local area network are started. Wherein, after the first network device is started, a first tree network topology is constructed and obtained. After the second network device is started, a second tree network topology is constructed and obtained.
  • n is less than or equal to m
  • the two or more tree network topologies include at least the first tree network Topology and the second tree network topology.
  • the second network device may send the first network to the first network.
  • the device sends a first unicast message, where the first unicast message includes the second tree network topology.
  • the first unicast message is used to determine the number of tree network topologies existing in the local area network, or to determine whether there is an association relationship between the first tree network topology and the second tree network topology.
  • the first network device receives a first unicast message sent by the second network device, and the first unicast message includes the second tree-shaped network topology. Determining, by the first network device according to the second tree network topology and the first tree network topology, a network device in which each node of the first tree network topology and the second tree network topology is located Whether the same network equipment exists. There are two specific implementations.
  • the first case the same network device does not exist in the first tree network topology and the second tree network topology
  • the first tree network topology and the second tree network topology include different network devices, it can be determined that the first tree network topology and the second tree network topology are two independent trees in the local area network.
  • Network topology, the network device where the root node is located in the first tree network topology and the network device where the root node is located in the second tree network topology are determined as the network devices where the respective root nodes of the two tree network topologies in the local area network are located.
  • the second case the same network device exists in the first tree network topology and the second tree network topology
  • the first tree-like network topology and the second tree-like network topology include at least one identical network device, the same network devices in the first and second tree-like network topology can be combined to obtain Third tree network topology. That is, there is an association relationship between the first tree network topology and the second tree network topology, and they need to be merged into an independent tree network topology. Furthermore, the network device where the root node is located in the third tree network topology is determined as the network device where the root node is located in the tree network topology of the local area network. There are several possible implementation modes below.
  • the first network device may convert the first tree-shaped network topology. Merging with the second tree network topology to obtain a third tree network topology.
  • the first network device may determine that the first tree network topology is related to the second tree network topology, and associate the first tree network topology with the second tree network topology. Network topology is merged to obtain a third tree network topology.
  • the first network device still determines the first tree network topology and the second tree network topology as two in the local area network. Independent network topology, further determining the network device where the root node of the first tree network topology is located and the network device where the root node of the second tree network topology is located as the respective roots of the two tree network topologies in the local area network The network device where the node is located.
  • FIG. 5 and FIG. 6 respectively show schematic diagrams of a first tree network topology and a second tree network topology.
  • the first network device determines that the network device C where the root node is located in the first tree network topology and the network device C where the child node is located in the second tree network topology are the same.
  • the second tree network topology is merged and added to the first tree network topology to obtain a third tree network topology as shown in FIG. 7.
  • the first network device directly determines a network device where a root node is located in the first tree network topology. Is the network device where the root node of the tree network topology of the local area network is located.
  • a complete first tree network topology composed of the m network devices may be constructed according to multicast messages sent by each of the m network devices in the local area network. Furthermore, the network device where the root node is located in the first tree network topology is determined as the network device where the root node is located in the tree network topology of the local area network.
  • the first network device may place a first tree network topology in the first tree network topology.
  • the network device at the root node location is determined as a candidate root node network device.
  • the candidate root node network device is the network device where the root node is located in the first tree network topology, which may be the root node in a separate tree network topology in the local area network.
  • the network device on which it is located may also be the network device on which the child nodes are located in a separate tree network topology.
  • the first network device sends a first unicast message to a candidate root node network device, where the first unicast message carries a first tree network topology.
  • the candidate root node network device receives the first unicast message, and determines whether the candidate root node network device is the network device where the root node of the tree network topology in the local area network is located according to the status information recorded in its own device. If so, the network device where the root node is located in the first tree network topology is the network device where the root node is located in the tree network topology of the local area network. If not, then it is determined that the first tree network topology is not an independent tree network topology of the local area network, and accordingly the network device where the root node is located in the first tree network topology is the network device where the child node is located in the tree network topology of the local area network.
  • the candidate root node network device may further send a response message to the first network device, and the response message is used to indicate (or notify) whether the network device in which the root node is located in the first tree network topology is a tree network topology of the local area network.
  • the network device where the root node is located may further send a response message to the first network device, and the response message is used to indicate (or notify) whether the network device in which the root node is located in the first tree network topology is a tree network topology of the local area network.
  • the status information is used to indicate that the candidate root node network device is any one of the following node network devices: an isolated node, a root node, a leaf node, and an intermediate node.
  • node network devices an isolated node, a root node, a leaf node, and an intermediate node.
  • status information recorded by each network device is used to indicate that the network device is a network device where an isolated node is located.
  • the status information recorded in each network device can be updated according to the constructed tree network topology.
  • a network device is a network device located at a child node position in the tree network topology, and accordingly the network device may update its status information to a network device located at a child node position. .
  • This facilitates the subsequent startup of the network device to determine whether it is the root node in the tree network topology of the local area network directly according to the state information recorded in the previous network device when constructing another tree network topology.
  • the candidate root node network device determines whether the candidate root node network device is the network device where the root node is located in the tree network topology of the local area network according to its own state information, and the specific determination condition is as follows:
  • the state information is used to indicate that the candidate root node network device is a network device where an isolated node is located, or is used to indicate that the candidate root node network device is a network device where a root node of a local area network is located.
  • the first The tree network topology is an independent tree network topology in the local area network.
  • the network device where the root node is located in the first tree network (the candidate root node network device) is the network device where the root node is located in the tree network topology of the local area network.
  • the first unicast message further includes second authentication information
  • the second authentication information is based on information other than the second authentication information in the first unicast message ( For example, generated by the first tree network topology, etc., for how to generate the second authentication information, refer to the foregoing related description of the first authentication information, and details are not described herein again.
  • the HMAC algorithm is used to calculate the tree network topology and other information in the first unicast message sent by the network device to obtain the second authentication information and add it to the first unicast message.
  • the network device can first authenticate the second authentication information in the first unicast message. After the authentication is successful, it will continue to perform subsequent steps, such as determining the local network's The network device where the root node is located in the tree network topology. Regarding the generation and authentication of the second authentication information, refer to the foregoing description of the first authentication information, and details are not described herein again.
  • the network device where the root node is located in each tree network topology may be obtained from a data source center. (Or image storage device) to obtain an image of the OS to be installed (OS image for short), and then issue the obtained OS image to each network device in each tree network topology to implement in each network device OS installation.
  • the specific principle of OS installation is described. Specifically, after the first network device obtains the OS image, the OS image may be installed in or written to the hard disk or non-volatile memory of the first network device to implement the OS installation.
  • a large number of network devices can be divided into local area networks, and the network devices in each local area network can discover each other by sending multicast messages, thereby quickly constructing a corresponding tree network topology.
  • the OS image is distributed according to the tree network topology, so as to install the OS in each network device in the tree network topology. This avoids the traditional technology of manually installing service IP addresses to implement OS installation of large quantities of network equipment, which has problems such as large workload, complicated configuration, and time-consuming, thereby improving the efficiency and convenience of OS batch installation. Sex.
  • an embodiment of the present invention further proposes an exception processing mechanism based on a tree network topology.
  • the network device where the child node is located may periodically send progress information to the network device where the parent node is located.
  • the network device where the parent node is located may send response information to the network device where the child node is located.
  • the network device where the child node is located (specifically, the detection module of the network device) may determine whether the network device where the negative node is located occurs according to whether a response message from the network device where the child parent node is received is received within a preset time period Malfunction or abnormality.
  • the tree network topology if an abnormality occurs in a network device where a node is located, the tree network topology may be updated. Taking the first network device in the first tree network topology as an example, the following three situations exist.
  • the first network device is a network device where a root node is located in the first tree network topology
  • the first network device may be connected below it.
  • the network device where the child node is located is updated to the network device where the root node in the first tree network topology is located, that is, the child node connected under the first network device is updated to the root node of the first tree network topology.
  • the first tree network topology is split into two separate tree network topologies, which are specifically described below by way of example.
  • the first network device when the first network device is a network device where an intermediate node is located in the first tree network topology, if the first network device is abnormal, the first network device may be connected to the first network device.
  • the network device where the child node of the is located is registered and added to the network device where the parent node of the first network device (that is, the standby parent node) is located.
  • the first network device when the first network device is a network device where a leaf node is located in the first tree network topology, if the first network device is abnormal, the first network device may be clipped. Branch processing to delete the first network device in the first tree network topology, that is, delete a leaf node corresponding to the first network device.
  • the first tree network topology is a binary tree network topology as an example.
  • the network device (RootSP) where the root node is located is abnormal.
  • the network device A or B can notify the link module of its own device Cut the chain.
  • a or B performs the chain cut, first obtain the network device where its standby parent node is located. If A and B cannot find the network device where the standby parent node is located, it will automatically change to the root node of the tree network topology.
  • the first tree network topology will be split into two independent new tree network topologies, here Two tree-shaped network topologies, with the network device where the root node is located as A and B, respectively.
  • the standby parent node here refers to the grandparent node of the node.
  • the standby parent node of O in the figure is C, that is, the network device of the standby parent node of the network device O where the node is located is C.
  • the network device L where the leaf node is located is abnormal and stops reporting its own progress information. If the network device G where L's parent node is located has not received the progress information reported by L within a preset time period (for example, about 10s), it will perform a pruning operation on L to delete L.
  • a preset time period for example, about 10s
  • B finds out that L's progress information is missing after comparison, that is, L is deleted.
  • the local information of the B device can be updated.
  • node B reports progress information there is no progress information of L. That is, the network equipment where each node is located in the tree network topology can identify and know that the network equipment where a certain leaf node is abnormal and is pruned by the reported progress information.
  • the network device C where the intermediate node is located is abnormal. If the network devices G and H where the node is located in the picture detect an abnormality in the network device C where their parent node is located, G and H will perform a chain cut to make a registration request to network device A where their standby parent node is located. To register and add G and H under A. Correspondingly, after receiving the registration request, A can recognize that C is abnormal, and delete C. At the same time, G and H are registered and mounted under A. How to register the embodiment of the present invention will not be described in detail here.
  • the corresponding tree network topology in the local area network can be dynamically updated or adjusted, thereby helping to improve the stability and reliability of the tree network topology. Further, downloading and distributing the OS image based on the updated tree network topology effectively guarantees that each network device in the tree network topology can successfully install the OS, thereby improving the reliability and success rate of batch OS installation.
  • each network device involved in each tree network topology may be added to its own tree network topology.
  • the following takes the first tree network topology as an independent tree network topology of the local area network as an example to explain in detail how to add each network device in the local area network to the first tree network topology. It is assumed that the network device where the root node of the first tree network topology is located is the first network device. In the process of adding a network device, the following specific implementations exist.
  • the version of the SP deployed by the network device in the local area network is the same as the version of the SP deployed by the first network device.
  • each network device in the local area network is pre-deployed with an SP.
  • the first network device is the network device where the root node is located.
  • a multicast message sent by the network device where each node is located in the first tree network topology may be received.
  • the multicast message carries the attribute information of the network device.
  • the attribute information includes the version of the SP.
  • the first network device determines that the first tree network topology is an independent tree network topology in the local area network (after S104) ).
  • the first network device may send a notification message to a network device (root node network device) where the root node of the first tree network topology is located, where the notification message carries the first tree network topology, and of course includes the first tree Information of each network device in the network topology, such as the attribute information of the network device, the version of the SP, and so on.
  • the root node network device in the first tree network topology can also know the version of the SP deployed by each network device in the first tree network topology.
  • the first network device may directly send an add request to these network devices to These network devices are added and built into the first tree network topology.
  • the following uses the third network device as an example to explain related content.
  • the first network device sends an add request to a third network device, where the add request is used to request that the third network device be added to a network device where a parent node of the third network device is located.
  • the adding request carries a parent node of the third network device (that is, a network device in which the parent node of the third network device is located), and specifically may carry related information (such as a device identifier, a device name) of a network device in which the parent node is located. Wait).
  • the third network device is a network device in which an SP having the same SP version is deployed as the first network device.
  • the third network device receives the add request, parses the add request, and sends a registration request to a network device where a parent node of the third network device is located, where the registration request is used to request that the third network device
  • Three network devices are registered to a network device where a parent node of the third network device is located.
  • the network device where the parent node of the third network device is located receives the registration request, and registers the third network device to the network device where the parent node of the third network device is located.
  • the network device where the parent node of the third network device is located may also send a registration response to the third network device, where the registration response is used to notify whether the third network device is successfully registered to the third network device. Under the network device where the parent node of the network device is located.
  • the third network device may disable its own multicast function to disable or stop sending multicast messages to other network devices in the local area network.
  • the registration request may carry the network device where the parent node of the third network device is located and / or the first network device (that is, the network device where the root node is located in the first tree network topology).
  • the network device where the parent node of the third network device is located can parse the registration request and verify whether the information carried by the registration request matches the pre-stored information in its own device. For example, matching the network device of the parent node of the third network device carried in the registration request with its own device, or matching the network of the first network device carried in the registration request with the pre-stored root node in its own device Devices, etc.
  • the third network device is successfully registered under the network device where the parent node of the third network device is located. If the matching fails, a registration response message is sent to the third network device to notify the third network device that it cannot register to the network device where the parent node of the third network device is located.
  • the network device in the local area network has its own multicast function turned off.
  • the network device may actively turn off its multicast function and stop sending to other network devices in the LAN. Send a multicast message.
  • a notification message specifically, a registration response
  • the network device stops or disables its own multicast function.
  • the network device may also send a response message of the communication message to the network device where the parent node is located.
  • the network device where the parent node is located adds the network device to its tree network topology.
  • the network device where the parent node is located adds the network device to its tree network topology. It can be understood that the network device where the parent node is located uses a database or a specified file or other form to record the position of the network device in the tree network topology structure. .
  • the version of the SP deployed by the network device in the local area network is different from the version of the SP deployed by the first network device.
  • the version of the SP deployed in these network devices is different from the version of the SP deployed in the first network device.
  • the first network device may directly send an update request to these network devices to update the version of the SP deployed in these network devices to the version of the SP deployed in the first network device. Further, subsequent adding requests are sent to the updated network devices to add and build the network devices into the first tree network topology.
  • the following uses the fourth network device to update the SP version as an example for explanation.
  • the first network device sends an update request to a fourth network device, where the update request is used to request that the SP version in the fourth network device be updated to the SP version in the first network device, that is, the fourth network device.
  • the version of the SP deployed in the device is updated to the version of the SP deployed in the first network device.
  • the fourth network device receives the update request and determines whether the SP deployed in the device has been updated. When the version of the SP is not updated by the fourth network device, the version of the SP in the fourth network device is updated to the version of the SP in the first network device in response to the update request.
  • a new network device after a new network device is added to the local area network (referred to as a new network device), after the new network device is running, it can send multicast messages to other network devices in the local area network.
  • the network device where the root node is located in each tree network topology in the local area network can receive the multicast message sent by the newly added network device, that is, it is detected that the newly added network device has entered the local area network. Furthermore, it is determined whether the version of the SP deployed in the new network device is the same as the version of the SP deployed in the network device where the root node is located in the tree network topology according to the multicast message sent by the new network device.
  • an add request may be sent to the newly added network device to add the newly added network device to the tree network topology. If they are not the same, an update request is sent to the newly added network device to update the version of the SP of the newly added network device to the version of the SP deployed in the network device where the root node in the tree network topology is located.
  • the newly added network device may be The chronological order of registration requests is added first to the tree network topology that receives the registration request first. For example, the network device where the root node is located in the first tree network topology (the first network device) takes precedence over the network device where the root node is located in the second tree network topology. After receiving the registration request sent by the first network device, the new network device is added or mounted to the first tree network topology according to the registration request.
  • At least two tree network topologies exist in the local area network, and specifically may include a first tree network topology and a second tree network topology.
  • the first tree network topology and the second tree network topology include at least one identical network device.
  • the first tree network topology and the second tree network topology both include network device A.
  • the network device A preferentially receives the network device where the root node of the first tree network topology is located. (First network device) registration request sent. Accordingly, the network device A can register and add itself to the first tree network topology according to the registration request.
  • an embodiment of the present invention further proposes a message reporting mechanism based on a tree network topology.
  • the tree network topology includes a root node, a leaf node, and an intermediate node.
  • the network device where the root node is located receives the progress information reported by the leaf node and the network device where the intermediate node is located, where the progress information is used to indicate the progress of the network device where the node is located during business processing, such as data transmission and reception; or It can be used to indicate the deployment progress of the network device where the node is located in the tree network topology, for example, it has been added to the tree network topology.
  • the network device where the leaf node is located can report its own progress information in real time or periodically.
  • the network device where the intermediate node is located may also periodically report the progress information of the network device where the own device and its connected child nodes are located.
  • the network device where the intermediate node is located does not reach the preset time
  • the network device where the intermediate node is located receives the progress information reported by the network device where other nodes are located, the network device where the intermediate node is located reports itself and other nodes forcibly.
  • the preset time is a time when the network device where the intermediate node is located reports its own progress information.
  • FIG. 11 shows a schematic structural diagram of a binary tree network topology.
  • the network device where each node is located can report its progress information to the network device where the parent node is located in real time or periodically.
  • leaf node O taking leaf node O as an example, it can periodically (for example, 2s) report its progress information to the network device G where its parent node is located.
  • G can determine whether an abnormality has occurred / occurred in O according to whether the progress information reported by O is received within a preset time period.
  • the time interval for periodically reporting progress information is 2s. It is assumed that at time 12:23:08, A reports the progress information of itself and the network devices C and D where the child nodes are located to the network device RootSP where the root node is located. At 12:23:09, the network equipments of nodes C and D each reported to A the progress information of the network equipments of their next child nodes. At this time, A receives the progress information reported by nodes C and D, and immediately reports it to RootSP in combination with its own progress information. At the same time, the timer is updated. The next time the progress information is reported is 12:23:11.
  • a large number of network devices can be divided into local area networks, and the batch network devices in each local area network can discover each other by sending multicast messages, and construct a corresponding tree network topology.
  • the tree network topology will be dynamically adjusted to ensure that each network device in the tree network name topology is operating normally, which solves the problem that the OS image cannot be transmitted and the OS cannot be caused by the unstable or unreliable tree network topology. Issues such as deployment, thereby improving the stability and reliability of the tree network topology and effectively ensuring the successful installation of the OS of the network equipment.
  • FIG. 12 is a schematic structural diagram of a network device according to an embodiment of the present invention.
  • the network device 120 (such as the first network device) provided in the embodiment of the present invention may include a communication module 1201 and a processing module 1202.
  • a storage module 1203 may be further included.
  • the storage module is configured to store program code and data of the network device 120. among them,
  • the communication module 1201 is configured to send a multicast message to other network devices in the local area network,
  • the processing module 1202 is configured to determine a first tree network topology composed of the n network devices according to a multicast message sent by the n network devices, where n is less than or equal to m, and the multicast message includes Information for describing attributes of the network device;
  • the processing module 1202 is further configured to determine each tree shape in at least one tree network topology of the local area network when the number of times that the communication module sends multicast messages to other network devices in the local area network meets a first threshold.
  • the network device where the root node of the network topology is located so that the network device where the root node of each tree network topology is located obtains an OS image and sends it to each network device in each tree network topology for OS installation.
  • the communication module 1201 is further configured to: when at least two tree network topologies including the first tree network topology and the second tree network topology exist in the local area network, and the first Receiving a first unicast message sent by a second network device when the tree network topology and the second tree network topology include different network devices, and the first unicast message includes the second tree network topology,
  • the second tree-shaped network topology is constituted by the second network device, and the second network device is another network device that is running except the first network device among the m network devices;
  • the processing module 1202 is specifically configured to determine that a network device where a root node of the first tree network topology is located and a network device where a root node of the second tree network topology is respectively two trees of the local area network. The network device where the respective root node is located in the network topology.
  • the communication module 1201 is further configured to: when at least two tree network topologies including the first tree network topology and the second tree network topology exist in the local area network, and the first When the tree network topology and the second tree network topology include at least one identical network device, a first unicast message sent by a second network device is received, and the first unicast message includes the second tree network Topology, the second tree-shaped network topology is formed by the second network device, and the second network device is another network device that is running in addition to the first network device among the m network devices ;
  • the processing module 1202 is specifically configured to merge repeated network devices in the first tree network topology and the second tree network topology to generate a third tree network topology, and a root node of the third tree network topology.
  • the located network device is the network device where the root node is located in the tree network topology of the local area network.
  • the processing module 1202 is specifically configured to determine that, when only the first tree network topology exists in the local area network, a network device where a root node of the first tree network topology is located is of the local area network. The network device where the root node is located in the tree network topology.
  • the processing module 1202 is specifically configured to sort the multicast messages sent by the n network devices according to a preset rule to obtain a first tree network topology formed by the n network devices.
  • processing module 1202 is further configured to update the first tree network topology when the first network device in the first tree network topology is abnormal.
  • the processing module 1202 is specifically configured to, when the first network device is a network device where a root node in the first tree network topology is located, locate a sub-node connected to the first network device. Updating the network device to the network device where the root node is located in the first tree network topology;
  • the processing module 1202 is specifically configured to: when the first network device is a network device where an intermediate node in the first tree network topology is located, a network device where a child node connected to the first network device is located Registering to the first network device under a network device corresponding to a parent node in the first tree network topology;
  • the processing module 1202 is specifically configured to: when the first network device is a network device where a leaf node in the first tree network topology is located, the first network device will perform a pruning process to A leaf node corresponding to the first network device is deleted from the first tree network topology.
  • FIG. 12 is only one possible implementation manner of this embodiment of the present invention.
  • the network device may further include more or fewer components, which is not limited herein.
  • parts that are not shown or described in the embodiment of the present invention reference may be made to the related description in the method embodiment described in FIG. 3, and details are not described herein again.
  • the network device 120 may correspond to performing the method described in the embodiment of the present invention, and the above and other operations and / or functions of each unit in the network device 120 are respectively implemented to implement the corresponding method in FIG. 3. The process is not repeated here for brevity.
  • FIG. 13 is a schematic structural diagram of still another network device according to an embodiment of the present invention.
  • a network device 1300 (for example, a first network device) provided by an embodiment of the present invention includes one or more processors 1301, a communication interface 1302, and a memory 1303.
  • the processor 1301, the communication interface 1302, and the memory 1303 can be accessed through It is connected in a bus or other manner.
  • the connection is made through a bus 1304 as an example. among them:
  • the processor 1301 may be composed of one or more general-purpose processors, such as a central processing unit (Central Processing Unit).
  • the processor 1301 may be configured to run a program of a processing module in related program code. In other words, the processor 1301 executes the program code to implement a processing module.
  • the processing module For details about the processing module, refer to related descriptions in the foregoing embodiments.
  • the communication interface 1302 may be a wired interface (such as an Ethernet interface) or a wireless interface (such as a cellular network interface or using a wireless local area network interface) for communicating with other modules / network devices.
  • a wired interface such as an Ethernet interface
  • a wireless interface such as a cellular network interface or using a wireless local area network interface
  • the communication interface 1302 in this embodiment of the present invention may be specifically used to receive a multicast message and the like sent by other network devices in a local area network.
  • the memory 1303 may include volatile memory (for example, random access memory (RAM); the memory may also include non-volatile memory (for example, read-only memory) memory (ROM), flash memory (flash memory), hard disk (HDD), or solid state drive (SSD); the memory 1303 may also include a combination of the above types of memories.
  • RAM random access memory
  • ROM read-only memory
  • flash memory flash memory
  • HDD hard disk
  • SSD solid state drive
  • the memory 1303 may also include a combination of the above types of memories.
  • the memory 1303 may be configured to store a set of program code, so that the processor 1301 calls the program code stored in the memory 1303 to implement related functions of the processing module involved in the embodiment of the present invention.
  • FIG. 13 is only one possible implementation manner of this embodiment of the present invention.
  • the network device may further include more or fewer components, which is not limited herein.
  • the network device 1300 may correspond to the network device 1300 for batch installation of OS in the embodiment of the present invention, and may correspond to the first network device in the method shown in FIG. 3 according to the embodiment of the present invention.
  • the above and other operations and / or functions of each module in the network device 1300 are to implement the corresponding processes of the methods in FIG. 3, respectively, and for the sake of brevity, they are not repeated here.
  • FIG. 2 A schematic structural diagram of a communication system provided by an embodiment of the present invention.
  • the communication system provided by the embodiment of the present invention includes one or more local area networks (one LAN is taken as an example in the figure).
  • Each local area network includes one or more network devices (the illustration uses m network devices as an example, where m is a positive integer).
  • Each network device may specifically be a network device as described in FIG. 12 or FIG. 13, and details are not described herein again.
  • the communication system further includes a management device and a mirror storage device. among them,
  • the management device is configured to manage the one or more network devices
  • the image storage device is configured to store an operating system OS image for a network device to install an OS corresponding to the OS image.
  • the above embodiments may be implemented in whole or in part by software, hardware, firmware, or any other combination.
  • the above embodiments may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be from a website site, a computer, a server, or a data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server, a data center, and the like, including one or more sets of available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium.
  • the semiconductor medium may be a solid state drive (SSD).
  • the program can be stored in a computer-readable storage medium.
  • the foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disc.

Abstract

Disclosed are a method and device for operating system (OS) batch installation, and a network device. The method comprises: a first network device determines, on the basis of a multicast message transmitted by n network devices, a first tree network topology constituted by the n network devices; and, when the number of times that the first network device transmits a multicast message to other network devices in a local area network satisfies a first threshold, determines a network device at where a root node of each tree network topology of the at least one tree network topology is located, thus facilitating the network device at where the root node of each tree network topology is located to acquire an OS mirror and to transmit to the network devices in each tree network topology for OS installation. This solves the problem of complex tasks and heavy workload found in a prior solution for OS batch installation.

Description

操作系统OS批量安装方法、装置和网络设备Operating system OS batch installation method, device and network equipment 技术领域Technical field
本发明涉及互联网技术领域,尤其涉及操作系统OS批量安装方法、装置和网络设备。The present invention relates to the field of Internet technologies, and in particular, to a method, a device, and a network device for batch installation of an operating system OS.
背景技术Background technique
在互联网中,网络设备管理系统(operations management systems,OM)支持管理大批量网络设备。在大批量网络设备安装操作系统(operating system,OS)的应用场景下,传统技术方案中大批量网络设备的OS安装方案为:OM需先引导各个网络设备进入自身部署的智能管理操作系统(smartProvisioning OS,SP),然后为各网络设备的SP配置相应地业务互联网协议(internet protocol address,IP)地址,便于OM根据各个网络设备的业务IP地址来规划并构建由所述各个网络设备(具体为各个网络设备对应的SP)组成的二叉树网络拓扑。最后,按照该二叉树网络拓扑的层结构依次将待安装OS的镜像(以下简称OS镜像)分发到该网络拓扑的每个节点SP中,进而实现各个网络设备的OS安装。In the Internet, network equipment management systems (operations management systems, OM) support the management of large quantities of network equipment. In the application scenario where operating systems (OS) are installed on a large number of network devices, the OS installation solution for high-volume network devices in the traditional technical solution is: OM needs to first guide each network device to the smart management operating system (smartProvisioning) deployed by itself. OS, SP), and then configure the corresponding service Internet Protocol (IP) address for the SP of each network device, so that the OM can plan and build the network device (specifically, A binary tree network topology consisting of SPs corresponding to each network device. Finally, according to the layer structure of the binary tree network topology, an image of an OS to be installed (hereinafter referred to as an OS image) is distributed to each node SP of the network topology in order to implement OS installation of each network device.
然而在实践中发现,现有OS批量安装方案中,需手工设置大批量网络设备各自的业务IP地址,网络规划和具体设置过程比较复杂,存在批量安装OS耗时长的问题。However, in practice, it was found that in the existing OS batch installation scheme, it is necessary to manually set the respective service IP addresses of a large number of network devices. The network planning and specific setting process are relatively complicated, and there is a problem that the batch OS installation takes a long time.
发明内容Summary of the invention
本申请公开了操作系统OS批量安装方法、装置和网络设备,能够解决现有OS批量安装方案中存在的耗时长的问题。The present application discloses a method, a device and a network device for batch installation of an operating system OS, which can solve the problem of long time consumption in the existing batch installation scheme of OS.
第一方面,本发明实施例公开提供了一种操作系统OS批量安装方法,该方法包括:第一网络设备根据n个网络设备发送的组播消息,确定由n个网络设备构成的第一树形网络拓扑,其中,第一网络设备为局域网中m个网络设备中的任一已运行的网络设备,n小于或等于m,m和n均为正整数,该组播消息包括用于描述所述网络设备的属性的信息;当第一网络设备向所述局域网中其他网络设备发送组播消息的次数满足第一阈值时,确定局域网的至少一个树形网络拓扑中每个树形网络拓扑的根节点所在的网络设备,以便于每个树形网络拓扑的根节点所在网络设备获取OS镜像,并发送给每个树形网络拓扑中的各个网络设备进行OS安装。According to a first aspect, an embodiment of the present invention provides a method for batch installation of an operating system OS. The method includes: a first network device determining a first tree composed of n network devices according to a multicast message sent by the n network devices; Network topology, where the first network device is any of the m network devices in the local area network that is running, n is less than or equal to m, m and n are positive integers, and the multicast message includes The attribute information of the network device is described; when the number of times that the first network device sends multicast messages to other network devices in the local area network meets a first threshold, determining the The network device where the root node is located, so that the network device where the root node of each tree network topology is located obtains the OS image and sends it to each network device in each tree network topology for OS installation.
通过实施本发明实施例,第一网络设备可根据n个网络设备发的组播消息来确定局域网中所包括的每个树形网络拓扑,然后通过每个树形网络拓扑的根节点所在的网络设备将获取的OS镜像下发给每个树形网络拓扑中的各个网络设备,进而在各个网络设备中实现OS的安装,这样可解决现有OS批量安装方案中存在的批量安装OS耗时较长的问题,提升了OS批量安装的效率。By implementing the embodiment of the present invention, the first network device may determine each tree network topology included in the local area network according to the multicast message sent by the n network devices, and then pass the network where the root node of each tree network topology is located. The device sends the obtained OS image to each network device in each tree network topology, and then installs the OS in each network device. This can solve the time-consuming and bulky installation of the OS in the existing OS batch installation solution. The long problem improves the efficiency of OS batch installation.
在一种可能的实现方式中,所述确定所述局域网的至少一个树形网络拓扑中每个树形网络拓扑的根节点所在的网络设备包括:当所述局域网中存在包括所述第一树形 网络拓扑以及第二树形网络拓扑在内的至少两个树形网络拓扑,且第一树形网络拓扑和第二树形网络拓扑包括不同的网络设备时,第一网络设备接收第二网络设备发送的第一单播消息,该第一单播消息包括由第二网络设备构成的第二树形网络拓扑,且所述第二网络设备为所述m个网络设备中除了所述第一网络设备外另一已运行的网络设备;第一网络设备确定第一树形网络拓扑的根节点所在的网络设备以及第二树形网络拓扑的根节点所在的网络设备分别为局域网的两个树形网络拓扑中各自根节点所在的网络设备。In a possible implementation manner, the determining a network device where a root node of each tree network topology in at least one tree network topology of the local area network includes: when the local network includes the first tree, When at least two tree network topologies including the first network device topology and the second tree network topology include different network devices, the first network device receives the second network A first unicast message sent by a device, the first unicast message including a second tree network topology formed by a second network device, and the second network device is the m network devices except the first Another network device running outside the network device; the first network device determines that the network device where the root node of the first tree network topology is located and the network device where the root node of the second tree network topology is the two trees of the local area network respectively The network device where the respective root node is located in the network topology.
通过实施上述步骤,第一网络设备可确定出所述局域网中存在的两个独立的树形网络拓扑,进而通过两个树形网络拓扑各自根节点所在的网络设备获取OS镜像,并分发给每个树形网络拓扑中的各个网络设备进行OS的安装,这样能够快速、准确地确定出局域网中存在的每个独立的树形网络拓扑,从而提升OS批量安装的高效性。By implementing the above steps, the first network device can determine two independent tree network topologies existing in the local area network, and then obtain the OS image through the network device where the respective root nodes of the two tree network topologies are located, and distribute the OS image Each network device in a tree network topology performs OS installation, so that each independent tree network topology existing in the local area network can be quickly and accurately determined, thereby improving the efficiency of OS batch installation.
在一种可能的实现方式中,所述确定所述局域网的至少一个树形网络拓扑中每个树形网络拓扑的根节点所在的网络设备包括:In a possible implementation manner, the determining a network device where a root node of each tree network topology in at least one tree network topology of the local area network includes:
当局域网中存在包括第一树形网络拓扑以及第二树形网络拓扑在内的至少两个树形网络拓扑时,第一树形网络拓扑和第二树形网络拓扑包括至少一个相同的网络设备。第一网络设备接收第二网络设备发送的第一单播消息,该第一单播消息包括由第二网络设备构成的第二树形网络拓扑,该第二网络设备为所述m个网络设备中除了第一网络设备外另一已运行的网络设备。相应地,第一网络设备可合并第一树形网络拓扑和第二树形网络拓扑中重复网络设备以生成第三树形网络拓扑,该第三树形网络拓扑的根节点所在的网络设备为局域网的树形网络拓扑中根节点所在的网络设备。When at least two tree network topologies including the first tree network topology and the second tree network topology exist in the local area network, the first tree network topology and the second tree network topology include at least one identical network device . A first network device receives a first unicast message sent by a second network device, the first unicast message includes a second tree network topology formed by a second network device, and the second network device is the m network devices In addition to the first network device, another network device is already running. Correspondingly, the first network device may merge repeated network devices in the first tree network topology and the second tree network topology to generate a third tree network topology. The network device where the root node of the third tree network topology is is The network device where the root node is located in the tree network topology of the local area network.
通过实施上述步骤,第一网络设备可将局域网中存在相同网络设备的不同树形网络拓扑进行合并或整合,以获得一个新的树形网络拓扑。进而根据该树形网络拓扑中根节点所在的网络设备来获取OS镜像,实现该树形网络拓扑中各个网络设备的OS安装。这样可快速、准确地确定出局域网中存在的每个独立的树形网络拓扑,从而提升OS批量安装的高效性。By implementing the above steps, the first network device can merge or integrate different tree network topologies in which the same network device exists in the local area network to obtain a new tree network topology. Furthermore, the OS image is obtained according to the network device where the root node is located in the tree network topology, and the OS installation of each network device in the tree network topology is achieved. In this way, each independent tree network topology existing in the local area network can be quickly and accurately determined, thereby improving the efficiency of OS batch installation.
在一种可能的实现方式中,所述确定所述局域网的至少一个树形网络拓扑中每个树形网络拓扑的根节点所在的网络设备包括:当局域网中仅存在第一树形网络拓扑时,此时第一网络设备可确定第一树形网络拓扑的根节点所在的网络设备为局域网的树形网络拓扑中根节点所在的网络设备。In a possible implementation manner, determining the network device where the root node of each tree network topology in at least one tree network topology of the local area network includes: when only the first tree network topology exists in the local area network At this time, the first network device may determine that the network device where the root node of the first tree network topology is located is the network device where the root node is located in the tree network topology of the local area network.
在一种可能的实现方式中,所述第一网络设备根据n个网络设备发送的组播消息,确定由n个网络设备构成的第一树形网络拓扑包括:第一网络设备可按照预设规则,将n个网络设备发送的组播消息进行排序,以获得由n个网络设备构成的第一树形网络拓扑。该预设规则可为用户或系统自定义设置的,例如按照以下优先级顺序排列n个网络设备各自组播消息中的属性信息:所述网络速率>所述内存大小>所述处理器数量>所述硬盘大小>所述设备标识。In a possible implementation manner, the determining, by the first network device according to a multicast message sent by the n network devices, a first tree network topology composed of n network devices includes: the first network device may A rule is to sort the multicast messages sent by n network devices to obtain a first tree network topology composed of n network devices. The preset rule may be customized by the user or the system, for example, the attribute information in the respective multicast messages of the n network devices is arranged in the following priority order: the network rate> the memory size> the number of processors> The hard disk size> the device identification.
通过实施上述步骤,第一网络设备可按照预设规则对n个网络设备进行排列,以构建出第一树形网络拓扑,这样能够提升树形网络拓扑构建的效率以及可靠性。By implementing the above steps, the first network device can arrange n network devices according to a preset rule to construct a first tree network topology, which can improve the efficiency and reliability of the tree network topology construction.
在一种可能的实现方式中,所述方法还包括:当第一树形网络拓扑中的第一网络设备发生异常时,可对第一树形网络拓扑进行更新。通过实施上述步骤,当树形网络 拓扑中存在发生异常的网络设备时能够智能地、及时地对该树形网络拓扑进行更新,以保证树形网络拓扑的可靠性和稳定性,解决了传统技术中由于树形网络拓扑不稳定造成网络设备的OS安装不成功的问题。In a possible implementation manner, the method further includes: when the first network device in the first tree network topology is abnormal, updating the first tree network topology. By implementing the above steps, when there is an abnormal network device in the tree network topology, the tree network topology can be updated intelligently and in time to ensure the reliability and stability of the tree network topology and solve the traditional technology Due to the instability of the tree network topology, the OS installation of network devices is not successful.
在一种可能的实现方式中,所述第一树形网络拓扑包括根节点、叶子节点以及子节点,所述对所述第一树形网络拓扑进行更新包括:当第一网络设备为第一树形网络拓扑中根节点所在的网络设备时,第一网络设备下连接的子节点所在的网络设备将更新为所述第一树形网络拓扑中根节点所在的网络设备。当第一网络设备为第一树形网络拓扑中中间节点所在的网络设备时,第一网络设备下连接的子节点所在的网络设备将注册到第一网络设备对应在第一树形网络拓扑中的父节点所在的网络设备下;当第一网络设备为第一树形网络拓扑中叶子节点所在的网络设备时,第一网络设备将进行剪枝处理,以在第一树形网络拓扑中删除第一网络设备对应的叶子节点。In a possible implementation manner, the first tree network topology includes a root node, a leaf node, and a child node, and the updating the first tree network topology includes: when the first network device is the first When the network device on which the root node is located in the tree network topology, the network device on which the child node connected under the first network device is located is updated to the network device on which the root node is located in the first tree network topology. When the first network device is the network device where the intermediate node is located in the first tree network topology, the network device where the child node connected under the first network device is registered with the first network device corresponds to the first tree network topology Under the network device where the parent node is located; when the first network device is the network device where the leaf node in the first tree network topology is located, the first network device will perform a pruning process to delete it in the first tree network topology A leaf node corresponding to the first network device.
通过实施上述步骤,针对树形网络拓扑中不同节点所在的网络设备发生异常时,给出不同的树形网络拓扑更新方案;这样可保证树形网络拓扑中各个节点所在的网络设备均正常运行,从而提高树形网络拓扑的可靠性和稳定性。Through the implementation of the above steps, different network topology update solutions for different nodes in the tree network topology are provided when abnormalities occur on the network devices where the nodes are located in the tree network topology. This ensures that the network devices where the nodes in the tree network topology are operating normally. This improves the reliability and stability of the tree network topology.
在一种可能的实现方式中,所述第一网络设备根据n个网络设备发送的组播消息,确定由所述n个网络设备构成的第一树形网络拓扑之前,还包括:设备管理系统OM可根据m个网络设备各自的管理互联网协议IP地址,向m个网络设备发送智能管理软件SP。相应地,m个网络设备中每个网络设备可接收所述SP,并将SP安装到自身网络设备的非易失性存储器中,便于后续网络设备利用SP向局域网中的其他网络设备发送组播消息。通过实施上述步骤,根据网络设备的管理IP地址可将SP提前部署到该网络设备中,便于后续利用该网络设备的SP来引导自动完成OS的安装,从而能够提升OS安装的便捷性和高效性。In a possible implementation manner, before the first network device determines a first tree network topology composed of the n network devices according to a multicast message sent by the n network devices, the method further includes: a device management system The OM may send the intelligent management software SP to the m network devices according to the respective management Internet protocol IP addresses of the m network devices. Correspondingly, each of the m network devices can receive the SP and install the SP into the non-volatile memory of its own network device, so that subsequent network devices can use the SP to send multicast to other network devices in the local area network. Message. By implementing the above steps, the SP can be deployed to the network device in advance according to the management IP address of the network device, which facilitates the subsequent use of the SP of the network device to guide the automatic completion of the OS installation, thereby improving the convenience and efficiency of the OS installation. .
在一种可能的实现方式中,所述组播消息还包括第一鉴权信息,所述第一网络设备根据n个网络设备发送的组播消息,确定由所述n个网络设备构成的第一树形网络拓扑包括:在第一网络设备对所述n个网络设备发送的组播消息中的第一鉴权消息鉴权成功的情况下,根据n个网络设备发送的组播消息,确定由该n个网络设备构成的第一树形网络拓扑。第一鉴权信息可为采用HMAC等预设算法对组播消息中的属性信息进行处理获得的。In a possible implementation manner, the multicast message further includes first authentication information, and the first network device determines, according to the multicast message sent by the n network devices, a first number composed of the n network devices. A tree-like network topology includes: when the first network device successfully authenticates the first authentication message in the multicast messages sent by the n network devices, determining according to the multicast messages sent by the n network devices A first tree network topology formed by the n network devices. The first authentication information may be obtained by processing attribute information in the multicast message by using a preset algorithm such as HMAC.
通过实施上述步骤,通过对网络设备发的组播消息中的鉴权信息进行鉴权,来验证该网络设备是否为伪装(不合法)设备,进而决定是否利用该网络设备发的组播消息来构建相应的树形网络拓扑,这样可提升树形网络拓扑构建的准确性和可靠性。By implementing the above steps, the authentication information in the multicast message sent by the network device is verified to verify whether the network device is a masquerading (illegal) device, and then decide whether to use the multicast message sent by the network device to Construct the corresponding tree network topology, which can improve the accuracy and reliability of the tree network topology construction.
在一种可能的实现方式中,所述方法还包括:在第一网络设备运行的情况下,获取动态主机配置协议DHCP设备发送的配置IP地址,并将该配置IP地址作为第一网络设备的业务IP地址。In a possible implementation manner, the method further includes: when the first network device is running, obtaining a configuration IP address sent by a dynamic host configuration protocol DHCP device, and using the configuration IP address as a Service IP address.
在一种可能的实现方式中,所述第一网络设备为所述第一树形网络拓扑的根节点所在的网络设备,所述方法还包括:第一网络设备向第三网络设备发送添加请求,该添加请求用于请求将第三网络设备添加到第三网络设备的父节点所在的网络设备上,第三网络设备与第一网络设备安装有相同版本的SP。相应地,第三网络设备接收添加请求后,可向第三网络设备的父节点所在的网络设备发送注册请求,该注册请求包括 所述第三网络设备的父节点所在的网络设备和/或所述第一网络设备。第三网络设备的父节点所在的网络设备接收所述注册请求,在对所述注册请求中的所述第三网络设备的父节点所在的网络设备和/或所述第一网络设备验证成功的情况下,向第三网络设备发送注册成功响应,所述注册成功响应用于通知所述第三网络设备停止在所述局域网中发送组播消息。可选地,所述注册成功响应还包括第三网络设备的备用父节点所在的网络设备,即第三网络设备的祖父节点所在的网络设备。In a possible implementation manner, the first network device is a network device where a root node of the first tree network topology is located, and the method further includes: the first network device sends an add request to a third network device The adding request is used to request that the third network device be added to the network device where the parent node of the third network device is located. The third network device and the first network device have the same version of the SP installed. Correspondingly, after receiving the add request, the third network device may send a registration request to the network device where the parent node of the third network device is located, where the registration request includes the network device and / or the network device where the parent node of the third network device is located. The first network device is described. The network device where the parent node of the third network device is located receives the registration request, and the network device where the parent node of the third network device in the registration request is located and / or the first network device is successfully authenticated. In the case, a registration success response is sent to the third network device, and the registration success response is used to notify the third network device to stop sending a multicast message in the local area network. Optionally, the registration success response further includes a network device where the standby parent node of the third network device is located, that is, a network device where the grandparent node of the third network device is located.
通过实施上述步骤,第一树形网络拓扑中根节点所在的网络设备可通过下发注册消息,将各节点所在的网络设备添加并注册到该树形网络拓扑中,从而实现第一树形网络拓扑的快速构建。By implementing the above steps, the network device where the root node is located in the first tree network topology can send a registration message to add and register the network device where each node is located in the tree network topology, thereby realizing the first tree network topology. Fast build.
在一种可能的实现方式中,第一网络设备为第一树形网络拓扑的根节点所在的网络设备,所述方法还包括:第一网络设备向第四网络设备发送更新请求,该更新请求用于请求将第四网络设备安装的SP的版本更新为第一网络设备中安装的SP的版本;第四网络设备接收所述更新请求,在未更新第四网络设备中SP的版本的情况下,根据所述更新请求将第四网络设备中SP的版本更新为第一网络设备中SP的版本。In a possible implementation manner, the first network device is a network device where a root node of a first tree network topology is located, and the method further includes: the first network device sends an update request to a fourth network device, where the update request For requesting to update the version of the SP installed in the fourth network device to the version of the SP installed in the first network device; the fourth network device receives the update request, and if the version of the SP in the fourth network device is not updated Updating the version of the SP in the fourth network device to the version of the SP in the first network device according to the update request.
通过实施上述步骤,可保证局域网中每个树形网络拓扑中所包括的各个网络设备具有或部署有相同版本的SP软件,避免由于网络设备中SP版本不同导致在OS安装时出现一些异常状况,例如每个网络设备安装OS的时长不同、安装时出现不同的错误故障增加维修人员的工作量等等。By implementing the above steps, it is possible to ensure that each network device included in each tree network topology in the local area network has or has the same version of SP software, and avoid some abnormal conditions during OS installation due to different SP versions in the network device. For example, each network device has a different OS installation time, and different error faults occur during installation, increasing the workload of maintenance personnel, and so on.
第二方面,本申请提供一种OS批量安装的装置,所述装置包括用于执行第一方面或第一方面任一种可能实现方式中的OS批量安装方法的各个模块。In a second aspect, the present application provides a device for batch installation of OSs, which includes various modules for executing the method for batch installation of OSs in the first aspect or any possible implementation manner of the first aspect.
第三方面,本申请提供了一种网络设备,所述网络设备包括处理器、存储器、通信接口、总线,所述处理器、存储器和通信接口之间通过总线连接并完成相互间的通信,所述存储器中用于存储计算机执行指令,所述网络设备运行时,所述处理器执行所述存储器中的计算机执行指令以利用所述网络设备中的硬件资源执行第一方面或第一方面任一种可能实现方式中所述方法的操作步骤。In a third aspect, the present application provides a network device. The network device includes a processor, a memory, a communication interface, and a bus. The processor, the memory, and the communication interface are connected by a bus and complete communication with each other. The memory is used to store computer execution instructions, and when the network device is running, the processor executes the computer execution instructions in the memory to use the hardware resources in the network device to perform the first aspect or any of the first aspect Operation steps of the method described in one possible implementation manner.
第四方面,本申请提供一种通信系统,该通信系统包括至少一个网络设备,每个网络设备包括处理器、存储器、通信接口、总线,所述处理器、存储器和通信接口之间通过总线连接并完成相互间的通信,所述存储器中用于存储计算机执行指令,所述网络设备运行时,所述处理器执行所述存储器中的计算机执行指令以利用所述网络设备中的硬件资源执行第一方面或第一方面任一种可能实现方式中所述方法的操作步骤。According to a fourth aspect, the present application provides a communication system. The communication system includes at least one network device. Each network device includes a processor, a memory, a communication interface, and a bus. The processor, the memory, and the communication interface are connected by a bus. And complete communication with each other, the memory is used to store computer execution instructions, and when the network device is running, the processor executes the computer execution instructions in the memory to use hardware resources in the network device to execute the first The operation steps of the method described in one aspect or any possible implementation manner of the first aspect.
第五方面,本申请提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述各方面所述的方法。In a fifth aspect, the present application provides a computer-readable storage medium having instructions stored in the computer-readable storage medium, which when executed on a computer, causes the computer to execute the methods described in the above aspects.
第六方面,本申请提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各方面所述的方法。In a sixth aspect, the present application provides a computer program product containing instructions that, when run on a computer, causes the computer to perform the methods described in the above aspects.
本申请在上述各方面提供的实现方式的基础上,还可以进行进一步组合以提供更多实现方式。On the basis of the implementation manners provided in the above aspects, this application may be further combined to provide more implementation manners.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是传统技术中提供的一种二叉树网络拓扑的结构示意图。FIG. 1 is a schematic structural diagram of a binary tree network topology provided in the conventional technology.
图2是本发明实施例提供的一种网络架构示意图。FIG. 2 is a schematic diagram of a network architecture according to an embodiment of the present invention.
图3是本发明实施例提供的一种操作系统OS批量安装方法的流程示意图。FIG. 3 is a schematic flowchart of a method for batch installing an operating system OS according to an embodiment of the present invention.
图4是本发明实施例提供的一种树形网络拓扑的示意图。FIG. 4 is a schematic diagram of a tree network topology according to an embodiment of the present invention.
图5是本发明实施例提供的另一种树形网络拓扑结构示意图。FIG. 5 is a schematic diagram of another tree network topology structure according to an embodiment of the present invention.
图6是本发明实施例提供的另一种树形网络拓扑结构示意图。FIG. 6 is a schematic diagram of another tree network topology structure according to an embodiment of the present invention.
图7是本发明实施例提供的另一种树形网络拓扑结构示意图。FIG. 7 is a schematic diagram of another tree network topology structure according to an embodiment of the present invention.
图8是本发明实施例提供的一种树形网络拓扑更新的示意图。FIG. 8 is a schematic diagram of a tree network topology update according to an embodiment of the present invention.
图9是本发明实施例提供的另一种树形网络拓扑更新的示意图。FIG. 9 is a schematic diagram of another tree network topology update according to an embodiment of the present invention.
图10是本发明实施例提供的另一种树形网络拓扑更新的示意图。FIG. 10 is a schematic diagram of another tree network topology update according to an embodiment of the present invention.
图11是本发明实施例提供的另一种树形网络拓扑结构示意图。FIG. 11 is a schematic diagram of another tree network topology structure according to an embodiment of the present invention.
图12是本发明实施例提供的一种网络设备的结构示意图。FIG. 12 is a schematic structural diagram of a network device according to an embodiment of the present invention.
图13是本发明实施例提供的另一种网络设备的结构示意图。FIG. 13 is a schematic structural diagram of another network device according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明的附图,对本发明实施例中的技术方案进行详细描述。The technical solutions in the embodiments of the present invention will be described in detail below with reference to the accompanying drawings of the present invention.
首先,介绍本发明实施例涉及的一些技术术语。First, some technical terms related to the embodiments of the present invention are introduced.
智能管理操作系统:也名剪裁版操作系统或SP。是网络设备(具体可为服务器)上安装的一套智能管理工具,用于引导网络设备安装(或部署)操作系统OS。即是,该智能管理操作系统中包括有用于引导网络设备安装OS的编程文件。Intelligent management operating system: also known as tailored operating system or SP. It is a set of intelligent management tools installed on a network device (specifically a server), and is used to guide the network device to install (or deploy) an operating system OS. That is, the intelligent management operating system includes a programming file for guiding a network device to install an OS.
散列消息鉴别码(Hash Message Authentication Code,HMAC)算法:也名HAMC算法。指利用哈希算法,以一个密钥和一个消息作为输入,生成一个消息摘要作为输出。本发明实施例中,输出的消息摘要具体可为鉴权信息,具体将在下文进行详述。Hash Message Authentication Code (HMAC) algorithm: also known as the HAMC algorithm. Refers to the use of a hash algorithm, a key and a message as input, to generate a message digest as output. In the embodiment of the present invention, the output message digest may be authentication information, which will be described in detail below.
树形网络拓扑:是一种类似于总线拓扑的局域网拓扑,该树形网络拓扑可以包括两个及以上的分支,每个分支可包括一个或多个节点。本发明实施例中涉及的树形网络拓扑可以为二叉树网络拓扑,即每个分支上包括两个节点。Tree network topology: It is a local area network topology similar to a bus topology. The tree network topology can include two or more branches, and each branch can include one or more nodes. The tree network topology involved in the embodiment of the present invention may be a binary tree network topology, that is, each branch includes two nodes.
根节点:指树形网络拓扑中没有父节点的节点。Root node: A node that has no parent node in a tree network topology.
叶子节点:指树形网络拓扑中没有子节点的节点。Leaf node: A node that has no child nodes in a tree-like network topology.
中间节点:指树形网络拓扑中存在有父节点以及子节点的节点,即是树形网络拓扑中除根节点和叶子节点之外的节点。Intermediate node: Refers to a node with a parent node and a child node in the tree network topology, that is, a node other than the root node and the leaf node in the tree network topology.
孤立节点:指树形网络拓扑中没有父节点以及子节点的节点,即树形网络拓扑中单独的、独立的节点。Isolated node: A node without a parent node and a child node in a tree network topology, that is, a separate and independent node in the tree network topology.
示例性地,如图1示出一种二叉树网络拓扑的结构示意图。如图1中,节点A为根节点,节点D、E、F以及G均为叶子节点,节点B和C均为中间节点。其中,图示中,节点A为节点B和C的父节点,相应地节点B和C分别为节点A的子节点。节点B为节点D和E的父节点,节点C为节点F和G的父节点。图示中节点A还为节点D、E、F以及G的祖父节点,相应地节点D、E、F以及G分别为节点A的子孙节点。Exemplarily, a structure diagram of a binary tree network topology is shown in FIG. 1. As shown in Figure 1, node A is the root node, nodes D, E, F, and G are leaf nodes, and nodes B and C are intermediate nodes. Among them, the node A is the parent node of the nodes B and C, and the nodes B and C are the child nodes of the node A respectively. Node B is the parent of nodes D and E, and node C is the parent of nodes F and G. Node A in the figure is also the grandparent node of nodes D, E, F, and G. Correspondingly, nodes D, E, F, and G are the grandchildren of node A, respectively.
值得说明的是,树形网络拓扑是一种逻辑结构,具体可以利用网络设备中指定文件、数据库或其他存储形式存储。It is worth noting that the tree network topology is a logical structure, which can be stored in a specified file, database, or other storage form in the network device.
为解决传统技术方案中大批量网络设备中安装OS的方案中存在的工作复杂、工作量大以及耗时较长等问题,本发明实施例提出一种OS批量安装方法以及所述方法适用的网络设备以及相关的网络框架。首先,参见图2,是本发明实施例提供的一种通信系统的网络框架示意图。如图2中,该网络框架示意图包括管理设备、镜像存储设备、一个或多个局域网(图示以3个局域网为例)以及中间设备。每个局域网中包括有一个或多个网络设备(具体可为服务器等),图中示出一个局域网中包括有m个网络设备,m为正整数。图示中192.168.1.X-192.168.3.X分别为三个局域网各自的业务IP地址,这里不做详述。其中:In order to solve the problems of complicated work, large workload, and long time consumption in the solution of installing an OS in a large number of network devices in the traditional technical solution, an embodiment of the present invention proposes a method for OS batch installation and a network to which the method is applicable Devices and related network frameworks. First, referring to FIG. 2, it is a schematic diagram of a network framework of a communication system according to an embodiment of the present invention. As shown in FIG. 2, the schematic diagram of the network framework includes a management device, a mirrored storage device, one or more local area networks (three local area networks are taken as an example), and an intermediate device. Each local area network includes one or more network devices (specifically, it can be a server, etc.). It is shown that a local area network includes m network devices, where m is a positive integer. In the picture, 192.168.1.X-192.168.3.X are the service IP addresses of the three LANs, respectively, which will not be described in detail here. among them:
管理设备,也可叫设备管理系统OM。用于管理各个局域网中的网络设备,即支持管理大批量网络设备。Management equipment can also be called equipment management system OM. It is used to manage the network devices in each local area network, that is, to support the management of a large number of network devices.
镜像存储设备,也可叫数据源中心。用于存储操作系统OS镜像,即提供用于网络设备安装OS的OS镜像,本发明实施例这里不做详述。Mirrored storage devices can also be called data source centers. It is used to store the operating system OS image, that is, to provide an OS image for installing OS on a network device, which is not described in detail in the embodiment of the present invention.
中间设备,用于实现数据的转发,图示中通过该中间设备可将管理设备的信息(如管理设备下发的配置命令等)下发给局域网中的各个网络设备,或者通过该中间设备将网络设备的信息上报给管理设备等,本发明实施例这里不做详述。该中间设备具体可包括但不限于交换机、路由器、或者其他用于实现数据传输的设备。An intermediate device is used to implement data forwarding. In the figure, the intermediate device can be used to send information about the management device (such as configuration commands issued by the management device) to each network device in the local area network. The information of the network device is reported to the management device and the like, which is not described in detail in the embodiment of the present invention. The intermediate device may specifically include, but is not limited to, a switch, a router, or other devices for implementing data transmission.
网络设备,可以配置多个网络IP地址,分别用于传输管理数据和业务数据。具体实施中,可以利用两个网卡按照预置网络规划分配不同的网段,用于传输管理数据的IP地址可以称为管理IP地址,用于传输业务数据的IP地址可以称为业务IP地址。换句话说,网络设备的网络规划可以按照业务需求区分为管理侧和业务侧。管理侧部署有iBMC系统。业务侧部署有SP,用于引导所述网络设备安装OS系统。Network equipment can be configured with multiple network IP addresses for transmitting management data and business data, respectively. In specific implementation, two network cards may be used to allocate different network segments according to a preset network plan. The IP address used to transmit management data may be referred to as a management IP address, and the IP address used to transmit business data may be referred to as a service IP address. In other words, the network planning of the network equipment can be divided into management side and service side according to service requirements. An iBMC system is deployed on the management side. An SP is deployed on the service side to guide the network device to install an OS system.
具体的,管理设备(即设备管理系统OM)可根据局域网中m个网络设备各自的管理IP地址,向该m个网络设备发送SP。相应地,在网络设备接收到SP后,可将SP写到或安装到自身的硬盘或非易失性存储器中。便于后续网络设备中的SP从镜像存储设备中获取OS镜像,引导实现OS的安装。关于如何在大批量网络设备中安装OS,具体在本发明实施例下文进行详细阐述。Specifically, the management device (ie, the device management system OM) may send an SP to the m network devices according to the management IP addresses of the m network devices in the local area network. Correspondingly, after the SP is received by the network device, the SP can be written to or installed in its own hard disk or non-volatile memory. It is convenient for the SPs in subsequent network devices to obtain the OS image from the image storage device and guide the implementation of the OS. How to install the OS in a large number of network devices is described in detail below in the embodiments of the present invention.
请参见图3,是本发明实施例提供的一种操作系统OS批量安装方法的流程示意图。所述方法应用在包括m个网络设备的局域网中,每个网络设备中预先安装有智能管理操作系统SP,以用于引导所述网络设备安装相应地操作系统OS。如图3所述的方法包括如下实施步骤:Please refer to FIG. 3, which is a schematic flowchart of a method for batch installing an operating system OS provided by an embodiment of the present invention. The method is applied in a local area network including m network devices, and each network device is pre-installed with an intelligent management operating system SP for guiding the network device to install a corresponding operating system OS. The method shown in FIG. 3 includes the following implementation steps:
步骤S102、第一网络设备根据n个网络设备发送的组播消息,确定由所述n个网络设备构成的第一树形网络拓扑,其中,所述第一网络设备为局域网中m个网络设备中的任一已运行的网络设备,n小于或等于m,且n和m均为正整数,所述组播消息包括用于描述所述网络设备的属性的信息。Step S102: The first network device determines a first tree network topology composed of the n network devices according to a multicast message sent by the n network devices, where the first network device is m network devices in a local area network. In any running network device, n is less than or equal to m, and n and m are positive integers, and the multicast message includes information used to describe attributes of the network device.
本发明实施例中,局域网中的任一网络设备启动或运行(具体为该网络设备部署的SP运行)后,所述任一网络设备可周期性(如每间隔5s)在局域网中发送组播消息。相应地,该任一网络设备可接收局域网中已运行的其他网络设备发送的组播消 息。In the embodiment of the present invention, after any network device in the local area network is started or running (specifically, the SP deployed by the network device is running), any of the network devices may periodically (for example, every 5 s) send multicast in the local area network. Message. Correspondingly, any one network device can receive multicast messages sent by other network devices already running on the local area network.
当局域网中有n个已运行的网络设备时,该n个网络设备中的一个或多个网络设备可周期性地发送组播消息。相应地,该一个或多个网络设备也可接收局域网中其他网络设备发送的组播消息,进而根据接收的组播消息构建出相应地树形网络拓扑。其中,n为小于或等于m的正整数。When there are n running network devices in the local area network, one or more of the n network devices may periodically send multicast messages. Correspondingly, the one or more network devices may also receive multicast messages sent by other network devices in the local area network, and then construct a corresponding tree network topology according to the received multicast messages. Here, n is a positive integer less than or equal to m.
即,具体存在以下两种情况。第一种情况,局域网中n个已运行的网络设备中的部分网络设备可根据自身接收的组播消息构建出相应地树形网络拓扑。第二种情况,局域网中n个已运行的网络设备中每个网络设备均构建树形网络拓扑,则此时n个网络设备可构建获得n个树形网络拓扑。That is, the following two cases exist. In the first case, some network devices among the n running network devices in the local area network can construct a corresponding tree network topology according to the multicast message received by the network device. In the second case, each network device of the n running network devices in the local area network constructs a tree network topology. At this time, n network devices can be constructed to obtain n tree network topologies.
下面以第一网络设备为例,详细阐述第一网络设备如何基于组播消息构建第一树形网络拓扑。The following uses the first network device as an example to explain in detail how the first network device constructs a first tree network topology based on the multicast message.
具体的,第一网络设备在运行后,可周期性在局域网中发送组播消息。相应地,所述第一网络设备也可接收所述局域网中已运行的其他网络设备发送的组播消息。进一步地,所述第一网络设备可根据n个网络设备各自发送的组播消息,构建获得由所述n个网络设备构成的第一树形网络拓扑。其中,所述n个网络设备可包括所述第一网络设备,即所述第一网络设备可根据自身发送的组播消息以及接收的n-1个网络设备发送的组播消息,来确定所述第一树形网络拓扑,n为大于1的正整数。可选地,所述n个网络设备也可为所述局域网中除所述第一网络设备之外的其他已运行的网络设备等,本发明实施例不做限定。Specifically, after the first network device is running, it can periodically send multicast messages in the local area network. Correspondingly, the first network device may also receive multicast messages sent by other network devices already running in the local area network. Further, the first network device may construct and obtain a first tree network topology composed of the n network devices according to the multicast messages sent by the n network devices. The n network devices may include the first network device, that is, the first network device may determine all the network devices according to the multicast message sent by itself and the received multicast messages sent by the n-1 network devices. In the first tree network topology, n is a positive integer greater than 1. Optionally, the n network devices may also be other network devices running in the local area network except the first network device, which is not limited in the embodiment of the present invention.
所述组播消息包括属性信息,所述属性信息为用于描述所述网络设备的属性的信息,例如所述网络设备的内存大小、硬盘大小、处理器CPU数量、CPU运行速率、业务IP地址、SP版本以及设备标识等信息。所述设备标识用于区分所述网络设备,其可包括但不限于网络设备的编号、通用唯一识别码(universally unique identifier,UUID)等,本发明实施例这里不做详述。The multicast message includes attribute information, and the attribute information is information for describing attributes of the network device, such as a memory size, a hard disk size, a processor CPU number, a CPU operating speed, and a service IP address of the network device. , SP version, and device identification. The device identifier is used to distinguish the network device, and may include, but is not limited to, a network device number, a universally unique identifier (UUID), and the like, which are not described in detail in the embodiment of the present invention.
作为一种可能的实施方式,所述第一网络设备可根据所述n个网络设备各自组播消息中的属性信息,按照预设规则对所述n个网络设备进行排序,以获得所述第一树形网络拓扑。As a possible implementation manner, the first network device may sort the n network devices according to attribute information in respective multicast messages of the n network devices according to a preset rule to obtain the first network device. A tree network topology.
所述预设规则用于排列网络设备以生成相应地网络拓扑,其具体可为用户或系统自定义设置的规则,例如系统可根据实际的业务需求来设置等。示例性地,所述预设规则为按照属性信息的优先级来排列所述网络设备,进而生成所述第一树形网络拓扑(具体为二叉树网络拓扑)。其中,所述属性信息的优先级按照从高到低的顺序依次可为:所述网络速率>所述内存大小>所述处理器数量>所述硬盘大小>所述设备标识。The preset rules are used for arranging network devices to generate corresponding network topologies. Specifically, the preset rules can be customized for users or the system. For example, the system can be set according to actual business requirements. Exemplarily, the preset rule is to arrange the network devices according to the priority of the attribute information, thereby generating the first tree network topology (specifically, a binary tree network topology). The priority of the attribute information may be in the order of high to low: the network rate> the memory size> the number of processors> the hard disk size> the device identification.
举例来说,假设局域网中第一网络设备A启动后,接收到5个网络设备(具体为网络设备B-F)各自发送的组播消息。网络设备A结合自身的组播消息,共计6个网络设备(具体为网络设备A-F)的组播消息,根据6个网络设备各自组播消息中的属性信息,按照如上优先级从高到低的顺序对这6个网络设备依次进行排序,假设排序后的网络设备依次为:B-F-C-A-D-E。进一步地,将排序后的网络设备B-E按照层结构从上到下,从左到右(或从右到左)的顺序依次填入二叉树中,以获得由这6个网络设备构成的二叉树网络拓扑(即树形网络拓扑)。具体可参见图4所示,示出将 排序后的网络设备按照从上到下以及从左到右的顺序填写到二叉树,以获得的树形网络拓扑。For example, it is assumed that after the first network device A in the local area network is started, it receives multicast messages sent by five network devices (specifically, network devices B-F). Network device A combines its own multicast messages with a total of 6 network device (specifically network device AF) multicast messages. According to the attribute information in the respective multicast messages of the 6 network devices, the priority is from highest to lowest according to the above. The six network devices are sorted in order. It is assumed that the sorted network devices are: BFCADE. Further, the sorted network devices BE are sequentially filled into the binary tree in the order of the layer structure from top to bottom and from left to right (or from right to left) to obtain a binary tree network topology composed of these 6 network devices. (Ie tree network topology). For details, refer to FIG. 4, which shows a tree network topology obtained by filling the sorted network devices into a binary tree in the order from top to bottom and from left to right.
需要说明的是,局域网中可能存在多个网络设备同时启动的情况,这时启动后的网络设备可分别按照S102的拓扑构建原理,构建出相应地树形网络拓扑。这些树形网络拓扑可以相同,也可不同,本发明实施例这里不做详述和限定。It should be noted that there may be situations where multiple network devices are started at the same time in the local area network. At this time, the network devices after startup can be constructed according to the topology construction principle of S102 to construct a corresponding tree network topology. These tree network topologies may be the same or different, and the embodiments of the present invention are not described in detail and limited herein.
可选地,所述局域网络中的任一网络设备运行后,通过网络可自动获得动态主机配置协议(dynamic host configuration protocol,DHCP)服务器发送的配置IP地址。进一步地,所述任一网络设备可将该配置IP地址作为该任一网络设备(即该网络设备上部署的SP)的业务IP地址,便于后续通过该业务IP地址与其他网络设备实现业务通信。Optionally, after any network device in the local area network is running, the configuration IP address sent by a dynamic host configuration protocol (DHCP) server can be obtained automatically through the network. Further, any one of the network devices may use the configured IP address as a service IP address of the any network device (that is, the SP deployed on the network device), which is convenient for subsequent service communication with other network devices through the service IP address. .
作为一种可能的实施方式,所述组播消息还包括第一鉴权信息,所述第一鉴权信息是根据所述网络设备发送的组播消息中的属性信息生成的。相应地,步骤S102中,所述第一网络设备接收n个网络设备发送的组播消息后,需先对所述n个网络设备各自的组播消息中的第一鉴权信息进行验证,在验证成功后,继续执行步骤S102根据所述n个网络设备发送的组播消息确定所述第一树形网络拓扑。As a possible implementation manner, the multicast message further includes first authentication information, and the first authentication information is generated according to attribute information in a multicast message sent by the network device. Accordingly, in step S102, after receiving the multicast message sent by the n network devices, the first network device needs to verify the first authentication information in the multicast message of each of the n network devices. After the verification is successful, step S102 is performed to determine the first tree network topology according to the multicast message sent by the n network devices.
具体的,所述第一鉴权信息为所述网络设备根据预设第一算法对所述网络设备的属性信息进行计算获得的,所述预设第一算法为用户侧或系统侧自定义设置的算法,其可包括但不限于HMAC算法等。在获得所述第一鉴权信息后,所述网络设备可将该第一鉴权信息添加到自身的组播消息中,以便后续将其在局域网中发送。在实际应用中,所述组播消息通常用二进制数据包表示,本发明实施例这里不做详述。Specifically, the first authentication information is obtained by the network device calculating attribute information of the network device according to a preset first algorithm, and the preset first algorithm is a user-side or system-side custom setting Algorithms, which may include but are not limited to HMAC algorithms and the like. After obtaining the first authentication information, the network device may add the first authentication information to its own multicast message, so as to send it in the local area network in the future. In practical applications, the multicast message is usually represented by a binary data packet, which is not described in detail in the embodiment of the present invention.
相应地,所述第一网络设备接收所述n个网络设备中任一网络设备发送的组播消息后,可根据预设第一算法对该组播消息中的属性信息进行处理,以计算获得相应的鉴权验证信息。进一步地,将该鉴权验证信息和该组播消息中的第一鉴权信息进行比对,如果对比一致,则对所述n个网络设备中的任一网络设备发送的组播消息鉴权(或验证)成功。如果对比不一致,则表示对所述n个网络设备中的任一网络设备发送的组播消息鉴权失败,该n个网络设备中任一网络设备发送的组播消息不可用,可丢弃这条组播消息。Correspondingly, after receiving the multicast message sent by any one of the n network devices, the first network device may process the attribute information in the multicast message according to a preset first algorithm to calculate and obtain Corresponding authentication information. Further, the authentication verification information is compared with the first authentication information in the multicast message. If the comparison is consistent, the multicast message sent by any one of the n network devices is authenticated. (Or verify) success. If the comparison is inconsistent, it means that the authentication of the multicast message sent by any one of the n network devices has failed. The multicast message sent by any one of the n network devices is unavailable, and this one can be discarded. Multicast message.
同样地,所述第一网络设备根据上述鉴权原理,对所述n个网络设备发送的组播消息中的第一鉴权信息进行鉴权。在对所述n个网络设备发送的组播消息中的第一鉴权信息鉴权成功后,继续执行S102。否则,在对所述n个网络设备中的任一网络设备发送的组播消息中的第一鉴权信息鉴权失败后,可丢弃该n个网络设备中的任一网络设备发送的组播消息,利用其他鉴权成功的所述n个网络设备中的网络设备所发送的组播消息,来构建所述第一树形网络拓扑,本发明实施例这里不做详述。Similarly, the first network device performs authentication on the first authentication information in the multicast message sent by the n network devices according to the foregoing authentication principle. After the first authentication information in the multicast message sent by the n network devices is successfully authenticated, step S102 is performed. Otherwise, after the first authentication information in the multicast message sent by any of the n network devices fails to be authenticated, the multicast sent by any of the n network devices may be discarded. The message uses multicast messages sent by other network devices among the n network devices that have been successfully authenticated to construct the first tree network topology, which is not described in detail in this embodiment of the present invention.
在一种可能的实施例中,当第一网络设备确定第一树形网络拓扑后,可将第一树形网络拓扑涉及的各个网络设备添加到该第一树形网络拓扑中。关于网络设备如何添加到树形网络拓扑中具体在下文进行详述。In a possible embodiment, after the first network device determines the first tree network topology, each network device involved in the first tree network topology may be added to the first tree network topology. How network devices are added to the tree network topology is described in detail below.
可选地,当局域网中存在多个树形网络拓扑时,该多个树形网络拓扑中存在相同的网络设备,此时可按照注册请求发送的时间先后顺序,将该网络设备优先添加到先发送注册请求的树形网络拓扑中。在添加完成后,可删除其他树形网络拓扑中存在 的该网络设备。具体将在下文进行详述。Optionally, when there are multiple tree network topologies in the local area network, the same network devices exist in the multiple tree network topologies. At this time, the network devices may be added to the first in accordance with the chronological order of registration request sending. Send a registration request in a tree network topology. After the addition is complete, you can delete the network device that exists in other tree network topologies. The details will be described later.
步骤S104、当所述第一网络设备向所述局域网中其他网络设备发送组播消息的次数满足第一阈值时,确定所述局域网的至少一个树形网络拓扑中每个树形网络拓扑的根节点所在的网络设备。便于所述每个树形网络拓扑的根节点所在的网络设备获取OS镜像,并发送给所述每个树形网络拓扑中各个网络设备进行OS安装。Step S104: When the number of times that the first network device sends multicast messages to other network devices in the local area network meets a first threshold, determine a root of each tree network topology in at least one tree network topology of the local area network. The network device where the node is located. It is convenient for the network device where the root node of each tree network topology is located to obtain an OS image and send it to each network device in each tree network topology for OS installation.
所述第一阈值为用户或系统自定义设置的,不同应用场景其具体的数值大小可不同。示例性地,为实现所述第一树形网络拓扑的快速构建,在局域网中各个网络设备的启动时间差异较大且业务处理的时延要求较长的应用场景下,所述第一阈值可设置得比较大,例如10/20等。相应地,在局域网中各个网络设备的启动时间差异不大(例如均为30-40s内成功启动)且业务处理的时延要求较短的应用场景下,所述第一阈值可设置得比较小,例如3等等,本发明实施例这里不做详述和限定。The first threshold is set by a user or a system, and a specific numerical value may be different in different application scenarios. Exemplarily, in order to realize the rapid construction of the first tree-like network topology, in an application scenario in which the startup time of each network device in a local area network is greatly different and the delay of service processing is required to be long, the first threshold value may be Set it relatively large, such as 10/20 and so on. Correspondingly, in application scenarios in which the startup time of each network device in the local area network is not significantly different (for example, all are successfully started within 30-40s) and the delay of service processing is required to be short, the first threshold may be set to be relatively small For example, 3 and so on, the embodiments of the present invention are not described in detail and limited herein.
下面阐述S104涉及的几种具体实施方式。Several specific implementations related to S104 are described below.
第一种实施方式中,在n小于m,所述局域网中存在两个或两个以上的树形网络拓扑的情况下,所述第一网络设备接收第二网络设备发送的第一单播消息,所述第二网络设备为所述m个网络设备中除所述第一网络设备之外的另一已运行的网络设备,所述第二网络设备构建所述第二树形网络拓扑,所述第一树形网络拓扑和所述第二树形网络拓扑包括不同的网络设备。则所述第一网络设备确定所述第一树形网络拓扑的根节点所在的网络设备和所述第二树形网络拓扑的根节点所在的网络设备分别为所述局域网的两个树形组网拓扑中各自根节点所在的网络设备。In a first implementation manner, when n is less than m and there are two or more tree network topologies in the local area network, the first network device receives a first unicast message sent by a second network device The second network device is another running network device other than the first network device among the m network devices, and the second network device constructs the second tree network topology, so The first tree network topology and the second tree network topology include different network devices. Then the first network device determines that the network device where the root node of the first tree network topology is located and the network device where the root node of the second tree network topology is respectively two tree groups of the local area network The network devices where the respective root nodes are located in the network topology.
第二种实施方式中,在n小于m,所述局域网中存在两个或两个以上的树形网络拓扑的情况下,所述第一网络设备接收第二网络设备发送的第一单播消息,所述第二网络设备为所述m个网络设备中除所述第一网络设备之外的另一已运行的网络设备,所述第二网络设备构建所述第二树形网络拓扑,所述第一树形网络拓扑和所述第二树形网络拓扑包括至少一个相同的网络设备。则所述第一网络设备合并所述第一树形网络拓扑和所述第二树形网络拓扑中重复的网络设备生成第三树形网络拓扑,所述第三树形网络拓扑的根节点所在的网络设备为所述局域网的树形网络拓扑中根节点所在的网络设备。In a second implementation manner, when n is less than m and there are two or more tree network topologies in the local area network, the first network device receives a first unicast message sent by a second network device The second network device is another running network device other than the first network device among the m network devices, and the second network device constructs the second tree network topology, so The first tree network topology and the second tree network topology include at least one identical network device. The first network device merges the duplicated network devices in the first tree network topology and the second tree network topology to generate a third tree network topology, where the root node of the third tree network topology is located The network device is the network device where the root node is located in the tree network topology of the local area network.
具体的,由于局域网中不同网络设备各自的启动时间差异不大,则启动后的网络设备自动构建相应的树形网络拓扑,关于所述树形网络拓扑的构建原理可参见前述实施例中的相关阐述,这里不再赘述。此时,局域网中可能存在多个树形网络拓扑,但各个树形网络拓扑之间有没有关联关系,例如某个树形网络拓扑为另一树形网络拓扑的子网拓扑等。具体在S104中实现确定,即确定局域网中存在的完整树形网络拓扑,确定局域网中树形网络拓扑的根节点。Specifically, since the startup times of different network devices in a local area network are not significantly different, the network devices after startup automatically construct a corresponding tree network topology. For the construction principle of the tree network topology, refer to the related examples in the foregoing embodiments. Explain, I won't repeat them here. At this time, there may be multiple tree network topologies in the local area network, but there is no correlation between the tree network topologies, for example, a tree network topology is a subnet topology of another tree network topology. Specifically, the determination is implemented in S104, that is, determining the complete tree network topology existing in the local area network, and determining the root node of the tree network topology in the local area network.
本发明实施例中,以局域网中第一网络设备和第二网络设备启动后,构建树形网络拓扑为例,阐述S104的具体实现。其中,所述第一网络设备启动后,构建获得第一树形网络拓扑。所述第二网络设备启动后,构建获得第二树形网络拓扑。In the embodiment of the present invention, the specific implementation of S104 is explained by taking the construction of a tree network topology as an example after the first network device and the second network device in the local area network are started. Wherein, after the first network device is started, a first tree network topology is constructed and obtained. After the second network device is started, a second tree network topology is constructed and obtained.
在n小于或等于m时,所述局域网中可能存在两个或两个以上的独立的树形网络拓扑,所述两个或两个以上的树形网络拓扑至少包括所述第一树形网络拓扑以及 所述第二树形网络拓扑。在所述第二网络设备获得所述第二树形网络拓扑后,可选地所述第二网络设备向局域网中其他设备发送组播消息的次数达到一定阈值时,可向所述第一网络设备发送第一单播消息,所述第一单播消息包括所述第二树形网络拓扑。所述第一单播消息用于确定所述局域网中存在的树形网络拓扑的数量,或者确定所述第一树形网络拓扑和所述第二树形网络拓扑是否存在关联关系。When n is less than or equal to m, there may be two or more independent tree network topologies in the local area network, and the two or more tree network topologies include at least the first tree network Topology and the second tree network topology. After the second network device obtains the second tree network topology, optionally, when the number of times that the second network device sends multicast messages to other devices in the local area network reaches a certain threshold, the second network device may send the first network to the first network. The device sends a first unicast message, where the first unicast message includes the second tree network topology. The first unicast message is used to determine the number of tree network topologies existing in the local area network, or to determine whether there is an association relationship between the first tree network topology and the second tree network topology.
相应地,所述第一网络设备接收所述第二网络设备发送的第一单播消息,所述第一单播消息包括所述第二树形网络拓扑。所述第一网络设备根据所述第二树形网络拓扑以及所述第一树形网络拓扑,确定所述第一树形网络拓扑和所述第二树形网络拓扑各自节点所在的网络设备中是否存在相同的网络设备。其具体存在以下两种实现情况。Correspondingly, the first network device receives a first unicast message sent by the second network device, and the first unicast message includes the second tree-shaped network topology. Determining, by the first network device according to the second tree network topology and the first tree network topology, a network device in which each node of the first tree network topology and the second tree network topology is located Whether the same network equipment exists. There are two specific implementations.
第一种情况:第一树形网络拓扑和第二树形网络拓扑中不存在相同的网络设备The first case: the same network device does not exist in the first tree network topology and the second tree network topology
即第一树形网络拓扑结构和第二树形网络拓扑结构包括不同的网络设备,则可确定该第一树形网络拓扑和第二树形网络拓扑为所述局域网中的两个独立的树形网络拓扑,将第一树形网络拓扑中根节点所在的网络设备以及第二树形网络拓扑中根节点所在的网络设备分别确定为局域网中两个树形网络拓扑各自根节点所在的网络设备。That is, the first tree network topology and the second tree network topology include different network devices, it can be determined that the first tree network topology and the second tree network topology are two independent trees in the local area network. Network topology, the network device where the root node is located in the first tree network topology and the network device where the root node is located in the second tree network topology are determined as the network devices where the respective root nodes of the two tree network topologies in the local area network are located.
第二种情况:第一树形网络拓扑和第二树形网络拓扑中存在相同的网络设备The second case: the same network device exists in the first tree network topology and the second tree network topology
即第一树形网络拓扑结构和第二树形网络拓扑结构包括至少一个相同的网络设备,则可将第一树形网络拓扑和第二树形网络拓扑中相同的网络设备进行合并,以获得第三树形网络拓扑。即,第一树形网络拓扑和第二树形网络拓扑存在关联关系,需合并为一个独立的树形网络拓扑。进而,将所述第三树形网络拓扑中根节点所在的网络设备确定为所述局域网的树形网络拓扑中根节点所在的网络设备。具体存在以下几种可能的实施方式。That is, the first tree-like network topology and the second tree-like network topology include at least one identical network device, the same network devices in the first and second tree-like network topology can be combined to obtain Third tree network topology. That is, there is an association relationship between the first tree network topology and the second tree network topology, and they need to be merged into an independent tree network topology. Furthermore, the network device where the root node is located in the third tree network topology is determined as the network device where the root node is located in the tree network topology of the local area network. There are several possible implementation modes below.
在一种可能的实施方式中,当第一树形网络拓扑的根节点所在的网络设备为第二树形网络拓扑中子节点的网络设备时,第一网络设备可将第一树形网络拓扑和第二树形网络拓扑进行合并,以获得第三树形网络拓扑。In a possible implementation manner, when the network device where the root node of the first tree-shaped network topology is located is a network device of a child node in the second tree-shaped network topology, the first network device may convert the first tree-shaped network topology. Merging with the second tree network topology to obtain a third tree network topology.
在另一种可能的实施方式中,当第一树形网络拓扑的根节点所在的网络设备不是第二树形网络拓扑中子节点的网络设备时,如果第一树形网络拓扑中根节点所在的网络设备和第二树形网络中根节点所在的网络设备相同,则第一网络设备可确定第一树形网络拓扑和第二树形网络拓扑存在关联,将第一树形网络拓扑和第二树形网络拓扑进行合并,以获得第三树形网络拓扑。In another possible implementation manner, when the network device where the root node of the first tree network topology is located is not the network device of the child node in the second tree network topology, if the root node in the first tree network topology is located If the network device is the same as the root device in the second tree network, the first network device may determine that the first tree network topology is related to the second tree network topology, and associate the first tree network topology with the second tree network topology. Network topology is merged to obtain a third tree network topology.
在另一种可能的实施方式中,当第一树形网络拓扑的根节点所在的网络设备不是第二树形网络拓扑中子节点的网络设备时,如果所述第一树形网络的根节点所在的网络设备和所述第二树形网络的根节点所在的网络设备不同,则第一网络设备仍将第一树形网络拓扑和第二树形网络拓扑确定为所述局域网中的两个独立网络拓扑,进而将第一树形网络拓扑的根节点所在的网络设备和所述第二树形网络拓扑的根节点所在的网络设备确定为所述局域网中的两个树形网络拓扑各自根节点所在的网络设备。In another possible implementation manner, when the network device where the root node of the first tree network topology is located is not the network device of the child node in the second tree network topology, if the root node of the first tree network topology is The network device where the network device is located is different from the network device where the root node of the second tree network is located, the first network device still determines the first tree network topology and the second tree network topology as two in the local area network. Independent network topology, further determining the network device where the root node of the first tree network topology is located and the network device where the root node of the second tree network topology is located as the respective roots of the two tree network topologies in the local area network The network device where the node is located.
举例来说,如图5和图6分别示出第一树形网络拓扑和第二树形网络拓扑的示意图。如图所示,假设所述第一网络设备确定到所述第一树形网络拓扑中根节点所在的网络设备C和所述第二树形网络拓扑中子节点所在的网络设备C相同,则可将第二 树形网络拓扑合并以及添加到第一树形网络拓扑中,从而获得如图7所示的第三树形网络拓扑。For example, FIG. 5 and FIG. 6 respectively show schematic diagrams of a first tree network topology and a second tree network topology. As shown in the figure, assuming that the first network device determines that the network device C where the root node is located in the first tree network topology and the network device C where the child node is located in the second tree network topology are the same, The second tree network topology is merged and added to the first tree network topology to obtain a third tree network topology as shown in FIG. 7.
第三种实施方式中,在n等于m,所述局域网中仅包括一个树形网络拓扑的情况下,所述第一网络设备直接将所述第一树形网络拓扑中根节点所在的网络设备确定为所述局域网的树形网络拓扑的根节点所在的网络设备。In a third implementation manner, in a case where n is equal to m and the local area network includes only one tree network topology, the first network device directly determines a network device where a root node is located in the first tree network topology. Is the network device where the root node of the tree network topology of the local area network is located.
具体的,在第一网络设备启动后,可根据局域网中m个网络设备各自发送的组播消息,构建出由所述m个网络设备构成的一个完整的第一树形网络拓扑。进而,将第一树形网络拓扑中根节点所在的网络设备确定为所述局域网的树形网络拓扑中根节点所在的网络设备。Specifically, after the first network device is started, a complete first tree network topology composed of the m network devices may be constructed according to multicast messages sent by each of the m network devices in the local area network. Furthermore, the network device where the root node is located in the first tree network topology is determined as the network device where the root node is located in the tree network topology of the local area network.
第四种实施方式中,在第一网络设备向所述局域网中其他网络设备发送组播消息的次数满足第一阈值的情况下,所述第一网络设备可将第一树形网络拓扑中位于根节点位置的网络设备确定为候选根节点网络设备,所述候选根节点网络设备为第一树形网络拓扑中根节点所在的网络设备,其可能是局域网中某个单独的树形网络拓扑中根节点所在的网络设备,也可能是某个单独的树形网络拓扑中子节点所在的网络设备。该第一网络设备向候选根节点网络设备发送第一单播消息,第一单播消息携带有第一树形网络拓扑。In a fourth implementation manner, in a case where the number of times a first network device sends a multicast message to other network devices in the local area network meets a first threshold, the first network device may place a first tree network topology in the first tree network topology. The network device at the root node location is determined as a candidate root node network device. The candidate root node network device is the network device where the root node is located in the first tree network topology, which may be the root node in a separate tree network topology in the local area network. The network device on which it is located may also be the network device on which the child nodes are located in a separate tree network topology. The first network device sends a first unicast message to a candidate root node network device, where the first unicast message carries a first tree network topology.
相应地,候选根节点网络设备接收所述第一单播消息,并根据自身设备中记录的状态信息来确定候选根节点网络设备是否为局域网中树形网络拓扑的根节点所在的网络设备。如果是,则第一树形网络拓扑中根节点所在的网络设备为局域网的树形网络拓扑中根节点所在的网络设备。如果不是,则确定第一树形网络拓扑不是局域网的独立树形网络拓扑,相应地第一树形网络拓扑中根节点所在的网络设备为局域网的树形网络拓扑中子节点所在的网络设备。Correspondingly, the candidate root node network device receives the first unicast message, and determines whether the candidate root node network device is the network device where the root node of the tree network topology in the local area network is located according to the status information recorded in its own device. If so, the network device where the root node is located in the first tree network topology is the network device where the root node is located in the tree network topology of the local area network. If not, then it is determined that the first tree network topology is not an independent tree network topology of the local area network, and accordingly the network device where the root node is located in the first tree network topology is the network device where the child node is located in the tree network topology of the local area network.
可选地,该候选根节点网络设备还可向第一网络设备发送响应消息,响应消息用于指示(或通知)第一树形网络拓扑中根节点所在的网络设备是否为局域网的树形网络拓扑中根节点所在的网络设备。Optionally, the candidate root node network device may further send a response message to the first network device, and the response message is used to indicate (or notify) whether the network device in which the root node is located in the first tree network topology is a tree network topology of the local area network. The network device where the root node is located.
其中,状态信息用于指示候选根节点网络设备为以下节点所在网络设备中的任一项:孤立节点、根节点、叶子节点以及中间节点等。具体的,在局域网中各个网络设备初始启动时,每个网络设备各自记录的状态信息用于指示该网络设备为孤立节点所在的网络设备。相应地,随着局域网中各网络设备运行后,构建形成树形网络拓扑后,根据构建的树形网络拓扑可更新各网络设备中记录的状态信息。例如在某确定的树形网络拓扑中,某网络设备在该树形网络拓扑中为位于子节点位置的网络设备,相应地该网络设备可将自身的状态信息更新为位于子节点位置的网络设备。这样便于后续启动的网络设备在构建另一树形网络拓扑时,直接根据之前该网络设备中记录的状态信息来确定其是否为局域网的树形网络拓扑中的根节点。The status information is used to indicate that the candidate root node network device is any one of the following node network devices: an isolated node, a root node, a leaf node, and an intermediate node. Specifically, when each network device in the local area network is initially started, status information recorded by each network device is used to indicate that the network device is a network device where an isolated node is located. Correspondingly, after the network devices in the local area network are running, after the tree network topology is formed, the status information recorded in each network device can be updated according to the constructed tree network topology. For example, in a certain tree network topology, a network device is a network device located at a child node position in the tree network topology, and accordingly the network device may update its status information to a network device located at a child node position. . This facilitates the subsequent startup of the network device to determine whether it is the root node in the tree network topology of the local area network directly according to the state information recorded in the previous network device when constructing another tree network topology.
所述候选根节点网络设备根据自身的状态信息来确定候选根节点网络设备是否为所述局域网的树形网络拓扑中根节点所在的网络设备,其具体确定条件为:候选根节点网络设备中记录的状态信息用于指示该候选根节点网络设备为孤立节点所在的网络设备,或者用于指示该候选根节点网络设备为局域网的根节点所在的网络设备。The candidate root node network device determines whether the candidate root node network device is the network device where the root node is located in the tree network topology of the local area network according to its own state information, and the specific determination condition is as follows: The state information is used to indicate that the candidate root node network device is a network device where an isolated node is located, or is used to indicate that the candidate root node network device is a network device where a root node of a local area network is located.
即,在确定到候选根节点网络设备中记录的状态信息用于指示候选根节点网络 设备为局域网的孤立节点所在的网络设备,或者为局域网的根节点所在的网络设备时,则可确定第一树形网络拓扑为局域网中的一个独立的树形网络拓扑,第一树形网络中根节点所在的网络设备(候选根节点网络设备)为局域网的树形网络拓扑中根节点所在的网络设备。That is, when it is determined that the state information recorded in the candidate root node network device is used to indicate that the candidate root node network device is a network device where an isolated node of the local area network is located, or a network device where a root node of the local area network is located, the first The tree network topology is an independent tree network topology in the local area network. The network device where the root node is located in the first tree network (the candidate root node network device) is the network device where the root node is located in the tree network topology of the local area network.
作为一种可能的实现方式中,所述第一单播消息中还包括第二鉴权信息,该第二鉴权信息是基于第一单播消息中除第二鉴权信息外的其他信息(例如第一树形网络拓扑等)生成的,关于第二鉴权信息如何生成可参见前述第一鉴权信息的相关阐述,这里不再赘述。例如,采用HMAC算法对所述网络设备发的第一单播消息中的树形网络拓扑等信息进行计算,以获得第二鉴权信息,并将其添加至第一单播消息中等。In a possible implementation manner, the first unicast message further includes second authentication information, and the second authentication information is based on information other than the second authentication information in the first unicast message ( For example, generated by the first tree network topology, etc., for how to generate the second authentication information, refer to the foregoing related description of the first authentication information, and details are not described herein again. For example, the HMAC algorithm is used to calculate the tree network topology and other information in the first unicast message sent by the network device to obtain the second authentication information and add it to the first unicast message.
相应地,在网络设备接收到第一单播消息后,可先对第一单播消息中的第二鉴权信息进行鉴权,在鉴权成功后,将继续执行后续步骤,如确定局域网的树形网络拓扑中根节点所在的网络设备等。关于第二鉴权信息的生成以及鉴权具体可参见前述第一鉴权信息的相关描述,这里不再赘述。Correspondingly, after the network device receives the first unicast message, it can first authenticate the second authentication information in the first unicast message. After the authentication is successful, it will continue to perform subsequent steps, such as determining the local network's The network device where the root node is located in the tree network topology. Regarding the generation and authentication of the second authentication information, refer to the foregoing description of the first authentication information, and details are not described herein again.
在一种可能的实现方式中,第一网络设备确定到局域网的每个树形网络拓扑中根节点所在的网络设备后,所述每个树形网络拓扑中根节点所在的网络设备可从数据源中心(或镜像存储设备)中获得待安装OS的镜像(简称OS镜像),进而将获得的OS镜像下发到所述每个树形网络拓扑中各个网络设备,以在所述各个网络设备中实现OS的安装。In a possible implementation manner, after the first network device determines a network device where a root node is located in each tree network topology of the local area network, the network device where the root node is located in each tree network topology may be obtained from a data source center. (Or image storage device) to obtain an image of the OS to be installed (OS image for short), and then issue the obtained OS image to each network device in each tree network topology to implement in each network device OS installation.
以所述第一网络设备为例,阐述OS安装的具体原理。具体的,第一网络设备获得OS镜像后,可将所述OS镜像安装到或写到第一网络设备的硬盘或非易失性存储器中,以实现OS的安装。Taking the first network device as an example, the specific principle of OS installation is described. Specifically, after the first network device obtains the OS image, the OS image may be installed in or written to the hard disk or non-volatile memory of the first network device to implement the OS installation.
通过实施本发明实施例,能够将大批量网络设备按局域网划分,每个局域网中的网络设备可以通过发送组播消息来相互发现,从而快速构建出相应地树形网络拓扑。进而按照树形网络拓扑实现OS镜像的分发,以在树形网络拓扑中的各个网络设备中安装OS。这样避免传统技术中采用手工配置的业务IP地址来实现大批量网络设备的OS安装,其存在的工作量大、配置复杂、耗时较长等问题,从而提升了OS批量安装的高效性以及便捷性。By implementing the embodiments of the present invention, a large number of network devices can be divided into local area networks, and the network devices in each local area network can discover each other by sending multicast messages, thereby quickly constructing a corresponding tree network topology. Furthermore, the OS image is distributed according to the tree network topology, so as to install the OS in each network device in the tree network topology. This avoids the traditional technology of manually installing service IP addresses to implement OS installation of large quantities of network equipment, which has problems such as large workload, complicated configuration, and time-consuming, thereby improving the efficiency and convenience of OS batch installation. Sex.
在一种可能的实施方式中,本发明实施例还提出基于树形网络拓扑的异常处理机制。具体的,子节点所在的网络设备可周期性地向其父节点所在网络设备发送进度信息。相应地,父节点所在网络设备接收子节点所在网络设备发送的进度信息后,可向子节点所在网络设备发送响应信息。子节点所在网络设备(具体可为该网络设备的检测模块)可根据在预设时长内是否接收到该子父节点所在网络设备反馈的响应消息,来确定所述负节点所在的网络设备是否发生故障或出现异常。在所述树形网络拓扑中,如果节点所在网络设备发生了异常,则可对所述树形网络拓扑进行更新。以所述第一树形网络拓扑中的第一网络设备为例,具体存在以下三种情况。In a possible implementation manner, an embodiment of the present invention further proposes an exception processing mechanism based on a tree network topology. Specifically, the network device where the child node is located may periodically send progress information to the network device where the parent node is located. Correspondingly, after receiving the progress information sent by the network device where the child node is located, the network device where the parent node is located may send response information to the network device where the child node is located. The network device where the child node is located (specifically, the detection module of the network device) may determine whether the network device where the negative node is located occurs according to whether a response message from the network device where the child parent node is received is received within a preset time period Malfunction or abnormality. In the tree network topology, if an abnormality occurs in a network device where a node is located, the tree network topology may be updated. Taking the first network device in the first tree network topology as an example, the following three situations exist.
第一种,在所述第一网络设备为所述第一树形网络拓扑中根节点所在的网络设备时,如果所述第一网络设备发生异常,则可将所述第一网络设备其下连接的子节点 所在的网络设备更新为所述第一树形网络拓扑中根节点所在的网络设备,即将第一网络设备下连接的子节点更新为第一树形网络拓扑的根节点,此时所述第一树形网络拓扑被分裂为两个单独的树形网络拓扑,具体在下文举例说明。First, when the first network device is a network device where a root node is located in the first tree network topology, if an abnormality occurs in the first network device, the first network device may be connected below it. The network device where the child node is located is updated to the network device where the root node in the first tree network topology is located, that is, the child node connected under the first network device is updated to the root node of the first tree network topology. The first tree network topology is split into two separate tree network topologies, which are specifically described below by way of example.
第二种,在所述第一网络设备为所述第一树形网络拓扑中中间节点所在的网络设备时,如果所述第一网络设备发生异常,则可将所述第一网络设备下连接的子节点所在的网络设备注册并添加到所述第一网络设备的父节点(即备用父节点)所在的网络设备上。Second, when the first network device is a network device where an intermediate node is located in the first tree network topology, if the first network device is abnormal, the first network device may be connected to the first network device. The network device where the child node of the is located is registered and added to the network device where the parent node of the first network device (that is, the standby parent node) is located.
第三种,在所述第一网络设备为所述第一树形网络拓扑中叶子节点所在的网络设备时,如果所述第一网络设备发生异常,则可将所述第一网络设备进行剪枝处理,以在所述第一树形网络拓扑中删除所述第一网络设备,即删除所述第一网络设备对应的叶子节点。Third, when the first network device is a network device where a leaf node is located in the first tree network topology, if the first network device is abnormal, the first network device may be clipped. Branch processing to delete the first network device in the first tree network topology, that is, delete a leaf node corresponding to the first network device.
举例来说,以所述第一树形网络拓扑为二叉树网络拓扑为例。如图8中,假设根节点所在的网络设备(RootSP)发生异常。子节点所在的网络设备A或B的检测模块检测到其父节点所在的网络设备(图示中的根节点所在网络设备RootSP)出现异常后,网络设备A或B可通知自身设备的链路模块进行切链。在A或B进行切链后,首先获取自身的备用父节点所在的网络设备。如果A和B找不到备用父节点所在的网络设备,将自动变更为树形网络拓扑的根节点,此时第一树形网络拓扑将分裂为两个独立的新的树形网络拓扑,这里分别是以根节点所在的网络设备为A和B的两个树形网络拓扑。这里的备用父节点是指节点的祖父节点,例如图示中O的备用父节点为C,即是节点所在的网络设备O的备用父节点所在的网络设备为C。For example, the first tree network topology is a binary tree network topology as an example. As shown in FIG. 8, it is assumed that the network device (RootSP) where the root node is located is abnormal. After the detection module of the network device A or B where the child node is located detects that the network device (the root device RootSP where the root node is located) of the parent node is abnormal, the network device A or B can notify the link module of its own device Cut the chain. After A or B performs the chain cut, first obtain the network device where its standby parent node is located. If A and B cannot find the network device where the standby parent node is located, it will automatically change to the root node of the tree network topology. At this time, the first tree network topology will be split into two independent new tree network topologies, here Two tree-shaped network topologies, with the network device where the root node is located as A and B, respectively. The standby parent node here refers to the grandparent node of the node. For example, the standby parent node of O in the figure is C, that is, the network device of the standby parent node of the network device O where the node is located is C.
又如图9中,假设叶子节点所在的网络设备L发生异常,停止上报自身的进度信息。如果L的父节点所在的网络设备G在预设时长内(如10s左右)仍然未收到L上报的进度信息,则会对L进行剪枝操作,以删除L。相应地,节点所在的网络设备E向B上报进度信息时,B经过对比发现少了L的进度信息,即L被删除了,此时可更新B设备自身的本地信息。相应地,B节点上报进度信息时,也不会存在L的进度信息。即是,树形网络拓扑中各节点所在的网络设备,可通过上报的进度信息来识别并获知某个叶子节点所在的网络设备发生了异常,被剪枝。As shown in FIG. 9, it is assumed that the network device L where the leaf node is located is abnormal and stops reporting its own progress information. If the network device G where L's parent node is located has not received the progress information reported by L within a preset time period (for example, about 10s), it will perform a pruning operation on L to delete L. Correspondingly, when the network device E where the node is located reports progress information to B, B finds out that L's progress information is missing after comparison, that is, L is deleted. At this time, the local information of the B device can be updated. Correspondingly, when node B reports progress information, there is no progress information of L. That is, the network equipment where each node is located in the tree network topology can identify and know that the network equipment where a certain leaf node is abnormal and is pruned by the reported progress information.
又如图10中,假设中间节点所在的网络设备C发生了异常。如果图示中节点所在的网络设备G和H检测到其父节点所在的网络设备C发生了异常,则G和H将进行切链,向自身的备用父节点所在的网络设备A发生注册请求,以将G和H注册和添加到A下。相应地,A接收到注册请求后,可识别到C发生了异常,将C进行删除。同时将G和H注册并挂载到A下,关于如何注册本发明实施例这里不做详述。As shown in FIG. 10, it is assumed that the network device C where the intermediate node is located is abnormal. If the network devices G and H where the node is located in the picture detect an abnormality in the network device C where their parent node is located, G and H will perform a chain cut to make a registration request to network device A where their standby parent node is located. To register and add G and H under A. Correspondingly, after receiving the registration request, A can recognize that C is abnormal, and delete C. At the same time, G and H are registered and mounted under A. How to register the embodiment of the present invention will not be described in detail here.
通过实施本发明实施例,当网络设备发生异常时可动态更新或调整局域网中相应的树形网络拓扑,从而有利于提高树形网络拓扑的稳定性和可靠性。进一步地,基于更新后的树形网络拓扑来实现OS镜像的下载和分发,有效保证了树形网络拓扑中各个网络设备能够成功安装OS,从而提升了OS批量安装的可靠性以及成功率。By implementing the embodiments of the present invention, when an abnormality occurs in a network device, the corresponding tree network topology in the local area network can be dynamically updated or adjusted, thereby helping to improve the stability and reliability of the tree network topology. Further, downloading and distributing the OS image based on the updated tree network topology effectively guarantees that each network device in the tree network topology can successfully install the OS, thereby improving the reliability and success rate of batch OS installation.
在一种可能的实施方式中,第一网络设备确定局域网中的每个树形网络拓扑后,可将每个树形网络拓扑涉及的各网络设备添加到自身树形网络拓扑中。下面以所述第一树形网络拓扑为所述局域网的一个独立的树形网络拓扑为例详细阐述如何将局域网 中各个网络设备添加到第一树形网络拓扑中。假设第一树形网络拓扑的根节点所在的网络设备为所述第一网络设备。在网络设备添加过程中,具体存在以下几种实施方式。In a possible implementation manner, after the first network device determines each tree network topology in the local area network, each network device involved in each tree network topology may be added to its own tree network topology. The following takes the first tree network topology as an independent tree network topology of the local area network as an example to explain in detail how to add each network device in the local area network to the first tree network topology. It is assumed that the network device where the root node of the first tree network topology is located is the first network device. In the process of adding a network device, the following specific implementations exist.
在一种可能的实施方式中,局域网中网络设备部署的SP的版本和第一网络设备部署的SP的版本相同。其中,局域网中每个网络设备均预先部署有SP,关于SP的部署可参见图2所述实施例中的相关阐述,这里不再赘述。第一网络设备作为根节点所在的网络设备,在S104中可接收到第一树形网络拓扑中每个节点所在网络设备发的组播消息,该组播消息中携带有网络设备的属性信息,该属性信息中包括有SP的版本。In a possible implementation manner, the version of the SP deployed by the network device in the local area network is the same as the version of the SP deployed by the first network device. Wherein, each network device in the local area network is pre-deployed with an SP. For the deployment of the SP, reference may be made to the relevant description in the embodiment shown in FIG. The first network device is the network device where the root node is located. In S104, a multicast message sent by the network device where each node is located in the first tree network topology may be received. The multicast message carries the attribute information of the network device. The attribute information includes the version of the SP.
可选地,当第一网络设备不为第一树形网络拓扑中根节点所在的网络设备时,第一网络设备确定第一树形网络拓扑为局域网中一个独立的树形网络拓扑后(S104后),第一网络设备可向所述第一树形网络拓扑根节点所在的网络设备(根节点网络设备)发送通知消息,该通知消息携带所述第一树形网络拓扑,当然包括第一树形网络拓扑中每个网络设备的信息,如网络设备的属性信息,SP的版本等等。相应地,第一树形网络拓扑中的根节点网络设备同样可知道该第一树形网络拓扑中每个网络设备部署的SP的版本。Optionally, when the first network device is not the network device where the root node is located in the first tree network topology, the first network device determines that the first tree network topology is an independent tree network topology in the local area network (after S104) ), The first network device may send a notification message to a network device (root node network device) where the root node of the first tree network topology is located, where the notification message carries the first tree network topology, and of course includes the first tree Information of each network device in the network topology, such as the attribute information of the network device, the version of the SP, and so on. Accordingly, the root node network device in the first tree network topology can also know the version of the SP deployed by each network device in the first tree network topology.
相应地,对于局域网中存在有一些网络设备,这些网络设备中部署SP的版本和所述第一网络设备中部署SP的版本相同时,第一网络设备可直接向这些网络设备发送添加请求,以将这些网络设备添加并构建到所述第一树形网络拓扑中。下面以第三网络设备为例进行相关内容的阐述。Correspondingly, for some network devices in the local area network, when the version of the SP deployed in these network devices is the same as the version of the SP deployed in the first network device, the first network device may directly send an add request to these network devices to These network devices are added and built into the first tree network topology. The following uses the third network device as an example to explain related content.
所述第一网络设备向第三网络设备发送添加请求,所述添加请求用于请求将所述第三网络设备添加到所述第三网络设备的父节点所在的网络设备下。所述添加请求携带所述第三网络设备的父节点(即所述第三网络设备的父节点所在的网络设备),具体可携带该父节点所在网络设备的相关信息(如设备标识、设备名称等)。其中,所述第三网络设备为与所述第一网络设备部署有具有相同SP版本的SP的网络设备。The first network device sends an add request to a third network device, where the add request is used to request that the third network device be added to a network device where a parent node of the third network device is located. The adding request carries a parent node of the third network device (that is, a network device in which the parent node of the third network device is located), and specifically may carry related information (such as a device identifier, a device name) of a network device in which the parent node is located. Wait). The third network device is a network device in which an SP having the same SP version is deployed as the first network device.
相应地,所述第三网络设备接收所述添加请求,解析所述添加请求,向所述第三网络设备的父节点所在的网络设备发送注册请求,所述注册请求用于请求将所述第三网络设备注册到所述第三网络设备的父节点所在的网络设备。所述第三网络设备的父节点所在的网络设备接收所述注册请求,将所述第三网络设备注册到所述第三网络设备的父节点所在的网络设备下。进一步地,所述第三网络设备的父节点所在的网络设备还可向所述第三网络设备发送注册响应,所述注册响应用于通知所述第三网络设备是否成功注册到所述第三网络设备的父节点所在的网络设备下。Accordingly, the third network device receives the add request, parses the add request, and sends a registration request to a network device where a parent node of the third network device is located, where the registration request is used to request that the third network device Three network devices are registered to a network device where a parent node of the third network device is located. The network device where the parent node of the third network device is located receives the registration request, and registers the third network device to the network device where the parent node of the third network device is located. Further, the network device where the parent node of the third network device is located may also send a registration response to the third network device, where the registration response is used to notify whether the third network device is successfully registered to the third network device. Under the network device where the parent node of the network device is located.
可选地,所述第三网络设备接收所述注册响应后,如果所述注册响应用于通知所述第三网络设备已注册到所述第三网络设备的父节点所在的网络设备下,则所述第三网络设备可关闭自身的组播功能,以关闭或停止向所述局域网中的其他网络设备发送组播消息。Optionally, after the third network device receives the registration response, if the registration response is used to notify the third network device that the third network device has been registered with the network device where the parent node of the third network device is located, The third network device may disable its own multicast function to disable or stop sending multicast messages to other network devices in the local area network.
在注册过程中,所述注册请求可携带有所述第三网络设备的父节点所在的网络设备和/或所述第一网络设备(即第一树形网络拓扑中根节点所在的网络设备)。相应地,所述第三网络设备的父节点所在的网络设备接收所述注册请求后,可解析所述注册请求,并验证所述注册请求携带的信息是否和自身设备中的预存信息匹配。例如将 所述注册请求中携带的第三网络设备的父节点所在的网络设备和自身设备进行匹配,或者将所述注册请求中携带的第一网络设备和自身设备中预存的根节点所在的网络设备进行匹配等。During the registration process, the registration request may carry the network device where the parent node of the third network device is located and / or the first network device (that is, the network device where the root node is located in the first tree network topology). Correspondingly, after receiving the registration request, the network device where the parent node of the third network device is located can parse the registration request and verify whether the information carried by the registration request matches the pre-stored information in its own device. For example, matching the network device of the parent node of the third network device carried in the registration request with its own device, or matching the network of the first network device carried in the registration request with the pre-stored root node in its own device Devices, etc.
如果匹配成功,则将所述第三网络设备成功注册到所述第三网络设备的父节点所在的网络设备下。如果匹配失败,则向所述第三网络设备发送注册响应消息,用于通知所述第三网络设备不能注册到所述第三网络设备的父节点所在的网络设备下。If the matching is successful, the third network device is successfully registered under the network device where the parent node of the third network device is located. If the matching fails, a registration response message is sent to the third network device to notify the third network device that it cannot register to the network device where the parent node of the third network device is located.
值得说明的是,局域网中网络设备关闭自身的组播功能,具体存在以下两种情况。一种情况,当构建树形网络拓扑的网络设备向局域网中其他网络设备发送组播消息的次数到达第二阈值时,该网络设备可主动关闭自身的组播功能,停止向局域网中其他网络设备发送组播消息。另一种情况,当局域网中非构建树形网络拓扑的网络设备接收到其父节点所在的网络设备发送的通知消息(具体可为注册响应),且该网络节点未加入其他树形网络拓扑时,该网络设备停止或关闭自身组播功能。可选地,该网络设备还可以向其父节点所在网络设备发送通信消息的响应消息,此时,父节点所在网路设备将该网络设备添加至其树形网络拓扑中。其中,父节点所在网路设备将该网络设备添加至其树形网络拓扑,可以理解为是父节点所在网络设备利用数据库或指定文件或其他形式,记录该网络设备在树形网络拓扑结构的位置。It is worth noting that the network device in the local area network has its own multicast function turned off. The following two situations exist. In one case, when the number of times that a network device constructing a tree-like network topology sends multicast messages to other network devices in the LAN reaches a second threshold, the network device may actively turn off its multicast function and stop sending to other network devices in the LAN. Send a multicast message. In another case, when a network device that does not build a tree-like network topology in the local area network receives a notification message (specifically, a registration response) sent by the network device where its parent node is located, and the network node does not join another tree-like network topology , The network device stops or disables its own multicast function. Optionally, the network device may also send a response message of the communication message to the network device where the parent node is located. At this time, the network device where the parent node is located adds the network device to its tree network topology. The network device where the parent node is located adds the network device to its tree network topology. It can be understood that the network device where the parent node is located uses a database or a specified file or other form to record the position of the network device in the tree network topology structure. .
在另一种可能的实施方式中,局域网中网络设备部署的SP的版本和第一网络设备部署的SP的版本不相同。In another possible implementation manner, the version of the SP deployed by the network device in the local area network is different from the version of the SP deployed by the first network device.
对于局域网中存在有一些网络设备,这些网络设备中部署SP的版本和所述第一网络设备中部署SP的版本不相同。这种情况下,第一网络设备可直接向这些网络设备发送更新请求,以将这些网络设备中部署的SP的版本更新为所述第一网络设备中部署SP的版本。进而,后续在向更新后的这些网络设备发送添加请求,以将这些网络设备添加并构建到所述第一树形网络拓扑中。下面以第四网络设备如何更新SP版本为例进行相关内容的阐述。For some network devices in the local area network, the version of the SP deployed in these network devices is different from the version of the SP deployed in the first network device. In this case, the first network device may directly send an update request to these network devices to update the version of the SP deployed in these network devices to the version of the SP deployed in the first network device. Further, subsequent adding requests are sent to the updated network devices to add and build the network devices into the first tree network topology. The following uses the fourth network device to update the SP version as an example for explanation.
所述第一网络设备向第四网络设备发送更新请求,所述更新请求用于请求将所述第四网络设备中的SP版本更新为所述第一网络设备中的SP版本,即将第四网络设备中部署的SP的版本更新为所述第一网络设备中部署的SP的版本。相应地,所述第四网络设备接收所述更新请求,确定自身设备中部署的SP是否已更新过版本。在所述第四网络设备未更新SP的版本的情况下,响应所述更新请求,将所述第四网络设备中SP的版本更新为所述第一网络设备中SP的版本。The first network device sends an update request to a fourth network device, where the update request is used to request that the SP version in the fourth network device be updated to the SP version in the first network device, that is, the fourth network device. The version of the SP deployed in the device is updated to the version of the SP deployed in the first network device. Correspondingly, the fourth network device receives the update request and determines whether the SP deployed in the device has been updated. When the version of the SP is not updated by the fourth network device, the version of the SP in the fourth network device is updated to the version of the SP in the first network device in response to the update request.
在另一种可能的实施方式中,当局域网中新增进入网络设备(简称新增网络设备)后,该新增网络设备运行后,可向局域网中的其他网络设备发送组播消息。相应地,局域网中每个树形网络拓扑中根节点所在的网络设备可接收该新增网络设备发的组播消息,即检测到局域网中进入了新增网络设备。进而根据该新增网络设备发的组播消息,确定该新增网络设备中部署的SP的版本是否和树形网络拓扑中根节点所在的网络设备部署的SP的版本相同。In another possible implementation manner, after a new network device is added to the local area network (referred to as a new network device), after the new network device is running, it can send multicast messages to other network devices in the local area network. Correspondingly, the network device where the root node is located in each tree network topology in the local area network can receive the multicast message sent by the newly added network device, that is, it is detected that the newly added network device has entered the local area network. Furthermore, it is determined whether the version of the SP deployed in the new network device is the same as the version of the SP deployed in the network device where the root node is located in the tree network topology according to the multicast message sent by the new network device.
如果相同,则可向该新增网络设备发送添加请求,以将该新增网络设备添加到该树形网络拓扑中。如果不相同,则向该新增网络设备发送更新请求,以将该新增网络设备的SP的版本更新为该树形网络拓扑中根节点所在的网络设备中部署的SP的版 本。If they are the same, an add request may be sent to the newly added network device to add the newly added network device to the tree network topology. If they are not the same, an update request is sent to the newly added network device to update the version of the SP of the newly added network device to the version of the SP deployed in the network device where the root node in the tree network topology is located.
可选地,当局域网中存在至少两个树形网络拓扑(具体可包括第一树形网络设备和第二树形网络拓扑)时,对于新增网络设备而言,新增网络设备可根据接收注册请求的时间先后顺序,优先添加到先接收到注册请求的树形网络拓扑中。例如,第一树形网络拓扑中根节点所在的网络设备(第一网络设备)优先于第二树形网络拓扑中根节点所在的网络设备向新增网络设备发送注册请求,相应地新增网络设备接收到第一网络设备发的注册请求后,根据该注册请求将新增网络设备添加或挂载到第一树形网络拓扑中。Optionally, when there are at least two tree network topologies in the local area network (which may specifically include a first tree network device and a second tree network topology), for a newly added network device, the newly added network device may be The chronological order of registration requests is added first to the tree network topology that receives the registration request first. For example, the network device where the root node is located in the first tree network topology (the first network device) takes precedence over the network device where the root node is located in the second tree network topology. After receiving the registration request sent by the first network device, the new network device is added or mounted to the first tree network topology according to the registration request.
在另一种可能的实施方式中,局域网中存在至少两个树形网络拓扑,具体可包括第一树形网络拓扑和第二树形网络拓扑。第一树形网络拓扑和第二树形网络拓扑中包括至少一个相同的网络设备。对于这些相同的网络设备而言,可根据接收树形网络拓扑根节点所在的网络设备发送注册请求的时间先后顺序,优先将自身添加并注册到发送注册请求时间较先的树形网络设备中。例如,第一树形网络拓扑和第二树形网络拓扑均包括网络设备A,在树形网络拓扑添加网络设备过程中,网络设备A优先接收到第一树形网络拓扑根节点所在的网络设备(第一网络设备)发送的注册请求。相应地,网络设备A根据该注册请求可将自身注册并添加到第一树形网络拓扑中。In another possible implementation manner, at least two tree network topologies exist in the local area network, and specifically may include a first tree network topology and a second tree network topology. The first tree network topology and the second tree network topology include at least one identical network device. For these same network devices, according to the chronological order of the network device where the root node of the tree network topology receives the registration request, it is preferred to add and register itself to the tree network device with the earlier time of sending the registration request. For example, the first tree network topology and the second tree network topology both include network device A. During the process of adding a network device to the tree network topology, the network device A preferentially receives the network device where the root node of the first tree network topology is located. (First network device) registration request sent. Accordingly, the network device A can register and add itself to the first tree network topology according to the registration request.
在一种可能的实现方式,本发明实施例还提出基于树形网络拓扑的消息上报机制。具体的,所述树形网络拓扑中包括根节点、叶子节点以及中间节点。根节点所在的网络设备接收叶子节点以及中间节点各自所在网络设备上报的进度信息,所述进度信息用于指示该节点所在网络设备进行业务处理时的进度,例如当前正进行数据收发等;或者,可用于指示该节点所在网络设备在所述树形网络拓扑中的部署进度,例如已添加到该树形网络拓扑中等。相应地,叶子节点所在网络设备可实时或周期性地上报自身的进度信息。中间节点所在的网络设备也可周期性将自身设备以及其下连接的子节点所在网络设备的进度信息进行上报。可选地,当中间节点所在网络设备未到达预设时间时,中间节点所在网络设备接收到其他节点所在网络设备上报的进度信息时,所述中间节点所在的网络设备强制性上报自身以及其他节点所在网络设备的进度信息。其中,所述预设时间为所述中间节点所在的网络设备上报自身进度信息的时间。In a possible implementation manner, an embodiment of the present invention further proposes a message reporting mechanism based on a tree network topology. Specifically, the tree network topology includes a root node, a leaf node, and an intermediate node. The network device where the root node is located receives the progress information reported by the leaf node and the network device where the intermediate node is located, where the progress information is used to indicate the progress of the network device where the node is located during business processing, such as data transmission and reception; or It can be used to indicate the deployment progress of the network device where the node is located in the tree network topology, for example, it has been added to the tree network topology. Correspondingly, the network device where the leaf node is located can report its own progress information in real time or periodically. The network device where the intermediate node is located may also periodically report the progress information of the network device where the own device and its connected child nodes are located. Optionally, when the network device where the intermediate node is located does not reach the preset time, when the network device where the intermediate node is located receives the progress information reported by the network device where other nodes are located, the network device where the intermediate node is located reports itself and other nodes forcibly. Progress information of the network device. The preset time is a time when the network device where the intermediate node is located reports its own progress information.
举例来说,如图11示出一种二叉树网络拓扑的结构示意图。在该二叉树网络拓扑中,每个节点所在的网络设备可实时或周期性地向父节点所在网络设备上报自身的进度信息。如图6,以叶子节点O为例,其可周期性(如2s)地向其父节点所在的网络设备G上报自身的进度信息。相应地,G可根据在预设时长内是否接收到O上报的进度信息,来确定O是否发生/出现了异常。For example, FIG. 11 shows a schematic structural diagram of a binary tree network topology. In the binary tree network topology, the network device where each node is located can report its progress information to the network device where the parent node is located in real time or periodically. As shown in FIG. 6, taking leaf node O as an example, it can periodically (for example, 2s) report its progress information to the network device G where its parent node is located. Correspondingly, G can determine whether an abnormality has occurred / occurred in O according to whether the progress information reported by O is received within a preset time period.
对于中间节点所在的网络设备A而言,其周期性上报进度信息的时间间隔为2s。假设在时间12:23:08,A向根节点所在的网络设备RootSP上报自身以及子节点所在网络设备C和D各自的进度信息。12:23:09时,节点C和D各自所在网络设备均又向A上报了其下子节点所在网络设备的进度信息。此时A接收到节点C和D上报的进度信息后,结合自身的进度信息,立即上报给RootSP。同时更新定时器的计时,下次上报进度信息的时间点为12:23:11。For network device A where the intermediate node is located, the time interval for periodically reporting progress information is 2s. It is assumed that at time 12:23:08, A reports the progress information of itself and the network devices C and D where the child nodes are located to the network device RootSP where the root node is located. At 12:23:09, the network equipments of nodes C and D each reported to A the progress information of the network equipments of their next child nodes. At this time, A receives the progress information reported by nodes C and D, and immediately reports it to RootSP in combination with its own progress information. At the same time, the timer is updated. The next time the progress information is reported is 12:23:11.
通过实施本发明实施例,可将大批量网络设备按局域网划分,每个局域网中的 批量网络设备可通过发组播消息来相互发现,并构建相应地树形网络拓扑。同时,也会动态调整树形网络拓扑,以保证树形网名拓扑中每个网络设备都正常运行,解决了由于树形网络拓扑不稳定或不可靠所带来的OS镜像无法传输以及OS无法部署等问题,从而提升了树形网络拓扑的稳定性和可靠性,有效保证网络设备的OS成功安装。By implementing the embodiments of the present invention, a large number of network devices can be divided into local area networks, and the batch network devices in each local area network can discover each other by sending multicast messages, and construct a corresponding tree network topology. At the same time, the tree network topology will be dynamically adjusted to ensure that each network device in the tree network name topology is operating normally, which solves the problem that the OS image cannot be transmitted and the OS cannot be caused by the unstable or unreliable tree network topology. Issues such as deployment, thereby improving the stability and reliability of the tree network topology and effectively ensuring the successful installation of the OS of the network equipment.
上文中结合图1至图11,详细描述了根据本发明实施例所提供的OS批量安装的方法,下面将结合图12和图13,描述根据本发明实施例所提供的OS批量安装的装置、设备和通信系统。The method for bulk OS installation according to the embodiment of the present invention is described in detail above with reference to FIGS. 1 to 11. The apparatus for bulk OS installation according to the embodiment of the present invention will be described below with reference to FIGS. 12 and 13. Equipment and communication systems.
请参见图12,是本发明实施例提供的一种网络设备的结构示意图。如图12所示,本发明实施例提供的网络设备120(如第一网络设备)可包括通信模块1201以及处理模块1202。可选地,还可包括存储模块1203。所述存储模块用于存储所述网络设备120的的程序代码和数据。其中,Please refer to FIG. 12, which is a schematic structural diagram of a network device according to an embodiment of the present invention. As shown in FIG. 12, the network device 120 (such as the first network device) provided in the embodiment of the present invention may include a communication module 1201 and a processing module 1202. Optionally, a storage module 1203 may be further included. The storage module is configured to store program code and data of the network device 120. among them,
所述通信模块1201,用于向所述局域网中其他网络设备发送组播消息,The communication module 1201 is configured to send a multicast message to other network devices in the local area network,
所述处理模块1202,用于根据n个网络设备发送的组播消息,确定由所述n个网络设备构成的第一树形网络拓扑,其中,n小于或等于m,所述组播消息包括用于描述所述网络设备的属性的信息;The processing module 1202 is configured to determine a first tree network topology composed of the n network devices according to a multicast message sent by the n network devices, where n is less than or equal to m, and the multicast message includes Information for describing attributes of the network device;
所述处理模块1202,还用于当所述通信模块向所述局域网中其他网络设备发送组播消息的次数满足第一阈值时,确定所述局域网的至少一个树形网络拓扑中每个树形网络拓扑的根节点所在的网络设备,以便于所述每个树形网络拓扑的根节点所在网络设备获取OS镜像,并发送给所述每个树形网络拓扑中各个网络设备进行OS安装。The processing module 1202 is further configured to determine each tree shape in at least one tree network topology of the local area network when the number of times that the communication module sends multicast messages to other network devices in the local area network meets a first threshold. The network device where the root node of the network topology is located, so that the network device where the root node of each tree network topology is located obtains an OS image and sends it to each network device in each tree network topology for OS installation.
可选地,所述通信模块1201还用于当所述局域网中存在包括所述第一树形网络拓扑以及第二树形网络拓扑在内的至少两个树形网络拓扑,且所述第一树形网络拓扑和所述第二树形网络拓扑包括不同的网络设备时,接收第二网络设备发送的第一单播消息,所述第一单播消息包括所述第二树形网络拓扑,所述第二树形网络拓扑为所述第二网络设备构成的,且所述第二网络设备为所述m个网络设备中除了所述第一网络设备外另一已运行的网络设备;Optionally, the communication module 1201 is further configured to: when at least two tree network topologies including the first tree network topology and the second tree network topology exist in the local area network, and the first Receiving a first unicast message sent by a second network device when the tree network topology and the second tree network topology include different network devices, and the first unicast message includes the second tree network topology, The second tree-shaped network topology is constituted by the second network device, and the second network device is another network device that is running except the first network device among the m network devices;
所述处理模块1202,具体用于确定所述第一树形网络拓扑的根节点所在的网络设备以及所述第二树形网络拓扑的根节点所在的网络设备分别为所述局域网的两个树形网络拓扑中各自根节点所在的网络设备。The processing module 1202 is specifically configured to determine that a network device where a root node of the first tree network topology is located and a network device where a root node of the second tree network topology is respectively two trees of the local area network. The network device where the respective root node is located in the network topology.
可选地,所述通信模块1201还用于当所述局域网中存在包括所述第一树形网络拓扑以及第二树形网络拓扑在内的至少两个树形网络拓扑,且所述第一树形网络拓扑和所述第二树形网络拓扑包括至少一个相同的网络设备时,接收第二网络设备发送的第一单播消息,所述第一单播消息包括所述第二树形网络拓扑,所述第二树形网络拓扑为所述第二网络设备构成的,且所述第二网络设备为所述m个网络设备中除了所述第一网络设备外另一已运行的网络设备;Optionally, the communication module 1201 is further configured to: when at least two tree network topologies including the first tree network topology and the second tree network topology exist in the local area network, and the first When the tree network topology and the second tree network topology include at least one identical network device, a first unicast message sent by a second network device is received, and the first unicast message includes the second tree network Topology, the second tree-shaped network topology is formed by the second network device, and the second network device is another network device that is running in addition to the first network device among the m network devices ;
所述处理模块1202,具体用于合并所述第一树形网络拓扑和所述第二树形网络拓扑中重复网络设备生成第三树形网络拓扑,所述第三树形网络拓扑的根节点所在的网络设备为所述局域网的树形网络拓扑中根节点所在的网络设备。The processing module 1202 is specifically configured to merge repeated network devices in the first tree network topology and the second tree network topology to generate a third tree network topology, and a root node of the third tree network topology. The located network device is the network device where the root node is located in the tree network topology of the local area network.
可选地,所述处理模块1202具体用于当所述局域网中仅存在所述第一树形网络拓 扑时,确定所述第一树形网络拓扑的根节点所在的网络设备为所述局域网的树形网络拓扑中根节点所在的网络设备。Optionally, the processing module 1202 is specifically configured to determine that, when only the first tree network topology exists in the local area network, a network device where a root node of the first tree network topology is located is of the local area network. The network device where the root node is located in the tree network topology.
可选地,所述处理模块1202具体用于按照预设规则,将所述n个网络设备发送的组播消息进行排序,以获得由所述n个网络设备构成的第一树形网络拓扑。Optionally, the processing module 1202 is specifically configured to sort the multicast messages sent by the n network devices according to a preset rule to obtain a first tree network topology formed by the n network devices.
可选地,所述处理模块1202还用于当所述第一树形网络拓扑中的所述第一网络设备发生异常时,对所述第一树形网络拓扑进行更新。Optionally, the processing module 1202 is further configured to update the first tree network topology when the first network device in the first tree network topology is abnormal.
可选地,所述处理模块1202具体用于当所述第一网络设备为所述第一树形网络拓扑中根节点所在的网络设备时,将所述第一网络设备下连接的子节点所在的网络设备更新为所述第一树形网络拓扑中根节点所在的网络设备;Optionally, the processing module 1202 is specifically configured to, when the first network device is a network device where a root node in the first tree network topology is located, locate a sub-node connected to the first network device. Updating the network device to the network device where the root node is located in the first tree network topology;
所述处理模块1202,具体用于当所述第一网络设备为所述第一树形网络拓扑中中间节点所在的网络设备时,将所述第一网络设备下连接的子节点所在的网络设备注册到所述第一网络设备对应在所述第一树形网络拓扑中的父节点所在的网络设备下;The processing module 1202 is specifically configured to: when the first network device is a network device where an intermediate node in the first tree network topology is located, a network device where a child node connected to the first network device is located Registering to the first network device under a network device corresponding to a parent node in the first tree network topology;
所述处理模块1202,具体用于当所述第一网络设备为所述第一树形网络拓扑中叶子节点所在的网络设备时,所述第一网络设备将进行剪枝处理,以在所述第一树形网络拓扑中删除所述第一网络设备对应的叶子节点。The processing module 1202 is specifically configured to: when the first network device is a network device where a leaf node in the first tree network topology is located, the first network device will perform a pruning process to A leaf node corresponding to the first network device is deleted from the first tree network topology.
需要说明的,图12仅仅是本发明实施例实施例的一种可能的实现方式,实际应用中,网络设备还可以包括更多或更少的部件,这里不作限制。关于本发明实施例中未示出或未描述的部分,可参见前述图3所述方法实施例中的相关介绍,这里不再赘述。It should be noted that FIG. 12 is only one possible implementation manner of this embodiment of the present invention. In actual applications, the network device may further include more or fewer components, which is not limited herein. For parts that are not shown or described in the embodiment of the present invention, reference may be made to the related description in the method embodiment described in FIG. 3, and details are not described herein again.
根据本发明实施例的网络设备120可对应于执行本发明实施例中描述的方法,并且网络设备120中的各个单元的上述和其它操作和/或功能分别为了实现图3中的各个方法的相应流程,为了简洁,在此不再赘述。The network device 120 according to the embodiment of the present invention may correspond to performing the method described in the embodiment of the present invention, and the above and other operations and / or functions of each unit in the network device 120 are respectively implemented to implement the corresponding method in FIG. 3. The process is not repeated here for brevity.
请参见图13,是本发明实施例提供的又一种网络设备的结构示意图。如图13所示,本发明实施例提供的网络设备1300(例如第一网络设备)包括一个或多个处理器1301、通信接口1302和存储器1303,处理器1301、通信接口1302和存储器1303可通过总线或者其它方式连接,本发明实施例以通过总线1304连接为例。其中:Please refer to FIG. 13, which is a schematic structural diagram of still another network device according to an embodiment of the present invention. As shown in FIG. 13, a network device 1300 (for example, a first network device) provided by an embodiment of the present invention includes one or more processors 1301, a communication interface 1302, and a memory 1303. The processor 1301, the communication interface 1302, and the memory 1303 can be accessed through It is connected in a bus or other manner. In the embodiment of the present invention, the connection is made through a bus 1304 as an example. among them:
处理器1301可以由一个或者多个通用处理器构成,例如中央处理器(Central Processing Unit,CPU)。处理器1301可用于运行相关的程序代码中处理模块的程序。也就是说,处理器1301执行程序代码可以实现处理模块。其中,关于所述处理模块具体可参见前述实施例中的相关阐述。The processor 1301 may be composed of one or more general-purpose processors, such as a central processing unit (Central Processing Unit). The processor 1301 may be configured to run a program of a processing module in related program code. In other words, the processor 1301 executes the program code to implement a processing module. For details about the processing module, refer to related descriptions in the foregoing embodiments.
通信接口1302可以为有线接口(例如以太网接口)或无线接口(例如蜂窝网络接口或使用无线局域网接口),用于与其他模块/网络设备进行通信。例如,本发明实施例实施例中通信接口1302具体可用于接收局域网中其他网络设备发送的组播消息等。The communication interface 1302 may be a wired interface (such as an Ethernet interface) or a wireless interface (such as a cellular network interface or using a wireless local area network interface) for communicating with other modules / network devices. For example, the communication interface 1302 in this embodiment of the present invention may be specifically used to receive a multicast message and the like sent by other network devices in a local area network.
存储器1303可以包括易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM);存储器也可以包括非易失性存储器(non-volatile memory),例如只读存储器(read-only memory,ROM)、快闪存储器(flash memory)、硬盘(hard disk drive,HDD)或固态硬盘(solid state drive,SSD);存储器1303还可以包括上述种类的存储器的组合。存储器1303可用于存储一组程序代码,以便于处理器1301调用存储器1303中存储的程序代码以实现本发明实施例中涉及的所述处理 模块的相关功能。The memory 1303 may include volatile memory (for example, random access memory (RAM); the memory may also include non-volatile memory (for example, read-only memory) memory (ROM), flash memory (flash memory), hard disk (HDD), or solid state drive (SSD); the memory 1303 may also include a combination of the above types of memories. The memory 1303 may be configured to store a set of program code, so that the processor 1301 calls the program code stored in the memory 1303 to implement related functions of the processing module involved in the embodiment of the present invention.
需要说明的,图13仅仅是本发明实施例实施例的一种可能的实现方式,实际应用中,网络设备还可以包括更多或更少的部件,这里不作限制。It should be noted that FIG. 13 is only one possible implementation manner of this embodiment of the present invention. In actual applications, the network device may further include more or fewer components, which is not limited herein.
应理解,根据本发明实施例的网络设备1300可对应于本发明实施例中的OS批量安装的网络设备1300,并可以对应于执行根据本发明实施例图3所示的方法中第一网络设备,并且网络设备1300中的各个模块的上述和其它操作和/或功能分别为了实现图3中的各个方法的相应流程,为了简洁,在此不再赘述。It should be understood that the network device 1300 according to the embodiment of the present invention may correspond to the network device 1300 for batch installation of OS in the embodiment of the present invention, and may correspond to the first network device in the method shown in FIG. 3 according to the embodiment of the present invention. In addition, the above and other operations and / or functions of each module in the network device 1300 are to implement the corresponding processes of the methods in FIG. 3, respectively, and for the sake of brevity, they are not repeated here.
本发明实施例提供的一种通信系统的结构示意图。如图2所示,本发明实施例提供的通信系统包括一个或多个局域网(图示以一个局域网为例示出)。每个局域网中包括一个或多个网络设备(图示以m个网络设备为例,m为正整数)。每个网络设备具体可为如图12或图13所述的网络设备,这里不再赘述。可选地,所述通信系统还包括管理设备以及镜像存储设备。其中,A schematic structural diagram of a communication system provided by an embodiment of the present invention. As shown in FIG. 2, the communication system provided by the embodiment of the present invention includes one or more local area networks (one LAN is taken as an example in the figure). Each local area network includes one or more network devices (the illustration uses m network devices as an example, where m is a positive integer). Each network device may specifically be a network device as described in FIG. 12 or FIG. 13, and details are not described herein again. Optionally, the communication system further includes a management device and a mirror storage device. among them,
所述管理设备,用于管理所述一个或多个网络设备;The management device is configured to manage the one or more network devices;
所述镜像存储设备,用于存储操作系统OS镜像,以供网络设备安装所述OS镜像对应的OS。The image storage device is configured to store an operating system OS image for a network device to install an OS corresponding to the OS image.
关于本发明实施例实施例中未示出或未描述的内容,可参见前述图2-图13所述实施例中的相关阐述,这里不再赘述。Regarding the content that is not shown or described in the embodiments of the present invention, reference may be made to related descriptions in the foregoing embodiments shown in FIGS. 2 to 13, and details are not described herein again.
上述实施例,可以全部或部分地通过软件、硬件、固件或其他任意组合来实现。当使用软件实现时,上述实施例可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载或执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以为通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集合的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质。半导体介质可以是固态硬盘(solid state drive,SSD)。The above embodiments may be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the processes or functions according to the embodiments of the present invention are wholly or partially generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be from a website site, a computer, a server, or a data center. Transmission via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server, a data center, and the like, including one or more sets of available media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium may be a solid state drive (SSD).
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。A person of ordinary skill in the art can understand that all or part of the processes in the method of the foregoing embodiment can be implemented by using a computer program to instruct related hardware. The program can be stored in a computer-readable storage medium. When executed, the processes of the embodiments of the methods described above may be included. The foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disc.

Claims (16)

  1. 一种操作系统OS批量安装方法,其特征在于,所述方法包括:A method for batch installation of an operating system OS, characterized in that the method includes:
    第一网络设备根据n个网络设备发送的组播消息,确定由所述n个网络设备构成的第一树形网络拓扑,其中,所述第一网络设备为局域网中m个网络设备中的任一已运行的网络设备,n小于或等于m,m和n均为正整数,所述组播消息包括用于描述所述网络设备的属性的信息;The first network device determines a first tree network topology formed by the n network devices according to a multicast message sent by the n network devices, where the first network device is any of m network devices in a local area network. A running network device, n is less than or equal to m, m and n are positive integers, and the multicast message includes information for describing attributes of the network device;
    当所述第一网络设备向所述局域网中其他网络设备发送组播消息的次数满足第一阈值时,确定所述局域网的至少一个树形网络拓扑中每个树形网络拓扑的根节点所在的网络设备,以便于所述每个树形网络拓扑的根节点所在网络设备获取OS镜像,并发送给所述每个树形网络拓扑中各个网络设备进行OS安装。When the number of times that the first network device sends a multicast message to other network devices in the local area network meets a first threshold, determining where a root node of each tree network topology in at least one tree network topology of the local area network is located A network device, so that the network device where the root node of each tree network topology is located obtains an OS image and sends it to each network device in each tree network topology for OS installation.
  2. 根据权利要求1所述的方法,其特征在于,所述确定所述局域网的至少一个树形网络拓扑中每个树形网络拓扑的根节点所在的网络设备包括:The method according to claim 1, wherein determining a network device where a root node of each tree network topology in at least one tree network topology of the local area network comprises:
    当所述局域网中存在包括所述第一树形网络拓扑以及第二树形网络拓扑在内的至少两个树形网络拓扑,且所述第一树形网络拓扑和所述第二树形网络拓扑包括不同的网络设备时,所述第一网络设备接收第二网络设备发送的第一单播消息,所述第一单播消息包括所述第二树形网络拓扑,所述第二树形网络拓扑为所述第二网络设备构成的,且所述第二网络设备为所述m个网络设备中除了所述第一网络设备外另一已运行的网络设备;When at least two tree network topologies including the first tree network topology and the second tree network topology exist in the local area network, and the first tree network topology and the second tree network When the topology includes different network devices, the first network device receives a first unicast message sent by a second network device, the first unicast message includes the second tree-shaped network topology, and the second tree-shaped The network topology is constituted by the second network device, and the second network device is another network device that runs in addition to the first network device among the m network devices;
    所述第一网络设备确定所述第一树形网络拓扑的根节点所在的网络设备以及所述第二树形网络拓扑的根节点所在的网络设备分别为所述局域网的两个树形网络拓扑中各自根节点所在的网络设备。Determining, by the first network device, a network device where a root node of the first tree network topology is located and a network device where a root node of the second tree network topology is respectively two tree network topologies of the local area network The network devices where the respective root nodes are located.
  3. 根据权利要求1所述的方法,其特征在于,所述确定所述局域网的至少一个树形网络拓扑中每个树形网络拓扑的根节点所在的网络设备包括:The method according to claim 1, wherein determining a network device where a root node of each tree network topology in at least one tree network topology of the local area network comprises:
    当所述局域网中存在包括所述第一树形网络拓扑以及第二树形网络拓扑在内的至少两个树形网络拓扑,且所述第一树形网络拓扑和所述第二树形网络拓扑包括至少一个相同的网络设备时,所述第一网络设备接收第二网络设备发送的第一单播消息,所述第一单播消息包括所述第二树形网络拓扑,所述第二树形网络拓扑为所述第二网络设备构成的,且所述第二网络设备为所述m个网络设备中除了所述第一网络设备外另一已运行的网络设备;When at least two tree network topologies including the first tree network topology and the second tree network topology exist in the local area network, and the first tree network topology and the second tree network When the topology includes at least one identical network device, the first network device receives a first unicast message sent by a second network device, the first unicast message includes the second tree network topology, and the second The tree network topology is constituted by the second network device, and the second network device is another network device that is running except the first network device among the m network devices;
    所述第一网络设备合并所述第一树形网络拓扑和所述第二树形网络拓扑中重复网络设备生成第三树形网络拓扑,所述第三树形网络拓扑的根节点所在的网络设备为所述局域网的树形网络拓扑中根节点所在的网络设备。The first network device merges repeated network devices in the first tree network topology and the second tree network topology to generate a third tree network topology, and a network where a root node of the third tree network topology is located. The device is a network device where the root node is located in the tree network topology of the local area network.
  4. 根据权利要求1所述的方法,其特征在于,所述确定所述局域网的至少一个树形网络拓扑中每个树形网络拓扑的根节点所在的网络设备包括:The method according to claim 1, wherein determining a network device where a root node of each tree network topology in at least one tree network topology of the local area network comprises:
    当所述局域网中仅存在所述第一树形网络拓扑时,所述第一网络设备确定所述第一树形网络拓扑的根节点所在的网络设备为所述局域网的树形网络拓扑中根节点所在 的网络设备。When only the first tree network topology exists in the local area network, the first network device determines that a network device where a root node of the first tree network topology is located is a root node in the tree network topology of the local area network The network device on which it is located.
  5. 根据权利要求1-4中任一项所述的方法,其特征在于,所述第一网络设备根据n个网络设备发送的组播消息,确定由所述n个网络设备构成的第一树形网络拓扑包括:The method according to any one of claims 1-4, wherein the first network device determines a first tree shape composed of the n network devices according to a multicast message sent by the n network devices. The network topology includes:
    所述第一网络设备按照预设规则,将所述n个网络设备发送的组播消息进行排序,以获得由所述n个网络设备构成的第一树形网络拓扑。The first network device sorts the multicast messages sent by the n network devices according to a preset rule to obtain a first tree network topology formed by the n network devices.
  6. 根据权利要求1-5中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-5, further comprising:
    当所述第一树形网络拓扑中的所述第一网络设备发生异常时,对所述第一树形网络拓扑进行更新。When the first network device in the first tree network topology is abnormal, the first tree network topology is updated.
  7. 根据权利要求6所述的方法,其特征在于,所述第一树形网络拓扑包括根节点、叶子节点以及子节点,所述对所述第一树形网络拓扑进行更新包括:The method according to claim 6, wherein the first tree network topology comprises a root node, a leaf node, and a child node, and the updating the first tree network topology comprises:
    当所述第一网络设备为所述第一树形网络拓扑中根节点所在的网络设备时,所述第一网络设备下连接的子节点所在的网络设备将更新为所述第一树形网络拓扑中根节点所在的网络设备;When the first network device is a network device where a root node is located in the first tree network topology, a network device where a child node connected under the first network device is located is updated to the first tree network topology The network device where the root node is located;
    当所述第一网络设备为所述第一树形网络拓扑中中间节点所在的网络设备时,所述第一网络设备下连接的子节点所在的网络设备将注册到所述第一网络设备对应在所述第一树形网络拓扑中的父节点所在的网络设备下;When the first network device is a network device where an intermediate node is located in the first tree network topology, a network device where a child node connected under the first network device is registered is corresponding to the first network device Under the network device where the parent node in the first tree network topology is located;
    当所述第一网络设备为所述第一树形网络拓扑中叶子节点所在的网络设备时,所述第一网络设备将进行剪枝处理,以在所述第一树形网络拓扑中删除所述第一网络设备对应的叶子节点。When the first network device is a network device where a leaf node in the first tree network topology is located, the first network device will perform a pruning process to delete all the nodes in the first tree network topology. The leaf node corresponding to the first network device is described.
  8. 一种操作系统OS批量安装的装置,其特征在于,所述装置包括局域网中m个网络设备中的任一已运行的第一网络设备,m为正整数,所述装置包括通信模块以及处理模块,其中,A device for batch installation of an operating system OS, characterized in that the device includes any first network device that is running in any of m network devices in a local area network, m is a positive integer, and the device includes a communication module and a processing module ,among them,
    所述通信模块,用于向所述局域网中其他网络设备发送组播消息;The communication module is configured to send a multicast message to other network devices in the local area network;
    所述处理模块,用于根据n个网络设备发送的组播消息,确定由所述n个网络设备构成的第一树形网络拓扑,其中,n小于或等于m,所述组播消息包括用于描述所述网络设备的属性的信息;The processing module is configured to determine a first tree network topology composed of the n network devices according to the multicast messages sent by the n network devices, where n is less than or equal to m, and the multicast message includes Information for describing attributes of the network device;
    所述处理模块,还用于当所述通信模块向所述局域网中其他网络设备发送组播消息的次数满足第一阈值时,确定所述局域网的至少一个树形网络拓扑中每个树形网络拓扑的根节点所在的网络设备,以便于所述每个树形网络拓扑的根节点所在网络设备获取OS镜像,并发送给所述每个树形网络拓扑中各个网络设备进行OS安装。The processing module is further configured to determine each tree network in at least one tree network topology of the local area network when the number of times that the communication module sends multicast messages to other network devices in the local area network meets a first threshold. The network device where the root node of the topology is located, so that the network device where the root node of each tree network topology is located obtains an OS image, and sends the OS image to each network device in each tree network topology for OS installation.
  9. 根据权利要求8所述的装置,其特征在于,The device according to claim 8, characterized in that:
    所述通信模块,还用于当所述局域网中存在包括所述第一树形网络拓扑以及第二树形网络拓扑在内的至少两个树形网络拓扑,且所述第一树形网络拓扑和所述第二树 形网络拓扑包括不同的网络设备时,接收第二网络设备发送的第一单播消息,所述第一单播消息包括所述第二树形网络拓扑,所述第二树形网络拓扑为所述第二网络设备构成的,且所述第二网络设备为所述m个网络设备中除了所述第一网络设备外另一已运行的网络设备;The communication module is further configured when at least two tree network topologies including the first tree network topology and the second tree network topology exist in the local area network, and the first tree network topology And when the second tree network topology includes a different network device, receiving a first unicast message sent by a second network device, the first unicast message includes the second tree network topology, and the second The tree network topology is constituted by the second network device, and the second network device is another network device that is running except the first network device among the m network devices;
    所述处理模块,具体用于确定所述第一树形网络拓扑的根节点所在的网络设备以及所述第二树形网络拓扑的根节点所在的网络设备分别为所述局域网的两个树形网络拓扑中各自根节点所在的网络设备。The processing module is specifically configured to determine that a network device where a root node of the first tree-shaped network topology is located and a network device where a root node of the second tree-shaped network topology is respectively two tree shapes of the local area network The network device where the respective root node is located in the network topology.
  10. 根据权利要求8所述的装置,其特征在于,The device according to claim 8, characterized in that:
    所述通信模块,还用于当所述局域网中存在包括所述第一树形网络拓扑以及第二树形网络拓扑在内的至少两个树形网络拓扑,且所述第一树形网络拓扑和所述第二树形网络拓扑包括至少一个相同的网络设备时,接收第二网络设备发送的第一单播消息,所述第一单播消息包括所述第二树形网络拓扑,所述第二树形网络拓扑为所述第二网络设备构成的,且所述第二网络设备为所述m个网络设备中除了所述第一网络设备外另一已运行的网络设备;The communication module is further configured when at least two tree network topologies including the first tree network topology and the second tree network topology exist in the local area network, and the first tree network topology And when the second tree-like network topology includes at least one same network device, receiving a first unicast message sent by a second network device, where the first unicast message includes the second tree-like network topology, the A second tree network topology is formed by the second network device, and the second network device is another network device that is already running among the m network devices except the first network device;
    所述处理模块,具体用于合并所述第一树形网络拓扑和所述第二树形网络拓扑中重复网络设备生成第三树形网络拓扑,所述第三树形网络拓扑的根节点所在的网络设备为所述局域网的树形网络拓扑中根节点所在的网络设备。The processing module is specifically configured to merge repeated network devices in the first tree network topology and the second tree network topology to generate a third tree network topology, where a root node of the third tree network topology is located The network device is the network device where the root node is located in the tree network topology of the local area network.
  11. 根据权利要求8所述的装置,其特征在于,The device according to claim 8, characterized in that:
    所述处理模块,具体用于当所述局域网中仅存在所述第一树形网络拓扑时,确定所述第一树形网络拓扑的根节点所在的网络设备为所述局域网的树形网络拓扑中根节点所在的网络设备。The processing module is specifically configured to determine, when only the first tree network topology exists in the local area network, determining that a network device where a root node of the first tree network topology is located is a tree network topology of the local area network. The network device where the root node is located.
  12. 根据权利要求8-11中任一项所述的装置,其特征在于,The device according to any one of claims 8-11, wherein:
    所述处理模块,具体用于按照预设规则,将所述n个网络设备发送的组播消息进行排序,以获得由所述n个网络设备构成的第一树形网络拓扑。The processing module is specifically configured to sort the multicast messages sent by the n network devices according to a preset rule to obtain a first tree network topology formed by the n network devices.
  13. 根据权利要求8-12中任一项所述的装置,其特征在于,The device according to any one of claims 8-12, wherein:
    所述处理模块,还用于当所述第一树形网络拓扑中的所述第一网络设备发生异常时,对所述第一树形网络拓扑进行更新。The processing module is further configured to update the first tree network topology when the first network device in the first tree network topology is abnormal.
  14. 根据权利要求13所述的装置,其特征在于,The device according to claim 13, wherein:
    所述处理模块,具体用于当所述第一网络设备为所述第一树形网络拓扑中根节点所在的网络设备时,将所述第一网络设备下连接的子节点所在的网络设备更新为所述第一树形网络拓扑中根节点所在的网络设备;The processing module is specifically configured to, when the first network device is a network device where a root node is located in the first tree network topology, update a network device where a child node connected under the first network device is located to A network device where a root node is located in the first tree network topology;
    所述处理模块,具体用于当所述第一网络设备为所述第一树形网络拓扑中中间节点所在的网络设备时,将所述第一网络设备下连接的子节点所在的网络设备注册到所述第一网络设备对应在所述第一树形网络拓扑中的父节点所在的网络设备下;The processing module is specifically configured to register a network device where a child node connected to the first network device is located when the first network device is a network device where an intermediate node is located in the first tree network topology. To the first network device corresponding to a network device where a parent node in the first tree network topology is located;
    所述处理模块,具体用于当所述第一网络设备为所述第一树形网络拓扑中叶子节点所在的网络设备时,所述第一网络设备将进行剪枝处理,以在所述第一树形网络拓扑中删除所述第一网络设备对应的叶子节点。The processing module is specifically configured to: when the first network device is a network device where a leaf node in the first tree network topology is located, the first network device will perform a pruning process to In a tree network topology, the leaf nodes corresponding to the first network device are deleted.
  15. 一种网络设备,其特征在于,所述网络设备为局域网中m个网络设备中的任一已运行的网络设备,m为正整数,所述网络设备包括处理器和存储器,所述存储器中用于存储计算机执行指令,所述网络设备运行时,所述处理器执行所述存储器中的计算机执行指令以利用所述网络设备中的硬件资源执行权利要求1至7中任一所述方法的操作步骤。A network device, characterized in that the network device is any network device that is already running among m network devices in a local area network, m is a positive integer, the network device includes a processor and a memory, and the memory is used for When the computer executes the instructions, the processor executes the computer executes the instructions in the memory to execute the operations of the method according to any one of claims 1 to 7 when the network device is running. step.
  16. 一种通信系统,其特征在于,所述通信系统包括至少一个网络设备,每个网络设备包括处理器和存储器,所述存储器中用于存储计算机执行指令,所述网络设备运行时,所述处理器执行所述存储器中的计算机执行指令以利用所述网络设备中的硬件资源执行权利要求1至7中任一所述方法的操作步骤。A communication system, characterized in that the communication system includes at least one network device, and each network device includes a processor and a memory, where the memory is used to store computer execution instructions, and when the network device is running, the processing The processor executes computer execution instructions in the memory to perform the operation steps of the method according to any one of claims 1 to 7 using hardware resources in the network device.
PCT/CN2019/085448 2018-07-13 2019-05-05 Method and device for operating system (os) batch installation, and network device WO2020010906A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810774828.0A CN109189403B (en) 2018-07-13 2018-07-13 Operating system OS batch installation method and device and network equipment
CN201810774828.0 2018-07-13

Publications (1)

Publication Number Publication Date
WO2020010906A1 true WO2020010906A1 (en) 2020-01-16

Family

ID=64936555

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/085448 WO2020010906A1 (en) 2018-07-13 2019-05-05 Method and device for operating system (os) batch installation, and network device

Country Status (2)

Country Link
CN (1) CN109189403B (en)
WO (1) WO2020010906A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112882748A (en) * 2021-03-04 2021-06-01 中国航空工业集团公司西安航空计算技术研究所 Image file management and batch deployment tool of embedded system
CN113207113A (en) * 2021-04-20 2021-08-03 上海富芮坤微电子有限公司 Multi-connection networking system, method, storage medium and electronic device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109189403B (en) * 2018-07-13 2022-04-22 超聚变数字技术有限公司 Operating system OS batch installation method and device and network equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110314146A1 (en) * 2009-02-18 2011-12-22 Nec Corporation Distribution monitoring system, distribution monitoring method, and program
CN102546839A (en) * 2012-03-25 2012-07-04 沈阳通用软件有限公司 Efficient and reliable software distribution method for large scale network
CN107948339A (en) * 2016-10-12 2018-04-20 阿里巴巴集团控股有限公司 A kind of network addressing method, equipment and device
CN109189403A (en) * 2018-07-13 2019-01-11 华为技术有限公司 Operating system OS batch installation method, device and the network equipment

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102520997A (en) * 2011-12-08 2012-06-27 曙光信息产业(北京)有限公司 Semi-automatic batch deploying method of homogenous cluster operating system
US9411840B2 (en) * 2014-04-10 2016-08-09 Facebook, Inc. Scalable data structures
CN105528232A (en) * 2016-01-27 2016-04-27 国家电网公司 Automatic installation method and system for software
CN107220110A (en) * 2017-04-27 2017-09-29 深圳市科力锐科技有限公司 The automatic adaptive method of hardware and system
CN107766474A (en) * 2017-10-09 2018-03-06 平安科技(深圳)有限公司 Dynamic Display relation expands drawing method and application server
CN107911251B (en) * 2017-12-08 2021-04-20 锐捷网络股份有限公司 Network equipment configuration method, device and medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110314146A1 (en) * 2009-02-18 2011-12-22 Nec Corporation Distribution monitoring system, distribution monitoring method, and program
CN102546839A (en) * 2012-03-25 2012-07-04 沈阳通用软件有限公司 Efficient and reliable software distribution method for large scale network
CN107948339A (en) * 2016-10-12 2018-04-20 阿里巴巴集团控股有限公司 A kind of network addressing method, equipment and device
CN109189403A (en) * 2018-07-13 2019-01-11 华为技术有限公司 Operating system OS batch installation method, device and the network equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112882748A (en) * 2021-03-04 2021-06-01 中国航空工业集团公司西安航空计算技术研究所 Image file management and batch deployment tool of embedded system
CN112882748B (en) * 2021-03-04 2023-04-14 中国航空工业集团公司西安航空计算技术研究所 Image file management and batch deployment tool of embedded system
CN113207113A (en) * 2021-04-20 2021-08-03 上海富芮坤微电子有限公司 Multi-connection networking system, method, storage medium and electronic device
CN113207113B (en) * 2021-04-20 2023-01-13 上海富芮坤微电子有限公司 Multi-connection networking system, method, storage medium and electronic device

Also Published As

Publication number Publication date
CN109189403A (en) 2019-01-11
CN109189403B (en) 2022-04-22

Similar Documents

Publication Publication Date Title
US10674486B2 (en) System, security and network management using self-organizing communication orbits in distributed networks
US10574532B2 (en) Component detection and management using relationships
US8429255B1 (en) Determining reorder commands for remote reordering of policy rules
US9331900B2 (en) Centralized management of access points
WO2020010906A1 (en) Method and device for operating system (os) batch installation, and network device
TW201543243A (en) Capability monitoring in a service oriented architecture
CN108259215B (en) Equipment management method and device
CN110166299B (en) SDN controller configuration recovery method and device
WO2018137520A1 (en) Service recovery method and apparatus
US10764214B1 (en) Error source identification in cut-through networks
WO2020119625A1 (en) Optical fiber cut-over method and apparatus, and sdn controller, system and storage medium
CN115623000B (en) Method and device for efficiently distributing data on digital networking
US8472336B2 (en) Network management apparatus for setting communication method of network apparatus
US9912592B2 (en) Troubleshooting openflow networks
US20240097979A1 (en) Fabric availability and synchronization
JP6389494B2 (en) Method and apparatus for generating network dependencies
US11172470B1 (en) System, security and network management using self-organizing communication orbits in distributed networks
US10402282B1 (en) Assisted device recovery
EP2840738B1 (en) Mep configuration method and network device
US20210274023A1 (en) Apparatus control method, device, control node, network apparatus and data center
JP6644902B2 (en) Neighbor monitoring in a hyperscale environment
WO2013178034A1 (en) Cloud service deployment method and system
US11411829B1 (en) Provisioning managed network nodes and/or managing network nodes
EP2552052A1 (en) Network management method and network management system
US20130205013A1 (en) Network management in a communications network

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: 19833524

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: 19833524

Country of ref document: EP

Kind code of ref document: A1