WO2023273627A1 - 选源方法、装置、***及存储介质 - Google Patents

选源方法、装置、***及存储介质 Download PDF

Info

Publication number
WO2023273627A1
WO2023273627A1 PCT/CN2022/092359 CN2022092359W WO2023273627A1 WO 2023273627 A1 WO2023273627 A1 WO 2023273627A1 CN 2022092359 W CN2022092359 W CN 2022092359W WO 2023273627 A1 WO2023273627 A1 WO 2023273627A1
Authority
WO
WIPO (PCT)
Prior art keywords
network device
clock
parameter value
parameter
port
Prior art date
Application number
PCT/CN2022/092359
Other languages
English (en)
French (fr)
Inventor
张亚伟
吕京飞
郝建武
陈松岩
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to JP2023572182A priority Critical patent/JP2024521137A/ja
Priority to EP22831454.8A priority patent/EP4311155A1/en
Publication of WO2023273627A1 publication Critical patent/WO2023273627A1/zh
Priority to US18/521,826 priority patent/US20240097812A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0641Change of the master or reference, e.g. take-over or failure of the master
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0685Clock or time synchronisation in a node; Intranode synchronisation

Definitions

  • the present application relates to the communication field, in particular to a source selection method, device, system and storage medium.
  • two network devices are currently selected as synchronization tracking sources in the network.
  • the two synchronous tracking sources one of them is the active synchronous tracking source, and the other is the standby synchronous tracking source.
  • the active synchronous tracking source is normal, the backup synchronous tracking source and all other network devices in the network except the two network devices track the active synchronous tracking source, so as to synchronize the clocks of each network device in the network.
  • the active synchronization tracking source fails, the other network devices track the standby synchronization tracking source, so that the clocks of the network devices in the network continue to be synchronized.
  • the standby synchronous tracking source and the other network devices re-track the active synchronous tracking source.
  • the clock of the primary synchronization tracking source is reset, and each network device in the network tracks the primary synchronization tracking source, so that the clock of each network device jumps.
  • the present application provides a source selection method, device, system and storage medium, so as to avoid clock jumps of network equipment. Described technical scheme is as follows:
  • the present application provides a source selection method.
  • the second network device modifies the parameter value corresponding to the synchronization source selection parameter of the first network device to a first parameter value, and the first parameter value is better than the parameter value corresponding to the synchronization source selection parameter of the second network device.
  • the clock of the second network device may be reset, and the network devices in the network will perform a source selection operation.
  • the first network device since the first parameter value is better than the parameter value corresponding to the synchronization source selection parameter of the second network device, the first network device based on the first parameter value and the parameter value corresponding to the synchronization source selection parameter of the second network device When selecting the source, the first network device will continue to be selected as the synchronization tracking source, thereby preventing the first network device from tracking the second network device, so as to avoid clock jumps of the first network device.
  • the second network device since the first parameter value is better than the parameter value corresponding to the synchronization source selection parameter of the second network device, the second network device will also choose to track the first network device when performing source selection, so that the second network device's The clock is synchronized with the clock of the first network device. as well as,
  • the third network device when the first network device cannot track the clock of the second network device, the third network device will choose to track the clock of the first network device.
  • the third network device selects the source, and may continue to select the first network device as the synchronization tracking source, thereby preventing the clock of the third network device from jumping, or may select the first network device
  • the second network is used as a synchronization tracking source, but because the clock of the second network device is synchronized with the clock of the first network device, the clock jump of the third network device is also avoided.
  • the synchronization source selection parameter of the first network device includes a local priority localPriority parameter of the first network device, and the first parameter value includes a first priority parameter value.
  • the first network device modifies the second priority parameter value corresponding to the localPriority parameter of the first network device to the first priority parameter value. In this way, by modifying the parameter value corresponding to the localPriority parameter of the first network device, when the first network device can track the second network device, the first network device can continue to be a synchronization tracking source, thereby avoiding the clock of the network device in the network jump occurs.
  • the second priority parameter value is inferior to the priority parameter value corresponding to the localPriority parameter of the first port
  • the first port is a port on the first network device that communicates with the second network device.
  • the first priority parameter value is better than the priority parameter value corresponding to the localPriority parameter of the first port, where the first port is a port on the first network device that communicates with the second network device. In this way, since the first priority parameter value is better than the priority parameter value corresponding to the localPriority parameter of the first port, it is ensured that the first network device is selected as the synchronization tracking source when the first network device selects a source.
  • the second priority parameter value is equal to the priority parameter value corresponding to the localPriority parameter of the second network device.
  • the first network device selects the synchronization tracking source based on the first priority parameter value, so that the first network device can select the first network device as the synchronization tracking source based on the first priority parameter value .
  • the first network device when it receives the message from the second network device through the first port, it compares the value of the first priority parameter with the priority parameter corresponding to the localPriority parameter of the first port value, the first port is the port on the first network device that communicates with the second network device.
  • the first network device selects the first network device as a synchronization tracking source. Therefore, the first network device is prevented from tracking the clock of the second network device, and the clock jump of the first network device is avoided.
  • the synchronization source selection parameter of the first network device includes a clock quality parameter of the first network device, and the first parameter value includes a first clock quality parameter value.
  • the first network device modifies the clock quality parameter value corresponding to the clock quality parameter of the first network device to the first clock quality parameter value. In this way, by modifying the clock quality parameter value corresponding to the clock quality parameter of the first network device, so that when the first network device can track the second network device, the network devices in the network can select the first network device to continue as a synchronization tracking source, Thus, clock jumps of network devices in the network are avoided.
  • the clock quality parameter of the first network device includes one or more of a clock level, a clock precision, and a logarithm value of a clock deviation of the first network device.
  • the first network device selects the synchronization tracking source based on the first clock quality parameter value, so that the first network device can select the first network device as the synchronization tracking source based on the first clock quality parameter value .
  • the first network device receives a notification message sent by the second network device, where the notification message includes a second clock quality parameter value, and the second clock quality parameter value is the clock of the second network device The clock quality parameter value corresponding to the quality parameter.
  • the first network device selects the first network device as a synchronization tracking source. Therefore, the first network device is prevented from tracking the clock of the second network device, and the clock jump of the first network device is avoided.
  • the number of synchronization source selection parameters of the first network device is one or more.
  • the present application provides a source selection method, in which the network device adjusts the default value of the local priority localPriority parameter of the network device itself to be inferior to the default value of the localPriority parameter value of the port of the network device .
  • the network device selects the source based on the adjusted default value of the localPriority parameter of the network device itself and the default value of the localPriority parameter value of the port of the network device.
  • the default value of the localPriority parameter of the network device itself is adjusted to be inferior to the default value of the localPriority parameter value of the port of the network device, when selecting a source, it will choose to track the existing active synchronous tracking source in the network, and track the main The clock of the source is tracked with synchronization, thereby avoiding clock jumps of network devices in the network.
  • the network device includes multiple ports, and the localPriority parameter values of the multiple ports have the same default value.
  • the network device sends a notification message after performing source selection, and the notification message includes a parameter value of a synchronization source selection parameter of the network device.
  • the clock of the network device After the network device selects the source, the clock of the network device has been synchronized with the clock of the active synchronization tracking source, so the network device sends a notification message after the source selection.
  • the clocks of other network devices will not jump.
  • the present application provides a source selection method.
  • the first network device tracks the first clock source
  • the first network device sets The state of the first port is a monitoring state
  • the first port is a port on the first network device that communicates with the first clock source, and the first port in the monitoring state does not participate in source selection.
  • the first network device can track the first clock source, keep the state of the first port as the monitoring state.
  • the state of the first port is kept as the monitoring state, because the first port in the monitoring state does not participate in the selection In this way, the first network device will not switch the tracked clock source back to the first clock source, which reduces the frequency of clock source switching and increases network stability.
  • the first network device tracks the second clock source.
  • the first network device after the first network device tracks the second clock source, when the first network device cannot track the second clock source, the first network device sets the state of the first port back to the non-monitoring state , the first port in the non-monitoring state participates in source selection. In this way, the first network device switches the tracked clock source back to the first clock source only when the first network device cannot track the second clock source, which reduces the frequency of clock source switching and increases network stability.
  • the present application provides a device for selecting a source, configured to execute the method in the first aspect or any possible implementation manner of the first aspect.
  • the apparatus includes a unit for executing the method in the first aspect or any possible implementation manner of the first aspect.
  • the present application provides a device for selecting a source, configured to execute the method in the second aspect or any possible implementation manner of the second aspect.
  • the apparatus includes a unit for executing the second aspect or the method in any possible implementation manner of the second aspect.
  • the present application provides a device for selecting a source, configured to execute the method in the third aspect or any possible implementation manner of the third aspect.
  • the apparatus includes a unit for executing the third aspect or the method in any possible implementation manner of the third aspect.
  • the present application provides a device for selecting a source, and the device includes a processor and a memory.
  • the processor and the memory may be connected through an internal connection.
  • the memory is used to store a program, and the processor is used to execute the program in the memory, so that the device completes the method in the first aspect or any possible implementation manner of the first aspect.
  • the present application provides a device for selecting a source, and the device includes a processor and a memory.
  • the processor and the memory may be connected through an internal connection.
  • the memory is used to store programs, and the processor is used to execute the programs in the memory, so that the device completes the second aspect or the method in any possible implementation manner of the second aspect.
  • the present application provides a device for selecting a source, and the device includes a processor and a memory.
  • the processor and the memory may be connected through an internal connection.
  • the memory is used to store a program, and the processor is used to execute the program in the memory, so that the device completes the third aspect or the method in any possible implementation manner of the third aspect.
  • the present application provides a computer program product, the computer program product includes a computer program stored in a computer-readable storage medium, and the calculation program is loaded by a processor to implement the above-mentioned first aspect and the first aspect.
  • the present application provides a computer-readable storage medium for storing a computer program, and the computer program is loaded by a processor to execute the first aspect, the second aspect, the third aspect, and the first aspect Any possible implementation manner, any possible implementation manner of the second aspect, or any possible implementation manner of the third aspect.
  • the present application provides a chip, including a memory and a processor, the memory is used to store computer instructions, and the processor is used to call and run the computer instructions from the memory to implement the first aspect, the second aspect, and the second aspect.
  • the third aspect any possible implementation of the first aspect, any possible implementation of the second aspect, or any possible implementation of the third aspect.
  • the present application provides a source selection system, the system includes the device described in the fourth aspect and the device described in the fifth aspect; or, the system includes the device described in the seventh aspect and the device described in the first aspect The device of eight aspects.
  • FIG. 1 is a schematic diagram of a network architecture provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of another network architecture provided by an embodiment of the present application.
  • Fig. 3 is a flow chart of a source selection method provided by the embodiment of the present application.
  • Fig. 4 is a flow chart of comparing data sets provided by the embodiment of the present application.
  • Fig. 5 is a flowchart of another comparison data set provided by the embodiment of the present application.
  • Fig. 6 is a flow chart of another source selection method provided by the embodiment of the present application.
  • Fig. 7 is a flow chart of another source selection method provided by the embodiment of the present application.
  • Fig. 8 is a schematic structural diagram of a source selection device provided by an embodiment of the present application.
  • Fig. 9 is a schematic structural diagram of another source selection device provided by the embodiment of the present application.
  • Fig. 10 is a schematic structural diagram of another source selection device provided by the embodiment of the present application.
  • Fig. 11 is a schematic structural diagram of another source selection device provided by the embodiment of the present application.
  • Fig. 12 is a schematic structural diagram of another source selection device provided by the embodiment of the present application.
  • Fig. 13 is a schematic structural diagram of another source selection device provided by the embodiment of the present application.
  • Fig. 14 is a schematic structural diagram of a source selection system provided by an embodiment of the present application.
  • the embodiment of the present application provides a network architecture 100, including:
  • the first network device 101 and the second network device 102 the first network device 101 communicates with the second network device 102 .
  • the first network device 101 keeps track of the clock of the second network device 102 .
  • the first network device 101 tracking the clock of the second network device 102 refers to: the first network device 101 synchronizes its own time with the time of the second network device 102, and/or, the first network device 101 synchronizes its own frequency with the time of the second network device 102 The frequency of the second network device 102 is synchronized.
  • the second network device 102 is the active synchronization tracking source
  • the first network device 101 is the standby synchronization tracking source. Therefore, when selecting the synchronization tracking source, the first network device 101 selects the second network device 102 as the synchronization tracking source, and tracks the clock of the second network device 102 .
  • the network architecture 100 further includes at least one third network device 103, and for any third network device in the at least one third network device 103, the third network device communicates with the first network device 101, and , the third network device communicates with the second network device 102 .
  • the third network device selects the second network device 102 as the synchronization tracking source and tracks the clock of the second network device 102 .
  • the first network device 101 includes at least one synchronization source selection parameter.
  • the at least one synchronization source selection parameter in the first network device 101 includes a local priority (localPriority) parameter and/or at least one first clock parameter and the like.
  • the at least one synchronization source parameter is a parameter of the clock of the first network device 101 .
  • the larger the priority parameter value corresponding to the localPriority parameter the better the priority parameter value corresponding to the localPriority parameter, or the smaller the priority parameter value corresponding to the localPriority parameter, indicating the priority parameter corresponding to the localPriority parameter.
  • the first network device 101 includes at least one port, and each port also includes a localPriority parameter.
  • the default value corresponding to the localPriority parameter of the first network device 101 is inferior to the default value corresponding to the localPriority parameter of each port.
  • the default value corresponding to the localPriority parameter of the first network device 101 is called the second priority parameter value, that is, the second priority parameter value is inferior to the default value corresponding to the localPriority parameter of each port.
  • the priority parameter value corresponding to the localPriority parameter is smaller, it means that the priority parameter value corresponding to the localPriority parameter is better, and the second priority parameter value corresponding to the localPriority parameter of the first network device 101 is "255", and the The default value corresponding to the localPriority parameter of each port is "128", so that the second priority parameter value corresponding to the localPriority parameter of the first network device 101 is inferior to the default value corresponding to the localPriority parameter of each port.
  • the at least one first clock parameter includes one or more of the following clock parameters: at least one first clock quality parameter, a first clock identifier, a first clock priority parameter, and the like.
  • the first clock identifier is a clock identifier of the first network device 101
  • the first clock priority parameter is a clock priority parameter of the first network device 101, and the like.
  • the clock priority parameter of the first network device 101 may also be referred to as a priority parameter 2 (Priority2) of the first network device 101 .
  • the at least one first clock quality parameter includes one or more of the following clock quality parameters: a first clock level, a first clock precision, a first clock skew logarithmic value, and the like.
  • the first network device 101 includes a first local data set, and the first local data set includes one or more of the following parameter values: the second priority parameter value corresponding to the localPriority parameter of the first network device 101 and the at least one first clock parameter The parameter value corresponding to each first clock parameter in . That is to say: the first local data set includes one or more of the following parameter values: the second priority parameter value corresponding to the localPriority parameter of the first network device 101, the parameter value corresponding to the first clock level, and the parameter value corresponding to the first clock accuracy The parameter value, the parameter value corresponding to the first clock deviation log value, the parameter value corresponding to the first clock priority parameter, the first clock identifier, and the like.
  • the first local data set includes the second priority parameter value "255", the parameter value A1 corresponding to the first clock level, the parameter value A2 corresponding to the first clock accuracy, and the parameter value A3 corresponding to the logarithmic value of the first clock bias , the parameter value A4 corresponding to the first clock priority parameter and the first clock identifier ID1.
  • the second network device 102 also includes at least one synchronization source selection parameter.
  • the at least one synchronization source selection parameter in the second network device 102 includes a localPriority parameter and/or at least one second clock parameter and the like.
  • the at least one synchronization source parameter is a parameter of the clock of the second network device 102 .
  • the second network device 102 includes at least one port, and each port also includes a localPriority parameter.
  • the priority parameter value corresponding to the localPriority parameter of the second network device 102 is equal to the default value corresponding to the localPriority parameter of each port.
  • the priority parameter value corresponding to the localPriority parameter of the second network device 102 is "128”
  • the default value corresponding to the localPriority parameter of each port is "128” so that the priority parameter corresponding to the localPriority parameter of the second network device 102
  • the level parameter value is equal to the default value corresponding to the localPriority parameter of each port.
  • the at least one second clock parameter includes one or more of the following clock parameters: at least one second clock quality parameter, a second clock identifier and/or a second clock priority parameter, and the like.
  • the second clock identifier is a clock identifier of the second network device 102
  • the second clock priority parameter is a clock priority parameter of the second network device 102, and the like.
  • the clock priority parameter of the second network device 102 may also be referred to as the priority parameter 2 of the second network device 102 .
  • the at least one second clock quality parameter includes one or more of the following clock quality parameters: a second clock level, a second clock precision, and/or a second clock skew logarithmic value, and the like.
  • the second network device 102 includes a second local data set, and the second local data set includes one or more parameter values as follows: the priority parameter value corresponding to the localPriority parameter of the second network device 102 and the at least one second clock parameter The parameter value corresponding to each second clock parameter. That is to say: the second local data set includes one or more of the following parameter values: the priority parameter value corresponding to the localPriority parameter of the second network device 102, the parameter value corresponding to the second clock level, and the parameter value corresponding to the second clock accuracy , the parameter value corresponding to the second clock deviation log value, the parameter value corresponding to the second clock priority parameter, the second clock identifier, and the like.
  • the second local data set includes the priority parameter value "128" corresponding to the localPriority parameter of the second network device 102, the parameter value B1 corresponding to the second clock level, the parameter value B2 corresponding to the second clock precision, the second clock The parameter value B3 corresponding to the deviation log value, the parameter value B4 corresponding to the second clock priority parameter, and the second clock identifier ID2.
  • the third network device For each third network device in the at least one third network device 103, the third network device also includes at least one synchronization source selection parameter.
  • the at least one synchronization source selection parameter in the third network device includes a localPriority parameter and/or at least one third clock parameter and the like.
  • the at least one synchronization source parameter is a parameter of the clock of the third network device.
  • the third network device includes at least one port, and each port also includes a localPriority parameter.
  • the default value corresponding to the localPriority parameter of the third network device is inferior to the default value corresponding to the localPriority parameter of each port. For example, suppose that the priority parameter value corresponding to the localPriority parameter of the third network device is "255", and the default value corresponding to the localPriority parameter of each port is "128", so that the localPriority parameter of the third network device corresponds to The value of the priority parameter is inferior to the corresponding default value of the per-port localPriority parameter.
  • the at least one third clock parameter includes one or more of the following clock parameters: at least one third clock quality parameter, a third clock identifier and/or a third clock priority parameter, and the like.
  • the third clock identifier is a clock identifier of the third network device
  • the third clock priority parameter is a clock priority parameter of the third network device.
  • the clock priority parameter of the third network device may also be referred to as the priority parameter 2 of the third network device.
  • the at least one third clock quality parameter includes one or more of the following clock quality parameters: a third clock level, a third clock precision, and/or a third clock skew logarithm, and the like.
  • the third network device includes a third local data set, and the third local data set includes one or more of the following parameter values: the priority parameter value corresponding to the localPriority parameter of the third network device and the at least one third clock parameter The parameter value corresponding to each third clock parameter. That is to say: the third local data set includes one or more of the following parameter values: the priority parameter value corresponding to the localPriority parameter of the third network device, the parameter value corresponding to the third clock level, and the parameter value corresponding to the third clock precision , the parameter value corresponding to the third clock deviation log value, the parameter value corresponding to the third clock priority parameter, the third clock identifier, and the like.
  • the third local data set includes the priority parameter value "255" corresponding to the localPriority parameter of the third network device, the parameter value C1 corresponding to the third clock level, the parameter value C2 corresponding to the third clock precision, the third clock The parameter value C3 corresponding to the deviation log value, the parameter value C4 corresponding to the third clock priority parameter, and the third clock identifier ID3.
  • the parameter value corresponding to the first clock parameter, the parameter value corresponding to the second clock parameter and the parameter value corresponding to the third clock parameter The parameter values are equal. That is to say: the parameter value A1 corresponding to the first clock level, the parameter value B1 corresponding to the second clock level, and the parameter value C1 corresponding to the third clock level are equal; the parameter value A2 corresponding to the first clock precision and the parameter value A2 corresponding to the second clock precision.
  • the parameter value B2 corresponding to the third clock precision is equal to the parameter value C2 corresponding to the third clock precision; the parameter value A3 corresponding to the first clock deviation log value, the parameter value B3 corresponding to the second clock deviation log value, and the parameter value corresponding to the third clock deviation log value C3 is equal.
  • the priority parameter value corresponding to the first clock priority parameter is equal to the priority parameter value corresponding to the second clock priority parameter. But both are better than the priority parameter value corresponding to the third clock priority parameter. That is to say, the parameter value A4 corresponding to the first clock priority parameter is equal to the parameter value B4 corresponding to the second clock priority parameter, but both A4 and B4 are better than the parameter value C4 corresponding to the third clock priority parameter.
  • the sequence between the first clock identifier of the first network device 101 and the second clock identifier of the second network device 102 is that the second clock identifier of the second network device 102 is ranked before the first clock identifier of the first network device 101 .
  • the embodiment of the present application provides a network architecture 200, including:
  • the first clock source 201 is the main clock source
  • the second clock source 202 is the backup clock source.
  • the first network device 201 tracks the first clock source 201, and tracks the second clock source 202 when the first clock source 201 cannot be tracked.
  • the so-called tracking of the first clock source 201 by the first network device 203 means that the first network device 203 synchronizes its own time with the time of the first clock source 201 .
  • the first network device 203 receives the first synchronization message sent by the first clock source 201, the first synchronization message includes the time of the first clock source 201, and the time of the first network device 203 is compared to the time of the first network device 203 based on the time included in the first synchronization message to sync.
  • the network architecture 200 also includes a second network device 204 and at least one third network device 205, the second network device 204 communicates with the second clock source 202, the first network device 203 communicates with the second clock source 203 through the second port The network device 204 communicates. For each third network device of the at least one third network device 205 , the third network device communicates with the first network device 203 , and the third network device 205 communicates with the second network device 204 .
  • the first network device 203 tracks the first clock source 201
  • the second network device 204 and each third network device also tracks the first clock source.
  • the first network device 203 sends a second synchronization packet, where the second synchronization packet includes the time of the first network device 203 performing time synchronization.
  • the second network device 204 receives the second synchronization packet, and synchronizes the time of the second network device 204 based on the time included in the second synchronization packet.
  • the third network device receives the second synchronization packet, and synchronizes the time of the third network device based on the time included in the second synchronization packet.
  • the second network device 204 tracks the second clock source 202, and the first network device 101 and each third network device also track the second clock source 202.
  • the so-called tracking of the second clock source 202 by the second network device 204 means that the second network device 204 synchronizes its own time with the time of the second clock source 202 .
  • the second network device 204 receives the third synchronization message sent by the second clock source 202, the third synchronization message includes the time of the second clock source 202, and the time of the second network device 204 is compared based on the time included in the third synchronization message to sync.
  • the so-called tracking of the second clock source 202 by the first network device 203 and each third network device refers to: the second network device 204 sends the fourth synchronization message, and the fourth synchronization message includes the clock source of the second network device 204 for time synchronization. time.
  • the first network device 203 receives the fourth synchronization packet sent by the second network device 204, and synchronizes the time of the first network device 203 based on the time included in the fourth synchronization packet.
  • the third network device receives the fourth synchronization packet sent by the second network device 204, and synchronizes the time of the third network device based on the time included in the fourth synchronization packet.
  • the second network device 204 tracks the second clock source 203 .
  • the first network device 203 and each third network device also track the second clock source 202, that is, the first network device 203 and each third network device receive the fourth synchronization message sent by the second network device 204, based on The time in the fourth synchronization packet is time synchronized.
  • the first network device 201 can track the first clock source 201, if the first network device 203 stops tracking the second clock source 202 and starts to track the first clock source 201, the second network device 204 and each third network The device also tracks the first clock source 201, so that the network device switches the tracked clock source, which increases the frequency of switching the tracked clock source and affects the stability of the network.
  • an embodiment of the present application provides a method 300 for source selection, which is applied to the network architecture 100 shown in FIG. 1 .
  • the first network device cannot track the second network device
  • the first network device is selected as the synchronization tracking source by modifying the value of the localPriority parameter of the first network device.
  • the method 300 includes:
  • Step 301 the first network device tracks the clock of the second network device.
  • the second network device is the main synchronization tracking source
  • the first network device is the standby synchronization tracking source, so each network device in the network architecture selects the second network device as the synchronization tracking source, and tracks the first Two network device clocks.
  • the time of the first network device is synchronized with the time of the second network device, and/or, the frequency of the first network device is synchronized with the frequency of the second network device.
  • the operation for the first network device to select the second network device as the synchronization tracking source is:
  • the first network device receives the first notification message sent by the second network device through the first port, and the first notification message includes a parameter value corresponding to each second clock parameter in at least one second clock parameter of the second network device , the first port is a port on the first network device that communicates with the second network device.
  • Acquire a first data set where the first data set includes a priority parameter value corresponding to the localPriority parameter of the first port and a parameter value corresponding to each second clock parameter in the first notification message.
  • the first network device receives through the second port a second notification message sent by a third network device communicating with the first network device, and the second notification message includes each of at least one third clock parameter of the third network device
  • the parameter value corresponding to the third clock parameter, and the second port is a port on the first network device that communicates with the third network device.
  • the first network device selects a source through a specified source selection algorithm based on the first local data set, the first data set and the second data set, and selects the second network device as a synchronization tracking source.
  • the first data set includes one or more of the following parameter values: a priority parameter value corresponding to the localPriority parameter of the first port, a parameter value corresponding to the second clock level, a parameter value corresponding to the second clock precision, The parameter value corresponding to the second clock deviation log value, the parameter value corresponding to the second clock priority parameter, the second clock identifier, and the like.
  • the first data set includes the priority parameter value "128" corresponding to the localPriority parameter of the first port, the parameter value B1 corresponding to the second clock level, the parameter value B2 corresponding to the second clock precision, and the logarithmic value of the second clock skew
  • the second data set includes one or more of the following parameter values: a priority parameter value corresponding to the localPriority parameter of the second port, a parameter value corresponding to the third clock level, a parameter value corresponding to the third clock precision, The parameter value corresponding to the third clock deviation log value, the parameter value corresponding to the third clock priority parameter, the third clock identifier, and the like.
  • the second data set includes the priority parameter value "128" corresponding to the localPriority parameter of the second port, the parameter value C1 corresponding to the third clock level, the parameter value C2 corresponding to the third clock accuracy, and the third logarithmic value of the clock skew
  • the above source selection operation is as follows: for any two data sets in the first local data set, the first data set and the second data set, assuming that the first local data set and the first data set are taken as an example, compare The first local data set and the first data set to select an optimal data set from the two data sets. Then compare the selected data set with the second data set to select an optimal data set from the two data sets, and use the network device corresponding to the optimal data set as a synchronization tracking source.
  • the first local data set includes one or more of the following parameter values: the second priority parameter value corresponding to the localPriority parameter of the first network device, the parameter value corresponding to the first clock level, the parameter value corresponding to the first clock accuracy, the first The parameter value corresponding to the logarithmic value of the clock deviation, the parameter value corresponding to the first clock priority parameter, the first clock identifier, and the like.
  • the first local data set includes the second priority parameter value "255", the parameter value A1 corresponding to the first clock level, the parameter value A2 corresponding to the first clock accuracy, and the parameter value A3 corresponding to the logarithmic value of the first clock bias , the parameter value A4 corresponding to the first clock priority parameter and the first clock identifier ID1.
  • the first network device compares the selected first data set and the second data set according to the above-mentioned 11-15 process, so as to select an optimal data set from the two data sets, and the selected optimal data set
  • the data set is a first data set.
  • the first network device Since the optimal data set finally selected by the first network device from the first local data set, the first data set and the second data set is the first data set, the first network device transfers the second network device corresponding to the first data set to As a synchronization tracking source, and track the clock of the second network device.
  • the first network device will also send a third notification packet to the second network device and the third network device, where the third notification packet includes a parameter value corresponding to each first clock parameter in the at least one first clock parameter. Therefore, the second network device and the third network device also perform source selection in the same way as the first network device, and both select the second network device as a synchronization tracking source.
  • the second network device receives the third notification message sent by the first network device through a third port
  • the third port is a port on the second network device that communicates with the first network device.
  • the third data set includes the priority parameter value corresponding to the localPriority parameter of the third port and the parameter value corresponding to each first clock parameter in the third notification message.
  • the second network device receives the second notification message sent by the third network device communicating with the second network device through the fourth port, and the fourth port is a port on the first network device communicating with the third network device.
  • the third data set includes one or more of the following parameter values: a priority parameter value corresponding to the localPriority parameter of the third port, a parameter value corresponding to the first clock level, a parameter value corresponding to the first clock precision, The parameter value corresponding to the first clock deviation log value, the parameter value corresponding to the first clock priority parameter, the first clock identifier, and the like.
  • the third data set includes the priority parameter value "128" corresponding to the localPriority parameter of the third port, the parameter value A1 corresponding to the first clock level, the parameter value A2 corresponding to the first clock precision, and the logarithmic value of the first clock deviation
  • the fourth data set includes one or more of the following parameter values: a priority parameter value corresponding to the localPriority parameter of the fourth port, a parameter value corresponding to the third clock level, a parameter value corresponding to the third clock precision, The parameter value corresponding to the third clock deviation log value, the parameter value corresponding to the third clock priority parameter, the third clock identifier, and the like.
  • the fourth data set includes the priority parameter value "128" corresponding to the localPriority parameter of the fourth port, the parameter value C1 corresponding to the third clock level, the parameter value C2 corresponding to the third clock accuracy, and the third logarithmic value of the clock skew
  • the second local data set of the second network device includes one or more of the following parameter values: the priority parameter value corresponding to the localPriority parameter of the second network device, the parameter value corresponding to the second clock level, and the parameter value corresponding to the second clock accuracy , the parameter value corresponding to the second clock deviation log value, the parameter value corresponding to the second clock priority parameter, the second clock identifier, and the like.
  • the second local data set includes the priority parameter value "128" corresponding to the localPriority parameter of the second network device, the parameter value B1 corresponding to the second clock level, the parameter value B2 corresponding to the second clock precision, and the second clock offset
  • the second local data set and the third data set are compared, and An optimal data set is selected from the two data sets. Then compare the selected data set with the fourth data set to select an optimal data set from the two data sets, and use the network device corresponding to the finally selected optimal data set as a synchronization tracking source.
  • the second network device compares the selected second local data set with the fourth data set according to the above-mentioned process of 21-26, so as to select an optimal data set from the two data sets, and the finally selected The optimal data set is the second local data set.
  • the second network device uses the second network device corresponding to the second local data set as a synchronization tracking source.
  • the third network device selects the second network device as the synchronization tracking source in the same way as the above-mentioned first network device or the second network device.
  • the network device periodically sends the notification message. That is to say: the first network device periodically sends a third notification message, and the third notification message includes the current corresponding parameter value of each third clock parameter in at least one third clock parameter, and the second network device and The third network device also periodically sends the notification message like the first network device.
  • Step 302 When the first network device cannot track the clock of the second network device, the first network device becomes the active clock tracking source, and the value of the second priority parameter corresponding to the localPriority parameter of the first network device is changed to the first Priority parameter value.
  • the first priority parameter value takes precedence over the second priority parameter value.
  • the first priority parameter value is also better than the priority parameter value corresponding to the localPriority parameter of the second network device.
  • the second priority parameter value is inferior to the priority parameter value corresponding to the localPriority parameter of the first port
  • the first port is a port on the first network device that communicates with the second network device.
  • the first priority parameter value is superior to the priority parameter value corresponding to the localPriority parameter of the first port.
  • the default value corresponding to the localPriority parameter of the first port is "128”
  • the priority parameter value corresponding to the localPriority parameter of the first port is "128”
  • the second priority parameter value is "255”
  • the first priority The level parameter value is "100”.
  • the first network device When the first network device cannot track the clock of the second network device, it modifies the second priority parameter value "255" corresponding to the localPriority parameter of the first network device to the first priority parameter value "100", so the first The first priority parameter value corresponding to the localPriority parameter in the network device is better than the priority parameter value corresponding to the localPriority parameter of the first port.
  • the priority parameter value corresponding to the localPriority parameter of the first network device included in the first local data set After modifying the second priority parameter value corresponding to the localPriority parameter of the first network device to the first priority parameter value, the priority parameter value corresponding to the localPriority parameter of the first network device included in the first local data set also follows becomes the first priority parameter value.
  • the failure of the first network device to track the clock of the second network device means that the first network device cannot receive the message (notification message and/or synchronization message, etc.) sent by the second network device.
  • the reason may be failure of the first port, failure of the link between the first network device and the second network device and/or failure of the second network device, etc.
  • the third network device may also be unable to track the clock of the second network device.
  • the first network device and the third network device reselect the synchronization tracking source, and both select The first network device acts as a synchronization tracking source, so that the first network device becomes an active synchronization tracking source.
  • the time of the first network device is synchronized with the time of the second network device, and/or, the frequency of the first network device is synchronized with the frequency of the second network device. Therefore, when the first network device becomes the active synchronization tracking source and other network devices track the first network device, the time and/or frequency of other network devices will not jump.
  • the first network device When the first port returns to normal, the link between the first network device and the second network device returns to normal and/or the second network device returns to normal, the first network device receives a report from the second network device through the first port The text indicates that the first network device can track the clock of the second network device.
  • Step 303 When the first network device can track the clock of the second network device, the first network device selects a synchronization tracking source based on the first priority parameter value, and the selected synchronization tracking source is the first network device.
  • the first network device When the first network device can track the clock of the second network device, the first network device compares the first priority parameter value with the localPriority of the first port when receiving a message from the second network device through the first port The priority parameter value corresponding to the parameter, when the first priority parameter value is better than the priority parameter value corresponding to the localPriority parameter of the first port, the first network device selects the first network device as a synchronization tracking source.
  • the first network device receives the first notification message from the second network device through the first port, and acquires the first data set. And, receiving the second notification message from the third network device through the second port, and acquiring the second data set.
  • the first data set and the second data set obtained here are respectively the same as the first data set and the second data set obtained in step 301 .
  • the first network device Since the priority parameter value corresponding to the localPriority parameter of the first network device in the first local data set is modified to the first priority parameter value, in the process of selecting a synchronization tracking source, the first network device follows the above-mentioned figure 4 The comparison process compares the first local data set with the first data set, and when comparing the first priority parameter value with the priority parameter value corresponding to the localPriority parameter of the first port, the comparison result obtained is the first priority parameter The value is better than the priority parameter value corresponding to the localPriority parameter of the first port, and the first network device selects the first local data set as the optimal data set. Then, the first network device compares the first local data set and the second data set according to the comparison process shown in FIG. A network device is the synchronization tracking source.
  • the clock of the second network device is reset.
  • the second network device resets its own clock to the factory-time state, that is, the second network device resets its own time to the factory-time time, and/or resets its own frequency to the factory-time frequency.
  • the second network device When the second network device returns to normal after failure, the second network device will adjust the default value of the local priority parameter localPriority of the second network device itself to be inferior to the default value of the localPriority parameter value of the port of the second network device. Then the second network device selects a source based on the adjusted default value of the localPriority parameter and the default value of the localPriority parameter value of the port of the second network device, and the selected synchronization tracking source is the first network device. Therefore, the second network device tracks the clock of the first network device, so that the time of the second network device is synchronized with the time of the first network device, and/or the frequency of the second network device is synchronized with the frequency of the first network device.
  • the adjusted priority parameter value corresponding to the local priority localPriority parameter of the second network device itself is equal to the second priority parameter value.
  • the second priority parameter value is "255”
  • the adjusted priority parameter value corresponding to the local priority localPriority parameter of the second network device itself is also "255”.
  • the second network device After the second network device adjusts the default value of the localPriority parameter of the second network device itself to be inferior to the default value of the localPriority parameter value of the port of the second network device, the second in the second local data set in the second network device The priority parameter value corresponding to the localPriority parameter value of the network device also becomes inferior to the default value of the localPriority parameter value of the port of the second network device.
  • the second network device adjusts the default value of the localPriority parameter of the second network device itself to "255".
  • the default value of the localPriority parameter value of the port of the second network device is "128", so that the default value of the localPriority parameter value of the second network device itself is inferior to the default value of the localPriority parameter value of the port of the second network device.
  • the port of the second network device includes a third port communicating with the first network device, so the priority parameter value corresponding to the localPriority parameter value of the second network device in the second local data set is worse than the default value of the localPriority parameter value of the third port value.
  • the third data is selected through the comparison process shown in FIG. 5 above. set as the optimal data set, and the first network device corresponding to the third data set is used as a synchronization tracking source.
  • the second network device sends a first notification message after performing source selection, and the first notification message includes a parameter value of a synchronization source selection parameter of the second network device.
  • the parameter value corresponding to the synchronization source selection parameter of the second network device included in the first notification message is: a parameter value corresponding to each second clock parameter in the at least one second clock parameter.
  • the network device periodically sends a notification message, and when the second network device returns to normal, the second network device waits for one or more periods before sending the first notification message to the third network device.
  • the second network device After the second network device selects the source, it tracks the clock of the first network device, that is, the time of the second network device is synchronized with the time of the first network device, and/or, the frequency of the second network device is synchronized with that of the first network device frequency synchronization. In this way, the second network device sends the first notification message after selecting the source, and the third network device receives the first notification message and performs a source selection operation.
  • the priority parameter value corresponding to the first clock priority parameter is equal to the priority parameter value corresponding to the second clock priority parameter
  • the second clock ID of the second network device is sorted before the first clock ID of the first network device, so the third network device will select the second network device as the synchronization tracking source when selecting the source, and track the second network device The device's clock.
  • the clock of the third network device will not jump occurs. That is, the time of the third network device does not hop, and/or, the frequency of the third network device does not hop.
  • the first network device tracks the clock of the second network device.
  • the first network device automatically becomes the active clock tracking source, and the value of the second priority parameter corresponding to the localPriority parameter of the first network device is changed to the first priority level parameter value.
  • the first port is the port on the first network device that communicates with the second network device, so although the first network device can track the first
  • the clock of the second network device is clocked, but the first network device continues to select the first network device as a synchronization tracking source based on the first priority parameter value, that is, the first network device will not track the second network device. That is to say, even if the clock of the second network device is reset when the second network device returns to normal, since the first network device will not track the clock of the second network device, clock jumping will not occur.
  • the second network device selects the first network device as a synchronization tracking source, and the second network device tracks the clock of the first network device. In this way, when the third network device chooses to track the clock of the first network device, the clock of the third network device is avoided. jump phenomenon occurs.
  • an embodiment of the present application provides a source selection method 600, which is applied to the network architecture 100 shown in FIG. 1.
  • the first network device cannot track the second network device
  • the first network device is selected as the synchronization tracking source by modifying the value of the clock quality parameter of the first network device.
  • the method 600 includes:
  • Step 601 It is the same as step 301 of the method 300 shown in FIG. 3 above, and will not be described in detail here.
  • Step 602 When the first network device cannot track the clock of the second network device, the first network device becomes the active clock tracking source, and the clock quality parameter value corresponding to the clock quality parameter of the first network device is changed to the first clock Quality parameter value.
  • the first clock quality parameter value is better than the second clock quality parameter value
  • the second clock quality parameter value is a clock quality parameter value corresponding to the clock quality parameter of the second network device.
  • the first network device may modify a clock quality parameter value corresponding to one clock quality parameter, or may modify clock quality parameter values corresponding to multiple clock quality parameters.
  • the modified clock quality parameters include one or more of the following parameters: a first clock class, a first clock precision, and a first clock skew logarithm.
  • the first network device when the first network device cannot track the clock of the second network device, it modifies the parameter value A1 corresponding to the first clock level of the first network device to A11, and A11 takes precedence over A1, and A1 is equal to the second The parameter value B1 corresponding to the clock level, that is, A11 is better than B1. And/or, modify the parameter value A2 corresponding to the first clock precision of the first network device to A21, A21 has priority over A2, and A2 is equal to the parameter value B2 corresponding to the second clock precision of the second network device, that is, A21 is better than B2 .
  • the clock quality corresponding to the clock quality parameter of the first network device After modifying the clock quality parameter value corresponding to the clock quality parameter of the first network device to the first clock quality parameter value, in the first local data set of the first network device, the clock quality corresponding to the clock quality parameter of the first network device The parameter value also becomes the first clock quality parameter value accordingly.
  • the third network device may also be unable to track the clock of the second network device.
  • the first network device and the third network device reselect the synchronization tracking source, and both select The first network device acts as a synchronization tracking source, so that the first network device becomes an active synchronization tracking source.
  • the detailed implementation process of selecting the synchronization tracking source by the first network device and the third network device refer to the detailed implementation process of selecting the synchronization tracking source in FIG. 4 or FIG. 5 above, and will not be described in detail here.
  • Step 603 When the first network device can track the clock of the second network device, the first network device selects a synchronization tracking source based on the first clock quality parameter value, and the selected synchronization tracking source is the first network device.
  • the first network device In the case where the first network device can track the clock of the second network device, the first network device receives a first notification message from the second network device through the first port, and the first notification message includes a second clock quality parameter; Comparing the first clock quality parameter value and the second clock quality parameter value, when comparing the first clock quality parameter value is better than the second clock quality parameter value, the first network device selects the first network device as a synchronization tracking source.
  • the first network device receives the first notification message from the second network device through the first port, and obtains the first data set, the first data set includes at least one second clock parameter of the second network device The parameter value corresponding to each second clock parameter and the priority parameter value corresponding to the localPriority parameter of the first port, where the parameter value corresponding to each second clock parameter includes a second clock quality parameter value. And, receiving a second notification message from the third network device through the second port, and acquiring a second data set, the second data set includes each third clock in at least one third clock quality parameter of the third network device The parameter value corresponding to the parameter and the priority parameter value corresponding to the localPriority parameter of the second port.
  • the first network device Since the first clock quality parameter value in the first local data set is better than the second clock quality parameter value in the first data set, in the process of selecting a synchronization tracking source, the first network device follows the comparison process shown in Figure 4 above Comparing the first local data set with the first data set, and when comparing the first clock quality parameter value with the second clock quality parameter value, the result of the comparison is that the first clock quality parameter value is better than the second clock quality parameter value , the first network device selects the first local data set as the optimal data set. Then, the first network device compares the first local data set and the second data set according to the comparison process shown in FIG. A network device is the synchronization tracking source.
  • the first network device modifies the parameter value A1 corresponding to the first clock level to A11, that is to say, the parameter value corresponding to the first clock level in the first local data set is A11
  • the first data obtained by the first network device The parameter value corresponding to the centralized second clock level is B1. Since A11 is better than B1, when the first network device compares the first local data set with the first data set, it compares that the first local data set is the optimal data set.
  • the first network device compares the first local data set and the second data set, and compares the first local data set as the optimal data set, and uses the first network device corresponding to the first local data set as a synchronization tracking source.
  • the second network device When the second network device returns to normal after failure, the second network device receives the third notification message sent by the first network device through the third port, and the third notification message includes at least one first clock parameter of the first network device
  • the parameter value corresponding to each first clock parameter, the parameter value corresponding to each first clock parameter includes the first clock quality parameter value; obtain the third data set, the third data set includes the localPriority parameter corresponding to the third port The priority parameter value and the parameter value corresponding to each first clock parameter.
  • the second local data set of the second network device includes the second clock quality parameter value. Since the first clock quality parameter value is better than the second clock quality parameter value, the second network device compares the second local data set with the third clock quality parameter value. Data sets, the third data set is compared to the optimal data set, so the first network device corresponding to the third data set is selected as a synchronization tracking source, and the clock of the first network device is tracked.
  • the third network device will also receive the first notification message and the third notification message, and perform a source selection operation. Since the second clock quality parameter value included in the first notification message is worse than the first clock quality parameter value included in the third notification message, the third network device also selects the first network device as a synchronization tracking source and tracks the first clock quality parameter value. Clocks for network devices.
  • the first network device can track the second network device
  • the first network device, the second network device and the third network device still select the first network device as a synchronization tracking source to track the clock of the first network device, so that The clock of the first network device, the clock of the second network device and the clock of the third network do not jump.
  • the first network device tracks the clock of the second network device.
  • the first network device automatically becomes the active clock tracking source, and the clock quality parameter value corresponding to the clock quality parameter of the first network device is modified to the first clock quality parameter value. Since the first clock quality parameter value is better than the second clock quality parameter value corresponding to the clock quality parameter of the second network device, although the first network device can track the clock of the second network device, the first network device Continue to select the first network device as the synchronization tracking source based on the first clock quality parameter value, that is, the first network device will not track the second network device.
  • the second network device and the third network device also select the first network device as a synchronization tracking source, so as to avoid clock jumps of the second network device and the third network device.
  • the embodiment of the present application provides a source selection method 700, which is applied to the network architecture 200 shown in FIG. 2.
  • the first network device sets the state of the first port
  • the first port is a port on the first network device that communicates with the first clock source.
  • the method 700 includes:
  • Step 701 The first network device tracks the first clock source.
  • the first network device communicates with the first clock source through the first port, and communicates with the second clock source through the second port.
  • the second network device communicates with the second network device through the second port, and the second network device communicates with the second clock source.
  • the first clock source is an active clock source
  • the second clock source is a backup clock source
  • the clock level of the first clock source is superior to the clock level of the second clock source.
  • the tracking of the first clock source by the first network device means that the time of the first network device is synchronized with the time of the first clock source.
  • the first network device when the first network device tracks the first clock source, the first network device sends a first notification message and a second synchronization message to the second network device and the third network device, and the first notification message
  • the message includes the first clock level
  • the first clock level is the clock level of the first clock source
  • the second synchronization message includes the time of the first network device.
  • the second network device receives the first notification message and the second synchronization message, selects and tracks the first network device based on the first clock level, and performs time synchronization based on the time included in the second synchronization message.
  • the third network device receives the first notification message and the second synchronization message, selects and tracks the first network device based on the first clock level, and performs time synchronization based on the time included in the second synchronization message.
  • the second network device and/or the third network device may also receive the clock level of the second clock source, and since the first clock level is better than the clock level of the second clock source, it is selected to track the first network device .
  • Step 702 When the first network device cannot track the first clock source, the first network device sets the state of the first port to the monitoring state, and the first port in the monitoring state does not participate in source selection.
  • the first network device can monitor the state of the first clock source through the first port in the monitoring state.
  • the monitoring status includes a passive only status and the like.
  • the failure of the first network device to track the first clock source may be: failure of the first port, failure of the link between the first network device and the first clock source, and/or failure of the first clock source.
  • the first network device may not receive the packet sent by the first clock source, or the first network device receives the second notification packet sent by the first clock source, the second notification packet carries the second clock level, and the second clock
  • the level is the clock level of the first clock source, the second clock level exceeds the range of the first level, and the failure of the first clock source is determined based on the second clock level, and the first level range includes at least one clock level corresponding to the clock source.
  • the second network device and the third network device track the second clock source.
  • the first network device sends a first notification message to the second network device, the first notification message includes a third clock level, the third clock level is the clock level of the first network device, and the third clock level is located at the second Within the second level range, the second level range includes the clock level corresponding to the network device.
  • the second network device receives the first notification message, determines that the first network device cannot track the first clock source based on the third clock level in the first notification message, and selects to track the second clock source. Similarly, the third network device also tracks the second network device.
  • Step 703 The first network device tracks the second clock source.
  • the second network device Since the second network device tracks the second clock source, the time of the second network device is synchronized with the second clock source.
  • the second network device sends a third notification message and a fourth synchronization message to the first network device, the third notification message includes a fourth clock level, the fourth clock level is the clock level of the second clock source, and the fourth clock The level is within the range of the first level, and the fourth synchronization message includes the time of the second network device.
  • the first network device receives the third notification message and the fourth synchronization message, selects to track the second network device based on the fourth clock level, and performs time synchronization based on the time included in the fourth synchronization message, so as to track the second clock source .
  • the first network device when the first network device cannot track the first clock source, the first network device tracks the second clock source, and in the process of tracking the second clock source, detects whether the first clock can be tracked through the first port in the monitoring state source.
  • Step 704 When the first network device detects that the first clock source can be tracked, the first network device keeps the state of the first port as a monitoring state.
  • the first network device tracking the second clock source
  • the state of the first port remains in the monitoring state. Since the first port in the monitoring state does not participate in source selection, the first network device continues to choose to track the second clock source, and will not switch the tracked clock source from the first clock source to the second clock source, so that the entire network architecture
  • the network equipment avoids switching the tracking clock source, increasing the stability of the network.
  • Step 705 After the first network device tracks the second clock source, when the first network device cannot track the second clock source, the first network device changes the state of the first port to the non-monitoring state, and the first port in the non-monitoring state Ports participate in source selection.
  • the second network device sends a fourth notification message to the first network device, the fourth notification message includes a fifth clock level, and the fifth clock level is within the range of the second level Inside.
  • the first network device receives the fourth notification message, and determines that the second network device cannot track the second clock source because the fifth clock level is within the range of the second level. Since the first network device can track the first clock source, the first network device restores the state of the first port to the non-monitoring state.
  • the first network device sets the state of the first port back to the non-monitoring state
  • the first network device selects to track the first clock source.
  • the second network device and the third network device choose to track the first network device.
  • the non-monitoring state includes a master (Master) state or a slave (Slave) state or the like.
  • the first network device tracks the first clock source.
  • the first network device sets the state of the first port to the monitoring state, and the first port is the first clock source.
  • the port on the network device that communicates with the first clock source the first port in the monitoring state does not participate in source selection, and the first network device tracks the second clock source.
  • the first network device can track the first clock source, the state of the first port remains in the monitoring state. Since the first port in the monitoring state does not participate in source selection, the first network device still tracks the first clock source.
  • the first network device restores the state of the first port to the non-monitoring state, and the first port in the non-monitoring state can participate in source selection, so that the first network device Can choose to track the first clock source. In this way, the frequency of switching the tracking clock source can be reduced, and the stability of the network can be improved.
  • the present application provides a source selection device 800, which can be deployed on the first network device 101 in the network architecture 100 shown in FIG. 6.
  • a source selection device 800 which can be deployed on the first network device 101 in the network architecture 100 shown in FIG. 6.
  • the processing unit 801 is configured to modify the parameter value corresponding to the synchronization source selection parameter of the device 800 when the device 800 cannot track the clock of the second network device after the device 800 tracks the clock of the second network device is the first parameter value, and the first parameter value is better than the parameter value corresponding to the synchronization source selection parameter of the second network device.
  • the processing unit 801 modifies the parameter value corresponding to the synchronization source selection parameter of the device 800 to the first parameter value for a detailed implementation process, refer to step 302 of the method 300 shown in FIG. 3 and the step 302 of the method 600 shown in FIG. 6 Relevant content in step 602 will not be described in detail here.
  • the synchronization source selection parameter of the device 800 includes a local priority localPriority parameter of the device 800, and the first parameter value includes a first priority parameter value;
  • the processing unit 801 is configured to modify the second priority parameter value corresponding to the localPriority parameter of the apparatus 800 to the first priority parameter value.
  • the processing unit 801 modifies the second priority parameter value corresponding to the localPriority parameter of the device 800 to the first priority parameter value for a detailed implementation process, refer to the relevant content in step 302 of the method 300 shown in FIG. 3 , which will not be described in detail here.
  • the second priority parameter value is inferior to the priority parameter value corresponding to the localPriority parameter of the first port
  • the first port is a port on the apparatus 800 that communicates with the second network device.
  • the first priority parameter value is better than the priority parameter value corresponding to the localPriority parameter of the first port, and the first port is a port on the apparatus 800 that communicates with the second network device.
  • the second priority parameter value is equal to the priority parameter value corresponding to the localPriority parameter of the second network device.
  • the processing unit 801 is further configured to select a synchronization tracking source based on the first priority parameter value.
  • the processing unit 801 selects a detailed implementation process of the synchronization tracking source based on the first priority parameter value, refer to the relevant content in step 303 of the method 300 shown in FIG. 3 , and will not be described in detail here.
  • processing unit 801 is also used for:
  • the first port When receiving a message from the second network device through the first port, compare the first priority parameter value with the priority parameter value corresponding to the localPriority parameter of the first port, the first port is the device 800 and the first port 2. Ports for network device communication;
  • the device 800 When it is compared that the first priority parameter value is better than the priority parameter value corresponding to the localPriority parameter of the first port, the device 800 is selected as a synchronization tracking source.
  • the synchronization source selection parameter of the apparatus 800 includes a clock quality parameter of the apparatus 800, and the first parameter value includes a first clock quality parameter value;
  • the processing unit 801 is configured to modify the clock quality parameter value corresponding to the clock quality parameter of the apparatus 800 to a first clock quality parameter value.
  • the clock quality parameter of the apparatus 800 includes one or more of a clock level, a clock precision, and a logarithm value of a clock deviation of the apparatus 800 .
  • the processing unit 801 is further configured to select a synchronization tracking source based on the first clock quality parameter value.
  • the processing unit 801 selects a detailed implementation process of synchronous tracking based on the first clock quality parameter value, refer to the related content in step 603 of the method 600 shown in FIG. 6 , and no more details are given here.
  • the apparatus 800 further includes: a receiving unit 802,
  • the receiving unit 802 is configured to receive a notification message sent by the second network device, where the notification message includes a second clock quality parameter value, and the second clock quality parameter value is a clock quality parameter value corresponding to the clock quality parameter of the second network device ;
  • the processing unit 801 is further configured to select the apparatus 800 as a synchronization tracking source when the first clock quality parameter value is better than the second clock quality parameter value.
  • the processing unit 801 selects a detailed implementation process of synchronous tracking, refer to the relevant content in step 603 of the method 600 shown in FIG. 6 , and no more details are given here.
  • the number of synchronization source selection parameters of the apparatus 800 is one or more.
  • the clock of the second network device may be reset, and the network devices in the network will perform a source selection operation. Since the first parameter value is better than the parameter value corresponding to the synchronization source selection parameter of the second network device, when the processing unit performs source selection based on the first parameter value and the parameter value corresponding to the synchronization source selection parameter of the second network device, it will continue to select The device acts as a synchronization tracking source, thereby preventing the device from tracking the second network device, so as to avoid clock jumps of the device.
  • the second network device will also choose to track the device when performing source selection, so that the clock of the second network device Synchronized with the clock of the device. And, for a third network device in the network other than the device and the second network device, when the device cannot track the clock of the second network device, the third network device will choose to track the clock of the device.
  • the third network device selects the source, and may continue to select the device as a synchronization tracking source, thereby avoiding the clock jump of the third network device, or may select the second network device As a synchronization tracking source, since the clock of the second network device is synchronized with the clock of the apparatus, the clock jump of the third network device is also avoided.
  • the present application provides a source selection device 900, the device 900 can be deployed in the second network device 102 in the network architecture 100 shown in FIG. 6.
  • the second network device in method 600 including:
  • the processing unit 901 is configured to adjust the default value of the local priority localPriority parameter of the device 900 itself to be inferior to the default value of the localPriority parameter value of the port of the device 900;
  • the processing unit 901 is further configured to select a source based on the adjusted default value of the localPriority parameter of the device 900 itself and the default value of the localPriority parameter value of the port of the device 900 .
  • the processing unit 901 adjusts the default value of the local priority parameter localPriority of the device 900 itself to be inferior to the default value of the localPriority parameter value of the port of the device 900, see the method shown in FIG. 3 Relevant content in step 303 of step 300 and step 603 of method 600 shown in FIG. 6 will not be described in detail here.
  • the processing unit 901 performs a detailed implementation process of source selection based on the adjusted default value of the localPriority parameter of the device 900 itself and the default value of the localPriority parameter value of the port of the device 900, see the method shown in FIG. 3 Relevant content in step 303 of step 300 and step 603 of method 600 shown in FIG. 6 will not be described in detail here.
  • the apparatus 900 includes multiple ports, and the localPriority parameter values of the multiple ports have the same default value.
  • the device 900 also includes:
  • the sending unit 902 is configured to send a notification message after source selection, where the notification message includes the parameter value of the synchronization source selection parameter of the device 900 .
  • the processing unit adjusts the default value of the local priority parameter localPriority of the device itself to be inferior to the default value of the localPriority parameter value of the port of the device.
  • the source is selected based on the adjusted default value of the localPriority parameter of the device itself and the default value of the localPriority parameter value of the port of the device. Since the default value of the localPriority parameter of the device itself is adjusted to be inferior to the default value of the localPriority parameter value of the port of the device, when the processing unit selects the source, it will select the existing primary synchronous tracking source in the tracking network, And track the clock of the active synchronous tracking source, so as to avoid clock jumps of network devices in the network.
  • the present application provides a source selection device 1000, which can be deployed on the first network device 201 in the network architecture 200 shown in FIG. 2 , or the first network device in the method 700 shown in FIG. 7 on, including:
  • the processing unit 1001 is configured to set the state of the first port to the monitoring state when the device 1000 cannot track the first clock source after the device 1000 tracks the first clock source, and the first port is the first port on the device 1000 For ports communicating with the first clock source, the first port in the monitoring state does not participate in source selection; when the device 1000 can track the first clock source, the state of the first port remains in the monitoring state.
  • processing unit 1001 is further configured to track the second clock source.
  • the processing unit 1001 tracks the detailed implementation process of the second clock source, refer to the related content in step 703 of the method 700 shown in FIG. 7 , and no more details are given here.
  • the processing unit 1001 is further configured to, after the device 1000 tracks the second clock source, when the device 1000 cannot track the second clock source, set the state of the first port back to the non-monitoring state, in the non-monitoring state.
  • the first port of monitoring status participates in source selection.
  • step 704 of the method 700 shown in FIG. 7 for the detailed implementation process of the processing unit 1001 setting the state of the first port back to the non-monitoring state, refer to the related content in step 704 of the method 700 shown in FIG. 7 , and will not be described in detail here.
  • the processing unit 1001 sets the state of the first port to the monitoring state when the device cannot track the first clock source after the device tracks the first clock source, and sets the state of the first port to the monitoring state when the device can track the first clock source.
  • the state of the first port remains in the monitoring state.
  • the processing unit will not switch the tracked clock source back to the first clock source, which reduces the frequency of switching the clock source and increases the stability of the network.
  • an embodiment of the present application provides a schematic diagram of a source selection device 1100 .
  • the apparatus 1100 may be the first network device 101 in the network architecture 100 shown in FIG. 1 , the first network device in the method 300 shown in FIG. 3 , or the first network device in the method 600 shown in FIG. 6 .
  • the apparatus 1100 includes at least one processor 1101 , internal connections 1102 , memory 1103 and at least one transceiver 1104 .
  • the device 1100 is a device with a hardware structure, and may be used to implement the functional modules in the device 800 described in FIG. 8 .
  • the processing unit 801 in the device 800 shown in FIG. This is achieved by the transceiver 1104 .
  • the apparatus 1100 may also be used to realize the function of the first network device in the above embodiment shown in FIG. 1 , FIG. 3 or FIG. 6 .
  • the processor 1101 may be a general-purpose central processing unit (central processing unit, CPU), network processor (network processor, NP), microprocessor, application-specific integrated circuit (application-specific integrated circuit, ASIC) , or one or more integrated circuits used to control the execution of the programs of this application.
  • CPU central processing unit
  • NP network processor
  • ASIC application-specific integrated circuit
  • the internal connection 1102 may include a path for transferring information between the above components.
  • the internal connection 1102 is a single board or a bus.
  • the above-mentioned transceiver 1104 is used for communicating with other devices or a communication network.
  • the above-mentioned memory 1103 may be a read-only memory (read-only memory, ROM) or other types of static storage devices that can store static information and instructions, a random access memory (random access memory, RAM) or other types that can store information and instructions.
  • ROM read-only memory
  • RAM random access memory
  • Type of dynamic storage device also can be electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), read-only disc (compact disc read-only memory, CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can be used by Any other medium accessed by a computer, but not limited to.
  • the memory can exist independently and be connected to the processor through the bus. Memory can also be integrated with the processor.
  • the memory 1103 is used to store the application program code for executing the solution of the present application, and the execution is controlled by the processor 1101 .
  • the processor 1101 is used to execute the application program code stored in the memory 1103, and cooperate with at least one transceiver 1104, so that the device 1100 realizes the functions in the patented method.
  • the processor 1101 may include one or more CPUs, for example, CPU0 and CPU1 in FIG. 11 .
  • the apparatus 1100 may include multiple processors, for example, the processor 1101 and the processor 1107 in FIG. 11 .
  • Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor.
  • a processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
  • an embodiment of the present application provides a schematic diagram of a source selection device 1200 .
  • the apparatus 1200 may be the second network device 102 in the network architecture 100 shown in FIG. 1 , the second network device in the method 300 shown in FIG. 3 , or the second network device in the method 600 shown in FIG. 6 .
  • the device 1200 includes at least one processor 1201 , internal connections 1202 , memory 1203 and at least one transceiver 1204 .
  • the device 1200 is a device with a hardware structure, and may be used to implement the functional modules in the device 900 described in FIG. 9 .
  • the processing unit 901 in the device 900 shown in FIG. 9 can be realized by calling the code in the memory 1203 by the at least one processor 1201, and the sending unit 902 in the device 900 shown in FIG. 9 can be This is achieved by the transceiver 1204 .
  • the apparatus 1200 may also be used to realize the function of the second network device in the embodiment shown in FIG. 1 , FIG. 3 or FIG. 6 above.
  • the processor 1201 may be a general-purpose central processing unit (central processing unit, CPU), network processor (network processor, NP), microprocessor, application-specific integrated circuit (application-specific integrated circuit, ASIC) , or one or more integrated circuits used to control the execution of the programs of this application.
  • CPU central processing unit
  • NP network processor
  • ASIC application-specific integrated circuit
  • the internal connection 1202 may include a path for transferring information between the components.
  • the internal connection 1202 is a single board or a bus.
  • the above-mentioned transceiver 1204 is used for communicating with other devices or a communication network.
  • the above-mentioned memory 1203 may be a read-only memory (read-only memory, ROM) or other types of static storage devices that can store static information and instructions, a random access memory (random access memory, RAM) or other types that can store information and instructions.
  • ROM read-only memory
  • RAM random access memory
  • Type of dynamic storage device also can be electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), read-only disc (compact disc read-only memory, CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can be used by Any other medium accessed by a computer, but not limited to.
  • the memory can exist independently and be connected to the processor through the bus. Memory can also be integrated with the processor.
  • the memory 1203 is used to store the application program code for executing the solution of the present application, and the execution is controlled by the processor 1201 .
  • the processor 1201 is used to execute the application program code stored in the memory 1203, and cooperate with at least one transceiver 1204, so that the device 1200 realizes the functions in the patented method.
  • the processor 1201 may include one or more CPUs, for example, CPU0 and CPU1 in FIG. 12 .
  • the apparatus 1200 may include multiple processors, for example, the processor 1201 and the processor 1207 in FIG. 12 .
  • Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor.
  • a processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
  • the apparatus 1300 may be the first network device 201 in the network architecture 200 shown in FIG. 2 , or the first network device in the method 700 shown in FIG. 7 .
  • the device 1300 includes at least one processor 1301 , internal connections 1302 , memory 1303 and at least one transceiver 1304 .
  • the device 1300 is a device with a hardware structure, and can be used to implement the functional modules in the device 1000 described in FIG. 10 .
  • the processing unit 1001 in the apparatus 1000 shown in FIG. 10 can be realized by calling codes in the memory 1303 by the at least one processor 1301 .
  • the apparatus 1300 may also be used to realize the function of the first network device in the above embodiment shown in FIG. 2 or FIG. 7 .
  • the processor 1301 may be a general-purpose central processing unit (central processing unit, CPU), network processor (network processor, NP), microprocessor, application-specific integrated circuit (application-specific integrated circuit, ASIC) , or one or more integrated circuits used to control the execution of the programs of this application.
  • CPU central processing unit
  • NP network processor
  • ASIC application-specific integrated circuit
  • the internal connection 1302 may include a path for transferring information between the components.
  • the internal connection 1302 is a single board or a bus.
  • the above-mentioned transceiver 1304 is used for communicating with other devices or a communication network.
  • the above-mentioned memory 1303 may be a read-only memory (read-only memory, ROM) or other types of static storage devices that can store static information and instructions, a random access memory (random access memory, RAM) or other types that can store information and instructions.
  • ROM read-only memory
  • RAM random access memory
  • Type of dynamic storage device also can be electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), read-only disc (compact disc read-only memory, CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can be used by Any other medium accessed by a computer, but not limited to.
  • the memory can exist independently and be connected to the processor through the bus. Memory can also be integrated with the processor.
  • the memory 1303 is used to store the application program code for executing the solution of the present application, and the execution is controlled by the processor 1301 .
  • the processor 1301 is used to execute the application program code stored in the memory 1303, and cooperate with at least one transceiver 1304, so that the device 1300 realizes the functions in the patented method.
  • the processor 1301 may include one or more CPUs, for example, CPU0 and CPU1 in FIG. 13 .
  • the apparatus 1300 may include multiple processors, for example, the processor 1301 and the processor 1307 in FIG. 13 .
  • Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor.
  • a processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
  • the embodiment of the present application provides a source selection system 1400, including the device 800 shown in FIG. 8 and the device 900 shown in FIG. 9, or, including the device 1100 shown in FIG. 12 shows the device 1200.
  • the device 800 shown in FIG. 8 or the device 1100 shown in FIG. 11 may be the first network device 1401, and the device 900 shown in FIG. Network device 1402.
  • the program can be stored in a computer-readable storage medium.
  • the above-mentioned The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

本申请公开了一种选源方法、装置、***及存储介质,属于通信领域。所述方法包括:在第一网络设备跟踪第二网络设备的时钟后,当所述第一网络设备无法跟踪所述第二网络设备的时钟时,所述第一网络设备将所述第一网络设备的同步选源参数对应的参数值修改为第一参数值,所述第一参数值优于所述第二网络设备的所述同步选源参数对应的参数值。本申请能够避免网络设备的时钟发生跳变。

Description

选源方法、装置、***及存储介质
本申请要求于2021年6月28日提交的申请号为202110718819.1、发明名称为“选源方法、装置、***及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信领域,特别涉及一种选源方法、装置、***及存储介质。
背景技术
随着网络技术的发展,对网络时延的检测精度提出了很高的要求。例如,对于网络中的任意两个网络设备,如果需要测量该两个网络设备之间的单向时延,该两个网络设备的时钟需要同步。
为了使网络中的各网络设备之间的时钟能够同步,目前在网络中选择两个网络设备作为同步跟踪源。对于该两个同步跟踪源,其中一个为主用同步跟踪源,另一个为备用同步跟踪源。在主用同步跟踪源正常时,备用同步跟踪源和该网络中除该两个网络设备之外的各其他网络设备跟踪主用同步跟踪源,以使网络中的每个网络设备的时钟同步。在主用同步跟踪源故障时,该各其他网络设备跟踪备用同步跟踪源,以使网络中的各网络设备的时钟继续同步。
在实现本申请的过程中,发明人发现现有技术至少存在以下问题:
如果主用同步跟踪源恢复正常,该备用同步跟踪源和该各其他网络设备重新跟踪主用同步跟踪源。在恢复正常时,主用同步跟踪源的时钟复位,而网络中的各网络设备跟踪主用同步跟踪源,使得各网络设备的时钟发生跳变。
发明内容
本申请提供了一种选源方法、装置、***及存储介质,以避免网络设备的时钟发生跳变。所述技术方案如下:
第一方面,本申请提供了一种选源方法,在所述方法中,在第一网络设备跟踪第二网络设备的时钟后,当第一网络设备无法跟踪第二网络设备的时钟时,第一网络设备将第一网络设备的同步选源参数对应的参数值修改为第一参数值,第一参数值优于第二网络设备的同步选源参数对应的参数值。
其中,在第一网络设备能够跟踪第二网络设备时,第二网络设备的时钟可能发生复位,网络中的网络设备会进行选源操作。对于第一网络设备,由于第一参数值优于第二网络设备的同步选源参数对应的参数值,第一网络设备基于第一参数值和第二网络设备的同步选源参数对应的参数值进行选源时,会继续选择第一网络设备作为同步跟踪源,从而阻止了第一网络设备跟踪第二网络设备,以避免第一网络设备的时钟发生跳变。
另外,由于第一参数值优于第二网络设备的同步选源参数对应的参数值,这样第二网络设备在进行选源时,也会选择跟踪第一网络设备,从而使得第二网络设备的时钟与第一网络设备的时钟同步。以及,
对于网络中除第一网络设备和第二网络设备以外的第三网络设备,在第一网络设备无法跟踪第二网络设备的时钟时,第三网络设备会选择跟踪第一网络设备的时钟。在第一网络设备能够跟踪第二网络设备时,第三网络设备进行选源,可能继续选择第一网络设备作为同步跟踪源,从而避免第三网络设备的时钟发生跳变,或者,可能选择第二网络作为同步跟踪源,但由于第二网络设备的时钟与第一网络设备的时钟同步,从而也避免第三网络设备的时钟发生跳变。
在一种可能的实现方式中,第一网络设备的同步选源参数包括第一网络设备的本地优先级localPriority参数,第一参数值包括第一优先级参数值。第一网络设备将第一网络设备的localPriority参数对应的第二优先级参数值修改为第一优先级参数值。如此通过修改第一网络设备的localPriority参数对应的参数值,以使在第一网络设备能够跟踪第二网络设备时,第一网络设备能够继续作为同步跟踪源,从而避免网络中的网络设备的时钟发生跳变。
在另一种可能的实现方式中,第二优先级参数值劣于第一端口的localPriority参数对应的优先级参数值,第一端口是第一网络设备上的与第二网络设备通信的端口。
在另一种可能的实现方式中,第一优先级参数值优于第一端口的localPriority参数对应的优先级参数值,第一端口是第一网络设备上的与第二网络设备通信的端口。这样由于第一优先级参数值优于第一端口的localPriority参数对应的优先级参数值,保证在第一网络设备进行选源时选择第一网络设备作为同步跟踪源。
在另一种可能的实现方式中,第二优先级参数值等于第二网络设备的localPriority参数对应的优先级参数值。
在另一种可能的实现方式中,第一网络设备基于第一优先级参数值,选择同步跟踪源,这样保证第一网络设备基于第一优先级参数值能够选择第一网络设备作为同步跟踪源。
在另一种可能的实现方式中,第一网络设备在通过第一端口接收到来自第二网络设备的报文时,比较第一优先级参数值和第一端口的localPriority参数对应的优先级参数值,第一端口是第一网络设备上的与第二网络设备通信的端口。在比较出第一优先级参数值优于第一端口的localPriority参数对应的优先级参数值时,第一网络设备选择第一网络设备作为同步跟踪源。从而阻止第一网络设备跟踪第二网络设备的时钟,避免了第一网络设备的时钟发生跳变。
在另一种可能的实现方式中,第一网络设备的同步选源参数包括第一网络设备的时钟质量参数,第一参数值包括第一时钟质量参数值。第一网络设备将第一网络设备的时钟质量参数对应的时钟质量参数值修改为第一时钟质量参数值。如此通过修改第一网络设备的时钟质量参数对应的时钟质量参数值,以使在第一网络设备能够跟踪第二网络设备时,网络中的网络设备能够选择第一网络设备继续作为同步跟踪源,从而避免网络中的网络设备的时钟发生跳变。
在另一种可能的实现方式中,第一网络设备的时钟质量参数包括第一网络设备的时钟等级、时钟精度和时钟偏差对数值中的一个或多个。
在另一种可能的实现方式中,第一网络设备基于第一时钟质量参数值,选择同步跟踪源,这样保证第一网络设备基于第一时钟质量参数值能够选择第一网络设备作为同步跟踪源。
在另一种可能的实现方式中,第一网络设备接收第二网络设备发送的通知报文,该通知报文包括第二时钟质量参数值,第二时钟质量参数值是第二网络设备的时钟质量参数对应的时钟质量参数值。在第一时钟质量参数值优于第二时钟质量参数值时,第一网络设备选择第一网络设备作为同步跟踪源。从而阻止第一网络设备跟踪第二网络设备的时钟,避免了第一网络设备的时钟发生跳变。
在另一种可能的实现方式中,第一网络设备的同步选源参数的个数为一个或多个。
第二方面,本申请提供了一种选源方法,在所述方法中,网络设备将网络设备自身的本地优先级localPriority参数的默认值调整为劣于网络设备的端口的localPriority参数值的默认值。网络设备基于调整后的网络设备自身的localPriority参数的默认值和网络设备的端口的localPriority参数值的默认值进行选源。
由于网络设备自身的localPriority参数的默认值被调整为劣于网络设备的端口的localPriority参数值的默认值,所以在选源时会选择跟踪网络中已存在的主用同步跟踪源,并跟踪该主用同步跟踪源的时钟,从而避免网络中的网络设备的时钟发生跳变。
在一种可能的实现方式中,网络设备包括多个端口,该多个端口的所述localPriority参数值的默认值相同。
在另一种可能的实现方式中,网络设备在进行选源后发送通知报文,该通知报文包括网络设备的同步选源参数的参数值。由于网络设备在进行选源后,该网络设备的时钟已与主用同步跟踪源的时钟同步,所以网络设备在进行选源后发送通知报文,其他网络设备选择跟踪该网络设备的时钟时,其他网络设备的时钟也不会发生跳变。
第三方面,本申请提供了一种选源方法,在所述方法中,在第一网络设备跟踪第一时钟源后,当第一网络设备无法跟踪第一时钟源时,第一网络设备设置第一端口的状态为监控状态,第一端口是第一网络设备上与第一时钟源通信的端口,处于监控状态的第一端口不参与选源。当第一网络设备可以跟踪第一时钟源时,将第一端口的状态保持为监控状态。
其中,当第一网络设备无法跟踪第一时钟源后,第一网络设备又可以跟踪第一时钟源时,将第一端口的状态保持为监控状态,由于处于监控状态的第一端口不参与选源,这样第一网络设备不会将跟踪的时钟源切换回第一时钟源,减小了切换时钟源的频率,增加了网络的稳定性。
在一种可能的实现方式中,第一网络设备跟踪第二时钟源。
在另一种可能的实现方式中,在第一网络设备跟踪第二时钟源后,当第一网络设备无法跟踪第二时钟源时,第一网络设备设置第一端口的状态恢复为非监控状态,处于非监控状态的第一端口参与选源。如此,只能在第一网络设备无法跟踪第二时钟源,第一网络设备才会将跟踪的时钟源切换回第一时钟源,减小了切换时钟源的频率,增加了网络的稳定性。
第四方面,本申请提供了一种选源装置,用于执行第一方面或第一方面的任意一种可能的实现方式中的方法。具体地,所述装置包括用于执行第一方面或第一方面的任意一种可能的实现方式中的方法的单元。
第五方面,本申请提供了一种选源装置,用于执行第二方面或第二方面的任意一种可能的实现方式中的方法。具体地,所述装置包括用于执行第二方面或第二方面的任意一种可能的实现方式中的方法的单元。
第六方面,本申请提供了一种选源装置,用于执行第三方面或第三方面的任意一种可能的实现方式中的方法。具体地,所述装置包括用于执行第三方面或第三方面的任意一种可能的实现方式中的方法的单元。
第七方面,本申请提供了一种选源装置,所述装置包括处理器和存储器。其中,所述处理器以及所述存储器之间可以通过内部连接相连。所述存储器用于存储程序,所述处理器用于执行所述存储器中的程序,使得所述装置完成第一方面或第一方面的任意可能的实现方式中的方法。
第八方面,本申请提供了一种选源装置,所述装置包括处理器和存储器。其中,所述处理器以及所述存储器之间可以通过内部连接相连。所述存储器用于存储程序,所述处理器用于执行所述存储器中的程序,使得所述装置完成第二方面或第二方面的任意可能的实现方式中的方法。
第九方面,本申请提供了一种选源装置,所述装置包括处理器和存储器。其中,所述处理器以及所述存储器之间可以通过内部连接相连。所述存储器用于存储程序,所述处理器用于执行所述存储器中的程序,使得所述装置完成第三方面或第三方面的任意可能的实现方式中的方法。
第十方面,本申请提供了一种计算机程序产品,所述计算机程序产品包括在计算机可读存储介质中存储的计算机程序,并且所述计算程序通过处理器进行加载来实现上述第一方面、第二方面、第三方面、第一方面任意可能的实现方式、第二方面任意可能的实现方式或第二方面任意可能的实现方式的方法。
第十一方面,本申请提供了一种计算机可读存储介质,用于存储计算机程序,所述计算机程序通过处理器进行加载来执行上述第一方面、第二方面、第三方面、第一方面任意可能的实现方式、第二方面任意可能的实现方式或第三方面任意可能的实现方式的方法。
第十二方面,本申请提供了一种芯片,包括存储器和处理器,存储器用于存储计算机指令,处理器用于从存储器中调用并运行该计算机指令,以执行第一方面、第二方面、第三方面、第一方面任意可能的实现方式、第二方面任意可能的实现方式或第三方面任意可能的实现方式的方法。
第十三方面,本申请提供了一种选源***,所述***包括第四方面所述的装置和第五方面所述的装置;或者,所述***包括第七方面所述的装置和第八方面所述的装置。
附图说明
图1是本申请实施例提供的一种网络架构示意图;
图2是本申请实施例提供的另一种网络架构示意图;
图3是本申请实施例提供的一种选源方法流程图;
图4是本申请实施例提供的一种比较数据集的流程图;
图5是本申请实施例提供的另一种比较数据集的流程图;
图6是本申请实施例提供的另一种选源方法流程图;
图7是本申请实施例提供的另一种选源方法流程图;
图8是本申请实施例提供的一种选源装置结构示意图;
图9是本申请实施例提供的另一种选源装置结构示意图;
图10是本申请实施例提供的另一种选源装置结构示意图;
图11是本申请实施例提供的另一种选源装置结构示意图;
图12是本申请实施例提供的另一种选源装置结构示意图;
图13是本申请实施例提供的另一种选源装置结构示意图;
图14是本申请实施例提供的一种选源***结构示意图。
具体实施方式
下面将结合附图对本申请实施方式作进一步地详细描述。
参见图1,本申请实施例提供了一种网络架构100,包括:
第一网络设备101和第二网络设备102,第一网络设备101与第二网络设备102通信。第一网络设备101跟踪第二网络设备102的时钟。
第一网络设备101跟踪第二网络设备102的时钟是指:第一网络设备101将自身的时间与第二网络设备102的时间进行同步,和/或,第一网络设备101将自身的频率与第二网络设备102的频率进行同步。
在一些实施例中,第二网络设备102为主用同步跟踪源,第一网络设备101为备用同步 跟踪源。所以第一网络设备101在选择同步跟踪源时,选择第二网络设备102作为同步跟踪源,并跟踪第二网络设备102的时钟。
参见图1,该网络架构100还包括至少一个第三网络设备103,对于该至少一个第三网络设备103中的任一个第三网络设备,该第三网络设备与第一网络设备101通信,以及,该第三网络设备与第二网络设备102通信。
由于第一网络设备101为备用同步跟踪源,第二网络设备102为主用同步跟踪源,所以该第三网络设备选择第二网络设备102为同步跟踪源,并跟踪第二网络设备102的时钟。
第一网络设备101包括至少一个同步选源参数。
第一网络设备101中的至少一个同步选源参数包括本地优先级(localPriority)参数和/或至少一个第一时钟参数等。该至少一个同步选源参数是第一网络设备101的时钟的参数。
在一些实施例中,localPriority参数对应的优先级参数值越大,表示该localPriority参数对应的优先级参数值越优,或者,localPriority参数对应的优先级参数值越小,表示该localPriority参数对应的优先级参数值越优。
第一网络设备101包括至少一个端口,每个端口也包括localPriority参数。第一网络设备101的localPriority参数对应的默认值劣于该每个端口的localPriority参数对应的默认值。为了便于说明,将第一网络设备101的localPriority参数对应的默认值称为第二优先级参数值,即第二优先级参数值劣于该每个端口的localPriority参数对应的默认值。
例如,假设localPriority参数对应的优先级参数值越小,表示该localPriority参数对应的优先级参数值越优,第一网络设备101的localPriority参数对应的第二优先级参数值为“255”,而该每个端口的localPriority参数对应的默认值为“128”,使得第一网络设备101的localPriority参数对应的第二优先级参数值劣于该每个端口的localPriority参数对应的默认值。
该至少一个第一时钟参数包括如下一个或多个时钟参数:至少一个第一时钟质量参数,第一时钟标识和第一时钟优先级参数等。第一时钟标识为第一网络设备101的时钟标识,第一时钟优先级参数为第一网络设备101的时钟优先级参数等。第一网络设备101的时钟优先级参数又可称为第一网络设备101的优先级参数2(Priority2)。
在一些实施例中,该至少一个第一时钟质量参数包括如下一个或多个时钟质量参数:第一时钟等级、第一时钟精度和第一时钟偏差对数值等。
第一网络设备101包括第一本地数据集,第一本地数据集包括如下一个或多个参数值:第一网络设备101的localPriority参数对应的第二优先级参数值和该至少一个第一时钟参数中的每个第一时钟参数对应的参数值。也就是说:第一本地数据集包括如下一个或多个参数值:第一网络设备101的localPriority参数对应的第二优先级参数值、第一时钟等级对应的参数值、第一时钟精度对应的参数值、第一时钟偏差对数值对应的参数值、第一时钟优先级参数对应的参数值和第一时钟标识等。
例如,假设第一本地数据集包括第二优先级参数值“255”、第一时钟等级对应的参数值A1、第一时钟精度对应的参数值A2、第一时钟偏差对数值对应的参数值A3、第一时钟优先级参数对应的参数值A4和第一时钟标识ID1。
第二网络设备102也包括至少一个同步选源参数。
第二网络设备102中的至少一个同步选源参数包括localPriority参数和/或至少一个第二时钟参数等。该至少一个同步选源参数是第二网络设备102的时钟的参数。
第二网络设备102包括至少一个端口,每个端口也包括localPriority参数。第二网络设备102的localPriority参数对应的优先级参数值等于该每个端口的localPriority参数对应的默认值。例如,第二网络设备102的localPriority参数对应的优先级参数值为“128”,而该每个端口的localPriority参数对应的默认值为“128”,使得第二网络设备102的localPriority参数对应的优先级参数值等于该每个端口的localPriority参数对应的默认值。
该至少一个第二时钟参数包括如下一个或多个时钟参数:至少一个第二时钟质量参数,第二时钟标识和/或第二时钟优先级参数等。第二时钟标识为第二网络设备102的时钟标识,第二时钟优先级参数为第二网络设备102的时钟优先级参数等。第二网络设备102的时钟优先级参数又可称为第二网络设备102的优先级参数2。
在一些实施例中,该至少一个第二时钟质量参数包括如下一个或多个时钟质量参数:第二时钟等级、第二时钟精度和/或第二时钟偏差对数值等。
第二网络设备102包括第二本地数据集,第二本地数据集包括如下一个或多个参数值:第二网络设备102的localPriority参数对应的优先级参数值和该至少一个第二时钟参数中的每个第二时钟参数对应的参数值。也就是说:第二本地数据集包括如下一个或多个参数值:第二网络设备102的localPriority参数对应的优先级参数值、第二时钟等级对应的参数值、第二时钟精度对应的参数值、第二时钟偏差对数值对应的参数值、第二时钟优先级参数对应的参数值和第二时钟标识等。
例如,假设第二本地数据集包括第二网络设备102的localPriority参数对应的优先级参数值“128”、第二时钟等级对应的参数值B1、第二时钟精度对应的参数值B2、第二时钟偏差对数值对应的参数值B3、第二时钟优先级参数对应的参数值B4和第二时钟标识ID2。
对于上述至少一个第三网络设备103中的每个第三网络设备,该第三网络设备也包括至少一个同步选源参数。
该第三网络设备中的至少一个同步选源参数包括localPriority参数和/或至少一个第三时钟参数等。该至少一个同步选源参数是该第三网络设备的时钟的参数。
该第三网络设备包括至少一个端口,每个端口也包括localPriority参数。该第三网络设备的localPriority参数对应的默认值劣于该每个端口的localPriority参数对应的默认值。例如,假设,该第三网络设备的localPriority参数对应的优先级参数值为“255”,而该每个端口的localPriority参数对应的默认值为“128”,使得该第三网络设备的localPriority参数对应的优先级参数值劣于该每个端口的localPriority参数对应的默认值。
该至少一个第三时钟参数包括如下一个或多个时钟参数:至少一个第三时钟质量参数,第三时钟标识和/或第三时钟优先级参数等。第三时钟标识为该第三网络设备的时钟标识,第三时钟优先级参数为该第三网络设备的时钟优先级参数。该第三网络设备的时钟优先级参数又可称为该第三网络设备的优先级参数2。
在一些实施例中,该至少一个第三时钟质量参数包括如下一个或多个时钟质量参数:第三时钟等级、第三时钟精度和/或第三时钟偏差对数值等。
该第三网络设备包括第三本地数据集,第三本地数据集包括如下一个或多个参数值:该第三网络设备的localPriority参数对应的优先级参数值和该至少一个第三时钟参数中的每个第三时钟参数对应的参数值。也就是说:第三本地数据集包括如下一个或多个参数值:该第三网络设备的localPriority参数对应的优先级参数值、第三时钟等级对应的参数值、第三时钟 精度对应的参数值、第三时钟偏差对数值对应的参数值、第三时钟优先级参数对应的参数值和第三时钟标识等。
例如,假设第三本地数据集包括该第三网络设备的localPriority参数对应的优先级参数值“255”、第三时钟等级对应的参数值C1、第三时钟精度对应的参数值C2、第三时钟偏差对数值对应的参数值C3、第三时钟优先级参数对应的参数值C4和第三时钟标识ID3。
在一些实施例中,对于同类型的第一时钟参数、第二时钟参数和第三时钟参数,该第一时钟参数对应的参数值、第二时钟参数对应的参数值和第三时钟参数对应的参数值相等。也就是说:第一时钟等级对应的参数值A1、第二时钟等级对应的参数值B1和第三时钟等级对应的参数值C1相等;第一时钟精度对应的参数值A2、第二时钟精度对应的参数值B2和第三时钟精度对应的参数值C2相等;第一时钟偏差对数值对应的参数值A3、第二时钟偏差对数值对应的参数值B3和第三时钟偏差对数值对应的参数值C3相等。
在一些实施例中,第一时钟优先级参数对应的优先级参数值等于第二时钟优先级参数对应的优先级参数值。但二者均优于第三时钟优先级参数对应的优先级参数值。也就是说,第一时钟优先级参数对应的参数值A4等于第二时钟优先级参数对应的参数值B4,但A4和B4均优于第三时钟优先级参数对应的参数值C4。
第一网络设备101的第一时钟标识和第二网络设备102的第二时钟标识之间的排序为第二网络设备102的第二时钟标识排在第一网络设备101的第一时钟标识之前。
参见图2,本申请实施例提供了一种网络架构200,包括:
第一时钟源201、第二时钟源202和第一网络设备203,第一网络设备203包括第一端口和第二端口,第一网络设备203通过第一端口与第一时钟源201通信,通过第二端口与第二时钟源202通信。
在一些实施例中,第一时钟源201为主用时钟源,第二时钟源202为备用时钟源。第一网络设备201跟踪第一时钟源201,在无法跟踪第一时钟源201时,跟踪第二时钟源202。
所谓第一网络设备203跟踪第一时钟源201是指:第一网络设备203将自身的时间与第一时钟源201的时间进行同步。在实现时,
第一网络设备203接收第一时钟源201发送的第一同步报文,第一同步报文包括第一时钟源201的时间,基于第一同步报文包括的时间对第一网络设备203的时间进行同步。
在一些实施例中,该网络架构200还第二网络设备204和至少一个第三网络设备205,第二网络设备204与第二时钟源202通信,第一网络设备203通过第二端口与第二网络设备204通信。对于该至少一个第三网络设备205中的每个第三网络设备,该第三网络设备与第一网络设备203通信,以及该第三网络设备205与第二网络设备204通信。
在第一网络设备203跟踪第一时钟源201的情况下,第二网络设备204和每个第三网络设备也跟踪第一时钟源。在实现时,
第一网络设备203发送第二同步报文,第二同步报文包括进行时间同步的第一网络设备203的时间。第二网络设备204接收第二同步报文,基于第二同步报文包括的时间对第二网络设备204的时间进行同步。对于每个第三网络设备,该第三网络设备接收第二同步报文,基于第二同步报文包括的时间对该第三网络设备的时间进行同步。
在第一网络设备203无法跟踪第一时钟源201的情况,第二网络设备204跟踪第二时钟 源202,第一网络设备101和每个第三网络设备也跟踪第二时钟源202。
所谓第二网络设备204跟踪第二时钟源202是指:第二网络设备204将自身的时间与第二时钟源202的时间进行同步。在实现时,
第二网络设备204接收第二时钟源202发送的第三同步报文,第三同步报文包括第二时钟源202的时间,基于第三同步报文包括的时间对第二网络设备204的时间进行同步。
所谓第一网络设备203和每个第三网络设备跟踪第二时钟源202是指:第二网络设备204发送第四同步报文,第四同步报文包括进行时间同步的第二网络设备204的时间。第一网络设备203接收第二网络设备204发送的第四同步报文,基于第四同步报文包括的时间对第一网络设备203的时间进行同步。对于每个第三网络设备,该第三网络设备接收第二网络设备204发送的第四同步报文,基于第四同步报文包括的时间对该第三网络设备的时间进行同步。
其中,在第一网络设备201无法跟踪第一时钟源201时,第二网络设备204跟踪第二时钟源203。同时,第一网络设备203和每个第三网络设备也跟踪第二时钟源202,即第一网络设备203和每个第三网络设备接收第二网络设备204发送的第四同步报文,基于第四同步报文中的时间进行时间同步。
在第一网络设备201可以跟踪第一时钟源201时,如果第一网络设备203停止跟踪第二时钟源202,并开始跟踪第一时钟源201,这样第二网络设备204和每个第三网络设备也跟踪第一时钟源201,使得网络设备切换跟踪的时钟源,增加了切换跟踪的时钟源的频率,影响网络的稳定性。
参见图3,本申请实施例提供了一种选源方法300,所述方法300应用于图1所示的网络架构100,在所述方法300中,第一网络设备在无法跟踪第二网络设备的时钟时,通过修改第一网络设备的localPriority参数的值,来实现选择第一网络设备作为同步跟踪源。所述方法300包括:
步骤301:第一网络设备跟踪第二网络设备的时钟。
在网络架构100中,第二网络设备为主用同步跟踪源,第一网络设备为备用同步跟踪源,所以该网络架构中的各网络设备均选择第二网络设备为同步跟踪源,并跟踪第二网络设备的时钟。
第一网络设备跟踪第二网络设备的时钟后,第一网络设备的时间与第二网络设备的时间同步,和/或,第一网络设备的频率与第二网络设备的频率同步。
对于该网络架构中的第一网络设备,第一网络设备选择第二网络设备为同步跟踪源的操作为:
第一网络设备通过第一端口接收第二网络设备发送的第一通知报文,第一通知报文包括第二网络设备的至少一个第二时钟参数中的每个第二时钟参数对应的参数值,第一端口是第一网络设备上与第二网络设备通信的端口。获取第一数据集,第一数据集包括第一端口的localPriority参数对应的优先级参数值和第一通知报文中的每个第二时钟参数对应的参数值。以及,
第一网络设备通过第二端口接收与第一网络设备通信的第三网络设备发送的第二通知报文,第二通知报文包括该第三网络设备的至少一个第三时钟参数中的每个第三时钟参数对应的参数值,第二端口是第一网络设备上与第三网络设备通信的端口。获取第二数据集,第二 数据集包括第二端口的localPriority参数对应的优先级参数值和第二通知报文中的每个第三时钟参数对应的参数值。
第一网络设备基于第一本地数据集、第一数据集和第二数据集,通过指定的选源算法进行选源,并选择第二网络设备作为同步跟踪源。
在一些实施例中,第一数据集包括如下一个或多个参数值:第一端口的localPriority参数对应的优先级参数值、第二时钟等级对应的参数值、第二时钟精度对应的参数值、第二时钟偏差对数值对应的参数值、第二时钟优先级参数对应的参数值和第二时钟标识等。例如,假设第一数据集包括第一端口的localPriority参数对应的优先级参数值“128”、第二时钟等级对应的参数值B1、第二时钟精度对应的参数值B2、第二时钟偏差对数值对应的参数值B3、第二时钟优先级参数对应的参数值B4和第二时钟标识ID2。
在一些实施例中,第二数据集包括如下一个或多个参数值:第二端口的localPriority参数对应的优先级参数值、第三时钟等级对应的参数值、第三时钟精度对应的参数值、第三时钟偏差对数值对应的参数值、第三时钟优先级参数对应的参数值和第三时钟标识等。例如,假设第二数据集包括第二端口的localPriority参数对应的优先级参数值“128”、第三时钟等级对应的参数值C1、第三时钟精度对应的参数值C2、第三时钟偏差对数值对应的参数值C3、第三时钟优先级参数对应的参数值C4和第三时钟标识ID3。
在一些实施例中,上述选源操作为:对于第一本地数据集、第一数据集和第二数据集中任意两个数据集,假设以第一本地数据集和第一数据集为例,比较第一本地数据集和第一数据集,以从该两个数据集中选择一个最优数据集。再比较选择的数据集与第二数据集,以从该两个数据集中选择一个最优数据集,将最优数据集对应的网络设备作为同步跟踪源。
第一本地数据集包括如下一个或多个参数值:第一网络设备的localPriority参数对应的第二优先级参数值、第一时钟等级对应的参数值、第一时钟精度对应的参数值、第一时钟偏差对数值对应的参数值、第一时钟优先级参数对应的参数值和第一时钟标识等。例如,假设第一本地数据集包括第二优先级参数值“255”、第一时钟等级对应的参数值A1、第一时钟精度对应的参数值A2、第一时钟偏差对数值对应的参数值A3、第一时钟优先级参数对应的参数值A4和第一时钟标识ID1。
参见图4,比较过程为:
11:比较第一时钟等级对应的参数值A1和第二时钟等级对应的参数值B1,如果比较的结果为A1=B1,执行操作12。
如果比较出A1优于B1,选择第一本地数据集为最优数据集;如果比较出B1优于A1,则选择第一数据集为最优数据集。但是,在本申请实施例中,事先配置第一时钟等级对应的参数值A1等于第二时钟等级对应的参数值B1,所以比较出A1=B1。
12:比较第一时钟精度对应的参数值A2和第二时钟精度对应的参数值B2,如果比较的结果为A2=B2,执行操作13。
如果比较出A2优于B2,选择第一本地数据集为最优数据集;如果比较出B2优于A2,则选择第一数据集为最优数据集。但是,在本申请实施例中,事先配置第一时钟精度对应的参数值A2等于第二时钟精度对应的参数值B2,所以比较出A2=B2。
13:比较第一时钟偏差对数值对应的参数值A3和第二时钟偏差对数值对应的参数值B3,如果比较的结果为A3=B3,执行操作14。
如果比较出A3优于B3,选择第一本地数据集为最优数据集;如果比较出B3优于A3,则选择第一数据集为最优数据集。但是,在本申请实施例中,事先配置第一时钟偏差对数值对应的参数值A3等于第二时钟偏差对数值对应的参数值B3,所以比较出A3=B3。
14:比较第一时钟优先级参数对应的参数值A4和第二时钟优先级参数对应的参数值B4,如果比较的结果为A4=B4,执行操作15。
如果比较出A4优于B4,选择第一本地数据集为最优数据集;如果比较出B4优于A4,则选择第一数据集为最优数据集。但是,在本申请实施例中,事先配置第一时钟优先级参数对应的参数值A4等于第二时钟优先级参数对应的参数值B4,所以比较出A4=B4。
15:比较第一网络设备的localPriority参数对应的第二优先级参数值“255”和第一端口的localPriority参数对应的优先级参数值“128”,比较的结果为优先级参数值“128”优于第二优先级参数值“255”,选择第一数据集为最优数据集。
对于第二数据集,第一网络设备按上述11-15的过程,比较选择的第一数据集与第二数据集,以从该两个数据集中选择一个最优数据集,且选择的最优数据集为第一数据集。
由于第一网络设备从第一本地数据集、第一数据集和第二数据集中最终选择的最优数据集为第一数据集,所以第一网络设备将第一数据集对应的第二网络设备作为同步跟踪源,并跟踪第二网络设备的时钟。
第一网络设备也会向第二网络设备和第三网络设备发送第三通知报文,第三通知报文包括至少一个第一时钟参数中的每个第一时钟参数对应的参数值。所以第二网络设备和第三网络设备也同第一网络设备一样进行选源,并都选择第二网络设备作为同步跟踪源。
以第二网络设备为例,第二网络设备通过第三端口接收第一网络设备发送的第三通知报文,第三端口是第二网络设备上与第一网络设备通信的端口。获取第三数据集,第三数据集包括第三端口的localPriority参数对应的优先级参数值和第三通知报文中的每个第一时钟参数对应的参数值。以及,
第二网络设备通过第四端口接收与第二网络设备通信的第三网络设备发送的第二通知报文,第四端口是第一网络设备上与第三网络设备通信的端口。获取第四数据集,第四数据集包括第四端口的localPriority参数对应的优先级参数值和第二通知报文中的每个第三时钟参数对应的参数值。
在一些实施例中,第三数据集包括如下一个或多个参数值:第三端口的localPriority参数对应的优先级参数值、第一时钟等级对应的参数值、第一时钟精度对应的参数值、第一时钟偏差对数值对应的参数值、第一时钟优先级参数对应的参数值和第一时钟标识等。例如,假设第三数据集包括第三端口的localPriority参数对应的优先级参数值“128”、第一时钟等级对应的参数值A1、第一时钟精度对应的参数值A2、第一时钟偏差对数值对应的参数值A3、第一时钟优先级参数对应的参数值A4和第一时钟标识ID1。
在一些实施例中,第四数据集包括如下一个或多个参数值:第四端口的localPriority参数对应的优先级参数值、第三时钟等级对应的参数值、第三时钟精度对应的参数值、第三时钟偏差对数值对应的参数值、第三时钟优先级参数对应的参数值和第三时钟标识等。例如,假设第四数据集包括第四端口的localPriority参数对应的优先级参数值“128”、第三时钟等级对应的参数值C1、第三时钟精度对应的参数值C2、第三时钟偏差对数值对应的参数值C3、第三时钟优先级参数对应的参数值C4和第三时钟标识ID3。
第二网络设备的第二本地数据集包括如下一个或多个参数值:第二网络设备的localPriority参数对应的优先级参数值、第二时钟等级对应的参数值、第二时钟精度对应的参数值、第二时钟偏差对数值对应的参数值、第二时钟优先级参数对应的参数值和第二时钟标识等。例如,假设第二本地数据集包括第二网络设备的localPriority参数对应的优先级参数值“128”、第二时钟等级对应的参数值B1、第二时钟精度对应的参数值B2、第二时钟偏差对数值对应的参数值B3、第二时钟优先级参数对应的参数值B4和第二时钟标识ID2。
对于第二本地数据集、第三数据集和第四数据集中任意两个数据集,假设以第二本地数据集和第三数据集为例,比较第二本地数据集和第三数据集,以从该两个数据集中选择一个最优数据集。再比较选择的数据集与第四数据集,以从该两个数据集中选择一个最优数据集,将最终选择的最优数据集对应的网络设备作为同步跟踪源。
参见图5,比较过程为:
21-24:分别与图5中的11-14相同,在此不再详细说明。
25:比较第二网络设备的localPriority参数对应的优先级参数值“128”和第三端口的localPriority参数对应的优先级参数值“128”,比较的结果为两个优先级参数值相等,执行操作26。
26:比较第一时钟标识“ID1”和第二时钟标识“ID2”,比较的结果为“ID2”排在“ID1”之前,选择第二本地数据集为最优数据集。
对于第四数据集,第二网络设备按上述21-26的过程,比较选择的第二本地数据集与第四数据集,以从该两个数据集中选择一个最优数据集,且最终选择的最优数据集为第二本地数据集。第二网络设备将第二本地数据集对应的第二网络设备作为同步跟踪源。
对于第三网络设备,第三网络设备同上述第一网络设备或第二网络设备一样,选择第二网络设备作为同步跟踪源。
其中,需要说明的是:网络设备周期性地发送通知报文。也就是说:第一网络设备周期性地发送第三通知报文,第三通知报文包括至少一个第三时钟参数中的每个第三时钟参数当前对应的参数值,同样第二网络设备和第三网络设备也同第一网络设备一样周期性地发送通知报文。
步骤302:第一网络设备在无法跟踪第二网络设备的时钟时,第一网络设备变为主用时钟跟踪源,将第一网络设备的localPriority参数对应的第二优先级参数值修改为第一优先级参数值。
第一优先级参数值优于第二优先级参数值。第一优先级参数值也优于第二网络设备的localPriority参数对应的优先级参数值。
第二优先级参数值劣于第一端口的localPriority参数对应的优先级参数值,第一端口是第一网络设备上的与第二网络设备通信的端口。第一优先级参数值优于第一端口的localPriority参数对应的优先级参数值。
例如,localPriority参数对应的优先级参数值越小,表示localPriority参数对应的优先级参数值越优。假设第一端口的localPriority参数对应的默认值为“128”,即第一端口的localPriority参数对应的优先级参数值为“128”,以及假设第二优先级参数值为“255”,第一优先级参数值为“100”。第一网络设备在无法跟踪第二网络设备的时钟的情况,将第一网络设备的localPriority参数对应的第二优先级参数值“255”修改为第一优先级参数值“100”, 所以第一网络设备中的localPriority参数对应的第一优先级参数值优于第一端口的localPriority参数对应的优先级参数值。
在将第一网络设备的localPriority参数对应的第二优先级参数值修改为第一优先级参数值后,第一本地数据集包括的第一网络设备的localPriority参数对应的优先级参数值也随之变为第一优先级参数值。
在步骤302中,第一网络设备无法跟踪第二网络设备的时钟是指:第一网络设备无法接收到第二网络设备发送的报文(通知报文和/或同步报文等)。原因可能是第一端口故障,第一网络设备与第二网络设备之间的链路故障和/或第二网络设备故障等。
在第一网络设备无法跟踪第二网络设备的时钟时,第三网络设备也可能无法跟踪第二网络设备的时钟,此时第一网络设备和第三网络设备重新选择同步跟踪源,并都选择第一网络设备作为同步跟踪源,使得第一网络设备变为主用同步跟踪源。其中,第一网络设备和第三网络设备选择同步跟踪源的详细实现过程,参见上述图4或图5选择同步跟踪源的详细实现过程,在此不再详细说明。
由于第一网络设备已跟踪第二网络设备,第一网络设备的时间与第二网络设备的时间同步,和/或,第一网络设备的频率与第二网络设备的频率同步。所以在第一网络设备变为主用同步跟踪源,其他网络设备跟踪第一网络设备,其他网络设备的时间和/或频率不会发生跳变现象。
在第一端口恢复正常,第一网络设备与第二网络设备之间的链路恢复正常和/或第二网络设备恢复正常时,第一网络设备通过第一端口接收来自第二网络设备的报文,表示第一网络设备能够跟踪第二网络设备的时钟。
步骤303:在第一网络设备能够跟踪第二网络设备的时钟的情况,第一网络设备基于第一优先级参数值,选择同步跟踪源,且选择的同步跟踪源为第一网络设备。
在第一网络设备能够跟踪第二网络设备的时钟的情况,第一网络设备在通过第一端口接收到来自第二网络设备的报文时,比较第一优先级参数值和第一端口的localPriority参数对应的优先级参数值,在比较出第一优先级参数值优于第一端口的localPriority参数对应的优先级参数值时,第一网络设备选择第一网络设备作为同步跟踪源。
在步骤303中,第一网络设备通过第一端口接收到来自第二网络设备的第一通知报文,获取第一数据集。以及,通过第二端口接收到来自第三网络设备的第二通知报文,获取第二数据集。在此获取的第一数据集和第二数据集分别与在步骤301中获取的第一数据集和第二数据集相同。
由于第一本地数据集中的第一网络设备的localPriority参数对应的优先级参数值被修改为第一优先级参数值,所以在选择同步跟踪源的过程中,第一网络设备按上述图4所示的比较过程比较第一本地数据集和第一数据集,并在比较第一优先级参数值和第一端口的localPriority参数对应的优先级参数值时,得出的比较结果为第一优先级参数值优于第一端口的localPriority参数对应的优先级参数值,第一网络设备选择第一本地数据集为最优数据集。然后,第一网络设备按上述图4所示的比较过程比较第一本地数据集和第二数据集,仍比较出第一本地数据集为最优数据集,选择第一本地数据集对应的第一网络设备为同步跟踪源。
其中,在第二网络设备故障后恢复正常时,第二网络设备的时钟复位。例如,第二网络设备将自身的时钟复位到出厂时的状态,即第二网络设备将自身的时间复位到出厂时的时间, 和/或,将自身的频率复位到出厂时的频率。
在第二网络设备故障后恢复正常时,第二网络设备会将第二网络设备自身的本地优先级localPriority参数的默认值调整为劣于第二网络设备的端口的localPriority参数值的默认值。然后第二网络设备基于调整后的localPriority参数的默认值和第二网络设备的端口的localPriority参数值的默认值进行选源,且选择的同步跟踪源为第一网络设备。从而使得第二网络设备跟踪第一网络设备的时钟,使得第二网络设备的时间与第一网络设备的时间同步,和/或,第二网络设备的频率与第一网络设备的频率同步。
在一些实施例中,调整后的第二网络设备自身的本地优先级localPriority参数对应的优先级参数值等于第二优先级参数值。例如,第二优先级参数值为“255”,调整后的第二网络设备自身的本地优先级localPriority参数对应的优先级参数值也为“255”。
在第二网络设备将第二网络设备自身的localPriority参数的默认值调整为劣于第二网络设备的端口的localPriority参数值的默认值后,第二网络设备中的第二本地数据集中的第二网络设备的localPriority参数值对应的优先级参数值也变为劣于第二网络设备的端口的localPriority参数值的默认值。
例如,假设第二网络设备将第二网络设备自身的localPriority参数的默认值调整为“255”。而第二网络设备的端口的localPriority参数值的默认值为“128”,使得第二网络设备自身的localPriority参数的默认值劣于第二网络设备的端口的localPriority参数值的默认值。第二网络设备的端口包括与第一网络设备通信的第三端口,所以第二本地数据集中的第二网络设备的localPriority参数值对应的优先级参数值劣于第三端口的localPriority参数值的默认值。这样第二网络设备在接收到第一网络设备发送第三通知报文并获取第三数据集,基于第二本地数据集和第三数据集,通过上述图5所示的比较过程选择第三数据集作为最优数据集,将第三数据集对应的第一网络设备作为同步跟踪源。
在一些实施例中,第二网络设备在进行选源后发送第一通知报文,第一通知报文包括第二网络设备的同步选源参数的参数值。
在一些实施例中,第一通知报文包括第二网络设备的同步选源参数对应的参数值是:至少一个第二时钟参数中的每个第二时钟参数对应的参数值。
网络设备周期性地发送通知报文,在第二网络设备在恢复正常时,第二网络设备等待一个或多个周期后,向第三网络设备发送第一通知报文。
第二网络设备在进行选源后,跟踪第一网络设备的时钟,即第二网络设备的时间与第一网络设备的时间同步,和/或,第二网络设备的频率与第一网络设备的频率同步。这样第二网络设备在进行选源后发送第一通知报文,第三网络设备会接收到第一通知报文,并进行选源操作。
由于相同类型的第一时钟质量参数对应的参数值和第二时钟质量参数对应的参数值相等,第一时钟优先级参数对应的优先级参数值等于第二时钟优先级参数对应的优先级参数值,而第二网络设备的第二时钟标识排序在第一网络设备的第一时钟标识之前,所以第三网络设备在进行选源时会选择第二网络设备作为同步跟踪源,并跟踪第二网络设备的时钟。
由于第二网络设备已跟踪第一网络设备,而第三网络设备之前也跟踪第一网络设备的时钟,这样第三网络设备跟踪第二网络设备的时钟后,第三网络设备的时钟也不会发生跳变。即第三网络设备的时间不会发生跳变,和/或,第三网络设备的频率不会发生跳变。
在本申请实施例中,第一网络设备跟踪第二网络设备的时钟。在第一网络设备无法跟踪第二网络设备的时钟时,第一网络设备自动变为主用时钟跟踪源,且将第一网络设备的localPriority参数对应的第二优先级参数值修改为第一优先级参数值。由于第一优先级参数值优于第一端口的localPriority参数对应的优先级参数值,第一端口是第一网络设备上与第二网络设备通信的端口,这样虽然在第一网络设备能够跟踪第二网络设备的时钟时,但是第一网络设备基于第一优先级参数值继续选择第一网络设备作为同步跟踪源,即第一网络设备不会跟踪第二网络设备。也就是说,即使第二网络设备恢复正常时,第二网络设备的时钟复位,由于第一网络设备不会跟踪第二网络设备的时钟,所以不会发生时钟跳变现象。另外,第二网络设备选择第一网络设备作为同步跟踪源,第二网络设备跟踪第一网络设备的时钟,这样第三网络设备选择跟踪第一网络设备的时钟时,避免第三网络设备的时钟发生跳变现象。
参见图6,本申请实施例提供了一种选源方法600,所述方法600应用于图1所示的网络架构100,在所述方法600中,第一网络设备在无法跟踪第二网络设备的时钟时,通过修改第一网络设备的时钟质量参数的值,来实现选择第一网络设备作为同步跟踪源。所述方法600包括:
步骤601:与上述图3所示方法300的步骤301相同,在此不再详细说明。
步骤602:第一网络设备在无法跟踪第二网络设备的时钟时,第一网络设备变为主用时钟跟踪源,将第一网络设备的时钟质量参数对应的时钟质量参数值修改为第一时钟质量参数值。
第一时钟质量参数值优于第二时钟质量参数值,第二时钟质量参数值是第二网络设备的该时钟质量参数对应的时钟质量参数值。
第一网络设备可以修改一个时钟质量参数对应的时钟质量参数值,也可以修改多个时钟质量参数对应的时钟质量参数值。
在一些实施例中,修改的时钟质量参数包括如下一个或多个参数:第一时钟等级、第一时钟精度和第一时钟偏差对数值。
例如,第一网络设备在无法跟踪第二网络设备的时钟时,将第一网络设备的第一时钟等级对应的参数值A1修改为A11,A11优先A1,而A1等于第二网络设备的第二时钟等级对应的参数值B1,即A11优于B1。和/或,将第一网络设备的第一时钟精度对应的参数值A2修改为A21,A21优先A2,而A2等于第二网络设备的第二时钟精度对应的参数值B2,即A21优于B2。和/或,将第一网络设备的第一时钟偏差对数值对应的参数值A3修改为A31,A31优先A3,而A3等于第二网络设备的第二时钟偏差对数值对应的参数值B3,即A31优于B3。
在将第一网络设备的时钟质量参数对应的时钟质量参数值修改为第一时钟质量参数值后,在第一网络设备的第一本地数据集中,第一网络设备的时钟质量参数对应的时钟质量参数值也随之变为第一时钟质量参数值。
在第一网络设备无法跟踪第二网络设备的时钟时,第三网络设备也可能无法跟踪第二网络设备的时钟,此时第一网络设备和第三网络设备重新选择同步跟踪源,并都选择第一网络设备作为同步跟踪源,使得第一网络设备变为主用同步跟踪源。其中,第一网络设备和第三网络设备选择同步跟踪源的详细实现过程,参见上述图4或图5选择同步跟踪源的详细实现 过程,在此不再详细说明。
步骤603:在第一网络设备能够跟踪第二网络设备的时钟的情况,第一网络设备基于第一时钟质量参数值,选择同步跟踪源,且选择的同步跟踪源为第一网络设备。
在第一网络设备能够跟踪第二网络设备的时钟的情况,第一网络设备通过第一端口接收到来自第二网络设备的第一通知报文,第一通知报文包括第二时钟质量参数;比较第一时钟质量参数值和第二时钟质量参数值,在比较出第一时钟质量参数值优于第二时钟质量参数值时,第一网络设备选择第一网络设备作为同步跟踪源。
在步骤603中,第一网络设备通过第一端口接收到来自第二网络设备的第一通知报文,获取第一数据集,第一数据集包括第二网络设备的至少一个第二时钟参数中的每个第二时钟参数对应的参数值和第一端口的localPriority参数对应的优先级参数值,该每个第二时钟参数对应的参数值包括第二时钟质量参数值。以及,通过第二端口接收到来自第三网络设备的第二通知报文,获取第二数据集,第二数据集包括第三网络设备的至少一个第三时钟质量参数中的每个第三时钟参数对应的参数值和第二端口的localPriority参数对应的优先级参数值。
由于第一本地数据集中的第一时钟质量参数值优于第一数据集中的第二时钟质量参数值,所以在选择同步跟踪源的过程中,第一网络设备按上述图4所示的比较过程比较第一本地数据集和第一数据集,并在比较第一时钟质量参数值和第二时钟质量参数值时,得出的比较结果为第一时钟质量参数值优于第二时钟质量参数值,第一网络设备选择第一本地数据集为最优数据集。然后,第一网络设备按上述图4所示的比较过程比较第一本地数据集和第二数据集,仍比较出第一本地数据集为最优数据集,选择第一本地数据集对应的第一网络设备为同步跟踪源。
例如,假设第一网络设备将第一时钟等级对应的参数值A1修改为A11,也就是说第一本地数据集中的第一时钟等级对应的参数值为A11,第一网络设备获取的第一数据集中的第二时钟等级对应的参数值为B1。由于A11优于B1,所以第一网络设备在比较第一本地数据集和第一数据集时,比较出第一本地数据集为最优数据集。第一网络设备比较第一本地数据集和第二数据集,并比较出第一本地数据集为最优数据集,将第一本地数据集对应的第一网络设备作为同步跟踪源。
在第二网络设备故障后恢复正常时,第二网络设备通过第三端口接收第一网络设备发送的第三通知报文,第三通知报文包括第一网络设备的至少一个第一时钟参数中的每个第一时钟参数对应的参数值,该每个第一时钟参数对应的参数值包括第一时钟质量参数值;获取第三数据集,第三数据集包括第三端口的localPriority参数对应的优先级参数值和该每个第一时钟参数对应的参数值。
而第二网络设备的第二本地数据集包括的第二时钟质量参数值,由于第一时钟质量参数值优于第二时钟质量参数值,所以第二网络设备比较第二本地数据集和第三数据集,比较出第三数据集为最优数据集,因此选择第三数据集对应的第一网络设备作为同步跟踪源,并跟踪第一网络设备的时钟。
第三网络设备也会接收第一通知报文和第三通知报文,并进行选源操作。由于第一通知报文包括的第二时钟质量参数值劣于第三通知报文包括的第一时钟质量参数值,所以第三网络设备也选择第一网络设备作为同步跟踪源,并跟踪第一网络设备的时钟。
因此,在第一网络设备能够跟踪第二网络设备时,第一网络设备、第二网络设备和第三 网络设备仍选择第一网络设备作为同步跟踪源,跟踪第一网络设备的时钟,从而使得第一网络设备的时钟、第二网络设备的时钟和第三网络时钟不会发生跳变。
在本申请实施例中,第一网络设备跟踪第二网络设备的时钟。在第一网络设备无法跟踪第二网络设备的时钟时,第一网络设备自动变为主用时钟跟踪源,且将第一网络设备的时钟质量参数对应的时钟质量参数值修改为第一时钟质量参数值。由于第一时钟质量参数值优于与第二网络设备的该时钟质量参数对应的第二时钟质量参数值,这样虽然在第一网络设备能够跟踪第二网络设备的时钟时,但是第一网络设备基于第一时钟质量参数值继续选择第一网络设备作为同步跟踪源,即第一网络设备不会跟踪第二网络设备。也就是说,即使第二网络设备恢复正常时,第二网络设备的时钟复位,由于第一网络设备不会跟踪第二网络设备的时钟,所以不会发生时钟跳变现象。另外,第二网络设备和第三网络设备也选择第一网络设备作为同步跟踪源,避免第二网络设备和第三网络设备的时钟发生跳变现象。
参见图7,本申请实施例提供了一种选源方法700,所述方法700应用于图2所示的网络架构200,在所述方法700中,第一网络设备通过设置第一端口的状态为监控状态,来实现选择时间源,第一端口是第一网络设备上的与第一时钟源通信的端口。所述方法700包括:
步骤701:第一网络设备跟踪第一时钟源。
第一网络设备通过第一端口与第一时钟源通信,通过第二端口与第二时钟源通信。
参见图2,第二网络设备通过第二端口与第二网络设备通信,而第二网络设备与第二时钟源通信。
在一些实施例中,第一时钟源为主用时钟源,第二时钟源为备用时钟源。
在一些实施例中,第一时钟源的时钟等级优于第二时钟源的时钟等级。
第一网络设备跟踪第一时钟源是指:第一网络设备的时间与第一时钟源的时间同步。
在一些实施例中,在第一网络设备跟踪第一时钟源的情况,第一网络设备向第二网络设备和第三网络设备发送第一通知报文和第二同步报文,第一通知报文包括第一时钟等级,第一时钟等级为第一时钟源的时钟等级,第二同步报文包括第一网络设备的时间。第二网络设备接收第一通知报文和第二同步报文,基于第一时钟等级选择跟踪第一网络设备,并基于第二同步报文包括的时间进行时间同步。第三网络设备接收第一通知报文和第二同步报文,基于第一时钟等级选择跟踪第一网络设备,并基于第二同步报文包括的时间进行时间同步。
在一些实施例中,第二网络设备和/或第三网络设备也可能接收第二时钟源的时钟等级,由于第一时钟等级优于第二时钟源的时钟等级,所以选择跟踪第一网络设备。
步骤702:当第一网络设备无法跟踪第一时钟源时,第一网络设备设置第一端口的状态为监控状态,处于监控状态的第一端口不参与选源。
第一网络设备可以通过处于监控状态的第一端口,监控第一时钟源的状态。
在一些实施例中,监控状态包括仅被动(passive only)状态等。
第一网络设备无法跟踪第一时钟源可能是:第一端口故障,第一网络设备与第一时钟源之间的链路故障和/或第一时钟源故障等。
第一网络设备可能接收不到第一时钟源发送的报文,或者,第一网络设备接收第一时钟源发送的第二通知报文,第二通知报文携带第二时钟等级,第二时钟等级为第一时钟源的时钟等级,第二时钟等级超出第一等级范围,基于第二时钟等级确定第一时钟源故障,第一等 级范围包括时钟源对应的至少一个时钟等级。
在第一网络设备无法跟踪第一时钟源时,第二网络设备和第三网络设备跟踪第二时钟源。在实现时,第一网络设备向第二网络设备发送第一通知报文,第一通知报文包括第三时钟等级,第三时钟等级为第一网络设备的时钟等级,第三时钟等级位于第二等级范围内,第二等级范围包括网络设备对应的时钟等级。
第二网络设备接收第一通知报文,基于第一通知报文中的第三时钟等级,确定第一网络设备无法跟踪第一时钟源,选择跟踪第二时钟源。同样第三网络设备也跟踪第二网络设备。
步骤703:第一网络设备跟踪第二时钟源。
由于第二网络设备跟踪第二时钟源,第二网络设备的时间与第二时钟源同步。第二网络设备向第一网络设备发送第三通知报文和第四同步报文,第三通知报文包括第四时钟等级,第四时钟等级为第二时钟源的时钟等级,且第四时钟等级位于第一等级范围内,第四同步报文包括第二网络设备的时间。第一网络设备接收第三通知报文和第四同步报文,基于第四时钟等级选择跟踪第二网络设备,并基于第四同步报文包括的时间进行时间同步,如此实现跟踪第二时钟源。
其中,在第一网络设备无法跟踪第一时钟源时,第一网络设备跟踪第二时钟源,在跟踪第二时钟源的过程中,通过处于监控状态的第一端口检测是否可以跟踪第一时钟源。
步骤704:在第一网络设备检测出可以跟踪第一时钟源时,第一网络设备将第一端口的状态保持为监控状态。
在第一网络设备跟踪第二时钟源的过程,第一网络设备通过处于监控状态的第一端口检测到可以跟踪第一时钟源时,第一端口的状态仍保持为监控状态。由于处于监控状态的第一端口不参与选源,所以第一网络设备继续选择跟踪第二时钟源,不会将跟踪的时钟源由第一时钟源切换为第二时钟源,使得整个网络架构中的网络设备避免切换跟踪的时钟源,增加网络的稳定性。
步骤705:在第一网络设备跟踪第二时钟源后,当第一网络设备无法跟踪第二时钟源时,第一网络设备将第一端口的状态为非监控状态,处于非监控状态的第一端口参与选源。
在第二网络设备无法跟踪第二时钟源的情况,第二网络设备向第一网络设备发送第四通知报文,第四通知报文包括第五时钟等级,第五时钟等级位于第二等级范围内。第一网络设备接收第四通知报文,由于第五时钟等级位于第二等级范围,确定第二网络设备无法跟踪第二时钟源。由于第一网络设备可以跟踪第一时钟源,第一网络设备将第一端口的状态恢复为非监控状态。
在第一网络设备设置第一端口的状态恢复为非监控状态时,第一网络设备选择跟踪第一时钟源。此时第二网络设备和第三网络设备选择跟踪第一网络设备。
在一些实施例中,非监控状态包括主(Master)状态或从(Slave)状态等。
在本申请实施例中,第一网络设备跟踪第一时钟源,当第一网络设备无法跟踪第一时钟源时,第一网络设备设置第一端口的状态为监控状态,第一端口是第一网络设备上与第一时钟源通信的端口,处于监控状态的第一端口不参与选源,第一网络设备跟踪第二时钟源。当第一网络设备可以跟踪第一时钟源时,第一端口的状态保持为监控状态,由于处于监控状态的第一端口不参与选源,所以第一网络设备仍跟踪第一时钟源。只有在第一网络设备无法跟踪第二时钟源时,第一网络设备才将第一端口的状态恢复为非监控状态,处于非监控状态的 第一端口可以参与选源,从而使得第一网络设备能够选择跟踪第一时钟源。如此,可以减少切换跟踪的时钟源的频率,提高网络的稳定性。
参见图8,本申请提供了一种选源装置800,所述装置800可以部署在图1所示网络架构100中的第一网络设备101,图3所示方法300的第一网络设备或图6所示方法600的第一网络设备上,包括:
处理单元801,用于在所述装置800跟踪第二网络设备的时钟后,当所述装置800无法跟踪第二网络设备的时钟时,将所述装置800的同步选源参数对应的参数值修改为第一参数值,第一参数值优于第二网络设备的同步选源参数对应的参数值。
可选的,处理单元801将所述装置800的同步选源参数对应的参数值修改为第一参数值的详细实现过程,参见图3所示方法300的步骤302和图6所示方法600的步骤602中的相关内容,在此不再详细说明。
可选的,所述装置800的同步选源参数包括所述装置800的本地优先级localPriority参数,第一参数值包括第一优先级参数值;
处理单元801,用于将所述装置800的localPriority参数对应的第二优先级参数值修改为第一优先级参数值。
可选的,处理单元801将所述装置800的localPriority参数对应的第二优先级参数值修改为第一优先级参数值的详细实现过程,参见图3所示方法300的步骤302中的相关内容,在此不再详细说明。
可选的,第二优先级参数值劣于第一端口的localPriority参数对应的优先级参数值,第一端口是所述装置800上的与第二网络设备通信的端口。
可选的,第一优先级参数值优于第一端口的localPriority参数对应的优先级参数值,第一端口是所述装置800上的与第二网络设备通信的端口。
可选的,第二优先级参数值等于第二网络设备的localPriority参数对应的优先级参数值。
可选的,处理单元801,还用于基于第一优先级参数值,选择同步跟踪源。
可选的,处理单元801基于第一优先级参数值,选择同步跟踪源的详细实现过程,参见图3所示方法300的步骤303中的相关内容,在此不再详细说明。
可选的,处理单元801,还用于:
在通过第一端口接收到来自第二网络设备的报文时,比较第一优先级参数值和第一端口的localPriority参数对应的优先级参数值,第一端口是所述装置800上的与第二网络设备通信的端口;
在比较出第一优先级参数值优于第一端口的localPriority参数对应的优先级参数值时,选择所述装置800作为同步跟踪源。
可选的,所述装置800的同步选源参数包括所述装置800的时钟质量参数,第一参数值包括第一时钟质量参数值;
处理单元801,用于将所述装置800的时钟质量参数对应的时钟质量参数值修改为第一时钟质量参数值。
可选的,所述装置800的时钟质量参数包括所述装置800的时钟等级、时钟精度和时钟偏差对数值中的一个或多个。
可选的,处理单元801,还用于基于第一时钟质量参数值,选择同步跟踪源。
可选的,处理单元801基于第一时钟质量参数值,选择同步跟踪的详细实现过程,参见图6所示方法600的步骤603中的相关内容,在此不再详细说明。
可选的,所述装置800还包括:接收单元802,
接收单元802,用于接收第二网络设备发送的通知报文,该通知报文包括第二时钟质量参数值,第二时钟质量参数值是第二网络设备的时钟质量参数对应的时钟质量参数值;
处理单元801,还用于在第一时钟质量参数值优于第二时钟质量参数值时,选择所述装置800作为同步跟踪源。
可选的,处理单元801选择同步跟踪的详细实现过程,参见图6所示方法600的步骤603中的相关内容,在此不再详细说明。
可选的,所述装置800的同步选源参数的个数为一个或多个。
在本申请实施例中,在所述装置能够跟踪第二网络设备时,第二网络设备的时钟可能发生复位,网络中的网络设备会进行选源操作。由于第一参数值优于第二网络设备的同步选源参数对应的参数值,处理单元基于第一参数值和第二网络设备的同步选源参数对应的参数值进行选源时,会继续选择所述装置作为同步跟踪源,从而阻止了所述装置跟踪第二网络设备,以避免所述装置的时钟发生跳变。另外,由于第一参数值优于第二网络设备的同步选源参数对应的参数值,这样第二网络设备在进行选源时,也会选择跟踪所述装置,从而使得第二网络设备的时钟与所述装置的时钟同步。以及,对于网络中除所述装置和第二网络设备以外的第三网络设备,在所述装置无法跟踪第二网络设备的时钟时,第三网络设备会选择跟踪所述装置的时钟。在所述装置能够跟踪第二网络设备时,第三网络设备进行选源,可能继续选择所述装置作为同步跟踪源,从而避免第三网络设备的时钟发生跳变,或者,可能选择第二网络作为同步跟踪源,但由于第二网络设备的时钟与所述装置的时钟同步,从而也避免第三网络设备的时钟发生跳变。
参见图9,本申请提供了一种选源装置900,所述装置900可以部署在图1所示网络架构100中的第二网络设备102,图3所示方法300的第二网络设备或图6所示方法600的第二网络设备上,包括:
处理单元901,用于将所述装置900自身的本地优先级localPriority参数的默认值调整为劣于所述装置900的端口的localPriority参数值的默认值;
处理单元901,还用于基于调整后的所述装置900自身的localPriority参数的默认值和所述装置900的端口的localPriority参数值的默认值进行选源。
可选的,处理单元901将所述装置900自身的本地优先级localPriority参数的默认值调整为劣于所述装置900的端口的localPriority参数值的默认值的详细实现过程,参见图3所示方法300的步骤303和图6所示方法600的步骤603中的相关内容,在此不再详细说明。
可选的,处理单元901基于调整后的所述装置900自身的localPriority参数的默认值和所述装置900的端口的localPriority参数值的默认值进行选源的详细实现过程,参见图3所示方法300的步骤303和图6所示方法600的步骤603中的相关内容,在此不再详细说明。
可选的,所述装置900包括多个端口,该多个端口的localPriority参数值的默认值相同。
可选的,所述装置900还包括:
发送单元902,用于在进行选源后发送通知报文,该通知报文包括所述装置900的同步选源参数的参数值。
在本申请实施例中,处理单元将所述装置自身的本地优先级localPriority参数的默认值调整为劣于所述装置的端口的localPriority参数值的默认值。基于调整后的所述装置自身的localPriority参数的默认值和所述装置的端口的localPriority参数值的默认值进行选源。由于所述装置自身的localPriority参数的默认值被调整为劣于所述装置的端口的localPriority参数值的默认值,所以在处理单元选源时会选择跟踪网络中已存在的主用同步跟踪源,并跟踪该主用同步跟踪源的时钟,从而避免网络中的网络设备的时钟发生跳变。
参见图10,本申请提供了一种选源装置1000,所述装置1000可以部署在图2所示网络架构200中的第一网络设备201,或者,图7所示方法700的第一网络设备上,包括:
处理单元1001,用于在所述装置1000跟踪第一时钟源后,当所述装置1000无法跟踪第一时钟源时,设置第一端口的状态为监控状态,第一端口是所述装置1000上与第一时钟源通信的端口,处于监控状态的第一端口不参与选源;当所述装置1000可以跟踪第一时钟源时,第一端口的状态保持为监控状态。
可选的,处理单元1001设置第一端口的状态为监控状态的详细实现过程,参见图7所示方法700的步骤702中的相关内容,在此不再详细说明。
可选的,处理单元1001,还用于跟踪第二时钟源。
可选的,处理单元1001跟踪第二时钟源的详细实现过程,参见图7所示方法700的步骤703中的相关内容,在此不再详细说明。
可选的,处理单元1001,还用于在所述装置1000跟踪第二时钟源后,当所述装置1000无法跟踪第二时钟源时,设置第一端口的状态恢复为非监控状态,处于非监控状态的第一端口参与选源。
可选的,处理单元1001设置第一端口的状态恢复为非监控状态的详细实现过程,参见图7所示方法700的步骤704中的相关内容,在此不再详细说明。
在本申请实施例中,处理单元1001在所述装置跟踪第一时钟源后,当所述装置无法跟踪第一时钟源时,设置第一端口的状态为监控状态,当所述装置可以跟踪第一时钟源时,第一端口的状态保持为监控状态。其中,当所述装置无法跟踪第一时钟源后,所述装置又可以跟踪第一时钟源时,将第一端口的状态保持为监控状态,由于处于监控状态的第一端口不参与选源,这样处理单元不会将跟踪的时钟源切换回第一时钟源,减小了切换时钟源的频率,增加了网络的稳定性。
参见图11,本申请实施例提供了一种选源装置1100示意图。该装置1100可以是上述图1所示网络架构100中的第一网络设备101,图3所示方法300的第一网络设备或图6所示方法600的第一网络设备。该装置1100包括至少一个处理器1101,内部连接1102,存储器1103以及至少一个收发器1104。
该装置1100是一种硬件结构的装置,可以用于实现图8所述的装置800中的功能模块。例如,本领域技术人员可以想到图8所示的装置800中的处理单元801可以通过该至少一个处理器1101调用存储器1103中的代码来实现,图8所示的装置800中的接收单元802可以 通过该收发器1104来实现。
可选的,该装置1100还可用于实现上述图1、图3或图6所示实施例中第一网络设备的功能。
可选的,上述处理器1101可以是一个通用中央处理器(central processing unit,CPU),网络处理器(network processor,NP),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。
上述内部连接1102可包括一通路,在上述组件之间传送信息。可选的,内部连接1102为单板或总线等。
上述收发器1104,用于与其他设备或通信网络通信。
上述存储器1103可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。
其中,存储器1103用于存储执行本申请方案的应用程序代码,并由处理器1101来控制执行。处理器1101用于执行存储器1103中存储的应用程序代码,以及配合至少一个收发器1104,从而使得该装置1100实现本专利方法中的功能。
在具体实现中,作为一种实施例,处理器1101可以包括一个或多个CPU,例如图11中的CPU0和CPU1。
在具体实现中,作为一种实施例,该装置1100可以包括多个处理器,例如图11中的处理器1101和处理器1107。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。
参见图12,本申请实施例提供了一种选源装置1200示意图。该装置1200可以是上述图1所示网络架构100中的第二网络设备102,图3所示方法300的第二网络设备或图6所示方法600的第二网络设备。该装置1200包括至少一个处理器1201,内部连接1202,存储器1203以及至少一个收发器1204。
该装置1200是一种硬件结构的装置,可以用于实现图9所述的装置900中的功能模块。例如,本领域技术人员可以想到图9所示的装置900中的处理单元901可以通过该至少一个处理器1201调用存储器1203中的代码来实现,图9所示的装置900中的发送单元902可以通过该收发器1204来实现。
可选的,该装置1200还可用于实现上述图1、图3或图6所示实施例中第二网络设备的功能。
可选的,上述处理器1201可以是一个通用中央处理器(central processing unit,CPU),网络处理器(network processor,NP),微处理器,特定应用集成电路(application-specific  integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。
上述内部连接1202可包括一通路,在上述组件之间传送信息。可选的,内部连接1202为单板或总线等。
上述收发器1204,用于与其他设备或通信网络通信。
上述存储器1203可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。
其中,存储器1203用于存储执行本申请方案的应用程序代码,并由处理器1201来控制执行。处理器1201用于执行存储器1203中存储的应用程序代码,以及配合至少一个收发器1204,从而使得该装置1200实现本专利方法中的功能。
在具体实现中,作为一种实施例,处理器1201可以包括一个或多个CPU,例如图12中的CPU0和CPU1。
在具体实现中,作为一种实施例,该装置1200可以包括多个处理器,例如图12中的处理器1201和处理器1207。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。
参见图13,本申请实施例提供了一种选源装置1300示意图。该装置1300可以是图2所示网络架构200中的第一网络设备201,或者,图7所示方法700的第一网络设备。该装置1300包括至少一个处理器1301,内部连接1302,存储器1303以及至少一个收发器1304。
该装置1300是一种硬件结构的装置,可以用于实现图10所述的装置1000中的功能模块。例如,本领域技术人员可以想到图10所示的装置1000中的处理单元1001可以通过该至少一个处理器1301调用存储器1303中的代码来实现。
可选的,该装置1300还可用于实现上述图2或图7所示实施例中第一网络设备的功能。
可选的,上述处理器1301可以是一个通用中央处理器(central processing unit,CPU),网络处理器(network processor,NP),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。
上述内部连接1302可包括一通路,在上述组件之间传送信息。可选的,内部连接1302为单板或总线等。
上述收发器1304,用于与其他设备或通信网络通信。
上述存储器1303可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only  memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。
其中,存储器1303用于存储执行本申请方案的应用程序代码,并由处理器1301来控制执行。处理器1301用于执行存储器1303中存储的应用程序代码,以及配合至少一个收发器1304,从而使得该装置1300实现本专利方法中的功能。
在具体实现中,作为一种实施例,处理器1301可以包括一个或多个CPU,例如图13中的CPU0和CPU1。
在具体实现中,作为一种实施例,该装置1300可以包括多个处理器,例如图13中的处理器1301和处理器1307。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。
参见图14,本申请实施例提供了一种选源***1400,包括如图8所示的装置800和如图9所示的装置900,或者,包括如图11所示的装置1100和如图12所示的装置1200。
参见图14,如图8所示的装置800或如图11所示的装置1100可以为第一网络设备1401,如图9所示的装置900或如图12所示的装置1200可以为第二网络设备1402。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (39)

  1. 一种选源方法,其特征在于,所述方法包括:
    在第一网络设备跟踪第二网络设备的时钟后,当所述第一网络设备无法跟踪所述第二网络设备的时钟时,所述第一网络设备将所述第一网络设备的同步选源参数对应的参数值修改为第一参数值,所述第一参数值优于所述第二网络设备的所述同步选源参数对应的参数值。
  2. 如权利要求1所述的方法,其特征在于,所述第一网络设备的同步选源参数包括所述第一网络设备的本地优先级localPriority参数,所述第一参数值包括第一优先级参数值;
    所述第一网络设备将所述第一网络设备的同步选源参数对应的参数值修改为第一参数值,包括:
    所述第一网络设备将所述第一网络设备的localPriority参数对应的第二优先级参数值修改为所述第一优先级参数值。
  3. 如权利要求2所述的方法,其特征在于,所述第二优先级参数值劣于第一端口的localPriority参数对应的优先级参数值,所述第一端口是所述第一网络设备上的与所述第二网络设备通信的端口。
  4. 如权利要求2或3所述的方法,其特征在于,所述第一优先级参数值优于第一端口的localPriority参数对应的优先级参数值,所述第一端口是所述第一网络设备上的与所述第二网络设备通信的端口。
  5. 如权利要求2-4任一项所述的方法,其特征在于,所述第二优先级参数值等于所述第二网络设备的localPriority参数对应的优先级参数值。
  6. 如权利要求2-5任一项所述的方法,其特征在于,所述方法还包括:
    所述第一网络设备基于所述第一优先级参数值,选择同步跟踪源。
  7. 如权利要求6所述的方法,其特征在于,所述第一网络设备基于所述第一优先级参数值,选择同步跟踪源,包括:
    所述第一网络设备在通过第一端口接收到来自所述第二网络设备的报文时,比较所述第一优先级参数值和所述第一端口的localPriority参数对应的优先级参数值,所述第一端口是所述第一网络设备上的与所述第二网络设备通信的端口;
    在比较出所述第一优先级参数值优于所述第一端口的localPriority参数对应的优先级参数值时,所述第一网络设备选择所述第一网络设备作为同步跟踪源。
  8. 如权利要求1所述的方法,其特征在于,所述第一网络设备的同步选源参数包括所述第一网络设备的时钟质量参数,所述第一参数值包括第一时钟质量参数值;
    所述第一网络设备将所述第一网络设备的同步选源参数对应的参数值修改为第一参数 值,包括:
    所述第一网络设备将所述第一网络设备的时钟质量参数对应的时钟质量参数值修改为所述第一时钟质量参数值。
  9. 如权利要求8所述的方法,其特征在于,所述第一网络设备的时钟质量参数包括所述第一网络设备的时钟等级、时钟精度和时钟偏差对数值中的一个或多个。
  10. 如权利要求8或9所述的方法,其特征在于,所述方法还包括:
    所述第一网络设备基于所述第一时钟质量参数值,选择同步跟踪源。
  11. 如权利要求10所述的方法,其特征在于,所述第一网络设备基于所述第一时钟质量参数值,选择同步跟踪源,包括:
    所述第一网络设备接收所述第二网络设备发送的通知报文,所述通知报文包括第二时钟质量参数值,所述第二时钟质量参数值是所述第二网络设备的时钟质量参数对应的时钟质量参数值;
    在所述第一时钟质量参数值优于所述第二时钟质量参数值时,所述第一网络设备选择所述第一网络设备作为同步跟踪源。
  12. 如权利要求1-11任一项所述的方法,其特征在于,所述第一网络设备的同步选源参数的个数为一个或多个。
  13. 一种选源方法,其特征在于,所述方法包括:
    网络设备将所述网络设备自身的本地优先级localPriority参数的默认值调整为劣于所述网络设备的端口的localPriority参数值的默认值;
    所述网络设备基于调整后的所述网络设备自身的localPriority参数的默认值和所述网络设备的端口的localPriority参数值的默认值进行选源。
  14. 如权利要求13所述的方法,其特征在于,所述网络设备包括多个端口,所述多个端口的所述localPriority参数值的默认值相同。
  15. 如权利要求13或14所述的方法,其特征在于,所述方法还包括:
    所述网络设备在进行选源后发送通知报文,所述通知报文包括所述网络设备的同步选源参数的参数值。
  16. 一种选源方法,其特征在于,所述方法包括:
    在第一网络设备跟踪第一时钟源后,当所述第一网络设备无法跟踪所述第一时钟源时,所述第一网络设备设置第一端口的状态为监控状态,所述第一端口是所述第一网络设备上与所述第一时钟源通信的端口,处于所述监控状态的第一端口不参与选源;
    当所述第一网络设备可以跟踪所述第一时钟源时,所述第一端口的状态保持为所述监控 状态。
  17. 如权利要求16所述的方法,其特征在于,所述方法还包括:
    所述第一网络设备跟踪第二时钟源。
  18. 如权利要求17所述的方法,其特征在于,所述方法还包括:
    在所述第一网络设备跟踪第二时钟源后,当所述第一网络设备无法跟踪所述第二时钟源时,所述第一网络设备设置第一端口的状态为非监控状态,处于所述非监控状态的所述第一端口参与选源。
  19. 一种选源装置,其特征在于,所述装置包括:
    处理单元,用于在所述装置跟踪第二网络设备的时钟后,当所述装置无法跟踪所述第二网络设备的时钟时,将所述装置的同步选源参数对应的参数值修改为第一参数值,所述第一参数值优于所述第二网络设备的所述同步选源参数对应的参数值。
  20. 如权利要求19所述的装置,其特征在于,所述装置的同步选源参数包括所述装置的本地优先级localPriority参数,所述第一参数值包括第一优先级参数值;
    所述处理单元,用于将所述装置的localPriority参数对应的第二优先级参数值修改为所述第一优先级参数值。
  21. 如权利要求20所述的装置,其特征在于,所述第二优先级参数值劣于第一端口的localPriority参数对应的优先级参数值,所述第一端口是所述装置上的与所述第二网络设备通信的端口。
  22. 如权利要求20或21所述的装置,其特征在于,所述第一优先级参数值优于第一端口的localPriority参数对应的优先级参数值,所述第一端口是所述装置上的与所述第二网络设备通信的端口。
  23. 如权利要求20-22任一项所述的装置,其特征在于,所述第二优先级参数值等于所述第二网络设备的localPriority参数对应的优先级参数值。
  24. 如权利要求20-23任一项所述的装置,其特征在于,所述处理单元,还用于基于所述第一优先级参数值,选择同步跟踪源。
  25. 如权利要求24所述的装置,其特征在于,所述处理单元,还用于:
    在通过第一端口接收到来自所述第二网络设备的报文时,比较所述第一优先级参数值和所述第一端口的localPriority参数对应的优先级参数值,所述第一端口是所述装置上的与所述第二网络设备通信的端口;
    在比较出所述第一优先级参数值优于所述第一端口的localPriority参数对应的优先级参 数值时,选择所述装置作为同步跟踪源。
  26. 如权利要求19所述的装置,其特征在于,所述装置的同步选源参数包括所述装置的时钟质量参数,所述第一参数值包括第一时钟质量参数值;
    所述处理单元,用于将所述装置的时钟质量参数对应的时钟质量参数值修改为所述第一时钟质量参数值。
  27. 如权利要求26所述的装置,其特征在于,所述装置的时钟质量参数包括所述装置的时钟等级、时钟精度和时钟偏差对数值中的一个或多个。
  28. 如权利要求26或27所述的装置,其特征在于,所述处理单元,还用于基于所述第一时钟质量参数值,选择同步跟踪源。
  29. 如权利要求28所述的装置,其特征在于,所述装置还包括:接收单元,
    所述接收单元,用于接收所述第二网络设备发送的通知报文,所述通知报文包括第二时钟质量参数值,所述第二时钟质量参数值是所述第二网络设备的时钟质量参数对应的时钟质量参数值;
    所述处理单元,还用于在所述第一时钟质量参数值优于所述第二时钟质量参数值时,选择所述装置作为同步跟踪源。
  30. 如权利要求19-29任一项所述的装置,其特征在于,所述装置的同步选源参数的个数为一个或多个。
  31. 一种选源装置,其特征在于,所述装置包括:
    处理单元,用于将所述装置自身的本地优先级localPriority参数的默认值调整为劣于所述装置的端口的localPriority参数值的默认值;
    所述处理单元,还用于基于调整后的所述装置自身的localPriority参数的默认值和所述装置的端口的localPriority参数值的默认值进行选源。
  32. 如权利要求31所述的装置,其特征在于,所述装置包括多个端口,所述多个端口的所述localPriority参数值的默认值相同。
  33. 如权利要求31或32所述的装置,其特征在于,所述装置还包括:
    发送单元,用于在进行选源后发送通知报文,所述通知报文包括所述装置的同步选源参数的参数值。
  34. 一种选源装置,其特征在于,所述装置包括:
    处理单元,用于在所述装置跟踪第一时钟源后,当所述装置无法跟踪所述第一时钟源时,设置第一端口的状态为监控状态,所述第一端口是所述装置上与所述第一时钟源通信的端口, 处于所述监控状态的第一端口不参与选源;当所述装置可以跟踪所述第一时钟源时,所述第一端口的状态保持为所述监控状态。
  35. 如权利要求34所述的装置,其特征在于,所述处理单元,还用于跟踪第二时钟源。
  36. 如权利要求35所述的装置,其特征在于,所述处理单元,还用于在所述装置跟踪第二时钟源后,当所述装置无法跟踪所述第二时钟源时,设置第一端口的状态恢复为非监控状态,处于所述非监控状态的所述第一端口参与选源。
  37. 一种选源***,其特征在于,所述选源***包括如权利要求19-30任一项所述的装置和如权利要求31-33任一项所述的装置。
  38. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被计算机执行时,实现如权利要求1-18任一项所述的方法。
  39. 一种计算机程序产品,其特征在于,所述计算机程序产品包括在计算机可读存储介质中存储的计算机程序,并且所述计算程序通过处理器进行加载来实现如权利要求1-18任一项所述的方法。
PCT/CN2022/092359 2021-06-28 2022-05-12 选源方法、装置、***及存储介质 WO2023273627A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2023572182A JP2024521137A (ja) 2021-06-28 2022-05-12 クロックソース選択方法、装置、及びシステム、並びに記憶媒体
EP22831454.8A EP4311155A1 (en) 2021-06-28 2022-05-12 Source selection method, apparatus, and system, and storage medium
US18/521,826 US20240097812A1 (en) 2021-06-28 2023-11-28 Clock source selection method, apparatus, and system, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110718819.1A CN115603886A (zh) 2021-06-28 2021-06-28 选源方法、装置、***及存储介质
CN202110718819.1 2021-06-28

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/521,826 Continuation US20240097812A1 (en) 2021-06-28 2023-11-28 Clock source selection method, apparatus, and system, and storage medium

Publications (1)

Publication Number Publication Date
WO2023273627A1 true WO2023273627A1 (zh) 2023-01-05

Family

ID=84692472

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/092359 WO2023273627A1 (zh) 2021-06-28 2022-05-12 选源方法、装置、***及存储介质

Country Status (5)

Country Link
US (1) US20240097812A1 (zh)
EP (1) EP4311155A1 (zh)
JP (1) JP2024521137A (zh)
CN (1) CN115603886A (zh)
WO (1) WO2023273627A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101399655A (zh) * 2007-09-27 2009-04-01 华为技术有限公司 穿通时钟设备同步端口的确定方法及装置
CN103490840A (zh) * 2012-06-12 2014-01-01 中兴通讯股份有限公司 一种进行精确时间协议报文处理的装置和方法
US20150222413A1 (en) * 2012-06-20 2015-08-06 Antti Olavi Pietilainen Synchronization in Computer Network
CN107046449A (zh) * 2016-02-06 2017-08-15 华为技术有限公司 用于时间同步的方法和时钟

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101399655A (zh) * 2007-09-27 2009-04-01 华为技术有限公司 穿通时钟设备同步端口的确定方法及装置
CN103490840A (zh) * 2012-06-12 2014-01-01 中兴通讯股份有限公司 一种进行精确时间协议报文处理的装置和方法
US20150222413A1 (en) * 2012-06-20 2015-08-06 Antti Olavi Pietilainen Synchronization in Computer Network
CN107046449A (zh) * 2016-02-06 2017-08-15 华为技术有限公司 用于时间同步的方法和时钟

Also Published As

Publication number Publication date
JP2024521137A (ja) 2024-05-28
US20240097812A1 (en) 2024-03-21
EP4311155A1 (en) 2024-01-24
CN115603886A (zh) 2023-01-13

Similar Documents

Publication Publication Date Title
EP2182670B1 (en) A method and apparatus for tracking clock source
US10771067B2 (en) System and method for hitless clock switching
US10924435B2 (en) System and method for port reduction using multiple chassis link aggregation group for stacked devices
WO2023273627A1 (zh) 选源方法、装置、***及存储介质
US9641268B2 (en) Method, system and device for synchronizing clocks
US20240022504A1 (en) Traffic forwarding method and apparatus
US20230362854A1 (en) Method and Apparatus for Selecting Clock Source
WO2023125255A1 (zh) 通信方法、装置、***及存储介质
US7243253B1 (en) Repeating switching of a cross-connect and a timing source in a network element through the use of a phase adjuster
US20210014118A1 (en) Stacked computer network devices having multiple master nodes
US20230208544A1 (en) Method, apparatus, and system for processing time synchronization fault and storage medium
US20230262625A1 (en) Time Synchronization Fault Processing Method, Apparatus, And System
WO2024114048A1 (zh) 一种时钟质量等级设置方法、设备及***
CN100454803C (zh) 一种快速无毛刺的时钟倒换方法和装置
US11212217B2 (en) Spanning tree enabled link aggregation system
CN112865899B (zh) 一种调整物理层phy主从模式的方法及装置
US20120320960A1 (en) Method, Device and System for Clock Dejitter
WO2021179915A1 (zh) 一种时钟端口状态处理方法、装置及***
KR102684118B1 (ko) 클록 포트 속성 복원 방법, 디바이스, 및 시스템
JPH0432330A (ja) システムクロツク保護方式
CN117527120A (zh) 一种ptp交换机及其实现方法
JP2001345789A (ja) 網同期装置用周波数監視回路

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

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2022831454

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2022831454

Country of ref document: EP

Effective date: 20231019

WWE Wipo information: entry into national phase

Ref document number: 2023572182

Country of ref document: JP

NENP Non-entry into the national phase

Ref country code: DE