WO2021023063A1 - 时间同步方法、时间同步发送端、接收端及系统 - Google Patents

时间同步方法、时间同步发送端、接收端及系统 Download PDF

Info

Publication number
WO2021023063A1
WO2021023063A1 PCT/CN2020/105203 CN2020105203W WO2021023063A1 WO 2021023063 A1 WO2021023063 A1 WO 2021023063A1 CN 2020105203 W CN2020105203 W CN 2020105203W WO 2021023063 A1 WO2021023063 A1 WO 2021023063A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
announce message
time synchronization
announce
keep
Prior art date
Application number
PCT/CN2020/105203
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 US17/633,329 priority Critical patent/US12028156B2/en
Priority to EP20849332.0A priority patent/EP4012947A4/en
Publication of WO2021023063A1 publication Critical patent/WO2021023063A1/zh

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
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter
    • H04L7/0004Initialisation of the receiver
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter
    • H04L7/04Speed or phase control by synchronisation signals

Definitions

  • the present invention relates to the field of communication, in particular to a time synchronization method, a time synchronization sending end, a receiving end and a system.
  • the 1588V2 standard is a standard for high-precision time synchronization. Unlike the Network Time Protocol (NTP), which can only achieve millisecond (ms) synchronization, 1588V2 can achieve nanosecond (ns) time synchronization. Since the first edition of the standard was published in 2008, it has been widely used in various fields such as aerospace and industry. After entering the 5G era, indoor positioning, Internet of Things and other fields have increasingly higher requirements for time synchronization, which has led to the emergence of ultra-high-precision time synchronization technology based on 1588V2, which in turn makes the application field of 1588V2 more and more broad.
  • NTP Network Time Protocol
  • ms millisecond
  • ns nanosecond
  • 1588V2 defines many kinds of messages to realize the interaction and time synchronization between network elements.
  • the Announce message is responsible for establishing a synchronization system and also That is, through the interaction and processing of Announce messages between different network elements, a time synchronization tree of the entire network is constructed.
  • Announce message in 1588V2 is shown in Figures 1 to 3.
  • Some parameters carried in Announce such as grandmasterPriority1, grandmasterClockQuality, etc., will cause the best master clock algorithm (best master clock, referred to as BMC) to be recalculated when these parameters change, thereby triggering changes in the network topology.
  • BMC best master clock
  • logMessageInterval represents the packet transmission interval, generally 3 packet transmission cycles without receiving The message will trigger the protocol to reselect the source calculation.
  • Announce message function is actually divided into two aspects, one is keep-alive, and the other is protocol calculation. That is to say, in the 1588 standard, Announce is a message with a variable length that may reach several K and a very fast packet transmission rate. Therefore, the CPU is required to process Announce messages at a ms-level rate and be able to support variable-length announce messages, causing the system to be busy.
  • the embodiment of the present invention provides a time synchronization method, a time synchronization sending end, a receiving end, and a system to solve the problem that the CPU system is busy due to processing of Announce messages in the prior art.
  • the embodiment of the present invention provides a time synchronization method, including:
  • the embodiment of the present invention also provides a time synchronization method, including:
  • the specific underlying hardware When the specific underlying hardware receives the keep-alive message of the Announce message, the specific underlying hardware performs keep-alive processing on the keep-alive message.
  • the embodiment of the present invention also provides a time synchronization method, including:
  • the Announce message is sent to the CPU for time synchronization processing; otherwise, the Announce message is performed on the specific underlying hardware Keep-alive processing.
  • the embodiment of the present invention also provides a time synchronization sending end, including:
  • the judgment module is set to judge whether the parameters that lead to the recalculation of the best master clock BMC algorithm have changed;
  • the sending module is set to send an Announce message based on the 1588 standard when the judgment module judges yes; when the judgment module judges no, send a keep-alive message of the Announce message.
  • the embodiment of the present invention also provides a time synchronization receiving terminal, including:
  • the specific underlying hardware is set to send the Announce message to the CPU when receiving an Announce message based on the 1588 standard, and prohibit the triggering of a connection failure alarm based on the Announce message; when a keep-alive message of the Announce message is received, Keep-alive processing of keep-alive messages on specific underlying hardware;
  • the CPU is set to perform time synchronization processing based on the Announce message.
  • the embodiment of the present invention also provides a time synchronization receiving terminal, including:
  • the specific underlying hardware is set to receive the Announce message based on the 1588 standard, and compare the Announce message with the content of the previous Announce message; according to the comparison result, it is judged that the content has changed and the changed content will lead to the best master clock BMC algorithm Recalculate, then send the Announce message to the CPU for time synchronization processing; otherwise, the Announce message will be kept alive on the specific underlying hardware;
  • the CPU is set to perform time synchronization processing based on the Announce message.
  • the embodiment of the present invention also provides a time synchronization connection system, including:
  • An embodiment of the present invention also provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps in any one of the foregoing method embodiments when running.
  • An embodiment of the present invention also provides an electronic device, including a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above method embodiments .
  • Fig. 1 is a schematic diagram of the header message structure of a PTP message in the prior art
  • FIG. 2 is a schematic diagram of the complete format of an Announce keep-alive message carrying an extended TLV in the prior art
  • FIG. 3 is a schematic diagram of the PDU format of the Announce message in the prior art
  • FIG. 4 is a schematic diagram of a time synchronization method in Embodiment 1 of the method of the present invention.
  • FIG. 5 is a schematic diagram of an extended TLV format of an Announce message according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a time synchronization method in the second embodiment of the method of the present invention.
  • FIG. 7 is a schematic diagram of a time synchronization method in a third method of the present invention.
  • FIG. 8 is a processing flowchart of a method for time synchronization at a transmitting end according to an embodiment of the present invention
  • FIG. 9 is a processing flowchart of a receiving end time synchronization method according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of a time synchronization sending end according to an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of a time synchronization receiving end according to an embodiment of the present invention.
  • FIG. 12 is a schematic diagram of a time synchronization receiving terminal according to an embodiment of the present invention.
  • Fig. 13 is a schematic diagram of a time synchronization system according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of the time synchronization method in Embodiment 1 of the method of the present invention. As shown in FIG.
  • the time synchronization methods include:
  • Step 401 Determine whether the parameters that cause the recalculation of the best master clock BMC algorithm have changed; for example, the ClockQuality, ClockClass, Priority and other parameters of the clock source have changed;
  • Step 402 if the judgment is yes, then deliver an Announce message based on the 1588 standard;
  • the original Announce message only exists as a protocol message, which is modified as follows:
  • the Announce message is sent to the downstream device immediately, and the downstream device sends it to the CPU for protocol calculation after receiving it. Considering the abnormal situation that a message may be lost when sending, N Announce messages can be sent continuously when changes occur.
  • the Announce message may not be sent.
  • the receiving end After receiving the original Announce message, the receiving end sends it to the CPU for protocol processing. Trigger the re-source calculation of the BMC algorithm.
  • the keep-alive message of the Announce message is delivered.
  • the keep-alive message specifically includes one of the following: an Announce message carrying a TLV, an Announce message carrying a custom field with a specific value, and a custom keep-alive message with a fixed length.
  • a fixed-length keep-alive message needs to be defined, which can be extended to the original announce message as a keep-alive message, or a new keep-alive message can be redefined , Keep the length of the keep-alive message as small as possible to facilitate hardware receiving and processing.
  • the definition method is not limited to the following:
  • a new keep-alive message can be defined by extending the message type message length message value (Type, Length, Value, TLV for short). As shown in Figure 5, a self-extension message is added to the Announce message. Define the TLV. When the Announce message carries this TLV, it means it is a keep-alive message.
  • the extension can be achieved by using the custom field of the Announce message.
  • the custom field takes a certain value, it is a keep-alive message.
  • the keep-alive message can be sent regularly according to the sending cycle set by the user.
  • an Announce connection failure alarm is generated. This alarm can be used to trigger the BMC algorithm to reselect the source calculation.
  • the packet sending period and the expected receiving period of the keep-alive message are configurable and allowed to be modified by the user.
  • the general period is set below the second level.
  • the value of N expected cycles at the receiving end can be configured, and the user can select an appropriate value according to the processing speed of the device. Whether the connection failure alarm triggers the BMC algorithm to reselect the source can also be configured.
  • FIG. 6 is a schematic diagram of the time synchronization method in the second embodiment of the method of the present invention. As shown in FIG. 6, the method implemented according to the present invention
  • the time synchronization methods include:
  • Step 601 When a specific underlying hardware receives an Announce message based on the 1588 standard, it sends the Announce message to the CPU for time synchronization processing, and prohibits triggering a connection failure alarm based on the Announce message; that is, the Announce message is received After that, only the protocol processing is performed, and the keep-alive processing is not performed.
  • Step 602 When the specific underlying hardware receives the keep-alive message of the Announce message, the specific underlying hardware performs keep-alive processing on the keep-alive message.
  • the specific underlying hardware specifically includes: logic chips or switching chips.
  • a connection failure alarm of the Announce message is generated through a specific underlying hardware and sent to the CPU, where N is a positive according to user configuration. Integer.
  • the embodiment of the present invention sets a new device switch. In the embodiment of the present invention, it does not need to be compatible with the old device.
  • the new device switch needs to be set to the on state, otherwise, the new device switch needs to be set to the on state.
  • the device switch is set to the off state, and the processing as described in the third method embodiment is executed.
  • FIG. 7 is a schematic diagram of the time synchronization method in the third method embodiment of the present invention. As shown in FIG. 7, the method implemented according to the present invention
  • the time synchronization methods include:
  • Step 701 Receive an Announce message based on the 1588 standard through a specific underlying hardware, and compare the content of the Announce message with the content of the previous Announce message;
  • Step 702 According to the comparison result of the specific underlying hardware, it is determined that the content has changed and the changed content will lead to the recalculation of the best master clock BMC algorithm, and then the Announce message is sent to the CPU for time synchronization processing; otherwise, the Announce message is processed in the specific underlying hardware. The message is kept alive.
  • the specific underlying hardware specifically includes: logic chips or switching chips.
  • a connection failure alarm of the Announce message is generated through specific underlying hardware and sent to the CPU, where N is a positive integer configured by the user .
  • the embodiment of the present invention sets a new device switch. If it is not necessary to be compatible with the old device, set the new device switch to the on state as shown in method embodiment 2, otherwise In the embodiment of the present invention, the switch of the new device needs to be set to the off state.
  • the new device sends the Announce message according to the original 1588 standard rule, and the packet sending rate is consistent with the user configuration.
  • the old device receives the message, it processes it in the same way as before.
  • the hardware switch chip or logic chip
  • the hardware that receives the message compares the content of the current Announce message with the content of the previous Announce message. If the changed content triggers the protocol recalculation then Send the CPU for protocol processing; otherwise, the hardware will filter out such messages and the hardware will keep alive processing, thereby reducing the impact on the CPU.
  • the new equipment When the old equipment communicates with the new equipment, the new equipment must be compatible with the processing of the old equipment. Therefore, the new device does not send new keep-alive messages, but sends Announce messages regularly in the original manner. When receiving, consider hardware filtering to reduce the impact on the CPU.
  • the new device regularly sends Announce messages to the old device in the original way, and the old device receives and processes it in the original way.
  • the old device also sends an Announce message to the new device.
  • the logic chip first processes it. The logic chip compares the previously stored Announce message based on the PTP link. If there is a change, it is sent to the CPU for processing. If there is no change, the logic chip performs the Announce keep-alive processing and then discards the Announce message to reduce the CPU processing.
  • the Announce message can be processed in a brand-new way.
  • This embodiment defines a new keep-alive Announce message based on the way the Announce message extends the TLV.
  • the complete message structure is shown in Figure 1.
  • a TLV is extended after the Announce message.
  • the TLV format is defined in Figure 5.
  • the Type value is 0x4000 (taken from the user-defined type of the 1588V2 standard); the Length value is 1 Bytes, Value indicates the subtype of Announce, and a value of 1 indicates that its function is keep-alive. Set the switches of the two new devices to on, which means that the package will be sent according to the new model.
  • the new device When the ClockQuality, ClockClass and other parameters carried by Announce change and the protocol needs to be recalculated, the new device immediately sends the Announce message in the original format.
  • the new device sends an Announce message carrying the extended TLV, that is, a keep-alive message.
  • the logic chip of the new device After the logic chip of the new device receives the Announce message, it judges whether it carries the extended TLV. If it carries the TLV, it means that the message only needs to be kept-alive. Then the logic chip will discard the message after the Announce connection failure alarm is detected inside the logic; if If the extended TLV is not carried, it will be sent to the CPU for protocol calculation.
  • the processing flow of this example is exactly the same as that of Example 2.
  • the only difference is that the keep-alive message of the example only contains the header structure of the PTP message, that is, a new message is defined.
  • MessageType uses the reserved type encoding in the 1588 standard. The value is 0x0E.
  • setting the switches of the two new devices to the on state means that the package is issued in a brand new mode.
  • the new device immediately sends the Announce message in the original format.
  • FIG. 8 is a processing flowchart of a method for time synchronization at a transmitting end according to an embodiment of the present invention. As shown in FIG. 8, it specifically includes the following processing:
  • step 801 it is determined that the time to send the package regularly is up
  • Step 802 determine whether to turn on the new device switch, if the determination is no, then perform step 803, otherwise, perform step 804;
  • Step 803 Send the original Announce message according to the timing of sending packets
  • Step 804 determine whether the parameter that triggers the recalculation of the protocol has changed, if the determination is no, perform step 805, otherwise, perform step 806;
  • Step 805 Send a keep-alive message
  • Step 806 Send the original Announce message.
  • FIG. 9 is a processing flow chart of the receiving end time synchronization method according to an embodiment of the present invention. As shown in FIG. 9, it specifically includes the following processing:
  • Step 901 Receive an Announce message or a keep-alive message
  • Step 902 it is judged whether to turn on the new device switch, if the judgement is no, go to step 903, otherwise, go to step 906;
  • Step 903 compare whether the Announce messages of this time and the last time are the same, if the judgment is no, go to 904, otherwise, go to 905;
  • Step 904 Send the Announce message to the CPU for protocol processing
  • Step 905 Keep alive the Announce message, and discard the message after processing
  • Step 906 Determine whether it is the original Announce message or the keep-alive message. If it is the original Announce message, go to step 907, otherwise, go to step 908;
  • Step 907 Send the Announce message to the CPU for protocol processing
  • Step 908 Keep-alive processing is performed on the keep-alive message, and the message is discarded after processing.
  • the processing problem caused by the definition defect of the Announce message standard is solved, thereby increasing the processing speed of the system and reducing the impact on the CPU, making the design of the 1588 protocol more reasonable.
  • FIG. 10 is a schematic diagram of a time synchronization sending end according to an embodiment of the present invention, as shown in FIG. 10, which specifically includes:
  • the judging module 100 is set to judge whether the parameters that lead to the recalculation of the best master clock BMC algorithm have changed; for example, the ClockQuality, ClockClass, Priority and other parameters of the clock source have changed;
  • the sending module 102 is configured to send an Announce message based on the 1588 standard when the judgment module 100 judges yes; when the judgment module 100 judges no, send a keep-alive message of the Announce message.
  • the original Announce message only exists as a protocol message, which is modified as follows:
  • the Announce message is sent to the downstream device immediately, and the downstream device sends it to the CPU for protocol calculation after receiving it. Considering the abnormal situation that a message may be lost when sending, N Announce messages can be sent continuously when changes occur.
  • the Announce message may not be sent.
  • the receiving end After receiving the original Announce message, the receiving end sends it to the CPU for protocol processing. Trigger the re-source calculation of the BMC algorithm.
  • the keep-alive message specifically includes one of the following: an Announce message carrying a TLV, an Announce message carrying a custom field with a specific value, and a custom keep-alive message with a fixed length.
  • a fixed-length keep-alive message needs to be defined, which can be extended to the original announce message as a keep-alive message, or a new keep-alive message can be redefined , Keep the length of the keep-alive message as small as possible to facilitate hardware receiving and processing.
  • the definition method is not limited to the following:
  • a new keep-alive message can be defined by extending TLV. As shown in Figure 5, a custom TLV is extended in the Announce message. When the Announce message carries this TLV, it means a keep-alive message. .
  • the extension can be achieved by using the custom field of the Announce message.
  • the custom field takes a certain value, it is a keep-alive message.
  • the keep-alive message sent by the sending module 102 can be periodically sent according to the sending cycle set by the user.
  • the Announce connection fails. Alarm, this alarm can be used to trigger the BMC algorithm to reselect the source calculation.
  • the packet sending period and the expected receiving period of the keep-alive message are configurable and allowed to be modified by the user.
  • the general period is set below the second level.
  • the value of N expected cycles at the receiving end can be configured, and the user can select an appropriate value according to the processing speed of the device. Whether the connection failure alarm triggers the BMC algorithm to reselect the source can also be configured.
  • FIG. 11 is a schematic diagram of a time synchronization receiving end according to an embodiment of the present invention. As shown in FIG. 11, the time synchronization receiving end according to an embodiment of the present invention specifically includes:
  • the specific underlying hardware 110 is set to send the Announce message to the CPU 112 when receiving an Announce message based on the 1588 standard, and prohibit the triggering of connection failure alarms based on the Announce message; that is, after receiving the Announce message, Only the protocol processing is performed, and the keep-alive processing is not performed.
  • the keep-alive processing of the keep-alive message is performed on the specific underlying hardware;
  • the specific underlying hardware specifically includes: logic chips or switching chips.
  • the CPU 112 is set to perform time synchronization processing based on the Announce message.
  • the specific underlying hardware 110 if the specific underlying hardware 110 does not receive a keep-alive message in N consecutive expected reception cycles, the specific underlying hardware 110 generates a connection failure alarm of the Announce message and sends it to the CPU 112, where N It is a positive integer configured by the user.
  • the embodiment of the present invention also includes a setting module, which is set to set the switch of the new device to the on state when the compatibility with the old device is not required; otherwise, the switch of the new device needs to be set to the off state. status.
  • FIG. 12 is a schematic diagram of a time synchronization receiving end according to an embodiment of the present invention. As shown in FIG. 12, the time synchronization receiving end according to an embodiment of the present invention specifically includes:
  • the specific underlying hardware 120 is set to receive the Announce message based on the 1588 standard, and compare the Announce message with the content of the previous Announce message; according to the comparison result, it is judged that the content has changed and the changed content will lead to the best master clock BMC
  • the algorithm is recalculated, the Announce message is sent to the CPU 122 for time synchronization processing; otherwise, the Announce message is kept alive on the specific underlying hardware;
  • the CPU 122 is set to perform time synchronization processing based on the Announce message.
  • the specific underlying hardware specifically includes: logic chips or switching chips.
  • the specific underlying hardware 120 if the specific underlying hardware 120 does not receive the Announce message in N consecutive expected reception cycles, the specific underlying hardware 120 generates a connection failure alarm of the Announce message and sends it to the CPU 122, where N is According to a positive integer configured by the user.
  • the embodiment of the present invention also includes a setting module, which is set to set the switch of the new device to the on state when the compatibility with the old device is not required; otherwise, the switch of the new device needs to be set to the off state. status.
  • the setting module needs to set the switch of the new device to the off state.
  • the new device sends the Announce message according to the original 1588 standard rule, and the packet sending rate is consistent with the user configuration.
  • the old device receives the message, it processes it in the same way as before.
  • the hardware switch chip or logic chip
  • the hardware that receives the message compares the content of the current Announce message with the content of the previous Announce message. If the changed content triggers the protocol recalculation then Send the CPU 122 for protocol processing; otherwise, the hardware will filter out such messages and the hardware will keep-alive processing, thereby reducing the impact on the CPU.
  • FIG. 13 is a schematic diagram of a time synchronization system according to an embodiment of the present invention. As shown in FIG. 13, it includes the time synchronization sending end 130 in the first embodiment of the above device and the implementation of the above device.
  • the time synchronization sending end 130 specifically includes:
  • the judging module 100 is set to judge whether the parameters that cause the recalculation of the best master clock BMC algorithm have changed; for example, the ClockQuality, ClockClass, Priority and other parameters of the clock source have changed;
  • the sending module 102 is configured to send an Announce message based on the 1588 standard when the judgment module 100 judges yes; when the judgment module 100 judges no, send a keep-alive message of the Announce message.
  • the original Announce message only exists as a protocol message, which is modified as follows:
  • the Announce message is sent to the downstream device immediately, and the downstream device sends it to the CPU for protocol calculation after receiving it. Considering the abnormal situation that a message may be lost when sending, N Announce messages can be sent continuously when changes occur.
  • the Announce message may not be sent.
  • the receiving end After receiving the original Announce message, the receiving end sends it to the CPU for protocol processing. Trigger the re-source calculation of the BMC algorithm.
  • the keep-alive message specifically includes one of the following: an Announce message carrying a TLV, an Announce message carrying a custom field with a specific value, and a custom keep-alive message with a fixed length.
  • a fixed-length keep-alive message needs to be defined, which can be extended to the original announce message as a keep-alive message, or a new keep-alive message can be redefined , Keep the length of the keep-alive message as small as possible to facilitate hardware receiving and processing.
  • the definition method is not limited to the following:
  • a new keep-alive message can be defined by extending TLV. As shown in Figure 5, a custom TLV is extended in the Announce message. When the Announce message carries this TLV, it means a keep-alive message. .
  • the extension can be achieved by using the custom field of the Announce message.
  • the custom field takes a certain value, it is a keep-alive message.
  • the keep-alive message sent by the sending module 102 can be periodically sent according to the sending cycle set by the user.
  • the Announce connection fails. Alarm, this alarm can be used to trigger the BMC algorithm to reselect the source calculation.
  • the packet sending period and the expected receiving period of the keep-alive message are configurable and allowed to be modified by the user.
  • the general period is set below the second level.
  • the value of N expected cycles at the receiving end can be configured, and the user can select an appropriate value according to the processing speed of the device. Whether the connection failure alarm triggers the BMC algorithm to reselect the source can also be configured.
  • the time synchronization receiver 132 specifically includes:
  • the specific underlying hardware 110 is set to receive the Announce message based on the 1588 standard, send the Announce message to the CPU 112, and prohibit triggering the connection failure alarm based on the Announce message; that is, after receiving the Announce message, only execute the protocol Processing, no keep-alive processing. Receive the keep-alive message of the Announce message, and perform keep-alive processing on the keep-alive message on the specific underlying hardware;
  • the specific underlying hardware specifically includes: logic chips or switching chips.
  • the CPU 112 is set to perform time synchronization processing based on the Announce message.
  • the specific underlying hardware 110 if the specific underlying hardware 110 does not receive a keep-alive message in N consecutive expected reception cycles, the specific underlying hardware 110 generates a connection failure alarm of the Announce message and sends it to the CPU 112, where N It is a positive integer configured by the user.
  • the embodiment of the present invention also includes a setting module, which is set to set the switch of the new device to the on state when the compatibility with the old device is not required; otherwise, the switch of the new device needs to be set to the off state. status.
  • the time synchronization receiving end as in the third embodiment of the apparatus may also be included, which specifically includes:
  • the specific underlying hardware 120 is set to receive the Announce message based on the 1588 standard, and compare the Announce message with the content of the previous Announce message; according to the comparison result, it is judged that the content has changed and the changed content will lead to the best master clock BMC
  • the algorithm is recalculated, the Announce message is sent to the CPU 122 for time synchronization processing; otherwise, the Announce message is kept alive in the specific underlying hardware;
  • the CPU 122 is set to perform time synchronization processing based on the Announce message.
  • the specific underlying hardware specifically includes: logic chips or switching chips.
  • the specific underlying hardware 120 if the specific underlying hardware 120 does not receive the Announce message in N consecutive expected reception cycles, the specific underlying hardware 120 generates a connection failure alarm of the Announce message and sends it to the CPU 122, where N is According to a positive integer configured by the user.
  • the embodiment of the present invention also includes a setting module, which is set to set the switch of the new device to the on state when the compatibility with the old device is not required; otherwise, the switch of the new device needs to be set to the off state. status.
  • the setting module needs to set the switch of the new device to the off state.
  • the new device sends the Announce message according to the original 1588 standard rule, and the packet sending rate is consistent with the user configuration.
  • the old device receives the message, it processes it in the same way as before.
  • the hardware switch chip or logic chip
  • the hardware that receives the message compares the content of the current Announce message with the content of the previous Announce message. If the changed content triggers the protocol recalculation then Send the CPU 122 for protocol processing; otherwise, the hardware will filter out such messages and the hardware will keep-alive processing to reduce the impact on the CPU.
  • the embodiment of the present invention also provides a computer-readable storage medium having a computer program stored in the computer-readable storage medium, wherein the computer program is configured to execute the steps in any of the foregoing method embodiments when running.
  • the foregoing computer-readable storage medium may include, but is not limited to: U disk, Read-Only Memory (Read-Only Memory, ROM for short), Random Access Memory (Random Access Memory, RAM for short) , Mobile hard drives, magnetic disks or optical disks and other media that can store computer programs.
  • U disk Read-Only Memory
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • Mobile hard drives magnetic disks or optical disks and other media that can store computer programs.
  • An embodiment of the present invention also provides an electronic device, including a memory and a processor, the memory is stored with a computer program, and the processor is configured to run the computer program to execute the steps in any of the foregoing method embodiments.
  • the aforementioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the aforementioned processor, and the input-output device is connected to the aforementioned processor.
  • modules or steps of the present invention can be implemented by a general computing device. They can be concentrated on a single computing device or distributed in a network composed of multiple computing devices. Above, alternatively, they can be implemented with program codes executable by the computing device, so that they can be stored in the storage device for execution by the computing device, and in some cases, can be executed in a different order than here. Perform the steps shown or described, or fabricate them into individual integrated circuit modules, or fabricate multiple modules or steps of them into a single integrated circuit module to achieve. In this way, the present invention is not limited to any specific combination of hardware and software.

