WO2014032350A1 - Method and node based on seamless redundant ring network for increasing precision of clock - Google Patents

Method and node based on seamless redundant ring network for increasing precision of clock Download PDF

Info

Publication number
WO2014032350A1
WO2014032350A1 PCT/CN2012/082004 CN2012082004W WO2014032350A1 WO 2014032350 A1 WO2014032350 A1 WO 2014032350A1 CN 2012082004 W CN2012082004 W CN 2012082004W WO 2014032350 A1 WO2014032350 A1 WO 2014032350A1
Authority
WO
WIPO (PCT)
Prior art keywords
clock
clock information
node
time
synchronization
Prior art date
Application number
PCT/CN2012/082004
Other languages
French (fr)
Chinese (zh)
Inventor
黄剑超
马化一
Original Assignee
北京东土科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京东土科技股份有限公司 filed Critical 北京东土科技股份有限公司
Publication of WO2014032350A1 publication Critical patent/WO2014032350A1/en

Links

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
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/42Loop networks
    • 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/0673Clock or time synchronisation among packet nodes using intermediate nodes, e.g. modification of a received timestamp before further transmission to the next packet node, e.g. including internal delay time or residence time into the packet

Definitions

  • the present invention relates to the field of ring networks, and in particular, to a method and a section for improving clock accuracy based on a seamless redundant ring network
  • RSTP Spanning Tree Protocol
  • MSTP Multiple Spanning Tree Protocol
  • IEEE 802. lw these two protocols can be applied to loops.
  • the network implements path redundancy through a certain algorithm, and at the same time prunes the loop network into a loop-free tree network.
  • IEC 62439 protocol of which IEC 62439-2 Media Redundancy Protocol (MRP)
  • MRP Media Redundancy Protocol
  • PRP Parallel Redundancy Protocol
  • the content of the protocol of the Seamless Automation Ring is mainly to send data frames from two ports of a node of the ring network to the ring network, and the data frames sent from one port are terminated on the other port of the node. Transmission, thereby enabling seamless transmission of data frames in a ring network.
  • each node receives two identical data frames, thus causing a waste of transmission paths in the ring network, and fixing the redundant ports of each node also causes the nodes to be used. Waste of port resources.
  • a node in the ring network sends a data frame to two ports located in the ring network respectively, when two data frames reach a certain node in the ring network, The node no longer forwards the data frame, that is, the data frame terminates at a node in the ring network.
  • the Accurate Clock Protocol (IEEE1588 protocol) implements accurate clock synchronization in measurement and control systems implemented in technologies such as network communications, local computing, and distributed objects.
  • nodes 1, 2, and 3 are seamlessly redundant.
  • the nodes in the network, 1A and 1B are the ring ports of node 1
  • 2A and 2B are the ring ports of node 2
  • 3A and 3B are the ring ports of node 3
  • the external ports of node 1 are connected to the master clock of the precision clock protocol
  • node 3 The external port is connected to the slave clock of the precision clock protocol.
  • the master clock can send synchronous clock information to the connected node (node 1), and the node 1 carries the received synchronous clock information in the ring network message and forwards it to the adjacent node.
  • the node 3 forwards the synchronous clock information to the slave clock, and the slave clock performs clock synchronization according to the synchronous clock information.
  • the existing precise clock protocol indicates that in a seamless redundant ring network, each node transmits a ring network message carrying synchronous clock information only as a transparent clock instead of a boundary clock, and each node only synchronizes clock information or carries The ring network packet with the synchronous clock information is forwarded.
  • the node receives and forwards the synchronous clock information or the ring network packet carrying the synchronous clock information has a certain time delay.
  • the prior art proposes A fixed correction value is preset, and each node uses the correction value to correct the synchronization clock information.
  • the time delay is uncertain. If the fixed correction value is used to correct the synchronous clock information, It will cause a large synchronization error in the synchronization of the master and slave clocks. If the accuracy of the error is in the us level, the result will have a us-level effect on the precision of the precision clock protocol. For many clock synchronizations requiring us-level precision. Application scenarios can have a big impact.
  • the embodiments of the present invention provide a method and a node for improving clock precision based on a seamless redundant ring network, which are used to solve the problem in the prior art that each node receives and forwards synchronous clock information or carries a synchronous clock.
  • the time delay of the time is uncertain, which leads to a large synchronization error of the master-slave clock.
  • a method for improving clock accuracy based on a seamless redundant ring network including:
  • the node in the seamless redundant ring network After receiving the synchronization clock information sent by the adjacent node or the master clock, the node in the seamless redundant ring network determines the resident duration of the received synchronization clock information in the local node, and the resident duration is synchronization. The length of time between the point in time when the clock information is input to the ingress port and the time point from the output to the egress port;
  • the modified synchronization clock information is forwarded to the adjacent node through the ring port. If the egress port is an external port, the modified synchronization clock information is forwarded to the external port.
  • the slave clock so that the slave clock is clocked according to the synchronous clock information.
  • a node in a seamless redundant ring network including:
  • a receiving unit configured to receive synchronous clock information sent by an adjacent node or a master clock
  • a dwell duration determining unit configured to determine a dwell duration of the synchronization clock information received by the receiving unit in the local node, where the dwell time is a time from the input to the ingress port to the output to the egress port Length of time between points;
  • a synchronous clock correcting unit configured to correct the received synchronous clock information according to the resident duration determined by the resident duration determining unit
  • a forwarding unit configured to: when the egress port is a ring port, forward the corrected synchronization clock information to the adjacent node by using the ring port, and when the egress port is an external port, pass the external port
  • the corrected synchronous clock information is forwarded to the slave clock so that the slave clock performs clock synchronization based on the synchronous clock information.
  • the method for improving the clock precision based on the seamless redundant ring network because each node respectively determines the time delay of receiving and forwarding the synchronous clock information or the ring network carrying the synchronous clock information, Then, according to the determined time delay, the received synchronous clock information is corrected and then forwarded, instead of using a fixed correction value to correct the synchronous clock information, thereby effectively reducing the synchronization error of the master-slave clock and improving the master. Synchronization accuracy from the clock.
  • FIG. 1 is a schematic structural view of a seamless redundant ring network in the prior art
  • FIG. 2 is a schematic flowchart of a method for improving clock precision based on a seamless redundant ring network according to Embodiment 1 of the present invention
  • FIG. 3 is a flowchart showing a duration of synchronization clock information in a node according to Embodiment 2 of the present invention
  • FIG. 4 is a schematic flowchart of clock frequency synchronization of a local clock of a node according to Embodiment 3 of the present invention
  • FIG. 5 is a schematic structural diagram 1 of a node in a seamless redundant ring network according to Embodiment 4 of the present invention
  • 5-2 is a second schematic structural diagram of a node in a seamless redundant ring network according to Embodiment 4 of the present invention
  • FIG. 6 is a third schematic structural diagram of a node in a seamless redundant ring network according to Embodiment 5 of the present invention. detailed description
  • the structure of the seamless redundant ring network is shown in Figure 1.
  • the seamless redundant ring network includes several nodes (node 1, node 2, and node 3 in Figure 1).
  • the nodes included in the seamless redundant ring network are not limited to the three nodes in Figure 1, but also the chain network composed of two nodes is also called the seamless redundant ring network.
  • the seamless redundancy The ring network includes both the HSR network and the ASR network, and can also be extended to the seamless redundant ring network type not listed.
  • Each node in the seamless redundant ring network is connected by a link.
  • the external port of node 1 is connected to the master clock, and the external port of node 3 is connected to the slave clock.
  • the master clock can be connected to the node 2 or 3 in the ring network.
  • which node is connected from the clock can also be based on The actual needs of the project implementation are deployed.
  • Each node (such as node 1, node 2, and node 3 in Figure 1) is connected through a ring port.
  • FIG. 2 it is a flow chart of a method for improving clock precision based on a seamless redundant ring network according to Embodiment 1 of the present invention.
  • the method includes the following steps:
  • Step 21 After receiving the synchronization clock information sent by the adjacent node or the master clock, the node in the seamless redundant ring network determines the resident duration of the received synchronization clock information in the local node, where the resident The duration is the length of time between the point in time when the synchronous clock information is input to the ingress port and the time point from the output to the egress port.
  • the synchronous clock information is transmitted between the master clock and the node, and the synchronous clock information is also transmitted between the slave clock and the node, and the ring network packets carrying the synchronous clock information are transmitted between the nodes, that is, the synchronization information is carried in the ring network report.
  • the master clock sends the synchronous clock information to the connected node through the external port, and the node connected to the master clock receives the synchronous clock information, and then corrects the synchronous clock information, and carries the modified synchronous clock information in the ring network message.
  • the node If the node is not connected to the slave clock, it will be corrected.
  • the subsequent synchronous clock information is carried in the ring network message and sent to the adjacent node. If the slave node is connected to the slave clock, the modified synchronous clock information is sent to the slave clock.
  • the ingress port of the node receiving the synchronous clock information may be an external port or a ring port. If the ingress port is an external port, it indicates that the node has a master clock connected through the external port, and the outbound port is a ring port, that is, the node passes through the ring.
  • the port forwards the ring network carrying the synchronous clock information to the adjacent node; if the ingress port is a ring port, the egress port is both It can be a ring port or an external port.
  • the egress port is a ring port, it indicates that the node is not connected to the master clock and the slave clock.
  • the node forwards the ring network packet carrying the synchronous clock information to the adjacent node through the ring port.
  • the egress port is an external port, it indicates that the node is connected to the slave clock through the external port, and the node forwards the synchronous clock information to the slave clock through the external port.
  • a node connected to the master clock may be referred to as an originating node, and a node connected to the slave clock may be referred to as a receiving node, and then other nodes may be referred to as intermediate nodes.
  • node 1 is the originating node
  • node 3 is the receiving node
  • node 2 is the intermediate node.
  • the originating node receives the synchronous clock information sent by the master clock through the external port, and forwards the ring network message carrying the synchronous clock information to the adjacent node through the two ring ports respectively, and the intermediate node receives the sent by the neighboring node through the ring port.
  • the ring network packet forwards the ring network packet to the neighboring node through another ring port.
  • the receiving node receives the ring network packet sent by the neighboring node through the ring port, and forwards the synchronous clock information to the slave clock through the external port.
  • the duration of the synchronization clock information received by the node in the node can also be regarded as the time delay when the node receives and forwards the synchronization clock information or the ring network message carrying the synchronization information.
  • the duration of the reservation specifically refers to the synchronization clock information. Enter the length of time between the point in time of the ingress port and the point in time when it is output to the egress port.
  • the ingress port is an external port
  • the originating node sends the ring network containing the synchronous clock information to the two ring ports simultaneously, that is, the egress port is two ring ports, and the synchronous clock
  • the length of time between the input of the information to the external port and the output to one of the ring ports is the same as the length of time between the synchronization clock information from the input to the external port and the output to the other ring port.
  • Step 22 Correct the received synchronous clock information according to the determined resident duration.
  • the received synchronous clock information is the uncorrected synchronous clock information sent by the master clock. If the node is not the originating node, the synchronous clock information carried in the received ring network message Synchronized clock information corrected for each node.
  • Step 23 If the egress port is a ring port, the modified synchronization clock information is forwarded to the adjacent node through the ring port, and if the egress port is an external port, the modified synchronization is performed through the external port.
  • the clock information is forwarded to the slave clock so that the slave clock is clocked according to the synchronous clock information.
  • the egress port is a ring port. At this time, the node forwards the ring network carrying the corrected synchronization clock information to the adjacent node through the ring port.
  • the egress port is an external port, and the node forwards the corrected synchronous clock information to the slave clock through the external port.
  • clock synchronization is performed according to the synchronous clock information, thereby realizing clock synchronization between the slave clock and the master clock.
  • the slave clock performs clock synchronization according to the synchronous clock information received first, and discards the subsequently received synchronous clock information.
  • the node in the seamless redundant ring network determines that the received synchronous clock information is The length of the dwell time in the node, the dwell time is the length of time between the time point of the synchronous clock information from the input to the ingress port to the time point of the output to the egress port, and the node corrects the receiving according to the determined dwell time.
  • the node forwards the corrected synchronous clock information to the adjacent node through the ring port, and if the outgoing port is an external port, the node passes the The external port forwards the corrected synchronous clock information to the slave clock, so that the slave clock synchronizes the clock according to the synchronous clock information.
  • Each node determines the time delay of receiving and forwarding the synchronous clock information or the ring network carrying the synchronous clock information, and then correcting the received synchronous clock information according to the determined time delay before forwarding. Instead of using a fixed correction value to correct the synchronous clock information, the synchronization error of the master-slave clock is effectively reduced, and the synchronization accuracy of the master-slave clock is improved.
  • the node may first obtain the first count value of the local clock when the synchronous clock information is input to the ingress port, and when the synchronous clock information is output to the egress port, the local The second count value of the clock is then determined according to the obtained first count value and second count value, and the clock frequency of the local clock, the duration of the synchronization clock information in the local node.
  • the local clock in the node is counted according to its own clock frequency.
  • the time point at which the node receives the synchronous clock information from the ingress port is ⁇ 1
  • the time point at which the synchronous clock information is output to the egress port is ⁇ 2.
  • the time point at which the node receives the synchronous clock information from the external port is ⁇ 1
  • the time at which the synchronous clock information is output to the ring port is ⁇ 2
  • the clock frequency of the local clock of the node is 125M, that is, The count is performed every 8 ns.
  • the first count value of the local clock is nl.
  • the node When the node is an intermediate node, the time point at which the node receives the ring network message carrying the synchronous clock information from the first ring port is T1, and the time point at which the synchronous clock information is output to the second ring port is ⁇ 2, the node The clock frequency of the local clock is 125 M, that is, every 8 ns is counted.
  • the first count value of the local clock is nl
  • the synchronous clock information is output to the second.
  • the clock of the local clock of the node Frequency is
  • the node determines the duration of the synchronization clock information in the local node according to the clock frequency of the local clock.
  • Embodiment 3 of the present invention It is proposed that each node can synchronize the clock frequency of the local clock before determining the resident duration. The method flow is shown in FIG. 4, and the specific processing flow is:
  • Step 41 Determine a deviation of a clock frequency between the local clock and the main clock according to the synchronous clock information received this time and the synchronous clock information received last time.
  • the master clock can periodically send synchronous clock information.
  • Step 42 Synchronize the clock frequency of the local clock according to the determined deviation of the clock frequency.
  • the node may first determine the time point corresponding to the synchronous clock information received this time, the time point corresponding to the last received synchronous clock information, the time point of receiving the synchronous clock information, and the last time receiving the synchronous clock information. At the time point, then based on the determined time points, the deviation of the clock frequency between the local clock and the main clock is calculated.
  • is the deviation of the clock frequency between the local clock and the main clock
  • t2 is the time point corresponding to the received synchronous clock information
  • tl is the time point corresponding to the last received synchronous clock information
  • t2' For the time when the synchronous clock information is received, tl' is the time point when the synchronous clock information is received last time, and the deviation of the clock frequency between the local clock and the master clock is:
  • the node may record the timestamp corresponding to the time point when the inbound port receives the synchronization clock information, and then the node may directly receive the synchronization clock information according to the current time.
  • the method for synchronizing the clock frequency of the local clock proposed in Embodiment 3 of the present invention can realize that the clock frequencies of the local clocks of all the nodes in the seamless redundant ring network are synchronized (both with the clock frequency of the main clock) Therefore, the accuracy of the resident duration calculated by each node is effectively improved, and the synchronization precision of the master-slave clock is further improved.
  • each node periodically receives the synchronization clock information, and each time the synchronization clock information is received, not only the determination of the resident duration but also the correction of the synchronization clock information according to the resident duration is performed. Operation, but also to perform the operation of synchronizing the clock frequency of the local clock (except for the first time receiving the synchronous clock information), then the node can determine the resident according to the synchronized clock frequency after receiving the synchronous clock information next time. duration.
  • the node in the seamless redundant ring network includes the first CPU component, the second CPU component, the first ring port, and the second ring port, as shown in FIG. 5-1, where the first CPU The component is connected to the first ring port and the second ring port, and the first ring port and the second ring port are responsible for sending, receiving, and forwarding the ring network.
  • the first CPU component includes a packet forwarding module and a frequency synchronization module
  • the second CPU component includes a protocol processing module. among them:
  • the packet forwarding module receives and forwards the synchronization information or the ring network message carrying the synchronization information through the external port or the ring port, and determines the resident duration of the received synchronization clock information in the node, and according to the determined resident duration. , Correct the received synchronous clock information.
  • the protocol processing module is configured to process the ring network and calculate the deviation of the clock frequency between the local clock and the main clock, and then send the deviation of the clock frequency to the first CPU component, and synchronize the frequency in the first CPU component.
  • the module adjusts the clock frequency of the local clock.
  • the frequency synchronization module is configured to generate a local clock, and adjust the clock frequency of the local clock according to the deviation of the clock frequency provided by the protocol processing module, so that the local clock and the clock frequency of the main clock are synchronized.
  • the first CPU component of the node saves the time when the ingress port receives the synchronous clock information or the ring network message carrying the synchronous clock information, and the first CPU component saves the synchronous clock information to the outbound The time of the port, so that the duration of the dwell is determined based on the two times saved.
  • node 1 is an originating node, and a master clock connected to an external port of node 1 transmits synchronous clock information, and a first CPU component of node 1 stores a time at which the node receives the synchronous clock information from an external port.
  • the first CPU component of node 1 saves the time t2 at which the synchronous clock information is transmitted to its first ring port and the second ring port, and then subtracts t2 from the recorded t2 to be the resident time of the synchronous clock information in node 1. It should be noted that the first CPU component adds the corrected synchronization clock information to the ring network message for forwarding.
  • the method for improving the clock precision based on the seamless redundant ring network provides a node in the seamless redundant ring network, and the structure thereof is as shown in FIG. 6, which includes:
  • the receiving unit 61 is configured to receive synchronous clock information sent by an adjacent node or a master clock;
  • the resident duration determining unit 62 is configured to determine a duration of the synchronization clock information received by the receiving unit 61 in the local node, where the resident duration is a time point from the input to the ingress port to the output to the egress port. Length of time between points in time;
  • the synchronization clock correction unit 63 is configured to correct the received synchronization clock information according to the resident duration determined by the resident duration determining unit 62;
  • the forwarding unit 64 is configured to: when the egress port is a ring port, forward the corrected synchronization clock information to the adjacent node by using the ring port, and when the egress port is an external port, pass the external port The corrected synchronous clock information is forwarded to the slave clock so that the slave clock performs clock synchronization based on the synchronous clock information.
  • the receiving unit 61 is not only used to receive the synchronization clock information sent by the adjacent node or the master clock, but also can be used to receive the ⁇ ⁇ text through the external port and the ring port, and the received ⁇ ⁇ ⁇ can be the ring network ⁇ ⁇ , can also be used for other data.
  • the forwarding unit 64 is not only used to forward the synchronous clock information, but also can be used to forward the data through the external port and the ring port, and the forwarded message can be a ring network message or other data message.
  • the receiving unit 61 is configured to receive a ring network message that is sent by the neighboring node and that carries the synchronous clock information, and confirm the synchronous clock information carried in the received ring network message as an adjacent node. Synchronized clock information sent;
  • the forwarding unit 64 is configured to carry the modified synchronization clock information in the ring network, and forward the ring network carrying the corrected synchronization clock information to the adjacent node through the ring port.
  • the resident duration determining unit 62 specifically includes:
  • the count value obtaining sub-unit is configured to obtain a first count value of the local clock when the synchronous clock information is input to the ingress port, and a second count value of the local clock when the synchronous clock information is output to the egress port;
  • the dwell duration determining subunit is configured to obtain a first count value and a second count value obtained by the subunit according to the count value, and a clock frequency of the local clock, and determine a dwell duration of the synchronous clock information in the node.
  • the master clock periodically sends synchronous clock information
  • the nodes in the seamless redundant ring network further include:
  • the clock frequency deviation determining unit is configured to: before the resident duration determining unit 62 determines the resident synchronization clock information in the local node, according to the currently received synchronous clock information and the last received synchronous clock information. Determining a deviation of a clock frequency between the local clock and the master clock;
  • the clock frequency synchronization unit is configured to determine a deviation of the clock frequency determined by the occupancy clock frequency deviation determining unit and synchronize the clock frequency of the local clock.
  • the clock frequency deviation determining unit specifically includes:
  • a time point determining subunit configured to determine a time point corresponding to the synchronous clock information received this time, a time point corresponding to the last received synchronous clock information, a time point of receiving the synchronous clock information, and a last received synchronous clock Time point of information;
  • the clock frequency deviation determining subunit is configured to calculate a deviation of a clock frequency between the local clock and the main clock according to each time point determined by the time point determining subunit.
  • the nodes in the seamless redundant ring network further include:
  • a timestamp recording unit configured to: before the clock frequency deviation determining unit determines the deviation of the clock frequency between the local clock and the main clock, after receiving the synchronous clock information, record the time point at which the ingress port receives the synchronous clock information Corresponding timestamp;
  • the time point determining subunit is specifically configured to determine, according to the timestamp recorded by the timestamp recording unit when the synchronous clock information is received, the time point of receiving the synchronous clock information, and according to the last time the synchronous clock information is received.
  • the timestamp records the timestamp recorded by the unit to determine the point in time when the synchronous clock information was last received.
  • the receiving unit 61 The receiving unit 61, the resident duration determining unit 62, the synchronous clock correcting unit 63, the forwarding unit 64, and the first
  • the clock frequency deviation determining unit corresponds to the protocol processing module in the second CPU component
  • the clock frequency synchronization unit corresponds to the frequency synchronization module in the first CPU component.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Abstract

