CN114362874A - Master clock equipment determining method and device, electronic equipment and storage medium - Google Patents

Master clock equipment determining method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114362874A
CN114362874A CN202210275455.9A CN202210275455A CN114362874A CN 114362874 A CN114362874 A CN 114362874A CN 202210275455 A CN202210275455 A CN 202210275455A CN 114362874 A CN114362874 A CN 114362874A
Authority
CN
China
Prior art keywords
master
master switch
determining
equipment
switch device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210275455.9A
Other languages
Chinese (zh)
Other versions
CN114362874B (en
Inventor
谈树峰
房亮
李龙威
谢鹏
陈斌
崔长桥
赵亚琼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Tasson Science and Technology Co Ltd
Original Assignee
Beijing Tasson Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Tasson Science and Technology Co Ltd filed Critical Beijing Tasson Science and Technology Co Ltd
Priority to CN202210275455.9A priority Critical patent/CN114362874B/en
Publication of CN114362874A publication Critical patent/CN114362874A/en
Application granted granted Critical
Publication of CN114362874B publication Critical patent/CN114362874B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Optical Communication System (AREA)
  • Small-Scale Networks (AREA)

Abstract

The application relates to the field of switches and time synchronization, and provides a method and a device for determining master clock equipment, electronic equipment and a storage medium, wherein the method comprises the following steps: when a communication network spanning tree is established, determining each main switch device to be selected in an optical fiber switching network, and determining an interaction result of network information interaction between each main switch device to be selected; and determining target master switch equipment in each master switch equipment to be selected according to the interaction result, and determining the target master switch equipment as master clock equipment in the optical fiber switching network. The method for determining the master clock equipment directly determines the master clock equipment in the optical fiber switching network according to the interaction result of network information interaction among all master switch equipment to be selected in the optical fiber switching network, and does not need to periodically detect the network, so that the master clock equipment in the optical fiber switching network is quickly determined.

Description

Master clock equipment determining method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of switches and time synchronization, and in particular, to a method and an apparatus for determining a master clock device, an electronic device, and a storage medium.
Background
At present, most of FC switch devices (fabric switch devices) adopt a primitive synchronization time mode to perform time synchronization, that is, the selection of the master clock device is basically performed by adopting a 1588 optimal master clock device selection mode. The selection mode of 1588 best master clock device needs to periodically detect the network, detect whether the master clock device changes in the network, generally, the period is 1s (second), and in this case, if the connection changes in the network, the master clock device needs to be selected again at least 1s later.
Disclosure of Invention
The application provides a method and a device for determining master clock equipment, electronic equipment and a storage medium, aiming at quickly determining the master clock equipment in a network.
In a first aspect, the present application provides a method for determining a master clock device, including:
when a communication network spanning tree is established, determining each main switch device to be selected in an optical fiber switching network, and determining an interaction result of network information interaction between each main switch device to be selected;
and determining target master switch equipment in each master switch equipment to be selected according to the interaction result, and determining the target master switch equipment as master clock equipment in the optical fiber switching network.
In one embodiment, the determining, according to the interaction result, a target master switch device in each of the master switch devices to be selected includes:
if the interaction result is that the first master switch equipment to be selected and the second master switch equipment to be selected are in the same network topology, determining a first time when the first master switch equipment to be selected receives a pulse per second signal, and determining a second time when the second master switch equipment to be selected receives the pulse per second signal;
if the first time is earlier than the second time, determining the first master switch device to be selected as the target master switch device;
and if the first time is later than the second time, determining the second master switch equipment to be selected as the target master switch equipment.
If the first time is earlier than the second time, determining the first master switch device to be selected as the target master switch device, including:
if the first time is earlier than the second time, sending a clock selection request packet to the second master switch equipment to be selected through the first master switch equipment to be selected;
receiving a master clock selection response packet returned by the second master switch device to be selected based on the clock selection request packet, and determining the first master switch device to be selected as the target master switch device.
After the determining the target master switch device as the master clock device in the fiber switching network, the method further includes:
if the master clock equipment does not receive the pulse-per-second signal within the duration preset time, sending a master clock switching request packet to the second master switch equipment to be selected through the first master switch equipment to be selected;
receiving a master clock switching response packet returned by the second master switch device to be selected according to the master clock switching request packet, and switching the master clock device from the first master switch device to be selected to the second master switch device to be selected.
The determining, according to the interaction result, a target master switch device among the master switch devices to be selected includes:
and if the interaction result is that the first master switch equipment to be selected and the second master switch equipment to be selected are in different network topologies, determining the first master switch equipment to be selected and the second master switch equipment to be selected as the target master switch equipment.
After determining the target master switch device in each master switch device to be selected according to the interaction result and determining the target master switch device as the master clock device in the optical fiber switching network, the method further includes:
if the master clock equipment has pulse per second signal input and time coding signal input at the same time, performing pulse per second time synchronization based on standard time information;
and if the master clock equipment lacks the time coding signal input, performing second pulse time synchronization according to the autonomous timing second-level time of the master clock equipment.
After determining the target master switch device in each master switch device to be selected according to the interaction result and determining the target master switch device as the master clock device in the optical fiber switching network, the method further includes:
determining each slave switch device connected with each link of a master clock device in an optical fiber switching network, and establishing a time synchronization network spanning tree by taking the master clock device as a root node and combining each slave switch device;
determining a port type of each port in the master clock device and a port type of each port in each slave switch device in the optical fiber switching network according to the time synchronization network spanning tree, wherein each port of the master clock device is a time synchronization master port, a port connected with the master clock device in each slave switch device is a time synchronization slave port, and a port connected with a communication node is a time synchronization master port;
determining a link state of each link of the master clock device in the optical fiber switching network, and adjusting a port type of a port in each slave switch device in the optical fiber switching network according to the link state.
In a second aspect, the present application further provides a master clock device determining apparatus, including:
the first determining module is used for determining each main switch device to be selected in the optical fiber switching network and determining an interaction result of network information interaction between each main switch device to be selected when a communication network spanning tree is established;
and the second determining module is used for determining target master switch equipment in each master switch equipment to be selected according to the interaction result and determining the target master switch equipment as master clock equipment in the optical fiber switching network.
In a third aspect, the present application further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the master clock device determining method of the first aspect when executing the program.
In a fourth aspect, the present application further provides a non-transitory computer readable storage medium comprising a computer program which, when executed by the processor, implements the steps of the master clock device determination method of the first aspect.
In a fifth aspect, the present application further provides a computer program product comprising a computer program which, when executed by the processor, implements the steps of the master clock device determination method of the first aspect.
According to the method, the device, the electronic equipment and the storage medium for determining the master clock equipment in the optical fiber switching network, in the process of determining the master clock equipment in the network, the master clock equipment in the optical fiber switching network is determined directly according to the interaction result of network information interaction between the master switch equipment to be selected in the optical fiber switching network, periodic detection on the network is not needed, and therefore the master clock equipment in the optical fiber switching network is determined rapidly.
Drawings
In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic flow chart of a master clock device determination method provided herein;
fig. 2 is a second schematic flowchart of a master clock device determination method provided in the present application;
fig. 3 is a third schematic flowchart of a master clock device determination method provided in the present application;
figure 4 is one of schematic diagrams of a fiber optic switching network;
FIG. 5 is one of the schematic diagrams of a time synchronized network spanning tree;
FIG. 6 is a second schematic diagram of an optical fiber switching network;
FIG. 7 is a second schematic diagram of a spanning tree of the time synchronization network;
FIG. 8 is a third schematic diagram of an optical fiber switching network;
FIG. 9 is a schematic structural diagram of a master clock device determination apparatus provided in the present application;
fig. 10 is a schematic structural diagram of an electronic device provided in the present application.
Detailed Description
To make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be clearly and completely described below with reference to the drawings in the present application, and it is obvious that the described embodiments are some, but not all embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The following describes a master clock device determination method, an apparatus, an electronic device, and a storage medium provided in the present application with reference to fig. 1 to 10.
Specifically, the method for determining a master clock device provided by the present application is shown in fig. 1 to 10, where fig. 1 is one of the flow diagrams of the method for determining a master clock device provided by the present application; fig. 2 is a second schematic flowchart of a master clock device determination method provided in the present application; fig. 3 is a third schematic flowchart of a master clock device determination method provided in the present application; figure 4 is one of schematic diagrams of a fiber optic switching network; FIG. 5 is one of the schematic diagrams of a time synchronized network spanning tree; FIG. 6 is a second schematic diagram of an optical fiber switching network; FIG. 7 is a second schematic diagram of a spanning tree of the time synchronization network; FIG. 8 is a third schematic diagram of an optical fiber switching network; FIG. 9 is a schematic structural diagram of a master clock device determination apparatus provided in the present application; fig. 10 is a schematic structural diagram of an electronic device provided in the present application.
While a logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in a different order than that shown or described herein.
In the embodiment of the application, an electronic device is taken as an execution subject for example, and a master clock device determination system is one of the expression forms of the electronic device, but the electronic device is not limited.
Referring to fig. 1, fig. 1 is a schematic flowchart of a master clock device determining method provided in the present application, where the master clock device determining method provided in the embodiment of the present application includes:
step S10, when determining that the communication network spanning tree is established, determining each to-be-selected master switch device in the optical fiber switching network, and determining an interaction result of network information interaction between each to-be-selected master switch device.
It should be noted that the master clock device starts to select when the FC switching network (fiber switching network) establishes the communication network spanning tree.
Therefore, when the master clock device determining system determines that the communication network spanning tree is established, it is necessary to determine each master switch device to be selected in the optical fiber switching network, and the number of the master switch devices to be selected is set according to the situation. For clarity of explanation of the embodiments of the present application, the number of master switch devices to be selected is 2 for illustration, but not for limitation. It can be further understood that, when the master clock device determining system determines that the communication network spanning tree is established, it needs to determine a first master switch device to be selected and a second master switch device to be selected in the optical fiber switching network. Then, the master clock device determining system needs to determine an interaction result of network information interaction between the first to-be-selected master switch device and the second to-be-selected master switch device, where the interaction result may be that the first to-be-selected master switch device and the second to-be-selected master switch device are in the same topology network, and the interaction result may also be that the first to-be-selected master switch device and the second to-be-selected master switch device are in different topology networks.
Step S20, determining a target master switch device in each master switch device to be selected according to the interaction result, and determining the target master switch device as a master clock device in the optical fiber switching network.
It should be noted that, a first master switch device to be selected and a second master switch device to be selected exist in the optical fiber switching network, so that two 1PPS (pulse per second) signals correspondingly exist in the optical fiber switching network, and are respectively input to the first master switch device to be selected and the second master switch device to be selected, so as to implement redundancy of the pulse per second signals. Further, there should be only one time reference device in the same topology network, and therefore, it is necessary to select a target master switch device from the first master switch device to be selected and the second master switch device to be selected, and determine the target master switch device as a master clock device to be selected in the optical fiber switching network.
Specifically, the master clock device determining system determines whether the first master switch device to be selected and the second master switch device to be selected are in the same topology network according to the interaction result.
If the first master switch equipment to be selected and the second master switch equipment to be selected are determined to be in the same topological network, the master clock equipment determining system determines target master switch equipment in the first master switch equipment to be selected and the second master switch equipment to be selected according to the time sequence of the time of the second pulse signal received by the first master switch equipment to be selected and the time of the second pulse signal received by the second master switch equipment to be selected. If the master clock equipment determining system determines that the first master switch equipment to be selected and the second master switch equipment to be selected are in different topology networks, at the moment, the first master switch equipment to be selected and the second master switch equipment to be selected can be used as target master switch equipment regardless of whether pulse-per-second signals are received by the first master switch equipment to be selected and the second master switch equipment to be selected. Specifically, the steps S201 to S204 are described.
Finally, the master clock device determination system determines the target master switch device as the master clock device in the fiber switching network.
The embodiment provides the method for determining the master clock device, which determines the master clock device in the optical fiber switching network directly according to the interaction result of network information interaction between the master switch devices to be selected in the optical fiber switching network, and does not need to periodically detect the network, thereby quickly determining the master clock device in the optical fiber switching network.
Further, the description of step S201 to step S204 is as follows:
step S201, if the interaction result is that the first master switch device to be selected and the second master switch device to be selected are in the same network topology, determining a first time when the first master switch device to be selected receives the pulse per second signal, and determining a second time when the second master switch device to be selected receives the pulse per second signal;
step S202, if the first time is earlier than the second time, determining the first master switch device to be selected as the target master switch device;
step S203, if the first time is later than the second time, determining the second master switch device to be selected as the target master switch device;
step S204, if the interaction result is that the first to-be-selected master switch device and the second to-be-selected master switch device are in different network topologies, determining the first to-be-selected master switch device and the second to-be-selected master switch device as target master switch devices.
Specifically, if it is determined that the interaction result is that the first master switch device to be selected and the second master switch device to be selected are in the same topology network, the master clock device determining system determines a first time when the first master switch device to be selected receives the pulse per second signal, and determines a second time when the second master switch device to be selected receives the pulse per second signal. Then, the master clock device determining system compares the first time with the second time in time sequence, and determines whether the first time is earlier than the second time or the first time is later than the second time.
If the first time is determined to be earlier than the second time, the master clock device determination system determines the first master switch device to be selected as the target master switch device. If it is determined that the first time is later than the second time, the master clock device determining system determines the second master switch device to be selected as the target master switch device, specifically, as described in step S2021 to step S2022.
Further, if it is determined that the first master switch device to be selected and the second master switch device to be selected are in different topology networks, at this time, whether the first master switch device to be selected and the second master switch device to be selected receive the pulse per second signal or not may be regarded as the target master switch device, and therefore, the master clock device determination system determines the first master switch device to be selected and the second master switch device to be selected as the target master switch device.
According to the interaction result of the first main switch equipment to be selected and the second main switch equipment to be selected and the time sequence of the second pulse signals received by the first main switch equipment to be selected and the second main switch equipment to be selected, the target main switch equipment is determined, so that the target main switch equipment in the optical fiber switching network is determined quickly and accurately, and further the main clock equipment in the optical fiber switching network is determined quickly and accurately.
Further, the description of step S2021 to step S2022 is as follows:
step S2021, if the first time is earlier than the second time, sending a clock selection request packet to the second master switch device to be selected through the first master switch device to be selected;
step S2022, receiving a master clock selection response packet returned by the second master switch device to be selected based on the clock selection request packet, and determining the first master switch device to be selected as the target master switch device.
Specifically, if it is determined that the first time is earlier than the second time, the master clock device determining system sends a clock selection request packet to the second master switch device to be selected through the first master switch device to be selected. Next, the master clock device determination system determines whether a master clock selection response packet returned by the second master switch device to be selected to the first master switch device to be selected based on the clock selection request packet is received.
It should be noted that, when the second master switch device to be selected receives the master clock selection request packet sent by the first master switch device to be selected, the second master switch device to be selected must reply the master clock selection response packet according to the master clock selection request packet.
If it is determined that a master clock selection response packet returned by the second master switch device to be selected to the first master switch device to be selected based on the clock selection request packet is received, the master clock device determination system determines the first master switch device to be selected as the target master switch device.
If it is determined that a master clock selection response packet returned by the second master switch device to be selected to the first master switch device to be selected based on the clock selection request packet is not received, the master clock device determines that the system sends the clock selection request packet to the second master switch device to be selected again through the first master switch device to be selected at intervals of a preset time length until a master clock selection response packet returned by the second master switch device to be selected to the first master switch device to be selected based on the clock selection request packet is received, wherein the preset time length is generally set to 1s (second).
Further, if it is determined that the first time is later than the second time, the master clock device determining system sends a clock selection request packet to the first master switch device to be selected through the second master switch device to be selected. Next, the master clock device determination system determines whether a master clock selection response packet returned by the first master switch device to be selected to the second master switch device to be selected based on the clock selection request packet is received.
It should be noted that, when the first master switch device to be selected receives the master clock selection request packet sent by the second master switch device to be selected, the first master switch device to be selected must reply the master clock selection response packet according to the master clock selection request packet.
If it is determined that a master clock selection response packet returned from the first master switch device to be selected to the second master switch device to be selected based on the clock selection request packet is received, the master clock device determination system determines the second master switch device to be selected as the target master switch device.
If it is determined that a master clock selection response packet returned to the second master switch device to be selected by the first master switch device to be selected based on the clock selection request packet is not received, the master clock device determines that the system sends the clock selection request packet to the first master switch device to be selected again through the second master switch device to be selected at intervals of a preset time length until the master clock selection response packet returned to the second master switch device to be selected by the first master switch device to be selected based on the clock selection request packet is received.
According to the time sequence of the second pulse signals received by the first main switch equipment to be selected and the second main switch equipment to be selected, and the clock selection request packet and the main clock selection response packet, the target main switch equipment is determined, so that the target main switch equipment in the optical fiber switching network is determined quickly and accurately, and the main clock equipment in the optical fiber switching network is further determined quickly and accurately.
Further, after determining the master clock device, it is required to determine whether the master clock device receives the pulse-per-second signal within the duration of the preset time, and perform master clock device switching according to the determination result, as described in steps S30 to S40.
Step S30, if the master clock device does not receive the pulse-per-second signal within the duration preset time, sending a master clock switching request packet to the second master switch device to be selected through the first master switch device to be selected;
step S40, receiving a master clock switching response packet returned by the second master switch device to be selected according to the master clock switching request packet, and switching the master clock device from the first master switch device to be selected to the second master switch device to be selected.
Specifically, for the case that the first master switch device to be selected and the second master switch device to be selected are in the same topology network, and the master clock device is the first master switch device to be selected: if the master clock equipment is determined not to receive the pulse-per-second signal within the continuous preset time, the master clock equipment determining system sends a master clock switching request packet to the second master switch equipment to be selected through the first master switch equipment to be selected, wherein the preset time is generally 10 s. Next, the master clock device determines whether a master clock switching response packet returned by the second master switch device to be selected to the first master switch device to be selected based on the master clock switching request packet is received by the system.
It should be noted that, if the second master switch device to be selected has the pulse per second signal, the master clock switching response packet may be fed back and the master clock device may be replaced, and the second master switch device to be selected returns the master clock switching response packet to the first master switch device to be selected. And if the second master switch equipment to be selected does not have the pulse per second signal, the master clock switching response packet can be fed back and the master clock equipment is replaced, and the second master switch equipment to be selected returns a master clock switching rejection packet to the first master switch equipment to be selected.
If it is determined that a master clock switching response packet returned to the first master switch device to be selected by the second master switch device to be selected based on the master clock switching request packet is received, the master clock device determination system switches the master clock device from the first master switch device to be selected to the second master switch device to be selected, that is, the master clock device at this time is the second master switch device to be selected.
If the master clock switching rejection packet returned to the first master switch equipment to be selected by the second master switch equipment to be selected based on the master clock switching request packet is determined to be received, the master clock equipment determining system maintains the first master switch equipment to be selected as the master clock equipment, and determines that the master clock equipment does not receive the second pulse signal all the time, the master clock switching request packet is sent by the first master switch equipment to be selected again at preset intervals until the returned master clock switching response packet is received, or the master clock equipment receives the second pulse signal.
For the case that the first master switch device to be selected and the second master switch device to be selected are in the same topology network, and the master clock device is the second master switch device to be selected: and if the master clock equipment does not receive the pulse-per-second signal within the continuous preset time length, the master clock equipment determining system sends a master clock switching request packet to the first master switch equipment to be selected through the second master switch equipment to be selected. Next, the master clock device determination system determines whether a master clock switching response packet returned by the first master switch device to be selected to the second master switch device to be selected based on the master clock switching request packet is received.
It should be noted that, if the first master switch device to be selected has the pulse-per-second signal that can feed back the master clock switching response packet and replace the master clock device, the first master switch device to be selected returns the master clock switching response packet to the second master switch device to be selected. And if the first master switch equipment to be selected does not have the pulse-per-second signal, the master clock switching response packet can be fed back and the master clock equipment is replaced, and the first master switch equipment to be selected returns a master clock switching rejection packet to the second master switch equipment to be selected.
If it is determined that a master clock switching response packet returned to the two master switch devices to be selected by the first master switch device to be selected based on the master clock switching request packet is received, the master clock device determining system switches the master clock device from the second master switch device to be selected to the first master switch device to be selected, that is, the master clock device at this time is the first master switch device to be selected.
If it is determined that a master clock switching rejection packet returned by the first master switch device to be selected to the second master switch device to be selected based on the master clock switching request packet is received, the master clock device determining system maintains the second master switch device to be selected as the master clock device, and determines that the master clock device does not receive the second pulse signal all the time, the master clock switching request packet is sent again by the second master switch device to be selected at intervals of a preset time length until the returned master clock switching response packet is received, or the master clock device receives the second pulse signal.
According to the embodiment of the application, the master clock equipment is switched according to the duration without receiving the pulse per second signal and by combining the master clock switching request packet and the master clock switching response packet, so that the accuracy of switching the master clock equipment is ensured.
Further, referring to fig. 2, fig. 2 is a second flowchart of the method for determining a master clock device provided in the present application, and after step S20, the method further includes:
step S50, if the master clock device has the second pulse signal input and the time code signal input at the same time, the second pulse time synchronization is carried out based on the standard time information;
and step S60, if the master clock device lacks the time code signal input, the second pulse time synchronization is carried out according to the autonomous timing second-level time of the master clock device.
It should be noted that after determining the master clock device, any of the network communication nodes may send a time-encoded (TOD) signal to the master clock device. Therefore, the master clock device determination system needs to determine whether the master clock device has both the pulse-per-second signal input and the time code signal input, or only the pulse-per-second signal input, i.e., lacks the time code signal input.
And if the main clock equipment is determined to have the pulse per second signal input and the time coding signal input at the same time, the main clock equipment determining system carries out pulse per second time synchronization according to standard system information. If only the second pulse signal is input, namely the time coding signal input is lacked, the main clock equipment determines that the system carries out second pulse time synchronization according to the autonomous timing second-level time of the main clock equipment.
The embodiment provides a method for determining master clock equipment, which performs pulse per second time synchronization in different time synchronization modes according to the condition that the master clock equipment has pulse per second signal input and time coding signal input at the same time or lacks time coding signal input, so that the accuracy of pulse per second time synchronization is ensured.
Further, referring to fig. 3, fig. 3 is a third schematic flowchart of the master clock device determining method provided in the present application, and after step S20, the method further includes:
step S70, determining each slave switch device connected with each link of the master clock device in the optical fiber switching network, and establishing a time synchronization network spanning tree by taking the master clock device as a root node and combining each slave switch device;
step S80, determining, according to a time synchronization network spanning tree, a port type of each port in the master clock device and a port type of each port in each slave switch device in the optical fiber switching network, where each port of the master clock device is a time synchronization master port, a port connected to the master clock device in each slave switch device is a time synchronization slave port, and a port connected to a communication node is a time synchronization master port;
step S90, determining a link state of each link of the master clock device in the optical fiber switching network, and adjusting a port type of a port in each slave switch device in the optical fiber switching network according to the link state.
It should be noted that, after determining the master clock device, the master clock device determining system needs to establish a time synchronization network spanning tree according to the master clock device and each slave switch device connected to each link of the master clock device in the optical fiber switching network.
In an embodiment, the optical fiber switching network is exemplified by a first master switch device to be selected as a master clock device, the first master switch device to be selected and a second master switch device to be selected are in the same topology network, wherein the master clock device (the first master switch device to be selected) is defined as a master switch device 1, the second master switch device to be selected is defined as a master switch device 2, the master switch device 1 and the master switch device 2 are connected, meanwhile, the master switch device 1 and the master switch device 2 are connected with a plurality of optical fiber nodes and a plurality of ethernet nodes, meanwhile, the master switch device 1 and the master switch device 2 are connected with a plurality of branch switch devices, and simultaneously, the plurality of branch switch devices are connected with a plurality of coaxial nodes, a plurality of optical fiber nodes and a plurality of ethernet nodes, therefore, the schematic diagram of the optical fiber switching network is shown in fig. 4, figure 4 is a schematic diagram of a fiber optic switching network.
Therefore, the master clock device determining system needs to determine each slave switch device connected to each link of the master clock device in the optical fiber switching network, and as can be seen from fig. 4, each slave switch device includes a master switch device 2, and a slave switch device 1 to a slave switch device n. Next, the master clock device determination system establishes a time synchronization network spanning tree with the master switch device 1 (master clock device) as a root node, the master switch device 2, and the branch switch devices 1 to n (slave switch devices) as respective branches, the time synchronization network spanning tree being as shown in fig. 5, and fig. 5 is a schematic diagram of the time synchronization network spanning tree.
Further, the port types of the ports in the optical fiber switching network, the master clock device and the slave switch devices are determined according to the time synchronization network spanning tree.
Specifically, in the time synchronization network spanning tree, the main switch device 2 is defined, and the branch switch devices 1 to n are all subordinate devices of the main switch device 1, and similarly, the main switch device 1 is defined to be the main switch device 2, and the branch switch devices 1 to n are superior devices, for between the superior and inferior switch devices, the superior switch device is a time synchronization master port, the inferior switch device is a time synchronization slave port, and connection ports of each switch device and the communication node are all time synchronization master ports. It should be noted that, in the optical fiber switching network, the connection ports of the switch device and the communication node are both used as time synchronization main ports, and since part of the communication nodes are dual redundant paths, a main time synchronization path needs to be designed and selected at the communication node. For the communication node, which path receives valid time service information (TOD time code signal) first selects as the primary time synchronization path, and at this time, even if another path receives valid time service information, no response is made unless the time service information received by the primary time synchronization path is invalid, as shown in the schematic diagrams of the optical fiber switching networks shown in fig. 4, fig. 6 and fig. 8, the optical fiber node n is the primary time synchronization path.
Therefore, the port types of the respective ports of the master switch device 1 (master clock device) are time synchronization master ports, the port types of the master switch device 2, and the ports of the branch switch devices 1 to n connected to the master switch device 1 are time synchronization slave ports, the port types of the master switch device 2, and the ports of the branch switch devices 1 to n connected to the communication nodes are time synchronization master ports, the time synchronization master ports are labeled M, and the time synchronization slave ports are labeled S, where the ports that are not labeled do not participate in the bidirectional time synchronization process. Therefore, the ports in the master switch device 1 are denoted by M, the master switch device 2, and the ports of the branch switch devices 1 to n connected to the master switch device 1 are denoted by S, the ports of the master switch device 2, and the ports of the branch switch devices 1 to n connected to the communication nodes are denoted by M, the fiber switching network in which the slave ports are denoted by groups is shown in fig. 6, and fig. 6 is a second schematic diagram of the fiber switching network.
Further, the master clock device determines that the system needs to detect the link states of the links of the master clock device in the optical fiber switching network in real time, determines whether the links change according to the link states, and if the links change, the master clock device determines that the time synchronization network spanning tree changes, so that the master clock device determines that the system reestablishes a new time synchronization network spanning tree according to the changed links, and adjusts the port types of the ports in the slave switch devices in the optical fiber switching network according to the new time synchronization network spanning tree.
In an embodiment, taking the example that the link between the master switch device 1 and the master switch device 2 is disconnected, and the master switch device 2 notifies the branch switch device 1 of the link connection, reconstructing a new time synchronization network spanning tree according to the link status is shown in fig. 7, where fig. 7 is a second schematic diagram of the time synchronization network spanning tree. Next, the master clock device determining system determines the port types of the ports in the master switch device 2 and the branch switch device 1 in the optical fiber switching network according to the new time synchronization network spanning tree. Since the link between the main switch device 1 and the main switch device 2 is disconnected, the connection port between the main switch device 2 and the main switch device 1 is adjusted from S to a non-port type, the connection port between the main switch device 2 and the branch switch device 1 is adjusted from a non-port type to S, the connection port between the branch switch device 1 and the main switch device 2 is adjusted from a non-port type to M, the adjusted optical fiber switching network is as shown in fig. 8, and fig. 8 is a third schematic diagram of the optical fiber switching network.
It should be noted that the time for the master switch device 2 to notify the branch switch device 1 of the link connection only needs 30ms (millisecond), that is, the recovery time of the master and slave ports only needs 30 ms.
The present embodiment provides a method for determining a master clock device, where ports of a master clock device and a slave switch device in an optical fiber switching network are configured with a master-slave mode according to a time synchronization network spanning tree, and a port of a slave switch device in the optical fiber switching network is adjusted according to a link state and a new time synchronization network spanning tree, so that adjustment of the master-slave port is quickly achieved after a change occurs in the network, and time synchronization is further quickly performed.
Further, the following describes the master clock device determining apparatus provided in the present application, and the master clock device determining apparatus described below and the master clock device determining method described above may be referred to in correspondence with each other.
As shown in fig. 9, fig. 9 is a schematic structural diagram of a master clock device determining apparatus provided in the present application, where the master clock device determining apparatus includes:
a first determining module 901, configured to determine each to-be-selected master switch device in an optical fiber switching network when a communication network spanning tree is established, and determine an interaction result of network information interaction between the to-be-selected master switch devices;
a second determining module 902, configured to determine, according to the interaction result, a target master switch device in each to-be-selected master switch device, and determine the target master switch device as a master clock device in the optical fiber switching network.
Further, the second determining module 902 is further configured to:
if the interaction result is that the first master switch equipment to be selected and the second master switch equipment to be selected are in the same network topology, determining a first time when the first master switch equipment to be selected receives a pulse per second signal, and determining a second time when the second master switch equipment to be selected receives the pulse per second signal;
if the first time is earlier than the second time, determining the first master switch device to be selected as the target master switch device;
and if the first time is later than the second time, determining the second master switch equipment to be selected as the target master switch equipment.
Further, the second determining module 902 is further configured to:
if the first time is earlier than the second time, sending a clock selection request packet to the second master switch equipment to be selected through the first master switch equipment to be selected;
receiving a master clock selection response packet returned by the second master switch device to be selected based on the clock selection request packet, and determining the first master switch device to be selected as the target master switch device.
Further, the master clock device determination means includes: a switching module to:
if the master clock equipment does not receive the pulse-per-second signal within the duration preset time, sending a master clock switching request packet to the second master switch equipment to be selected through the first master switch equipment to be selected;
receiving a master clock switching response packet returned by the second master switch device to be selected according to the master clock switching request packet, and switching the master clock device from the first master switch device to be selected to the second master switch device to be selected.
Further, the second determining module 902 is further configured to:
and if the interaction result is that the first master switch equipment to be selected and the second master switch equipment to be selected are in different network topologies, determining the first master switch equipment to be selected and the second master switch equipment to be selected as the target master switch equipment.
Further, the master clock device determination means includes: a time synchronization module to:
if the master clock equipment has pulse per second signal input and time coding signal input at the same time, performing pulse per second time synchronization based on standard time information;
and if the master clock equipment lacks the time coding signal input, performing second pulse time synchronization according to the autonomous timing second-level time of the master clock equipment.
Further, the master clock device determination means includes: a port determination update module to:
determining each slave switch device connected with each link of a master clock device in an optical fiber switching network, and establishing a time synchronization network spanning tree by taking the master clock device as a root node and combining each slave switch device;
determining a port type of each port in the master clock device and a port type of each port in each slave switch device in the optical fiber switching network according to the time synchronization network spanning tree, wherein each port of the master clock device is a time synchronization master port, a port connected with the master clock device in each slave switch device is a time synchronization slave port, and a port connected with a communication node is a time synchronization master port;
determining a link state of each link of the master clock device in the optical fiber switching network, and adjusting a port type of a port in each slave switch device in the optical fiber switching network according to the link state.
The specific embodiment of the master clock device determining apparatus provided in the present application is substantially the same as each embodiment of the master clock device determining method described above, and details thereof are not described herein.
Fig. 10 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 10: a processor (processor) 1010, a communication Interface (Communications Interface) 1020, a memory (memory) 1030, and a communication bus 1040, wherein the processor 1010, the communication Interface 1020, and the memory 1030 communicate with each other via the communication bus 1040. Processor 1010 may call logic instructions in memory 1030 to perform a master clock device determination method comprising:
when a communication network spanning tree is established, determining each main switch device to be selected in an optical fiber switching network, and determining an interaction result of network information interaction between each main switch device to be selected;
and determining target master switch equipment in each master switch equipment to be selected according to the interaction result, and determining the target master switch equipment as master clock equipment in the optical fiber switching network.
Furthermore, the logic instructions in the memory 1030 can be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present application also provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the master clock device determination method provided by the above methods, the method comprising:
when a communication network spanning tree is established, determining each main switch device to be selected in an optical fiber switching network, and determining an interaction result of network information interaction between each main switch device to be selected;
and determining target master switch equipment in each master switch equipment to be selected according to the interaction result, and determining the target master switch equipment as master clock equipment in the optical fiber switching network.
In yet another aspect, the present application also provides a non-transitory computer readable storage medium having stored thereon a computer program that, when executed by a processor, is implemented to perform the master clock device determination methods provided above, the method comprising:
when a communication network spanning tree is established, determining each main switch device to be selected in an optical fiber switching network, and determining an interaction result of network information interaction between each main switch device to be selected;
and determining target master switch equipment in each master switch equipment to be selected according to the interaction result, and determining the target master switch equipment as master clock equipment in the optical fiber switching network.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A master clock device determination method, comprising:
when a communication network spanning tree is established, determining each main switch device to be selected in an optical fiber switching network, and determining an interaction result of network information interaction between each main switch device to be selected;
and determining target master switch equipment in each master switch equipment to be selected according to the interaction result, and determining the target master switch equipment as master clock equipment in the optical fiber switching network.
2. The master clock device determination method according to claim 1, wherein the master switch devices to be selected include a first master switch device to be selected and a second master switch device to be selected,
the determining, according to the interaction result, a target master switch device among the master switch devices to be selected includes:
if the interaction result is that the first master switch equipment to be selected and the second master switch equipment to be selected are in the same network topology, determining a first time when the first master switch equipment to be selected receives a pulse per second signal, and determining a second time when the second master switch equipment to be selected receives the pulse per second signal;
if the first time is earlier than the second time, determining the first master switch device to be selected as the target master switch device;
and if the first time is later than the second time, determining the second master switch equipment to be selected as the target master switch equipment.
3. The method according to claim 2, wherein the determining the first master switch device to be selected as the target master switch device if the first time is earlier than the second time includes:
if the first time is earlier than the second time, sending a clock selection request packet to the second master switch equipment to be selected through the first master switch equipment to be selected;
receiving a master clock selection response packet returned by the second master switch device to be selected based on the clock selection request packet, and determining the first master switch device to be selected as the target master switch device.
4. The master clock device determination method of claim 3, wherein after determining the target master switch device as the master clock device in the fiber-switched network, further comprising:
if the master clock equipment does not receive the pulse-per-second signal within the duration preset time, sending a master clock switching request packet to the second master switch equipment to be selected through the first master switch equipment to be selected;
receiving a master clock switching response packet returned by the second master switch device to be selected according to the master clock switching request packet, and switching the master clock device from the first master switch device to be selected to the second master switch device to be selected.
5. The method for determining master clock equipment according to claim 1, wherein the determining a target master switch equipment in each master switch equipment to be selected according to the interaction result includes:
and if the interaction result is that the first master switch equipment to be selected and the second master switch equipment to be selected are in different network topologies, determining the first master switch equipment to be selected and the second master switch equipment to be selected as the target master switch equipment.
6. The method according to any one of claims 1 to 5, wherein after determining a target master switch device in each of the master switch devices to be selected according to the interaction result and determining the target master switch device as a master clock device in the fiber switching network, the method further includes:
if the master clock equipment has pulse per second signal input and time coding signal input at the same time, performing pulse per second time synchronization based on standard time information;
and if the master clock equipment lacks the time coding signal input, performing second pulse time synchronization according to the autonomous timing second-level time of the master clock equipment.
7. The method according to any one of claims 1 to 5, wherein after determining a target master switch device in each of the master switch devices to be selected according to the interaction result and determining the target master switch device as a master clock device in the fiber switching network, the method further includes:
determining each slave switch device connected with each link of a master clock device in an optical fiber switching network, and establishing a time synchronization network spanning tree by taking the master clock device as a root node and combining each slave switch device;
determining a port type of each port in the master clock device and a port type of each port in each slave switch device in the optical fiber switching network according to the time synchronization network spanning tree, wherein each port of the master clock device is a time synchronization master port, a port connected with the master clock device in each slave switch device is a time synchronization slave port, and a port connected with a communication node is a time synchronization master port;
determining a link state of each link of the master clock device in the optical fiber switching network, and adjusting a port type of a port in each slave switch device in the optical fiber switching network according to the link state.
8. A master clock device determination apparatus, comprising:
the first determining module is used for determining each main switch device to be selected in the optical fiber switching network and determining an interaction result of network information interaction between each main switch device to be selected when a communication network spanning tree is established;
and the second determining module is used for determining target master switch equipment in each master switch equipment to be selected according to the interaction result and determining the target master switch equipment as master clock equipment in the optical fiber switching network.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the master clock device determination method of any one of claims 1 to 7 when executing the computer program.
10. A non-transitory computer readable storage medium comprising a computer program, wherein the computer program when executed by a processor implements the steps of the master clock device determination method of any of claims 1 to 7.
CN202210275455.9A 2022-03-21 2022-03-21 Master clock equipment determining method and device, electronic equipment and storage medium Active CN114362874B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210275455.9A CN114362874B (en) 2022-03-21 2022-03-21 Master clock equipment determining method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210275455.9A CN114362874B (en) 2022-03-21 2022-03-21 Master clock equipment determining method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114362874A true CN114362874A (en) 2022-04-15
CN114362874B CN114362874B (en) 2022-08-12

Family

ID=81095024

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210275455.9A Active CN114362874B (en) 2022-03-21 2022-03-21 Master clock equipment determining method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114362874B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115580542A (en) * 2022-12-06 2023-01-06 苏州浪潮智能科技有限公司 Information exchange method and related device of multi-Ethernet switch

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101039173A (en) * 2007-04-29 2007-09-19 山东大学 Apparatus and method for realizing synchronization between Ethernet chain-like network nodes
CN201667660U (en) * 2010-03-03 2010-12-08 武汉迈威光电技术有限公司 Modularized IEEE1588 clock transparent transmission structure of Ethernet switch
CN102263631A (en) * 2011-08-10 2011-11-30 瑞斯康达科技发展股份有限公司 Method and clock node for determining master clock within 1588 clock domain
CN103107876A (en) * 2011-11-15 2013-05-15 中兴通讯股份有限公司 Implementation method, system and device for multi-clock synchronization technology hybrid networking
CN104145435A (en) * 2012-02-27 2014-11-12 瑞典爱立信有限公司 Frequency distribution using precision time protocol
CN105306517A (en) * 2014-07-16 2016-02-03 现代自动车株式会社 Method and apparatus for providing black box service for vehicle diagnosis using in-vehicle time synchronization message
CN105577308A (en) * 2014-11-03 2016-05-11 现代自动车株式会社 Method and apparatus for providing in-vehicle network time synchronization using redundant grandmaster
WO2022032544A1 (en) * 2020-08-12 2022-02-17 华为技术有限公司 Communication method, communication apparatus, terminal device and user plane network element

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101039173A (en) * 2007-04-29 2007-09-19 山东大学 Apparatus and method for realizing synchronization between Ethernet chain-like network nodes
CN201667660U (en) * 2010-03-03 2010-12-08 武汉迈威光电技术有限公司 Modularized IEEE1588 clock transparent transmission structure of Ethernet switch
CN102263631A (en) * 2011-08-10 2011-11-30 瑞斯康达科技发展股份有限公司 Method and clock node for determining master clock within 1588 clock domain
CN103107876A (en) * 2011-11-15 2013-05-15 中兴通讯股份有限公司 Implementation method, system and device for multi-clock synchronization technology hybrid networking
CN104145435A (en) * 2012-02-27 2014-11-12 瑞典爱立信有限公司 Frequency distribution using precision time protocol
CN105306517A (en) * 2014-07-16 2016-02-03 现代自动车株式会社 Method and apparatus for providing black box service for vehicle diagnosis using in-vehicle time synchronization message
CN105577308A (en) * 2014-11-03 2016-05-11 现代自动车株式会社 Method and apparatus for providing in-vehicle network time synchronization using redundant grandmaster
WO2022032544A1 (en) * 2020-08-12 2022-02-17 华为技术有限公司 Communication method, communication apparatus, terminal device and user plane network element

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115580542A (en) * 2022-12-06 2023-01-06 苏州浪潮智能科技有限公司 Information exchange method and related device of multi-Ethernet switch
WO2024119751A1 (en) * 2022-12-06 2024-06-13 苏州元脑智能科技有限公司 Information exchange method for plurality of ethernet switches, and related apparatus

Also Published As

Publication number Publication date
CN114362874B (en) 2022-08-12

Similar Documents

Publication Publication Date Title
EP2182670B1 (en) A method and apparatus for tracking clock source
CN100417094C (en) Network failure recovery method with redundancy port
EP3121996B1 (en) Synchronization failure processing method and system for clock and time synchronization network
JP2021525483A (en) Transmission channel bandwidth throttling method and equipment in Flexible Ethernet®
US8320281B2 (en) Methods, systems and computer readable media for utilizing a standard spanning tree protocol to indicate an active switching fabric in a network node
CN114362874B (en) Master clock equipment determining method and device, electronic equipment and storage medium
CN105340226B (en) The method and device thereof of the main preparation system switching of dynamic routing equipment
CN112367198B (en) Main/standby node switching method and device
CN111064646A (en) Looped network redundancy method, device and storage medium based on broadband field bus
CN114826466A (en) Selection and switching method of redundant master clock
CN114759998B (en) Vehicle clock synchronization method and device
WO2022217786A1 (en) Cross-network communicaton method, apparatus, and system for multi-bus network, and storage medium
CN113794765A (en) Gate load balancing method and device based on file transmission
US20120195186A1 (en) Method and system for preventing traffic loss caused by wait-to-restore mechanisms in service protection networks
FI95975C (en) Hierarchical synchronization method
CN102904662B (en) Cross-domain clock synchronization method and system based on PTP (Precision Time Protocol)
KR20230119215A (en) Clock source selection method and device
CN114615190B (en) Rerouting method, communication device, and storage medium
CN113422623A (en) Management method, system, device, electronic equipment and storage medium
CN111181766A (en) Redundant FC network system and method for realizing dynamic configuration of switch
CN115208823A (en) Flow forwarding method and device
CN108462548B (en) Time synchronization method and device
CN102821033B (en) Message transmission method and device
CN105577484A (en) EAPS failure detection method and system, and EAPS network
CN114650113B (en) Method and device for selecting clock source

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: 100176 701, Floor 7, Building 6, Yard 8, Kegu 1st Street, Beijing Economic and Technological Development Zone, Daxing District, Beijing

Patentee after: Beijing Tasson Technology Ltd.

Address before: Room 701, 7 / F, building 6, courtyard 8, KEGU 1st Street, Beijing Economic and Technological Development Zone, Daxing District, Beijing 100176

Patentee before: BEIJING TASSON TECHNOLOGY Ltd.

CP03 Change of name, title or address