Landscapes

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

Abstract

本发明公开了一种时间同步方法、时间同步发送端、接收端及系统,其中一种方法包括:判断导致最佳主时钟BMC算法重新计算的参数是否发生变化;如果判断为是,则下发基于1588标准的Announce报文;如果判断为否,则下发Announce报文的保活报文。本发明通过区分保活报文和协议报文,解决了处理Announce报文导致CPU系统繁忙的问题,从而实现对1588协议的优化,起到了减少对CPU冲击的作用。

Description

时间同步方法、时间同步发送端、接收端及系统 技术领域
本发明涉及通信领域,尤其涉及一种时间同步方法、时间同步发送端、接收端及系统。
背景技术
1588V2标准是一个关于高精度时间同步的标准,不同于网络时间协议(Network Time Protocol,简称为NTP)只能实现毫秒(ms)级别的同步,1588V2可以达到纳秒(ns)级别的时间同步,自从2008年第一版标准面世以来,已经广泛的应用于航天,工业等各个领域。进入5G时代之后,室内定位,物联网等领域对时间同步的要求越来越高,从而引发了基于1588V2的超高精度时间同步技术的产生,这又使得1588V2的应用领域越来越广阔。
在越来越多的使用后,发现1588V2标准中还是存在一些缺陷的,1588V2定义了很多种报文用来实现网元之间的交互和时间的同步,其中Announce报文负责建立同步体系,也就是不同网元之间通过对Announce报文的交互和处理,构建一个全网的时间同步树。
Announce报文在1588V2中的定义如图1~3所示。Announce中携带的一些参数,例如grandmasterPriority1,grandmasterClockQuality等,在这些参数发生变化的时候,会导致最佳主时钟算法(best master clock,简称为BMC)重新计算,从而引发网络拓扑的变化。当上述各种参数都没有变化的时候,按照协议要求,如果一段时间之内没有收到Announce报文,也会引发网络拓扑重新计算,其中logMessageInterval表示的是发 包间隔,一般3个发包周期没有收到报文就会触发协议重新选源计算。
由此可以看出来,Announce报文功能实际上划分为两个方面,一个是保活,另外一个是协议计算。也就是说在1588标准里面,Announce是一个变长长度可能达到几K的而且发包速率很快的报文。因此就要求CPU以ms级别的速率处理Announce报文并且能够支持变长度的announce报文,导致系统繁忙。
发明内容
本发明实施例提供一种时间同步方法、时间同步发送端、接收端及系统,用以解决现有技术中处理Announce报文导致CPU系统繁忙的问题。
本发明实施例提供一种时间同步方法,包括:
判断导致最佳主时钟BMC算法重新计算的参数是否发生变化;
如果判断为是,则下发基于1588标准的Announce报文;
如果判断为否,则下发Announce报文的保活报文。
本发明实施例还提供一种时间同步方法,包括:
在特定底层硬件接收到基于1588标准的Announce报文时,将Announce报文发送到CPU进行时间同步处理,并禁止基于Announce报文触发连接失效告警;
在特定底层硬件接收到Announce报文的保活报文时,在特定底层硬件对保活报文进行保活处理。
本发明实施例还提供一种时间同步方法,包括:
通过特定底层硬件接收基于1588标准的Announce报文,将Announce报文与上一个Announce报文的内容进行比较;
通过特定底层硬件根据比较结果,判断内容有变化且变化的内容会导 致最佳主时钟BMC算法重新计算,则将Announce报文发送到CPU进行时间同步处理;否则在特定底层硬件对Announce报文进行保活处理。
本发明实施例还提供一种时间同步发送端,包括:
判断模块,设置为判断导致最佳主时钟BMC算法重新计算的参数是否发生变化;
发送模块,设置为在判断模块判断为是的情况下,下发基于1588标准的Announce报文;在判断模块判断为否的情况下,下发Announce报文的保活报文。
本发明实施例还提供一种时间同步接收端,包括:
特定底层硬件,设置为在接收到基于1588标准的Announce报文时,将Announce报文发送到CPU,并禁止基于Announce报文触发连接失效告警;在接收到Announce报文的保活报文时,在特定底层硬件对保活报文进行保活处理;
CPU,设置为基于Announce报文进行时间同步处理。
本发明实施例还提供一种时间同步接收端,包括:
特定底层硬件,设置为接收基于1588标准的Announce报文,将Announce报文与上一个Announce报文的内容进行比较;根据比较结果,判断内容有变化且变化的内容会导致最佳主时钟BMC算法重新计算,则将Announce报文发送到CPU进行时间同步处理;否则在特定底层硬件对Announce报文进行保活处理;
CPU,设置为基于Announce报文进行时间同步处理。
本发明实施例还提供一种时间同步接系统,包括:
包括上述时间同步发送端以及上述时间同步接收端。
本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储 介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
本发明实施例还提供一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述任一项方法实施例中的步骤。
采用本发明实施例,通过区分保活报文和协议报文,解决了处理Announce报文导致CPU系统繁忙的问题,从而实现对1588协议的优化,起到了减少对CPU冲击的作用。
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。
附图说明
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1是现有技术的PTP报文的头部消息结构的示意图;
图2是现有技术的携带扩展TLV的Announce保活报文的完整格式的示意图;
图3是现有技术的Announce报文的PDU格式的示意图;
图4是本发明方法实施例一的时间同步方法的示意图;
图5是本发明实施例的Announce报文的扩展TLV格式的示意图;
图6是本发明方法实施例二的时间同步方法的示意图;
图7是本发明方法实施例三的时间同步方法的示意图;
图8是本发明实施例的发送端时间同步方法的处理流程图;
图9是本发明实施例的接收端时间同步方法的处理流程图;
图10是本发明实施例的时间同步发送端的示意图;
图11是本发明实施例的时间同步接收端的示意图;
图12是本发明实施例的时间同步接收端的示意图;
图13是本发明实施例的时间同步系统的示意图。
具体实施方式
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
方法实施例一
根据本发明的实施例,提供了一种时间同步方法,以下实施例为发送端的处理,图4是本发明方法实施例一的时间同步方法的示意图,如图4所示,根据本发明实施的时间同步方法具体包括:
步骤401,判断导致最佳主时钟BMC算法重新计算的参数是否发生变化;例如时钟源的ClockQuality,ClockClass,Priority等参数发生变化;
步骤402,如果判断为是,则下发基于1588标准的Announce报文;
在本发明实施例中,原有的Announce报文仅作为协议报文存在,修改如下:
(1)原有协议报文中的发送周期字段不再使用或者不再触发收端的 连接失效告警。
(2)当引发BMC算法的参数发生变化的时候,立刻发送此Announce报文给下游设备,下游设备收到后上送CPU进行协议计算。考虑到发送一个报文有可能丢失的异常情况,可以在发生变化的时候连续发送N个Announce报文。
(3)当没有参数变化的时候,Announce报文可以不发送。
(4)接收端接收到原有的Announce报文后,上送CPU进行协议处理。触发BMC算法的重新选源计算。
步骤403,如果判断为否,则下发Announce报文的保活报文。其中,保活报文具体包括以下之一:携带有TLV的Announce报文,携带有特定取值的自定义字段的Announce报文,长度固定不变的自定义保活报文。
也就是说,在本发明实施例中,需要定义一种固定长度的保活报文,可以在原有的announce报文上扩展作为保活报文,也可以重新定义一种新的保活报文,保活报文的长度尽量小以方便硬件收发处理,定义方式不限于下面几种:
(1)可以通过扩展报文类型报文长度报文值(Type,Length,Value,简称为TLV)的方式定义新的保活报文,如图5所示,在Announce报文里面扩展一个自定义TLV,当Announce报文携带此TLV的时候,表示是保活报文。
(2)可以通过使用Announce报文自定义字段的方式实现扩展,当自定义字段取值为某个值的时候表示是保活报文。
(3)可以通过定义一种新的保活报文的方式,保活报文的长度固定不变从而方便硬件处理。
在本发明实施例中,保活报文的发送可以按照用户设定的发送周期定 时发送,当接收端连续N个期望接收周期未收到保活报文的时候,则产生Announce连接失效告警,此告警可以用来触发BMC算法重新选源计算。
在本发明实施例中,保活报文的发包周期和期望接收周期可配置并且允许用户修改,为了保证丢包快速响应,一般周期设置为秒级以下。接收端的N个期望周期的值可配置,用户可以根据设备处理速度选择一个合适的值。连接失效告警是否触发BMC算法重新选源也可以配置。
方法实施例二
根据本发明的实施例,提供了一种时间同步方法,以下实施例为发送端的处理,图6是本发明方法实施例二的时间同步方法的示意图,如图6所示,根据本发明实施的时间同步方法具体包括:
步骤601,在特定底层硬件接收到基于1588标准的Announce报文时,将Announce报文发送到CPU进行时间同步处理,并禁止基于Announce报文触发连接失效告警;也就是说,接收到Announce报文后,仅仅执行协议处理,不进行保活处理。
步骤602,在特定底层硬件接收到Announce报文的保活报文时,在特定底层硬件对保活报文进行保活处理。其中,特定底层硬件具体包括:逻辑芯片或交换芯片。
在本发明实施例中,如果在连续N个期望接收周期未收到保活报文时,通过特定底层硬件产生Announce报文的连接失效告警并发送给CPU,其中,N为根据用户配置的正整数。
此外,为了对新老设备同时兼容,本发明实施例设置了一个新设备开关,在本发明实施例中,不需要与老设备兼容,需要将新设备开关设置为打开状态,否则,需要将新设备开关设置为关闭状态,执行如方法实施例三所 述的处理。
方法实施例三
根据本发明的实施例,提供了一种时间同步方法,以下实施例为发送端的处理,图7是本发明方法实施例三的时间同步方法的示意图,如图7所示,根据本发明实施的时间同步方法具体包括:
步骤701,通过特定底层硬件接收基于1588标准的Announce报文,将Announce报文与上一个Announce报文的内容进行比较;
步骤702,通过特定底层硬件根据比较结果,判断内容有变化且变化的内容会导致最佳主时钟BMC算法重新计算,则将Announce报文发送到CPU进行时间同步处理;否则在特定底层硬件对Announce报文进行保活处理。其中,特定底层硬件具体包括:逻辑芯片或交换芯片。
在本发明实施例中,如果在连续N个期望接收周期未收到Announce报文时,通过特定底层硬件产生Announce报文的连接失效告警并发送给CPU,其中,N为根据用户配置的正整数。
此外,为了对新老设备同时兼容,本发明实施例设置了一个新设备开关,如果不需要与老设备兼容,如方法实施例二所示的处理,则将新设备开关设置为打开状态,否则,在本发明实施例中,需要将新设备开关设置为关闭状态。
也就是说,在本发明实施例中,新设备按照原有1588标准的规则发送Announce报文,发包速率和用户配置保持一致。老设备接收到报文后按照以前的方式进行处理。新设备接收到老设备发过来的Announce报文后,接收报文的硬件(交换芯片或者逻辑芯片)对比当前Announce报文和上一个Announce报文的内容,如果变化的内容会触发协议重新计算则 送CPU进行协议处理;否则在硬件过滤掉这种报文并由硬件做保活处理,从而减少对CPU的冲击。
通过上述处理,在解决了处理Announce报文导致CPU系统繁忙的问题的同时,做到了同时兼容新老设备,使得新老设备能够平滑过度。
以下基于上述方法实施例,进行举例说明。
实例1
当老设备和新设备互通的时候,新设备必须兼容老设备的处理。所以新设备不发送新的保活报文,而是按照原有的方式定时发送Announce报文,接收的时候考虑在硬件做过滤以减少对CPU的冲击。
配置新设备的开关为关闭状态,新设备按照原有方式定时发送Announce报文给老设备,老设备按照原有方式进行接收处理。老设备同时发送Announce报文给新设备。新设备接收到Announce报文后首先由逻辑芯片进行处理。逻辑芯片和之前存储的基于PTP链接的Announce报文进行比较,如果有变化则上送CPU进行处理,如果没有变化则在逻辑进行Announce保活的处理然后丢弃Announce报文,减少对CPU的处理。
实例2
当新设备和新设备互通的时候,可以按照全新的方式进行Announce报文处理。此实施例基于Announce报文扩展TLV的方式定义新的保活Announce报文。完整的报文结构如附图1所示,在Announce报文后面扩展一个TLV,TLV格式定义如图5,Type取值为0x4000(取自1588V2标准的用户自定义类型);Length的值为1个字节,Value表示Announce的子类型,取值为1表示其功能是保活。设置两个新设备的开关为打开状态,表示按照全新模式发包。当Announce携带的ClockQuality,ClockClass等参数有变化需要协议重新计算的时候,新设备立刻发送原有格式的 Announce报文。当引发BMC算法的参数没有发生变化的时候,新设备发送携带扩展TLV的Announce报文,也就是保活报文。新设备的逻辑芯片接收到Announce报文后,判断是否携带扩展TLV,如果携带TLV则表示这个报文仅仅需要做保活处理,那么在逻辑内部做Announce连接失效告警检测后丢弃此报文;如果不携带扩展TLV则上送CPU进行协议计算。
实例3
此实例的处理流程和实施例2完全一样,唯一不同的是实例的保活报文仅仅包含PTP报文的header结构,也就是新定义一个消息,MessageType采用1588标准中的保留类型编码,假设取值为0x0E。具体地,设置两个新设备的开关为打开状态,表示按照全新模式发包。当Announce携带的ClockQuality,ClockClass等参数有变化需要协议重新计算的时候,新设备立刻发送原有格式的Announce报文。当引发BMC算法的参数没有发生变化的时候,新设备定时发送MessageType=0x0E的保活报文。新设备的逻辑芯片接收到Announce报文后上送CPU进行协议计算。接收到MessageType=0x0E的新保活包之后,在逻辑内部做连接失效告警检测后丢弃此报文。
以下结合上面三个实例,对发送端和接收端的时间同步方法进行说明。
图8是本发明实施例的发送端时间同步方法的处理流程图,如图8所示,具体包括如下处理:
步骤801,确定定时发包时刻到时;
步骤802,判断是否打开新设备开关,如果判断为否,则执行步骤803,否则,执行步骤804;
步骤803,按照定时发包时刻发送原有的Announce报文;
步骤804,判断触发协议重新计算的参数是否发生变化,如果判断为 否,则执行步骤805,否则,执行步骤806;
步骤805,发送保活报文;
步骤806,发送原有的Announce报文。
图9是本发明实施例的接收端时间同步方法的处理流程图,如图9所示,具体包括如下处理:
步骤901,接收到Announce报文或者保活报文;
步骤902,判断是否打开新设备开关,如果判断为否,则执行步骤903,否则,执行步骤906;
步骤903,比较本次和上次的Announce报文是否相同,如果判断为否,执行904,否则,执行905;
步骤904,将Announce报文送到CPU进行协议处理;
步骤905,对Announce报文进行保活处理,并在处理后丢弃报文;
步骤906,判断是原有的Announce报文还是保活报文,如果是原有的Announce报文,执行步骤907,否则,执行步骤908;
步骤907,将Announce报文送到CPU进行协议处理;
步骤908,对保活报文进行保活处理,并在处理后丢弃报文。
综上,借助于本发明实施例的技术方案,解决了Announce报文标准定义缺陷导致的处理问题,从而增加系统处理速度减少对CPU的冲击,使得1588协议设计更加合理。
装置实施例一
根据本发明实施例,提供了一种时间同步发送端,图10是本发明实施例的时间同步发送端的示意图,如图10所示,具体包括:
判断模块100,设置为判断导致最佳主时钟BMC算法重新计算的参 数是否发生变化;例如时钟源的ClockQuality,ClockClass,Priority等参数发生变化;
发送模块102,设置为在判断模块100判断为是的情况下,下发基于1588标准的Announce报文;在判断模块100判断为否的情况下,下发Announce报文的保活报文。
在本发明实施例中,原有的Announce报文仅作为协议报文存在,修改如下:
(1)原有协议报文中的发送周期字段不再使用或者不再触发收端的连接失效告警。
(2)当引发BMC算法的参数发生变化的时候,立刻发送此Announce报文给下游设备,下游设备收到后上送CPU进行协议计算。考虑到发送一个报文有可能丢失的异常情况,可以在发生变化的时候连续发送N个Announce报文。
(3)当没有参数变化的时候,Announce报文可以不发送。
(4)接收端接收到原有的Announce报文后,上送CPU进行协议处理。触发BMC算法的重新选源计算。
其中,保活报文具体包括以下之一:携带有TLV的Announce报文,携带有特定取值的自定义字段的Announce报文,长度固定不变的自定义保活报文。
也就是说,在本发明实施例中,需要定义一种固定长度的保活报文,可以在原有的announce报文上扩展作为保活报文,也可以重新定义一种新的保活报文,保活报文的长度尽量小以方便硬件收发处理,定义方式不限于下面几种:
(1)可以通过扩展TLV的方式定义新的保活报文,如图5所示,在 Announce报文里面扩展一个自定义TLV,当Announce报文携带此TLV的时候,表示是保活报文。
(2)可以通过使用Announce报文自定义字段的方式实现扩展,当自定义字段取值为某个值的时候表示是保活报文。
(3)可以通过定义一种新的保活报文的方式,保活报文的长度固定不变从而方便硬件处理。
在本发明实施例中,发送模块102发送保活报文可以按照用户设定的发送周期定时发送,当接收端连续N个期望接收周期未收到保活报文的时候,则产生Announce连接失效告警,此告警可以用来触发BMC算法重新选源计算。
在本发明实施例中,保活报文的发包周期和期望接收周期可配置并且允许用户修改,为了保证丢包快速响应,一般周期设置为秒级以下。接收端的N个期望周期的值可配置,用户可以根据设备处理速度选择一个合适的值。连接失效告警是否触发BMC算法重新选源也可以配置。
装置实施例二
根据本发明实施例,提供了一种时间同步接收端,图11是本发明实施例的时间同步接收端的示意图,如图11所示,根据本发明实施例的时间同步接收端具体包括:
特定底层硬件110,设置为在接收到基于1588标准的Announce报文时,将Announce报文发送到CPU 112,并禁止基于Announce报文触发连接失效告警;也就是说,接收到Announce报文后,仅仅执行协议处理,不进行保活处理。在接收到Announce报文的保活报文时,在特定底层硬件对保活报文进行保活处理;
其中,特定底层硬件具体包括:逻辑芯片或交换芯片。
CPU 112,设置为基于Announce报文进行时间同步处理。
在本发明实施例中,如果特定底层硬件110在连续N个期望接收周期未收到保活报文时,则特定底层硬件110产生Announce报文的连接失效告警并发送给CPU 112,其中,N为根据用户配置的正整数。
此外,为了对新老设备同时兼容,本发明实施例还包括设置模块,设置为在不需要与老设备兼容时,则将新设备开关设置为打开状态,否则,需要将新设备开关设置为关闭状态。
装置实施例三
根据本发明实施例,提供了一种时间同步接收端,图12是本发明实施例的时间同步接收端的示意图,如图12所示,根据本发明实施例的时间同步接收端具体包括:
特定底层硬件120,设置为接收基于1588标准的Announce报文,将Announce报文与上一个Announce报文的内容进行比较;根据比较结果,判断内容有变化且变化的内容会导致最佳主时钟BMC算法重新计算,则将Announce报文发送到CPU 122进行时间同步处理;否则在特定底层硬件对Announce报文进行保活处理;
CPU 122,设置为基于Announce报文进行时间同步处理。
其中,特定底层硬件具体包括:逻辑芯片或交换芯片。
在本发明实施例中,如果特定底层硬件120在连续N个期望接收周期未收到Announce报文时,通过特定底层硬件120产生Announce报文的连接失效告警并发送给CPU 122,其中,N为根据用户配置的正整数。
此外,为了对新老设备同时兼容,本发明实施例还包括设置模块,设 置为在不需要与老设备兼容时,则将新设备开关设置为打开状态,否则,需要将新设备开关设置为关闭状态。在本发明实施例中,需要设置模块需要将将新设备开关设置为关闭状态。
也就是说,在本发明实施例中,新设备按照原有1588标准的规则发送Announce报文,发包速率和用户配置保持一致。老设备接收到报文后按照以前的方式进行处理。新设备接收到老设备发过来的Announce报文后,接收报文的硬件(交换芯片或者逻辑芯片)对比当前Announce报文和上一个Announce报文的内容,如果变化的内容会触发协议重新计算则送CPU 122进行协议处理;否则在硬件过滤掉这种报文并由硬件作保活处理,从而减少对CPU的冲击。
通过上述处理,在解决了处理Announce报文导致CPU系统繁忙的问题的同时,做到了同时兼容新老设备,使得新老设备能够平滑过度。
系统实施例
根据本发明实施例,提供了一种时间同步系统,图13是本发明实施例的时间同步系统的示意图,如图13所示,包括上述装置实施例一的时间同步发送端130以及上述装置实施例二的时间同步接收端132。
具体地,时间同步发送端130具体包括:
判断模块100,设置为判断导致最佳主时钟BMC算法重新计算的参数是否发生变化;例如时钟源的ClockQuality,ClockClass,Priority等参数发生变化;
发送模块102,设置为在判断模块100判断为是的情况下,下发基于1588标准的Announce报文;在判断模块100判断为否的情况下,下发Announce报文的保活报文。
在本发明实施例中,原有的Announce报文仅作为协议报文存在,修改如下:
(1)原有协议报文中的发送周期字段不再使用或者不再触发收端的连接失效告警。
(2)当引发BMC算法的参数发生变化的时候,立刻发送此Announce报文给下游设备,下游设备收到后上送CPU进行协议计算。考虑到发送一个报文有可能丢失的异常情况,可以在发生变化的时候连续发送N个Announce报文。
(3)当没有参数变化的时候,Announce报文可以不发送。
(4)接收端接收到原有的Announce报文后,上送CPU进行协议处理。触发BMC算法的重新选源计算。
其中,保活报文具体包括以下之一:携带有TLV的Announce报文,携带有特定取值的自定义字段的Announce报文,长度固定不变的自定义保活报文。
也就是说,在本发明实施例中,需要定义一种固定长度的保活报文,可以在原有的announce报文上扩展作为保活报文,也可以重新定义一种新的保活报文,保活报文的长度尽量小以方便硬件收发处理,定义方式不限于下面几种:
(1)可以通过扩展TLV的方式定义新的保活报文,如图5所示,在Announce报文里面扩展一个自定义TLV,当Announce报文携带此TLV的时候,表示是保活报文。
(2)可以通过使用Announce报文自定义字段的方式实现扩展,当自定义字段取值为某个值的时候表示是保活报文。
(3)可以通过定义一种新的保活报文的方式,保活报文的长度固定 不变从而方便硬件处理。
在本发明实施例中,发送模块102发送保活报文可以按照用户设定的发送周期定时发送,当接收端连续N个期望接收周期未收到保活报文的时候,则产生Announce连接失效告警,此告警可以用来触发BMC算法重新选源计算。
在本发明实施例中,保活报文的发包周期和期望接收周期可配置并且允许用户修改,为了保证丢包快速响应,一般周期设置为秒级以下。接收端的N个期望周期的值可配置,用户可以根据设备处理速度选择一个合适的值。连接失效告警是否触发BMC算法重新选源也可以配置。
时间同步接收端132具体包括:
特定底层硬件110,设置为接收基于1588标准的Announce报文,将Announce报文发送到CPU 112,并禁止基于Announce报文触发连接失效告警;也就是说,接收到Announce报文后,仅仅执行协议处理,不进行保活处理。接收Announce报文的保活报文,在特定底层硬件对保活报文进行保活处理;
其中,特定底层硬件具体包括:逻辑芯片或交换芯片。
CPU 112,设置为基于Announce报文进行时间同步处理。
在本发明实施例中,如果特定底层硬件110在连续N个期望接收周期未收到保活报文时,则特定底层硬件110产生Announce报文的连接失效告警并发送给CPU 112,其中,N为根据用户配置的正整数。
此外,为了对新老设备同时兼容,本发明实施例还包括设置模块,设置为在不需要与老设备兼容时,则将新设备开关设置为打开状态,否则,需要将新设备开关设置为关闭状态。
优选地,在本发明实施例中,为了新老设备兼容,还可以包括如装置 实施例三的时间同步接收端,具体包括:
特定底层硬件120,设置为接收基于1588标准的Announce报文,将Announce报文与上一个Announce报文的内容进行比较;根据比较结果,判断内容有变化且变化的内容会导致最佳主时钟BMC算法重新计算,则将Announce报文发送到CPU 122进行时间同步处理;否则在特定底层硬件对Announce报文进行保活处理;
CPU 122,设置为基于Announce报文进行时间同步处理。
其中,特定底层硬件具体包括:逻辑芯片或交换芯片。
在本发明实施例中,如果特定底层硬件120在连续N个期望接收周期未收到Announce报文时,通过特定底层硬件120产生Announce报文的连接失效告警并发送给CPU 122,其中,N为根据用户配置的正整数。
此外,为了对新老设备同时兼容,本发明实施例还包括设置模块,设置为在不需要与老设备兼容时,则将新设备开关设置为打开状态,否则,需要将新设备开关设置为关闭状态。在本发明实施例中,需要设置模块需要将将新设备开关设置为关闭状态。
也就是说,在本发明实施例中,新设备按照原有1588标准的规则发送Announce报文,发包速率和用户配置保持一致。老设备接收到报文后按照以前的方式进行处理。新设备接收到老设备发过来的Announce报文后,接收报文的硬件(交换芯片或者逻辑芯片)对比当前Announce报文和上一个Announce报文的内容,如果变化的内容会触发协议重新计算则送CPU 122进行协议处理;否则在硬件过滤掉这种报文并由硬件作保活处理,从而减少对CPU的冲击。
通过上述处理,在解决了处理Announce报文导致CPU系统繁忙的问题的同时,做到了同时兼容新老设备,使得新老设备能够平滑过度。
本发明的实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
在一个示例性实施例中,上述计算机可读存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。
本发明的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。
在一个示例性实施例中,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。
本实施例中的具体示例可以参考上述实施例及示例性实施方式中所描述的示例,本实施例在此不再赘述。
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模 块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (17)

  1. 一种时间同步方法,包括:
    判断导致最佳主时钟BMC算法重新计算的参数是否发生变化;
    如果判断为是,则下发基于1588标准的Announce报文;
    如果判断为否,则下发Announce报文的保活报文。
  2. 如权利要求1所述的方法,其中,所述保活报文具体包括以下之一:携带有报文类型报文长度报文值TLV的Announce报文,携带有特定取值的自定义字段的Announce报文,长度固定不变的自定义保活报文。
  3. 一种时间同步方法,包括:
    在特定底层硬件接收到基于1588标准的Announce报文时,将所述Announce报文发送到CPU进行时间同步处理,并禁止基于所述Announce报文触发连接失效告警;
    在所述特定底层硬件接收到Announce报文的保活报文时,在所述特定底层硬件对所述保活报文进行保活处理。
  4. 如权利要求3所述的方法,其中,所述方法进一步包括:
    在连续N个期望接收周期未收到所述保活报文时,通过所述特定底层硬件产生Announce报文的连接失效告警并发送给CPU,其中,N为根据用户配置的正整数。
  5. 如权利要求3所述的方法,其中,所述特定底层硬件具体包括:逻辑芯片或交换芯片。
  6. 如权利要求3所述的方法,其中,接收基于1588标准的Announce报文之前,所述方法进一步包括:
    确定新设备开关为打开状态。
  7. 一种时间同步方法,包括:
    通过特定底层硬件接收基于1588标准的Announce报文,将所述 Announce报文与上一个Announce报文的内容进行比较;
    通过所述特定底层硬件根据比较结果,判断内容有变化且变化的内容会导致最佳主时钟BMC算法重新计算,则将所述Announce报文发送到CPU进行时间同步处理;否则在所述特定底层硬件对所述Announce报文进行保活处理。
  8. 如权利要求7所述的方法,其中,所述方法进一步包括:
    在连续N个期望接收周期未收到所述Announce报文时,通过所述特定底层硬件产生Announce报文的连接失效告警并发送给CPU,其中,N为根据用户配置的正整数。
  9. 如权利要求7所述的方法,其中,所述特定底层硬件具体包括:逻辑芯片或交换芯片。
  10. 如权利要求7所述的方法,其中,接收基于1588标准的Announce报文之前,所述方法进一步包括:
    确定新设备开关为关闭状态。
  11. 一种时间同步发送端,包括:
    判断模块,设置为判断导致最佳主时钟BMC算法重新计算的参数是否发生变化;
    发送模块,设置为在判断模块判断为是的情况下,下发基于1588标准的Announce报文;在判断模块判断为否的情况下,下发Announce报文的保活报文。
  12. 一种时间同步接收端,包括:
    特定底层硬件,设置为在接收到基于1588标准的Announce报文时,将所述Announce报文发送到CPU,并禁止基于所述Announce报文触发连接失效告警;在接收到Announce报文的保活报文时,在所述特定底层 硬件对所述保活报文进行保活处理;
    CPU,设置为基于所述Announce报文进行时间同步处理。
  13. 一种时间同步接收端,包括:
    特定底层硬件,设置为接收基于1588标准的Announce报文,将所述Announce报文与上一个Announce报文的内容进行比较;根据比较结果,判断内容有变化且变化的内容会导致最佳主时钟BMC算法重新计算,则将所述Announce报文发送到CPU进行时间同步处理;否则在所述特定底层硬件对所述Announce报文进行保活处理;
    CPU,设置为基于所述Announce报文进行时间同步处理。
  14. 一种时间同步系统,包括如权利要求11所述的时间同步发送端以及如权利要求12所述的时间同步接收端。
  15. 如权利要求14所述的系统,其中,还包括如权利要求13所述的时间同步接收端。
  16. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行所述权利要求1至2任一项中所述的方法,或者执行权利要求3至6任一项中所述的方法,或者执行权利要求7至10任一项中所述的方法。
  17. 一种电子装置,包括存储器和处理器,其特征在于,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行所述权利要求1至2任一项中所述的方法,或者执行权利要求3至6任一项中所述的方法,或者执行权利要求7至10任一项中所述的方法。