A method and node based on a seamless redundant ring network for increasing clock precision. When synchronize clock information transmitted by an adjacent node or by a master clock is received by the node in the seamless redundant ring network, the node determines the residing duration of the synchronize clock information in the present node, where the residing duration is the length of time between a point in time that the synchronize clock information is inputted to an entry port and a point in time that the synchronize clock information is outputted to an exit port. The received synchronize clock information is revised on the basis of the determined residing duration. If the exit port is a ring port, then the revised synchronize clock information is forwarded to the adjacent node via the ring port; if the exit port is an external port, then the revised synchronize clock information is forwarded to a slave clock via the external port, thus allowing the slave clock to perform a clock synchronization on the basis of the synchronize clock information. The technical solution of the present invention solves the problem of increased synchronization error between the master and slave clocks.

Description

基于无缝冗余环网的提高时钟精度的方法及节点 本申请要求在 2012年 8月 31日提交中国专利局、 申请号为 201210320749.5、 发明名称为 Method and node for improving clock precision based on seamless redundant ring network This application claims to be submitted to the Chinese Patent Office on August 31, 2012, the application number is 201210320749.5, and the invention name is
"基于无缝冗余环网的提高时钟精度的方法及节点"的中国专利申请的优先权,其全部内容通过 引用结合在本申请中。 技术领域 本发明涉及环网技术领域, 尤其涉及基于无缝冗余环网的提高时钟精度的方法及节 The priority of the Chinese Patent Application for "Method and Node for Improving Clock Accuracy Based on Seamless Redundant Ring Network" is hereby incorporated by reference in its entirety. TECHNICAL FIELD The present invention relates to the field of ring networks, and in particular, to a method and a section for improving clock accuracy based on a seamless redundant ring network
背景技术 为了解决网络传输路径的冗余, 目前高可用性网络中釆用快速生成树协议 ( RapidBACKGROUND OF THE INVENTION In order to solve the redundancy of a network transmission path, a fast spanning tree protocol is currently used in a high availability network (Rapid
Spanning Tree Protocol, RSTP )和多生成树协议 ( Multiple Spanning Tree Protocol, MSTP ), 参见美国电气和电子工程师协会 ( Institute of Electrical and Electronics Engineers, IEEE ) 802. lw, 这两种协议可以应用于环路网络, 通过一定的算法实现路径冗余, 同时将环路网 络修剪成无环路的树型网络。 Spanning Tree Protocol (RSTP) and Multiple Spanning Tree Protocol (MSTP), see Institute of Electrical and Electronics Engineers (IEEE) 802. lw, these two protocols can be applied to loops. The network implements path redundancy through a certain algorithm, and at the same time prunes the loop network into a loop-free tree network.
虽然这两种协议可以检测到链路故障, 但是因为操作时需要频繁发送报文来检查网络 状态, 所以故障恢复时间一般相对较长, 因而这两种协议并不满足工业网络对实时性的要 求。  Although these two protocols can detect link failures, because the operation needs to frequently send messages to check the network status, the recovery time is generally relatively long, so these two protocols do not meet the real-time requirements of industrial networks. .
为了解决网络协议对于工业网路的实时性的要求, 国际电工委员会( C )制定了工 业自动化高可用性网络协议集一 IEC 62439协议, 其中 IEC 62439-2媒体冗余协议(Media Redundancy Protocol, MRP )釆用主从式网络结构, 但是由于其网络中只有一个确定的主 节点, 发生故障时只由这个主设备处理故障, 故存在着网络风险集中的问题, 且其未实现 终端关键设备的冗余保护。 IEC 62439-3 并行冗余协议 ( Parallel Redundancy Protocol , PRP ) 釆用两个完全对等的主千网络, 终端设备利用双端口冗余技术实现故障快速恢复, 但其存 在着双端口的健康状态无法探测和系统成本成倍提高的不足。  In order to solve the real-time requirements of network protocols for industrial networks, the International Electrotechnical Commission (C) has developed an industrial automation high availability network protocol set IEC 62439 protocol, of which IEC 62439-2 Media Redundancy Protocol (MRP) The master-slave network structure is used, but since there is only one determined master node in the network, only the master device handles the fault when the fault occurs, so there is a problem of network risk concentration, and the redundancy of the terminal critical equipment is not realized. protection. IEC 62439-3 Parallel Redundancy Protocol (PRP) uses two fully peer-to-peer host networks. The terminal device uses dual-port redundancy technology to achieve fast fault recovery, but its dual-port health status cannot exist. The detection and system costs are doubled.
为此, 现有技术在 IEC 62439-3增加了关于高可用性无缝自动环 (High Availability To this end, the prior art has added a high availability seamless automatic ring in IEC 62439-3 (High Availability)
Seamless Automation Ring, HSR ) 的协议内容, 该协议技术内容主要是从环网某个节点的 两个端口向环网发送数据帧, 并且从其中一个端口发送的数据帧在该节点的另一个端口终 止传输, 从而实现在环形网络中数据帧的无缝传输。 实际上, 上述 HSR传输模式中, 每个 节点都会接收到两个完全相同的数据帧, 因此在环形网络中造成了传输路径的浪费, 同时 各个节点的冗余端口的固定也会造成节点可以使用的端口资源的浪费。 基于 IEC 62439-3出现的问题, 申请人提出了一种在环形网络中无缝冗余传输方式, 遍 周无缝冗余(Around Seamless Redundancy, ASR ) 方式, 请参考申请号为 201210167896.3 的中国专利, 该专利申请中的技术方案为: 环形网络中的某个节点向其位于该环形网络中 的两个端口分别发送数据帧, 当两个数据帧到达该环形网络中的某个节点时, 该节点不再 转发数据帧, 也就是说, 数据帧终止于环形网络中的某个节点。 The content of the protocol of the Seamless Automation Ring (HSR). The technical content of the protocol is mainly to send data frames from two ports of a node of the ring network to the ring network, and the data frames sent from one port are terminated on the other port of the node. Transmission, thereby enabling seamless transmission of data frames in a ring network. In fact, in the above HSR transmission mode, each node receives two identical data frames, thus causing a waste of transmission paths in the ring network, and fixing the redundant ports of each node also causes the nodes to be used. Waste of port resources. Based on the problems arising from IEC 62439-3, the applicant proposed a seamless redundant transmission method in the ring network, and the Around Seamless Redundancy (ASR) method. Please refer to the Chinese patent No. 201210167896.3. The technical solution in the patent application is: a node in the ring network sends a data frame to two ports located in the ring network respectively, when two data frames reach a certain node in the ring network, The node no longer forwards the data frame, that is, the data frame terminates at a node in the ring network.
精确时钟协议(IEEE1588协议)在网络通信、 本地计算和分布式对象等技术实现的测 量和控制系统中实现了时钟精确同步, 如图 1所示, 节点 1、 2、 3为无缝冗余环网中的节点, 1A和 1B为节点 1的环端口, 2A和 2B为节点 2的环端口, 3A和 3B为节点 3的环端口, 节点 1的 外接端口连接精密时钟协议的主时钟, 节点 3的外接端口连接精密时钟协议的从时钟。 为 了保证从时钟与主从时钟进行时间同步, 主时钟可以向连接的节点 (节点 1 )发送同步时 钟信息, 节点 1将接收到的同步时钟信息携带在环网报文中转发给相邻的节点, 节点 3接收 到携带有同步时钟信息的环网报文之后, 将同步时钟信息转发给从时钟, 从时钟根据同步 时钟信息进行时钟同步。 现有的精确时钟协议指出, 在无缝冗余环网中, 各节点传输携带 有同步时钟信息环网报文时, 只作为透明时钟, 而不是边界时钟, 各节点只将同步时钟信 息或携带有同步时钟信息的环网报文进行转发, 但是, 各节点接收并转发同步时钟信息或 携带有同步时钟信息的环网报文存在一定的时间延迟, 为了修正节点的延迟, 现有技术提 出, 预先设定一个固定的修正值, 每个节点都使用该修正值来修正同步时钟信息。  The Accurate Clock Protocol (IEEE1588 protocol) implements accurate clock synchronization in measurement and control systems implemented in technologies such as network communications, local computing, and distributed objects. As shown in Figure 1, nodes 1, 2, and 3 are seamlessly redundant. The nodes in the network, 1A and 1B are the ring ports of node 1, 2A and 2B are the ring ports of node 2, 3A and 3B are the ring ports of node 3, and the external ports of node 1 are connected to the master clock of the precision clock protocol, node 3 The external port is connected to the slave clock of the precision clock protocol. In order to ensure time synchronization between the slave clock and the master and slave clocks, the master clock can send synchronous clock information to the connected node (node 1), and the node 1 carries the received synchronous clock information in the ring network message and forwards it to the adjacent node. After receiving the ring network message carrying the synchronous clock information, the node 3 forwards the synchronous clock information to the slave clock, and the slave clock performs clock synchronization according to the synchronous clock information. The existing precise clock protocol indicates that in a seamless redundant ring network, each node transmits a ring network message carrying synchronous clock information only as a transparent clock instead of a boundary clock, and each node only synchronizes clock information or carries The ring network packet with the synchronous clock information is forwarded. However, the node receives and forwards the synchronous clock information or the ring network packet carrying the synchronous clock information has a certain time delay. In order to correct the delay of the node, the prior art proposes A fixed correction value is preset, and each node uses the correction value to correct the synchronization clock information.
但是, 无缝冗余环网中的各节点接收并转发同步时钟信息或携带有同步时钟信息的环 网报文时的时间延迟不确定, 若都使用固定的修正值来修正同步时钟信息, 就会对主从时 钟的同步造成较大的同步误差, 若误差的精度在 us级, 其结果会对精密时钟协议 ·ί艮文的精 度造成 us级的影响, 对很多要求 us级精度时钟同步的应用场景会造成很大的影响。 发明内容 有鉴于此, 本发明实施例提供一种基于无缝冗余环网的提高时钟精度的方法及节点, 用以解决现有技术中由于各节点接收并转发同步时钟信息或携带有同步时钟信息的环网 •ί艮文时的时间延迟不确定, 因此导致主从时钟的同步误差较大的问题。  However, when the nodes in the seamless redundant ring network receive and forward the synchronous clock information or the ring network message carrying the synchronous clock information, the time delay is uncertain. If the fixed correction value is used to correct the synchronous clock information, It will cause a large synchronization error in the synchronization of the master and slave clocks. If the accuracy of the error is in the us level, the result will have a us-level effect on the precision of the precision clock protocol. For many clock synchronizations requiring us-level precision. Application scenarios can have a big impact. SUMMARY OF THE INVENTION In view of the above, the embodiments of the present invention provide a method and a node for improving clock precision based on a seamless redundant ring network, which are used to solve the problem in the prior art that each node receives and forwards synchronous clock information or carries a synchronous clock. The ringing of information • The time delay of the time is uncertain, which leads to a large synchronization error of the master-slave clock.
本发明实施例通过如下技术方案实现:  The embodiment of the invention is implemented by the following technical solutions:
基于无缝冗余环网的提高时钟精度的方法, 包括:  A method for improving clock accuracy based on a seamless redundant ring network, including:
所述无缝冗余环网中的节点接收到相邻的节点或主时钟发送的同步时钟信息之后 , 确 定接收到的同步时钟信息在本节点内的驻留时长, 所述驻留时长为同步时钟信息从输入到 入端口的时间点到输出到出端口的时间点之间的时间长度;  After receiving the synchronization clock information sent by the adjacent node or the master clock, the node in the seamless redundant ring network determines the resident duration of the received synchronization clock information in the local node, and the resident duration is synchronization. The length of time between the point in time when the clock information is input to the ingress port and the time point from the output to the egress port;
根据确定出的驻留时长, 修正接收到的所述同步时钟信息; 若所述出端口为环端口, 则通过该环端口将修正后的同步时钟信息转发给相邻的节 若所述出端口为外接端口, 则通过该外接端口将修正后的同步时钟信息转发给从时 钟, 以使从时钟根据同步时钟信息进行时钟同步。 Correcting the received synchronous clock information according to the determined resident duration; If the egress port is a ring port, the modified synchronization clock information is forwarded to the adjacent node through the ring port. If the egress port is an external port, the modified synchronization clock information is forwarded to the external port. The slave clock, so that the slave clock is clocked according to the synchronous clock information.
一种无缝冗余环网中的节点, 包括:  A node in a seamless redundant ring network, including:
接收单元, 用于接收相邻的节点或主时钟发送的同步时钟信息;  a receiving unit, configured to receive synchronous clock information sent by an adjacent node or a master clock;
驻留时长确定单元, 用于确定接收单元接收到的同步时钟信息在本节点内的驻留时 长, 所述驻留时长为同步时钟信息从输入到入端口的时间点到输出到出端口的时间点之间 的时间长度;  a dwell duration determining unit, configured to determine a dwell duration of the synchronization clock information received by the receiving unit in the local node, where the dwell time is a time from the input to the ingress port to the output to the egress port Length of time between points;
同步时钟修正单元, 用于根据驻留时长确定单元确定出的驻留时长, 修正接收到的所 述同步时钟信息;  a synchronous clock correcting unit, configured to correct the received synchronous clock information according to the resident duration determined by the resident duration determining unit;
转发单元, 用于在所述出端口为环端口时, 通过该环端口将修正后的同步时钟信息后 转发给相邻的节点, 以及在所述出端口为外接端口时, 通过该外接端口将修正后的同步时 钟信息转发给从时钟, 以使从时钟根据同步时钟信息进行时钟同步。  a forwarding unit, configured to: when the egress port is a ring port, forward the corrected synchronization clock information to the adjacent node by using the ring port, and when the egress port is an external port, pass the external port The corrected synchronous clock information is forwarded to the slave clock so that the slave clock performs clock synchronization based on the synchronous clock information.
利用本发明涉及的基于无缝冗余环网的提高时钟精度的方法, 由于每个节点分别确定 自身接收并转发同步时钟信息或携带有同步时钟信息的环网 ·ί艮文时的时间延迟, 然后根据 确定出时间延迟对接收到的同步时钟信息进行修正后再进行转发, 而不再是使用固定的修 正值来修正同步时钟信息, 从而有效地降低了主从时钟的同步误差, 提高了主从时钟的同 步精度。  The method for improving the clock precision based on the seamless redundant ring network according to the present invention, because each node respectively determines the time delay of receiving and forwarding the synchronous clock information or the ring network carrying the synchronous clock information, Then, according to the determined time delay, the received synchronous clock information is corrected and then forwarded, instead of using a fixed correction value to correct the synchronous clock information, thereby effectively reducing the synchronization error of the master-slave clock and improving the master. Synchronization accuracy from the clock.
本发明的其它特征和优点将在随后的说明书中阐述, 并且, 部分地从说明书中变得显 而易见, 或者通过实施本发明而了解。 本发明的目的和其他优点可通过在所写的说明书、 权利要求书、 以及附图中所特别指出的结构来实现和获得。  Other features and advantages of the invention will be set forth in the description which follows, and The objectives and other advantages of the invention will be realized and attained by the <RTI
下面通过附图和具体实施方式, 对本发明的技术方案做进一步的详细描述。 附图说明 附图用来提供对本发明的进一步理解, 并且构成说明书的一部分, 与本发明的具体实 施方式一起用于解释本发明, 并不构成对本发明的限制。 在附图中:  The technical solutions of the present invention are further described in detail below through the accompanying drawings and specific embodiments. The drawings are intended to provide a further understanding of the invention, and are intended to be a In the drawing:
图 1为现有技术中, 无缝冗余环网结构示意图;  1 is a schematic structural view of a seamless redundant ring network in the prior art;
图 2为本发明实施例 1中, 基于无缝冗余环网的提高时钟精度的方法流程示意图; 图 3为本发明实施例 2中, 同步时钟信息在节点内的驻留时长;  2 is a schematic flowchart of a method for improving clock precision based on a seamless redundant ring network according to Embodiment 1 of the present invention; FIG. 3 is a flowchart showing a duration of synchronization clock information in a node according to Embodiment 2 of the present invention;
图 4为本发明实施例 3中, 对节点的本地时钟进行时钟频率同步的流程示意图; 图 5 - 1为本发明实施例 4中, 无缝冗余环网中的节点结构示意图一; 图 5-2为本发明实施例 4中, 无缝冗余环网中的节点结构示意图二; 4 is a schematic flowchart of clock frequency synchronization of a local clock of a node according to Embodiment 3 of the present invention; FIG. 5 is a schematic structural diagram 1 of a node in a seamless redundant ring network according to Embodiment 4 of the present invention; 5-2 is a second schematic structural diagram of a node in a seamless redundant ring network according to Embodiment 4 of the present invention;
图 6为本发明实施例 5中, 无缝冗余环网中的节点结构示意图三。 具体实施方式  FIG. 6 is a third schematic structural diagram of a node in a seamless redundant ring network according to Embodiment 5 of the present invention. detailed description
以下结合附图对本发明的优选实施方式进行说明, 应当理解, 此处所描述的优选实施 方式仅用于说明和解释本发明, 并不用于限定本发明。  The preferred embodiments of the present invention are described in conjunction with the accompanying drawings, and the preferred embodiments of the present invention are intended to illustrate and explain the invention.
无缝冗余环网的结构如图 1所示, 无缝冗余环网包括数个节点 (图 1中的节点 1、 节点 2 和节点 3 )。 当然, 无缝冗余环网中所包括的节点不仅限于图 1中的 3个节点, 也可以将两个 节点组成的链状网络也称为无缝冗余环网, 这里的无缝冗余环网既包括 HSR网络和 ASR网 络, 也可以扩展到没有列出的无缝冗余环网类型, 无缝冗余环网中的各个节点通过链路连 接。  The structure of the seamless redundant ring network is shown in Figure 1. The seamless redundant ring network includes several nodes (node 1, node 2, and node 3 in Figure 1). Of course, the nodes included in the seamless redundant ring network are not limited to the three nodes in Figure 1, but also the chain network composed of two nodes is also called the seamless redundant ring network. Here, the seamless redundancy The ring network includes both the HSR network and the ASR network, and can also be extended to the seamless redundant ring network type not listed. Each node in the seamless redundant ring network is connected by a link.
图 1中, 节点 1的外接端口连接主时钟, 节点 3的外接端口连接从时钟。 这里主时钟连 接无缝冗余环网中的哪个节点可以根据工程实现的实际需要来部署, 也可以将主时钟连接 到环网中的节点 2或 3 , 当然,从时钟连接哪个节点也可以根据工程实现的实际需要来部署。 各节点 (如图 1中的节点 1、 节点 2和节点 3 )之间通过环端口相连。  In Figure 1, the external port of node 1 is connected to the master clock, and the external port of node 3 is connected to the slave clock. Here, which node in the seamless redundant ring network can be deployed according to the actual needs of the engineering implementation, or the master clock can be connected to the node 2 or 3 in the ring network. Of course, which node is connected from the clock can also be based on The actual needs of the project implementation are deployed. Each node (such as node 1, node 2, and node 3 in Figure 1) is connected through a ring port.
实施例 1  Example 1
如图 2所示, 为本发明实施例 1提出的基于无缝冗余环网的提高时钟精度的方法流程示 意图, 该方法包括如下步骤:  As shown in FIG. 2, it is a flow chart of a method for improving clock precision based on a seamless redundant ring network according to Embodiment 1 of the present invention. The method includes the following steps:
步骤 21 , 所述无缝冗余环网中的节点接收到相邻的节点或主时钟发送的同步时钟信息 之后, 确定接收到的同步时钟信息在本节点内的驻留时长, 所述驻留时长为同步时钟信息 从输入到入端口的时间点到输出到出端口的时间点之间的时间长度。  Step 21: After receiving the synchronization clock information sent by the adjacent node or the master clock, the node in the seamless redundant ring network determines the resident duration of the received synchronization clock information in the local node, where the resident The duration is the length of time between the point in time when the synchronous clock information is input to the ingress port and the time point from the output to the egress port.
其中,主时钟和节点之间传输同步时钟信息,从时钟和节点之间也传输同步时钟信息, 而节点之间则传输携带有同步时钟信息的环网报文, 即将同步信息携带在环网报文中进行 传输。 具体的, 主时钟通过外接端口向相连的节点发送同步时钟信息, 与主时钟相连的节 点接收同步时钟信息, 然后对同步时钟信息进行修正, 将修正后的同步时钟信息携带在环 网报文中发送给相邻的节点, 若相邻的节点接收到环网报文后, 从环网报文中提取出同步 时钟信息, 对同步时钟信息进行修正, 若该节点未连接从时钟, 则将修正后的同步时钟信 息携带在环网报文中发送给相邻的节点, 若该节点连接有从时钟, 则将修正后的同步时钟 信息发送给从时钟。  The synchronous clock information is transmitted between the master clock and the node, and the synchronous clock information is also transmitted between the slave clock and the node, and the ring network packets carrying the synchronous clock information are transmitted between the nodes, that is, the synchronization information is carried in the ring network report. Transfer in the text. Specifically, the master clock sends the synchronous clock information to the connected node through the external port, and the node connected to the master clock receives the synchronous clock information, and then corrects the synchronous clock information, and carries the modified synchronous clock information in the ring network message. Sending to the adjacent node, if the neighboring node receives the ring network message, it extracts the synchronous clock information from the ring network message, and corrects the synchronous clock information. If the node is not connected to the slave clock, it will be corrected. The subsequent synchronous clock information is carried in the ring network message and sent to the adjacent node. If the slave node is connected to the slave clock, the modified synchronous clock information is sent to the slave clock.
其中, 节点接收同步时钟信息的入端口可以为外接端口或环端口, 若入端口为外接端 口, 则表明该节点通过外接端口连接有主时钟, 此时其出端口为环端口, 即节点通过环端 口向相邻的节点转发携带有同步时钟信息的环网 4艮文; 若入端口为环端口, 则其出端口既 可以为环端口, 也可以为外接端口, 当出端口为环端口时, 表明该节点没有连接主时钟和 从时钟, 节点通过环端口向相邻的节点转发携带有同步时钟信息的环网报文, 当出端口为 外接端口时, 表明该节点通过外接端口连接有从时钟, 节点通过外接端口向从时钟转发同 步时钟信息。 The ingress port of the node receiving the synchronous clock information may be an external port or a ring port. If the ingress port is an external port, it indicates that the node has a master clock connected through the external port, and the outbound port is a ring port, that is, the node passes through the ring. The port forwards the ring network carrying the synchronous clock information to the adjacent node; if the ingress port is a ring port, the egress port is both It can be a ring port or an external port. When the egress port is a ring port, it indicates that the node is not connected to the master clock and the slave clock. The node forwards the ring network packet carrying the synchronous clock information to the adjacent node through the ring port. When the egress port is an external port, it indicates that the node is connected to the slave clock through the external port, and the node forwards the synchronous clock information to the slave clock through the external port.
在本发明实施例 1中, 与主时钟相连的节点可以称为始发节点, 与从时钟相连的节点 可以称为接收节点, 那么其他节点可以称为中间节点。 在图 1中, 节点 1为始发节点, 节点 3为接收节点,节点 2为中间节点。始发节点通过外接端口接收主时钟发送的同步时钟信息, 并通过两个环端口分别向相邻的节点转发携带有同步时钟信息的环网报文, 中间节点通过 环端口接收相邻节点发送的环网报文, 并通过另一环端口向相邻的节点转发环网报文, 接 收节点通过环端口接收相邻节点发送的环网报文, 并通过外接端口向从时钟转发同步时钟 信息。  In the first embodiment of the present invention, a node connected to the master clock may be referred to as an originating node, and a node connected to the slave clock may be referred to as a receiving node, and then other nodes may be referred to as intermediate nodes. In Figure 1, node 1 is the originating node, node 3 is the receiving node, and node 2 is the intermediate node. The originating node receives the synchronous clock information sent by the master clock through the external port, and forwards the ring network message carrying the synchronous clock information to the adjacent node through the two ring ports respectively, and the intermediate node receives the sent by the neighboring node through the ring port. The ring network packet forwards the ring network packet to the neighboring node through another ring port. The receiving node receives the ring network packet sent by the neighboring node through the ring port, and forwards the synchronous clock information to the slave clock through the external port.
节点接收到的同步时钟信息在本节点内的驻留时长也可以看作节点接收并转发同步 时钟信息或携带同步信息的环网报文时的时间延迟, 该驻留时长具体指同步时钟信息从输 入到入端口的时间点到输出到出端口的时间点之间的时间长度。  The duration of the synchronization clock information received by the node in the node can also be regarded as the time delay when the node receives and forwards the synchronization clock information or the ring network message carrying the synchronization information. The duration of the reservation specifically refers to the synchronization clock information. Enter the length of time between the point in time of the ingress port and the point in time when it is output to the egress port.
要说明的是, 对于始发节点, 其入端口为外接端口, 始发节点将包含同步时钟信息的 环网 4艮文向两个环端口同时发送, 即出端口为两个环端口, 同步时钟信息从输入到外接端 口到输出到其中一个环端口之间的时间长度, 与该同步时钟信息从输入到外接端口到输出 到另一环端口之间的时间长度相同。  It should be noted that, for the originating node, the ingress port is an external port, and the originating node sends the ring network containing the synchronous clock information to the two ring ports simultaneously, that is, the egress port is two ring ports, and the synchronous clock The length of time between the input of the information to the external port and the output to one of the ring ports is the same as the length of time between the synchronization clock information from the input to the external port and the output to the other ring port.
步骤 22, 根据确定出的驻留时长, 修正接收到的所述同步时钟信息。  Step 22: Correct the received synchronous clock information according to the determined resident duration.
若节点为始发节点, 则接收到的同步时钟信息为未经修正的、 主时钟发送的同步时钟 信息, 若节点不为始发节点, 则接收到的环网报文中携带的同步时钟信息为经过之前各节 点修正后的同步时钟信息。  If the node is the originating node, the received synchronous clock information is the uncorrected synchronous clock information sent by the master clock. If the node is not the originating node, the synchronous clock information carried in the received ring network message Synchronized clock information corrected for each node.
若节点确定出的驻留时长为 Δ Τ, 接收到的同步时钟信息对应的时间点为 T, 则修正后 的同步时钟信息对应的时间点为 T' =△ T+T。  If the resident time length determined by the node is Δ Τ and the time point corresponding to the received synchronous clock information is T, the time point corresponding to the corrected synchronous clock information is T' = Δ T + T.
步骤 23 , 若所述出端口为环端口, 则通过该环端口将修正后的同步时钟信息转发给相 邻的节点, 若所述出端口为外接端口, 则通过该外接端口将修正后的同步时钟信息转发给 从时钟, 以使从时钟根据同步时钟信息进行时钟同步。  Step 23: If the egress port is a ring port, the modified synchronization clock information is forwarded to the adjacent node through the ring port, and if the egress port is an external port, the modified synchronization is performed through the external port. The clock information is forwarded to the slave clock so that the slave clock is clocked according to the synchronous clock information.
若节点为始发节点或中间节点, 则其出端口为环端口, 此时节点通过该环端口将携带 有修正后的同步时钟信息的环网 4艮文转发给相邻的节点。  If the node is an originating node or an intermediate node, the egress port is a ring port. At this time, the node forwards the ring network carrying the corrected synchronization clock information to the adjacent node through the ring port.
若节点为接收节点, 则其出端口为外接端口, 此时该节点通过该外接端口将修正后的 同步时钟信息转发给从时钟。 从时钟接收到同步时钟信息后, 根据该同步时钟信息进行时 钟同步, 从而实现了从时钟和主时钟的时钟同步。 其中, 从时钟会根据先接收到的同步时 钟信息进行时钟同步, 丢弃后续接收到的同步时钟信息。 由上述处理过程可知, 本发明实施例 1提出的技术方案中, 无缝冗余环网中的节点接 收到相邻的节点或主时钟发送的同步时钟信息之后 , 确定接收到的同步时钟信息在本节点 内的驻留时长, 所述驻留时长为同步时钟信息从输入到入端口的时间点到输出到出端口的 时间点之间的时间长度, 节点根据确定出的驻留时长, 修正接收到的所述同步时钟信息, 若所述出端口为环端口, 则节点通过该环端口将修正后的同步时钟信息转发给相邻的节 点, 若所述出端口为外接端口, 则节点通过该外接端口将修正后的同步时钟信息转发给从 时钟, 以使从时钟根据同步时钟信息进行时钟同步。 由于每个节点分别确定自身接收并转 发同步时钟信息或携带有同步时钟信息的环网 ·ί艮文时的时间延迟, 然后根据确定出时间延 迟对接收到的同步时钟信息进行修正后再进行转发, 而不再是使用固定的修正值来修正同 步时钟信息, 从而有效地降低了主从时钟的同步误差, 提高了主从时钟的同步精度。 If the node is a receiving node, the egress port is an external port, and the node forwards the corrected synchronous clock information to the slave clock through the external port. After receiving the synchronous clock information from the clock, clock synchronization is performed according to the synchronous clock information, thereby realizing clock synchronization between the slave clock and the master clock. The slave clock performs clock synchronization according to the synchronous clock information received first, and discards the subsequently received synchronous clock information. It can be seen from the above process that, in the technical solution proposed by Embodiment 1 of the present invention, after receiving the synchronization clock information sent by the adjacent node or the master clock, the node in the seamless redundant ring network determines that the received synchronous clock information is The length of the dwell time in the node, the dwell time is the length of time between the time point of the synchronous clock information from the input to the ingress port to the time point of the output to the egress port, and the node corrects the receiving according to the determined dwell time. If the outgoing port is a ring port, the node forwards the corrected synchronous clock information to the adjacent node through the ring port, and if the outgoing port is an external port, the node passes the The external port forwards the corrected synchronous clock information to the slave clock, so that the slave clock synchronizes the clock according to the synchronous clock information. Each node determines the time delay of receiving and forwarding the synchronous clock information or the ring network carrying the synchronous clock information, and then correcting the received synchronous clock information according to the determined time delay before forwarding. Instead of using a fixed correction value to correct the synchronous clock information, the synchronization error of the master-slave clock is effectively reduced, and the synchronization accuracy of the master-slave clock is improved.
实施例 2  Example 2
节点在确定接收到的同步时钟信息在本节点内的驻留时长时, 可以先获得同步时钟信 息输入到入端口时, 本地时钟的第一计数值 , 以及同步时钟信息输出到出端口时, 本地时 钟的第二计数值 , 然后根据获得的第一计数值和第二计数值 , 以及本地时钟的时钟频率, 确定同步时钟信息在本节点内的驻留时长。 其中, 节点中的本地时钟会按照自身的时钟频 率进行计数。  When determining the duration of the received synchronization clock information in the local node, the node may first obtain the first count value of the local clock when the synchronous clock information is input to the ingress port, and when the synchronous clock information is output to the egress port, the local The second count value of the clock is then determined according to the obtained first count value and second count value, and the clock frequency of the local clock, the duration of the synchronization clock information in the local node. The local clock in the node is counted according to its own clock frequency.
节点从入端口接收到同步时钟信息的时间点为 Τ 1 , 该同步时钟信息输出到出端口的时 间点为 Τ2, 则如图 3所示, 同步时钟信息在本节点内的驻留时长为 Δ Τ=Τ2-Τ1。  The time point at which the node receives the synchronous clock information from the ingress port is Τ 1, and the time point at which the synchronous clock information is output to the egress port is Τ2. As shown in FIG. 3, the duration of the synchronization clock information in the node is Δ. Τ=Τ2-Τ1.
当上述节点为始发节点时, 节点从外接端口接收到同步时钟信息的时间点为 Τ 1 , 该同 步时钟信息输出到环端口的时间点为 Τ2, 节点的本地时钟的时钟频率为 125M, 即每 8ns进 行一次计数, 同步时钟信息输入到外接端口时, 本地时钟的第一计数值为 nl , 同步时钟信 息输出到环端口时, 本地时钟的第二计数值为 n2, 则 Tl=nl*8, Τ2=η2*8, 同步时钟信息在 本节点内的驻留时长为 Δ Τ=Τ2-Τ1。  When the node is an originating node, the time point at which the node receives the synchronous clock information from the external port is Τ1, the time at which the synchronous clock information is output to the ring port is Τ2, and the clock frequency of the local clock of the node is 125M, that is, The count is performed every 8 ns. When the synchronous clock information is input to the external port, the first count value of the local clock is nl. When the synchronous clock information is output to the ring port, the second count value of the local clock is n2, then Tl=nl*8 , Τ2=η2*8, the duration of the synchronization clock information in this node is Δ Τ=Τ2-Τ1.
当上述节点为中间节点时, 节点从第一环端口接收到携带有同步时钟信息的环网报文 的时间点为 T1 , 该同步时钟信息输出到第二环端口的时间点为 Τ2, 节点的本地时钟的时钟 频率为 125M, 即每 8ns进行一次计数, 携带有同步时钟信息的环网报文输入到第一环端口 时, 本地时钟的第一计数值为 nl , 同步时钟信息输出到第二环端口时, 本地时钟的第二计 数值为 n2, 则 Tl=nl*8, Τ2=η2*8, 同步时钟信息在本节点内的驻留时长为 Δ Τ=Τ2-Τ1。  When the node is an intermediate node, the time point at which the node receives the ring network message carrying the synchronous clock information from the first ring port is T1, and the time point at which the synchronous clock information is output to the second ring port is Τ2, the node The clock frequency of the local clock is 125 M, that is, every 8 ns is counted. When the ring network packet carrying the synchronous clock information is input to the first ring port, the first count value of the local clock is nl, and the synchronous clock information is output to the second. When the ring port is used, the second count value of the local clock is n2, then Tl=nl*8, Τ2=η2*8, and the duration of the synchronization clock information in the node is Δ Τ=Τ2-Τ1.
当上述节点为接收节点时, 节点从环端口接收到携带有同步时钟信息的环网报文的时 间点为 T1 , 该同步时钟信息输出到外接端口的时间点为 Τ2, 节点的本地时钟的时钟频率为 When the node is a receiving node, the time point at which the node receives the ring network message carrying the synchronous clock information from the ring port is T1, and the time point at which the synchronous clock information is output to the external port is Τ2, the clock of the local clock of the node Frequency is
125M, 即每 8ns进行一次计数, 携带有同步时钟信息的环网 4艮文输入到环端口时, 本地时 钟的第一计数值为 nl , 同步时钟信息输出到外接端口时, 本地时钟的第二计数值为 n2, 则125M, that is, counting every 8 ns, when the ring network carrying the synchronous clock information is input to the ring port, the first count value of the local clock is nl, and when the synchronous clock information is output to the external port, the second of the local clock The count value is n2, then
Tl=nl*8, Τ2=η2*8, 同步时钟信息在本节点内的驻留时长为 Δ Τ=Τ2-Τ1。 实施例 3 Tl=nl*8, Τ2=η2*8, the duration of the synchronization clock information in the node is Δ Τ=Τ2-Τ1. Example 3
由实施例 2可知, 节点根据本地时钟的时钟频率来确定同步时钟信息在本节点内的驻 留时长, 为了保证各节点的本地时钟的时钟频率与主时钟的时钟频率一致, 本发明实施例 3提出各节点可以在确定驻留时长之前, 对本地时钟的时钟频率进行同步, 其方法流程如 图 4所示, 具体处理流程为:  It can be seen from the second embodiment that the node determines the duration of the synchronization clock information in the local node according to the clock frequency of the local clock. To ensure that the clock frequency of the local clock of each node is consistent with the clock frequency of the master clock, Embodiment 3 of the present invention It is proposed that each node can synchronize the clock frequency of the local clock before determining the resident duration. The method flow is shown in FIG. 4, and the specific processing flow is:
步骤 41 , 根据本次接收到的同步时钟信息和上一次接收到的同步时钟信息, 确定本地 时钟与所述主时钟之间的时钟频率的偏差。  Step 41: Determine a deviation of a clock frequency between the local clock and the main clock according to the synchronous clock information received this time and the synchronous clock information received last time.
其中, 主时钟可以周期性的发送同步时钟信息。  The master clock can periodically send synchronous clock information.
步骤 42, 根据确定出的时钟频率的偏差, 同步本地时钟的时钟频率。  Step 42: Synchronize the clock frequency of the local clock according to the determined deviation of the clock frequency.
具体的, 节点可以先确定本次接收到的同步时钟信息对应的时间点、 上一次接收到的 同步时钟信息对应的时间点、 本次接收同步时钟信息的时间点和上一次接收同步时钟信息 的时间点,然后根据确定出的各时间点,计算出本地时钟与主时钟之间的时钟频率的偏差。  Specifically, the node may first determine the time point corresponding to the synchronous clock information received this time, the time point corresponding to the last received synchronous clock information, the time point of receiving the synchronous clock information, and the last time receiving the synchronous clock information. At the time point, then based on the determined time points, the deviation of the clock frequency between the local clock and the main clock is calculated.
若△为本地时钟与所述主时钟之间的时钟频率的偏差, t2为本次接收到的同步时钟信 息对应的时间点, tl为上一次接收到的同步时钟信息对应的时间点, t2' 为本次接收同步 时钟信息的时间点, tl' 为上一次接收同步时钟信息的时间点, 则本地时钟与所述主时钟 之间的时钟频率的偏差为:  If Δ is the deviation of the clock frequency between the local clock and the main clock, t2 is the time point corresponding to the received synchronous clock information, and tl is the time point corresponding to the last received synchronous clock information, t2' For the time when the synchronous clock information is received, tl' is the time point when the synchronous clock information is received last time, and the deviation of the clock frequency between the local clock and the master clock is:
△ =[ ( ΐ2' -tl' ) - ( t2-tl ) ]/(tl' -tl)  △ =[ ( ΐ2' -tl' ) - ( t2-tl ) ]/(tl' -tl)
本发明实施例 3中, 节点在接收到同步时钟信息后, 可以记录入端口接收到该同步时 钟信息的时间点对应的时间戳, 然后该节点后续就可以直接根据本次接收到同步时钟信息 时记录的时间戳, 确定本次接收同步时钟信息的时间点, 以及根据上一次接收到同步时钟 信息时记录的时间戳, 确定上一次接收同步时钟信息的时间点。  In the third embodiment of the present invention, after receiving the synchronization clock information, the node may record the timestamp corresponding to the time point when the inbound port receives the synchronization clock information, and then the node may directly receive the synchronization clock information according to the current time. The timestamp of the record, the time point at which the synchronization clock information is received this time, and the time point recorded when the synchronization clock information was last received, determines the time point at which the synchronization clock information was last received.
釆用本发明实施例 3提出的对本地时钟的时钟频率进行同步的方法, 能够实现无缝冗 余环网中的全部节点的本地时钟的时钟频率都同步 (都和主时钟的时钟频率相同), 从而 有效地提高了各节点计算出的驻留时长的精度, 进一步提高了主从时钟的同步精度。  The method for synchronizing the clock frequency of the local clock proposed in Embodiment 3 of the present invention can realize that the clock frequencies of the local clocks of all the nodes in the seamless redundant ring network are synchronized (both with the clock frequency of the main clock) Therefore, the accuracy of the resident duration calculated by each node is effectively improved, and the synchronization precision of the master-slave clock is further improved.
此外, 在本发明实施例 3中, 各节点会周期性的接收同步时钟信息, 在每次接收到同 步时钟信息时, 不仅要执行确定驻留时长以及根据驻留时长对同步时钟信息进行修正的操 作, 还要执行对本地时钟的时钟频率进行同步的操作 (第一次接收到同步时钟信息除外), 那么该节点在下次接收到同步时钟信息之后, 就可以根据同步后的时钟频率确定驻留时 长。  In addition, in Embodiment 3 of the present invention, each node periodically receives the synchronization clock information, and each time the synchronization clock information is received, not only the determination of the resident duration but also the correction of the synchronization clock information according to the resident duration is performed. Operation, but also to perform the operation of synchronizing the clock frequency of the local clock (except for the first time receiving the synchronous clock information), then the node can determine the resident according to the synchronized clock frequency after receiving the synchronous clock information next time. duration.
实施例 4  Example 4
本发明实施例 4提出, 无缝冗余环网中的节点包括第一 CPU部件、 第二 CPU部件、 第一 环端口、第二环端口,如图 5-1所示,其中, 第一 CPU部件与第一环端口和第二环端口连接, 第一环端口和第二环端口负责发送、 接收和转发环网 ^艮文。 如图 5-2所示, 第一 CPU部件包括包转发模块和频率同步模块, 第二 CPU部件包括协议 处理模块。 其中: The embodiment of the present invention provides that the node in the seamless redundant ring network includes the first CPU component, the second CPU component, the first ring port, and the second ring port, as shown in FIG. 5-1, where the first CPU The component is connected to the first ring port and the second ring port, and the first ring port and the second ring port are responsible for sending, receiving, and forwarding the ring network. As shown in FIG. 5-2, the first CPU component includes a packet forwarding module and a frequency synchronization module, and the second CPU component includes a protocol processing module. among them:
包转发模块通过外接端口或环端口接收和转发同步信息或携带有同步信息的环网报 文, 并确定接收到的同步时钟信息在本节点内的驻留时长, 以及根据确定出的驻留时长, 修正接收到的同步时钟信息。  The packet forwarding module receives and forwards the synchronization information or the ring network message carrying the synchronization information through the external port or the ring port, and determines the resident duration of the received synchronization clock information in the node, and according to the determined resident duration. , Correct the received synchronous clock information.
协议处理模块用于处理环网 4艮文, 并计算出本地时钟与主时钟之间的时钟频率的偏 差, 然后将时钟频率的偏差发送给第一 CPU部件, 由第一 CPU部件中的频率同步模块调整 本地时钟的时钟频率。  The protocol processing module is configured to process the ring network and calculate the deviation of the clock frequency between the local clock and the main clock, and then send the deviation of the clock frequency to the first CPU component, and synchronize the frequency in the first CPU component. The module adjusts the clock frequency of the local clock.
频率同步模块用于产生本地时钟, 并根据协议处理模块提供的时钟频率的偏差调整本 地时钟的时钟频率, 使本地时钟和主时钟的时钟频率同步。  The frequency synchronization module is configured to generate a local clock, and adjust the clock frequency of the local clock according to the deviation of the clock frequency provided by the protocol processing module, so that the local clock and the clock frequency of the main clock are synchronized.
在所述无缝冗余环网中, 节点的第一 CPU部件保存入端口接收同步时钟信息或携带有 同步时钟信息的环网报文的时间,且第一 CPU部件保存同步时钟信息传输到出端口的时间, 从而根据保存的两个时间确定出驻留时长。 例如, 在图 1中, 节点 1为始发节点, 连接到节 点 1的外接端口的主时钟发送同步时钟信息, 节点 1的第一 CPU部件保存该节点从外接端口 接收该同步时钟信息的时间 tl ,节点 1的第一 CPU部件保存同步时钟信息传输到其第一环端 口和第二环端口的时间 t2,然后将记录的 t2减去 tl就是同步时钟信息在节点 1内的驻留时长。 另外要说明的是, 第一 CPU部件将修正后的同步时钟信息添加到环网报文中进行转发。  In the seamless redundant ring network, the first CPU component of the node saves the time when the ingress port receives the synchronous clock information or the ring network message carrying the synchronous clock information, and the first CPU component saves the synchronous clock information to the outbound The time of the port, so that the duration of the dwell is determined based on the two times saved. For example, in FIG. 1, node 1 is an originating node, and a master clock connected to an external port of node 1 transmits synchronous clock information, and a first CPU component of node 1 stores a time at which the node receives the synchronous clock information from an external port. The first CPU component of node 1 saves the time t2 at which the synchronous clock information is transmitted to its first ring port and the second ring port, and then subtracts t2 from the recorded t2 to be the resident time of the synchronous clock information in node 1. It should be noted that the first CPU component adds the corrected synchronization clock information to the ring network message for forwarding.
实施例 5  Example 5
基于本发明实施例 1提出的基于无缝冗余环网的提高时钟精度的方法, 本发明实施例 5 提出一种无缝冗余环网中的节点, 其结构如图 6所示, 包括:  The method for improving the clock precision based on the seamless redundant ring network according to the embodiment 1 of the present invention provides a node in the seamless redundant ring network, and the structure thereof is as shown in FIG. 6, which includes:
接收单元 61 , 用于接收相邻的节点或主时钟发送的同步时钟信息;  The receiving unit 61 is configured to receive synchronous clock information sent by an adjacent node or a master clock;
驻留时长确定单元 62, 用于确定接收单元 61接收到的同步时钟信息在本节点内的驻留 时长, 所述驻留时长为同步时钟信息从输入到入端口的时间点到输出到出端口的时间点之 间的时间长度;  The resident duration determining unit 62 is configured to determine a duration of the synchronization clock information received by the receiving unit 61 in the local node, where the resident duration is a time point from the input to the ingress port to the output to the egress port. Length of time between points in time;
同步时钟修正单元 63 , 用于根据驻留时长确定单元 62确定出的驻留时长, 修正接收到 的所述同步时钟信息;  The synchronization clock correction unit 63 is configured to correct the received synchronization clock information according to the resident duration determined by the resident duration determining unit 62;
转发单元 64, 用于在所述出端口为环端口时, 通过该环端口将修正后的同步时钟信息 转发给相邻的节点, 以及在所述出端口为外接端口时, 通过该外接端口将修正后的同步时 钟信息转发给从时钟, 以使从时钟根据同步时钟信息进行时钟同步。  The forwarding unit 64 is configured to: when the egress port is a ring port, forward the corrected synchronization clock information to the adjacent node by using the ring port, and when the egress port is an external port, pass the external port The corrected synchronous clock information is forwarded to the slave clock so that the slave clock performs clock synchronization based on the synchronous clock information.
其中, 接收单元 61不仅用于接收相邻的节点或主时钟发送的同步时钟信息, 还可以用 于通过外接端口和环端口接收 ·ί艮文,接收的 ·ί艮文可以为环网 ·ί艮文,也可以为其他数据 4艮文。  The receiving unit 61 is not only used to receive the synchronization clock information sent by the adjacent node or the master clock, but also can be used to receive the 艮 艮 text through the external port and the ring port, and the received 艮 艮 可以 can be the ring network · ί艮文, can also be used for other data.
转发单元 64不仅用于转发同步时钟信息, 还可以用于通过外接端口和环端口转发 4艮 文, 转发的报文可以为环网报文, 也可以为其他数据报文。 较佳地, 接收单元 61 , 具体用于接收相邻的节点发送的携带有同步时钟信息的环网报 文, 并将接收到的环网报文中携带的同步时钟信息确认为相邻的节点发送的同步时钟信 息; The forwarding unit 64 is not only used to forward the synchronous clock information, but also can be used to forward the data through the external port and the ring port, and the forwarded message can be a ring network message or other data message. Preferably, the receiving unit 61 is configured to receive a ring network message that is sent by the neighboring node and that carries the synchronous clock information, and confirm the synchronous clock information carried in the received ring network message as an adjacent node. Synchronized clock information sent;
转发单元 64, 具体用于将修正后的同步时钟信息携带在环网 ·ί艮文中, 并通过该环端口 将携带修正后的同步时钟信息的环网 4艮文转发给相邻的节点。  The forwarding unit 64 is configured to carry the modified synchronization clock information in the ring network, and forward the ring network carrying the corrected synchronization clock information to the adjacent node through the ring port.
较佳地, 所述驻留时长确定单元 62具体包括:  Preferably, the resident duration determining unit 62 specifically includes:
计数值获得子单元,用于获得同步时钟信息输入到入端口时,本地时钟的第一计数值, 以及同步时钟信息输出到出端口时, 本地时钟的第二计数值;  The count value obtaining sub-unit is configured to obtain a first count value of the local clock when the synchronous clock information is input to the ingress port, and a second count value of the local clock when the synchronous clock information is output to the egress port;
驻留时长确定子单元, 用于根据计数值获得子单元获得的第一计数值和第二计数值 , 以及本地时钟的时钟频率, 确定同步时钟信息在本节点内的驻留时长。  The dwell duration determining subunit is configured to obtain a first count value and a second count value obtained by the subunit according to the count value, and a clock frequency of the local clock, and determine a dwell duration of the synchronous clock information in the node.
更佳地, 所述主时钟周期性的发送同步时钟信息;  More preferably, the master clock periodically sends synchronous clock information;
所述无缝冗余环网中的节点还包括:  The nodes in the seamless redundant ring network further include:
时钟频率偏差确定单元, 用于在驻留时长确定单元 62确定接收到的同步时钟信息在本 节点内的驻留时长之前, 根据本次接收到的同步时钟信息和上一次接收到的同步时钟信 息, 确定本地时钟与所述主时钟之间的时钟频率的偏差;  The clock frequency deviation determining unit is configured to: before the resident duration determining unit 62 determines the resident synchronization clock information in the local node, according to the currently received synchronous clock information and the last received synchronous clock information. Determining a deviation of a clock frequency between the local clock and the master clock;
时钟频率同步单元, 用于才 居时钟频率偏差确定单元确定出的时钟频率的偏差, 同步 本地时钟的时钟频率。  The clock frequency synchronization unit is configured to determine a deviation of the clock frequency determined by the occupancy clock frequency deviation determining unit and synchronize the clock frequency of the local clock.
更佳地, 所述时钟频率偏差确定单元具体包括:  More preferably, the clock frequency deviation determining unit specifically includes:
时间点确定子单元, 用于确定本次接收到的同步时钟信息对应的时间点、上一次接收 到的同步时钟信息对应的时间点、 本次接收同步时钟信息的时间点和上一次接收同步时钟 信息的时间点;  a time point determining subunit, configured to determine a time point corresponding to the synchronous clock information received this time, a time point corresponding to the last received synchronous clock information, a time point of receiving the synchronous clock information, and a last received synchronous clock Time point of information;
时钟频率偏差确定子单元, 用于根据时间点确定子单元确定出的各时间点, 计算出本 地时钟与所述主时钟之间的时钟频率的偏差。  The clock frequency deviation determining subunit is configured to calculate a deviation of a clock frequency between the local clock and the main clock according to each time point determined by the time point determining subunit.
更佳地, 所述无缝冗余环网中的节点还包括:  More preferably, the nodes in the seamless redundant ring network further include:
时间戳记录单元, 用于在时钟频率偏差确定单元确定本地时钟与所述主时钟之间的时 钟频率的偏差之前, 在接收到同步时钟信息后, 记录入端口接收到该同步时钟信息的时间 点对应的时间戳;  a timestamp recording unit, configured to: before the clock frequency deviation determining unit determines the deviation of the clock frequency between the local clock and the main clock, after receiving the synchronous clock information, record the time point at which the ingress port receives the synchronous clock information Corresponding timestamp;
所述时间点确定子单元, 具体用于根据本次接收到同步时钟信息时时间戳记录单元记 录的时间戳, 确定本次接收同步时钟信息的时间点, 以及根据上一次接收到同步时钟信息 时时间戳记录单元记录的时间戳, 确定上一次接收同步时钟信息的时间点。  The time point determining subunit is specifically configured to determine, according to the timestamp recorded by the timestamp recording unit when the synchronous clock information is received, the time point of receiving the synchronous clock information, and according to the last time the synchronous clock information is received. The timestamp records the timestamp recorded by the unit to determine the point in time when the synchronous clock information was last received.
其中, 接收单元 61、 驻留时长确定单元 62、 同步时钟修正单元 63、 转发单元 64与第一 The receiving unit 61, the resident duration determining unit 62, the synchronous clock correcting unit 63, the forwarding unit 64, and the first
CPU部件中的包转发模块对应, 时钟频率偏差确定单元与第二 CPU部件中的协议处理模块 对应, 时钟频率同步单元与第一 CPU部件中的频率同步模块对应。 本领域的技术人员应明白, 本申请的实施例可提供为方法、 装置 (设备)、 或计算机 程序产品。 因此, 本申请可釆用完全硬件实施例、 完全软件实施例、 或结合软件和硬件方 面的实施例的形式。 而且, 本申请可釆用在一个或多个其中包含有计算机可用程序代码的 计算机可用存储介盾 (包括但不限于磁盘存储器、 CD-ROM、 光学存储器等)上实施的计 算机程序产品的形式。 Corresponding to the packet forwarding module in the CPU component, the clock frequency deviation determining unit corresponds to the protocol processing module in the second CPU component, and the clock frequency synchronization unit corresponds to the frequency synchronization module in the first CPU component. Those skilled in the art will appreciate that embodiments of the present application can be provided as a method, apparatus (device), or computer program product. Thus, the application can be in the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the application can be in the form of a computer program product embodied on one or more computer-usable storage interfaces (including but not limited to disk storage, CD-ROM, optical storage, etc.) in which computer usable program code is embodied.
本申请是参照根据本申请实施例的方法、 装置(设备 )和计算机程序产品的流程图和 /或方框图来描述的。 应理解可由计算机程序指令实现流程图和 /或方框图中的每一流程和 / 或方框、 以及流程图和 /或方框图中的流程和 /或方框的结合。 可提供这些计算机程序指令 到通用计算机、 专用计算机、 嵌入式处理机或其他可编程数据处理设备的处理器以产生一 个机器, 使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在 流程图一个流程或多个流程和 /或方框图一个方框或多个方框中指定的功能的装置。  The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus, and computer program products according to embodiments of the present application. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方 式工作的计算机可读存储器中, 使得存储在该计算机可读存储器中的指令产生包括指令装 置的制造品,该指令装置实现在流程图一个流程或多个流程和 /或方框图一个方框或多个方 框中指定的功能。  The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上, 使得在计算机 或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理, 从而在计算机或其他 可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和 /或方框图一个方 框或多个方框中指定的功能的步骤。  These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
尽管已描述了本申请的优选实施例, 但本领域内的技术人员一旦得知了基本创造性概 念, 则可对这些实施例作出另外的变更和修改。 所以, 所附权利要求意欲解释为包括优选 实施例以及落入本申请范围的所有变更和修改。 显然, 本领域的技术人员可以对本申请进 行各种改动和变型而不脱离本申请的精神和范围。 这样, 倘若本申请的这些修改和变型属 于本申请权利要求及其等同技术的范围之内, 则本申请也意图包含这些改动和变型在内。  Although the preferred embodiment of the present application has been described, those skilled in the art can make additional changes and modifications to the embodiments once they are aware of the basic inventive concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and the modifications and It will be apparent that those skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the application. Accordingly, it is intended that the present invention cover the modifications and variations of the present invention.

Claims

权 利 要 求 Rights request
1、 基于无缝冗余环网的提高时钟精度的方法, 其特征在于, 包括: 1. A method to improve clock accuracy based on a seamless redundant ring network, which is characterized by:
所述无缝冗余环网中的节点接收到相邻的节点或主时钟发送的同步时钟信息之后 , 确 定接收到的同步时钟信息在本节点内的驻留时长, 所述驻留时长为同步时钟信息从输入到 入端口的时间点到输出到出端口的时间点之间的时间长度; After receiving the synchronization clock information sent by the adjacent node or the master clock, the node in the seamless redundant ring network determines the residence time of the received synchronization clock information in the node, and the residence time is synchronization The length of time between the time point when the clock information is input to the inlet port and the time point when it is output to the egress port;
根据确定出的驻留时长, 修正接收到的所述同步时钟信息; Correct the received synchronization clock information according to the determined dwell time;
若所述出端口为环端口, 则通过该环端口将修正后的同步时钟信息转发给相邻的节 若所述出端口为外接端口, 则通过该外接端口将修正后的同步时钟信息转发给从时 钟, 以使从时钟根据同步时钟信息进行时钟同步。 If the outgoing port is a ring port, then the corrected synchronization clock information is forwarded to the adjacent node through the ring port. If the outgoing port is an external port, then the corrected synchronization clock information is forwarded to the adjacent node through the external port. Slave clock, so that the slave clock is clock synchronized based on the synchronized clock information.
2、 根据权利要求 1所述的基于无缝冗余环网的提高时钟精度的方法, 其特征在于, 确 定接收到的同步时钟信息在本节点内的驻留时长, 具体包括: 2. The method for improving clock accuracy based on a seamless redundant ring network according to claim 1, characterized in that determining the residence time of the received synchronized clock information in the node specifically includes:
获得同步时钟信息输入到入端口时, 本地时钟的第一计数值 , 以及同步时钟信息输出 到出端口时, 本地时钟的第二计数值; Obtain the first count value of the local clock when the synchronous clock information is input to the ingress port, and the second count value of the local clock when the synchronous clock information is output to the egress port;
根据获得的第一计数值和第二计数值 , 以及本地时钟的时钟频率, 确定同步时钟信息 在本节点内的驻留时长。 According to the obtained first count value and second count value and the clock frequency of the local clock, the residence time of the synchronized clock information in the local node is determined.
3、 根据权利要求 2所述的基于无缝冗余环网的提高时钟精度的方法, 其特征在于, 所 述主时钟周期性的发送同步时钟信息; 3. The method for improving clock accuracy based on a seamless redundant ring network according to claim 2, characterized in that the master clock periodically sends synchronized clock information;
所述确定接收到的同步时钟信息在本节点内的驻留时长之前, 还包括: Before determining the residence time of the received synchronization clock information in the current node, the method further includes:
根据本次接收到的同步时钟信息和上一次接收到的同步时钟信息, 确定本地时钟与所 述主时钟之间的时钟频率的偏差; Determine the clock frequency deviation between the local clock and the master clock based on the synchronous clock information received this time and the synchronous clock information received last time;
根据确定出的时钟频率的偏差, 同步本地时钟的时钟频率。 Based on the determined deviation of the clock frequency, the clock frequency of the local clock is synchronized.
4、 根据权利要求 3所述的基于无缝冗余环网的提高时钟精度的方法, 其特征在于, 根 据本次接收到的同步时钟信息和上一次接收到的同步时钟信息, 确定本地时钟与所述主时 钟之间的时钟频率的偏差, 具体包括: 4. The method for improving clock accuracy based on seamless redundant ring network according to claim 3, characterized in that, based on the synchronization clock information received this time and the synchronization clock information received last time, it is determined that the local clock and The clock frequency deviation between the main clocks specifically includes:
所述节点确定本次接收到的同步时钟信息对应的时间点、 上一次接收到的同步时钟信 息对应的时间点、 本次接收同步时钟信息的时间点和上一次接收同步时钟信息的时间点; 根据确定出的各时间点, 计算出本地时钟与所述主时钟之间的时钟频率的偏差。 The node determines the time point corresponding to the synchronization clock information received this time, the time point corresponding to the synchronization clock information received last time, the time point when the synchronization clock information is received this time, and the time point when the synchronization clock information was last received; According to each determined time point, the clock frequency deviation between the local clock and the master clock is calculated.
5、 根据权利要求 4所述的基于无缝冗余环网的提高时钟精度的方法, 其特征在于, 确 定本地时钟与所述主时钟之间的时钟频率的偏差之前, 还包括: 5. The method for improving clock accuracy based on a seamless redundant ring network according to claim 4, characterized in that before determining the clock frequency deviation between the local clock and the master clock, it further includes:
所述节点接收到同步时钟信息后, 记录入端口接收到该同步时钟信息的时间点对应的 时间戳; 所述节点确定本次接收同步时钟信息的时间点和上一次接收同步时钟信息的时间点, 具体包括: After receiving the synchronous clock information, the node records the timestamp corresponding to the time point when the incoming port receives the synchronous clock information; The node determines the time point at which the synchronization clock information is received this time and the time point at which the synchronization clock information was last received, specifically including:
所述节点根据本次接收到同步时钟信息时记录的时间戳, 确定本次接收同步时钟信息 的时间点, 以及根据上一次接收到同步时钟信息时记录的时间戳, 确定上一次接收同步时 钟信息的时间点。 The node determines the time point of receiving the synchronized clock information this time based on the timestamp recorded when it receives the synchronized clock information this time, and determines the last time it received the synchronized clock information based on the timestamp recorded when it received the synchronized clock information last time. time point.
6、 一种无缝冗余环网中的节点, 其特征在于, 包括: 6. A node in a seamless redundant ring network, characterized by: including:
接收单元, 用于接收相邻的节点或主时钟发送的同步时钟信息; The receiving unit is used to receive the synchronization clock information sent by the adjacent node or the master clock;
驻留时长确定单元, 用于确定接收单元接收到的同步时钟信息在本节点内的驻留时 长, 所述驻留时长为同步时钟信息从输入到入端口的时间点到输出到出端口的时间点之间 的时间长度; The residence time determination unit is used to determine the residence time of the synchronous clock information received by the receiving unit in the node. The residence time is the time from the time when the synchronous clock information is input to the inlet port to the time when the synchronous clock information is output to the egress port. the length of time between points;
同步时钟修正单元, 用于根据驻留时长确定单元确定出的驻留时长, 修正接收到的所 述同步时钟信息; A synchronization clock correction unit, configured to correct the received synchronization clock information according to the residence time determined by the residence time determination unit;
转发单元, 用于在所述出端口为环端口时, 通过该环端口将修正后的同步时钟信息后 转发给相邻的节点, 以及在所述出端口为外接端口时, 通过该外接端口将修正后的同步时 钟信息转发给从时钟, 以使从时钟根据同步时钟信息进行时钟同步。 A forwarding unit configured to forward the corrected synchronization clock information to adjacent nodes through the ring port when the outgoing port is a ring port, and when the outgoing port is an external port, forward the corrected synchronization clock information through the external port. The corrected synchronization clock information is forwarded to the slave clock, so that the slave clock performs clock synchronization based on the synchronization clock information.
7、 根据权利要求 6所述的无缝冗余环网中的节点, 其特征在于, 所述驻留时长确定单 元具体包括: 7. The node in the seamless redundant ring network according to claim 6, characterized in that the residence time determination unit specifically includes:
计数值获得子单元,用于获得同步时钟信息输入到入端口时,本地时钟的第一计数值, 以及同步时钟信息输出到出端口时, 本地时钟的第二计数值; The count value acquisition subunit is used to obtain the first count value of the local clock when the synchronous clock information is input to the ingress port, and the second count value of the local clock when the synchronous clock information is output to the egress port;
驻留时长确定子单元, 用于根据计数值获得子单元获得的第一计数值和第二计数值 , 以及本地时钟的时钟频率, 确定同步时钟信息在本节点内的驻留时长。 The residence duration determination subunit is used to determine the residence duration of the synchronized clock information in the node based on the first count value and the second count value obtained by the count value acquisition subunit and the clock frequency of the local clock.
8、 根据权利要求 7所述的无缝冗余环网中的节点, 其特征在于, 所述主时钟周期性的 发送同步时钟信息; 8. The node in the seamless redundant ring network according to claim 7, characterized in that the master clock periodically sends synchronization clock information;
所述无缝冗余环网中的节点还包括: The nodes in the seamless redundant ring network also include:
时钟频率偏差确定单元, 用于在驻留时长确定单元确定接收到的同步时钟信息在本节 点内的驻留时长之前, 根据本次接收到的同步时钟信息和上一次接收到的同步时钟信息, 确定本地时钟与所述主时钟之间的时钟频率的偏差; The clock frequency deviation determination unit is used to determine the residence time of the received synchronization clock information in the node before the residence time determination unit determines the residence time of the received synchronization clock information in the node. According to the synchronization clock information received this time and the synchronization clock information received last time, determining a clock frequency deviation between the local clock and said master clock;
时钟频率同步单元, 用于才 居时钟频率偏差确定单元确定出的时钟频率的偏差, 同步 本地时钟的时钟频率。 The clock frequency synchronization unit is used to synchronize the clock frequency of the local clock based on the deviation of the clock frequency determined by the clock frequency deviation determination unit.
9、 根据权利要求 8所述的无缝冗余环网中的节点, 其特征在于, 所述时钟频率偏差确 定单元具体包括: 9. The node in the seamless redundant ring network according to claim 8, characterized in that the clock frequency deviation determination unit specifically includes:
时间点确定子单元, 用于确定本次接收到的同步时钟信息对应的时间点、上一次接收 到的同步时钟信息对应的时间点、 本次接收同步时钟信息的时间点和上一次接收同步时钟 信息的时间点; The time point determination subunit is used to determine the time point corresponding to the synchronization clock information received this time, the time point corresponding to the synchronization clock information received last time, the time point corresponding to the synchronization clock information received this time and the last time the synchronization clock was received. The time point of the information;
时钟频率偏差确定子单元, 用于根据时间点确定子单元确定出的各时间点, 计算出本 地时钟与所述主时钟之间的时钟频率的偏差。 The clock frequency deviation determination subunit is used to calculate the clock frequency deviation between the local clock and the master clock based on each time point determined by the time point determination subunit.
10、 根据权利要求 9所述的无缝冗余环网中的节点, 其特征在于, 所述无缝冗余环网 中的节点还包括: 10. Nodes in the seamless redundant ring network according to claim 9, characterized in that, the nodes in the seamless redundant ring network further include:
时间戳记录单元, 用于在时钟频率偏差确定单元确定本地时钟与所述主时钟之间的时 钟频率的偏差之前, 在接收到同步时钟信息后, 记录入端口接收到该同步时钟信息的时间 点对应的时间戳; A timestamp recording unit, configured to record the time point at which the incoming port receives the synchronized clock information after receiving the synchronized clock information before the clock frequency deviation determining unit determines the clock frequency deviation between the local clock and the master clock. The corresponding timestamp;
所述时间点确定子单元, 具体用于根据本次接收到同步时钟信息时时间戳记录单元记 录的时间戳, 确定本次接收同步时钟信息的时间点, 以及根据上一次接收到同步时钟信息 时时间戳记录单元记录的时间戳, 确定上一次接收同步时钟信息的时间点。 The time point determination subunit is specifically used to determine the time point when the synchronization clock information is received this time based on the timestamp recorded by the timestamp recording unit when the synchronization clock information is received this time, and based on the time when the synchronization clock information was received last time. The timestamp recorded by the timestamp recording unit determines the time point when synchronized clock information was last received.
PCT/CN2012/082004 2012-08-31 2012-09-26 Method and node based on seamless redundant ring network for increasing precision of clock WO2014032350A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210320749.5 2012-08-31
CN201210320749.5A CN102833061B (en) 2012-08-31 2012-08-31 Based on method and the node of the raising clock accuracy of seamless redundant looped network

Publications (1)

Publication Number Publication Date
WO2014032350A1 true WO2014032350A1 (en) 2014-03-06

Family

ID=47336041

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/082004 WO2014032350A1 (en) 2012-08-31 2012-09-26 Method and node based on seamless redundant ring network for increasing precision of clock

Country Status (2)

Country Link
CN (1) CN102833061B (en)
WO (1) WO2014032350A1 (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103236894B (en) * 2013-04-03 2016-08-03 北京东土科技股份有限公司 Clock synchronizing method and device in a kind of seamless redundant network
CN105530139B (en) * 2014-09-28 2021-03-16 中兴通讯股份有限公司 Self-checking method and device for 1588 equipment
CN105356962B (en) * 2015-11-20 2018-05-04 上海联影医疗科技有限公司 Loop-type network system and its node time synchronous method
CN105491433B (en) * 2015-12-03 2019-05-17 北京小鸟科技股份有限公司 Audio video synchronization display methods and device and splice displaying system based on 1588V2 agreement
CN105591697B (en) * 2016-01-20 2018-04-17 中国科学院上海光学精密机械研究所 High-precision optical fiber time-frequency annular networking system and network-building method
CN105978652B (en) * 2016-04-27 2018-02-13 刘巍 Equipment, system and method at synchronous pair of Redundant Ethernet
CN106130710B (en) * 2016-06-29 2019-11-08 北京东土科技股份有限公司 A kind of clock synchronizing method and system
CN106506260A (en) * 2016-10-17 2017-03-15 国电南瑞科技股份有限公司 A kind of message time delay measurement and modification method based on HSR bidirectional loop networks
CN106656716B (en) * 2016-12-28 2019-08-20 中国人民解放军海军工程大学 Ring network topology structure with common clock
CN107359978A (en) * 2017-07-03 2017-11-17 南京南瑞继保电气有限公司 A kind of HSR/PRP network samples synchronous method based on data forwarding Time delay measurement
CN107800529B (en) * 2017-11-07 2020-10-20 北京飞利信电子技术有限公司 Clock frequency synchronization method of network node
CN110943795B (en) * 2019-10-22 2021-05-14 清华大学 Time synchronization method suitable for bus communication system
CN112994819B (en) * 2019-12-16 2023-02-03 华为技术有限公司 Message processing method for clock synchronization, clock synchronization method and device
CN111817810B (en) * 2020-05-25 2022-07-15 上海橙群微电子有限公司 Clock synchronization method, wireless network device and readable storage medium
CN111698076B (en) * 2020-06-03 2023-05-30 河北工业大学 Accurate communication synchronization method and system based on time compensation
CN117063437A (en) * 2021-04-08 2023-11-14 华为技术有限公司 Clock synchronization method, related device and equipment
CN114401067A (en) * 2021-12-24 2022-04-26 浙江中控技术股份有限公司 Time synchronization method for ring network communication, programmable gate array and ring network communication system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1964352A (en) * 2006-09-22 2007-05-16 华为技术有限公司 A method and device to improve clock precision
CN101425890A (en) * 2008-11-21 2009-05-06 中兴通讯股份有限公司 Transmitted clock implementing apparatus and method
CN101827098A (en) * 2010-03-31 2010-09-08 中兴通讯股份有限公司 Processing method and device for time synchronization
CN101867469A (en) * 2010-06-10 2010-10-20 北京东土科技股份有限公司 Realization method of precision synchronous clock
WO2012104326A1 (en) * 2011-02-01 2012-08-09 Alcatel Lucent Automatic capture of the network delay components

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1964352A (en) * 2006-09-22 2007-05-16 华为技术有限公司 A method and device to improve clock precision
CN101425890A (en) * 2008-11-21 2009-05-06 中兴通讯股份有限公司 Transmitted clock implementing apparatus and method
CN101827098A (en) * 2010-03-31 2010-09-08 中兴通讯股份有限公司 Processing method and device for time synchronization
CN101867469A (en) * 2010-06-10 2010-10-20 北京东土科技股份有限公司 Realization method of precision synchronous clock
WO2012104326A1 (en) * 2011-02-01 2012-08-09 Alcatel Lucent Automatic capture of the network delay components

Also Published As

Publication number Publication date
CN102833061B (en) 2016-02-24
CN102833061A (en) 2012-12-19

Similar Documents

Publication Publication Date Title
WO2014032350A1 (en) Method and node based on seamless redundant ring network for increasing precision of clock
JP5792884B2 (en) Method, apparatus and system for time distribution in a communication network
JP6214008B2 (en) Method and apparatus for communicating time information between time recognition devices
US10158441B1 (en) Securing time between nodes
US9548831B2 (en) Synchronizing system, synchronizing method, first synchronizing device, second synchronizing device, and computer program
JP5377663B2 (en) COMMUNICATION SYSTEM, COMMUNICATION DEVICE, AND TIME SYNCHRONIZATION METHOD
JP5915379B2 (en) Transmission apparatus and transmission method
WO2017071521A1 (en) Method, node and system for detecting clock synchronization path
JP2013104772A (en) Frame transmission device and synchronization method
EP2448168A1 (en) Method and system for bearing time synchronization protocol in optical transport network
WO2010057398A1 (en) Device and method for implementing clock transparent transmission
WO2014187310A1 (en) Method and apparatus for ptp synchronous network
US11349587B2 (en) Generating a timestamp
WO2011012057A1 (en) Message synchronization method, apparatus and system
Le et al. Evaluation of real-time ethernet with time synchronization and time-aware shaper using OMNeT++
JP6231453B2 (en) Communication control device
US8861552B2 (en) Fault-tolerant self-stabilizing distributed clock synchronization protocol for arbitrary digraphs
EP2458757B1 (en) A method for transmitting IEEE 1588V2 synchronization packets over ethernet in link-by-link mode, via network elements having a transparent clock, and associated help device
Moreira et al. IEEE 1588 Transparent Clock architecture for FPGA-based network devices
WO2017097034A1 (en) Time stamp processing method and apparatus for time message in optical transport network
US20110026654A1 (en) Network device of high-precision synchronization type, network system, and frame transfer method
JP2011071869A (en) Clock synchronizing method and packet communication system
JP6456776B2 (en) Delay fluctuation absorption method
JP2014519282A (en) Method, apparatus and system for detecting signal degradation in packet path
JP2009239452A (en) Transmission timing change type network device 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: 12883746

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12883746

Country of ref document: EP

Kind code of ref document: A1