PCT/CN2020/105203 2019-08-07 2020-07-28 时间同步方法、时间同步发送端、接收端及系统 WO2021023063A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US17/633,329 US12028156B2 (en) 2019-08-07 2020-07-28 Time synchronization method, time synchronization sending end and receiving end, and system
EP20849332.0A EP4012947A4 (en) 2019-08-07 2020-07-28 TIME SYNCHRONIZATION METHOD, TIME SYNCHRONIZATION TRANSMITTER AND RECEIVE END AND SYSTEM

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910725066.XA CN112152745B (zh) 2019-08-07 2019-08-07 时间同步方法、时间同步发送端、接收端及系统
CN201910725066.X 2019-08-07

Publications (1)

Publication Number Publication Date
WO2021023063A1 true WO2021023063A1 (zh) 2021-02-11

Family

ID=73891589

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/105203 WO2021023063A1 (zh) 2019-08-07 2020-07-28 时间同步方法、时间同步发送端、接收端及系统

Country Status (3)

Country Link
EP (1) EP4012947A4 (zh)
CN (1) CN112152745B (zh)
WO (1) WO2021023063A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101207606A (zh) * 2006-12-18 2008-06-25 华为技术有限公司 主时钟选举的方法和装置
CN102036361A (zh) * 2009-09-25 2011-04-27 华为技术有限公司 时钟源选择的处理方法、装置和系统
CN102546073A (zh) * 2012-01-12 2012-07-04 广州思唯奇计算机科技有限公司 一种基于多时钟环的防止时钟切换抖动的方法
CN103202072A (zh) * 2010-11-12 2013-07-10 高通股份有限公司 睡眠时钟误差恢复方案
US20150189611A1 (en) * 2009-05-13 2015-07-02 Dust Networks, Inc. Timing synchronization for wireless networks
CN105024798A (zh) * 2014-04-28 2015-11-04 中兴通讯股份有限公司 一种时间同步的方法及装置

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5158600B2 (ja) * 2008-10-15 2013-03-06 国立大学法人名古屋大学 通信装置、通信システム及び通信方法
CN101610272A (zh) * 2009-07-30 2009-12-23 迈普通信技术股份有限公司 一种避免邻居关系振荡的方法
CN102388556B (zh) * 2011-09-20 2014-02-26 华为技术有限公司 一种时钟等级分级方法及相关设备
CN104092528B (zh) * 2014-07-14 2017-06-06 新华三技术有限公司 一种时钟同步方法和装置
CN109155788B (zh) * 2016-05-19 2021-05-25 西门子股份公司 借助明确拆除消息在tsn网络中快速重新配置gm时钟的方法
US10158444B1 (en) * 2017-11-16 2018-12-18 Microsemi Corporation Event-driven precision time transfer

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101207606A (zh) * 2006-12-18 2008-06-25 华为技术有限公司 主时钟选举的方法和装置
US20150189611A1 (en) * 2009-05-13 2015-07-02 Dust Networks, Inc. Timing synchronization for wireless networks
CN102036361A (zh) * 2009-09-25 2011-04-27 华为技术有限公司 时钟源选择的处理方法、装置和系统
CN103202072A (zh) * 2010-11-12 2013-07-10 高通股份有限公司 睡眠时钟误差恢复方案
CN102546073A (zh) * 2012-01-12 2012-07-04 广州思唯奇计算机科技有限公司 一种基于多时钟环的防止时钟切换抖动的方法
CN105024798A (zh) * 2014-04-28 2015-11-04 中兴通讯股份有限公司 一种时间同步的方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4012947A4 *

Also Published As

Publication number Publication date
CN112152745B (zh) 2021-09-28
EP4012947A1 (en) 2022-06-15
US20220360349A1 (en) 2022-11-10
CN112152745A (zh) 2020-12-29
EP4012947A4 (en) 2022-10-26

Similar Documents

Publication Publication Date Title
US9832111B2 (en) OFS in-band communication method and OFS
EP2962429B1 (en) Traffic recovery in openflow networks
EP1411684A2 (en) Programmable inter-packet gap generator with byte granularity
CN112737914B (zh) 报文处理方法、装置、网络设备及可读存储介质
CN107294856B (zh) 确定拓扑变化的方法、设备及系统
CN113992588A (zh) 数据传输方法、装置、电子设备及可读存储介质
WO2018219103A1 (zh) 一种链路状态确定方法及设备
CN114157609B (zh) Pfc死锁检测方法及装置
JP4532253B2 (ja) フレーム転送装置及びフレームのループ抑止方法
JP2009200849A (ja) フレーム監視装置およびフレーム監視方法
WO2021023063A1 (zh) 时间同步方法、时间同步发送端、接收端及系统
TWI722947B (zh) 電子裝置與用於電子裝置的訊框傳送方法
US20130003550A1 (en) System and Method for Priority Based Flow Control Between Nodes
EP3242443A1 (en) Path continuity determination in an aggregate flow environment
US8788735B2 (en) Interrupt control apparatus, interrupt control system, interrupt control method, and interrupt control program
JP3801581B2 (ja) OSPFプロトコルのtype5LSAの分離セットによるフラッシング方法
US11063681B2 (en) Method for operating a communication network in a ring topology
WO2022063126A1 (zh) 报文传输控制、生成、传输方法及配置方法、设备、介质
CN108337181B (zh) 一种交换网拥塞管理方法和装置
CN113346974B (zh) 用于时钟同步的方法、设备、通信系统和存储介质
JP5904140B2 (ja) 伝送装置および異常検出方法
JP2017147583A (ja) ネットワーク中継装置
CN113965523A (zh) 一种基于环路的pfc死锁的处理方法及装置
WO2021023236A1 (zh) 冗余网络中的信息共享方法及装置、计算机存储介质
US12028156B2 (en) Time synchronization method, time synchronization sending end and receiving end, and system

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2020849332

Country of ref document: EP

Effective date: 20220307