WO2014000434A1 - 一种时间同步方法及系统 - Google Patents
一种时间同步方法及系统 Download PDFInfo
- Publication number
- WO2014000434A1 WO2014000434A1 PCT/CN2013/070459 CN2013070459W WO2014000434A1 WO 2014000434 A1 WO2014000434 A1 WO 2014000434A1 CN 2013070459 W CN2013070459 W CN 2013070459W WO 2014000434 A1 WO2014000434 A1 WO 2014000434A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- clock
- synchronization signal
- time
- node
- synchronized
- Prior art date
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/02—Details
- H04J3/06—Synchronising arrangements
- H04J3/0635—Clock or time synchronisation in a network
- H04J3/0685—Clock or time synchronisation in a node; Intranode synchronisation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40006—Architecture of a communication node
- H04L12/40013—Details regarding a bus controller
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L7/00—Arrangements for synchronising receiver with transmitter
- H04L7/0008—Synchronisation information channels, e.g. clock distribution lines
Definitions
- the present invention relates to the field of substrate management controller systems, and in particular, to a time synchronization method and system. Background technique
- BMC Baseboard Management Controller
- SEL System Event Log
- the BMC obtains various events and alarms on the main board through the system interface with the host, the local sensor bus, etc., and time stamps each event according to the local time of the B M C, and generates an event log.
- IPMI Intelligent Platform Management Interface
- the time stamp of the event log is of the order of seconds.
- multiple nodes are generally allowed to form a hardware partition, and the CPUs in the hardware partition are connected through the interconnect bus.
- the BMC is responsible for sending the SEL record of this node to a higher level Device Management Software (DMS).
- DMS Device Management Software
- the DMS analyzes and processes various types of SELs sent by the BMC, and generates various fault handling strategies accordingly. Since the hardware of each node in the same hard partition has a correlation, when a certain fault occurs, the BMC of each node may report multiple event records in a short time. In order for the fault handling module to correctly diagnose and handle faults, the DMS is required to correctly distinguish the order in which the events occur. Summary of the invention
- the present invention provides a time synchronization method, including:
- Selecting a clock bus device on the clock bus as a clock source node, and other clock bus devices on the clock bus are nodes to be synchronized;
- the clock source node broadcasts a calendar time of the clock source node to the node to be synchronized at a first moment;
- the clock source node transmits a clock synchronization signal to the node to be synchronized through the clock bus at a second time, and the second time interval is separated from the first time by a first predetermined time interval, and the clock synchronization signal is Generated by the clock source node, including the clock signal and the synchronization signal;
- the node to be synchronized decodes the clock synchronization signal to obtain the clock signal and the synchronization signal;
- the node to be synchronized adds the recorded time of the clock source node to the calendar time of the node to be synchronized after the first predetermined time interval.
- the invention also provides a time synchronization system, the system comprising:
- a clock source selection unit configured to determine whether the time synchronization system is a clock source node or a node to be synchronized
- a clock synchronization signal generating unit configured to generate a clock synchronization signal when the clock source selecting unit determines that the time synchronization system is a clock source node, where the clock synchronization signal includes a clock signal and a synchronization signal;
- a sending unit configured to: when the clock source selecting unit determines that the time synchronization system is a clock source node, transmit the clock synchronization signal generated by the clock synchronization signal generating unit to the node to be synchronized through the clock bus;
- a receiving unit configured to: when the clock source selecting unit determines that the time synchronization system is a node to be synchronized, receive a clock synchronization signal transmitted by the clock source node through the clock bus;
- a clock synchronization signal decoding unit configured to: when the clock source selection unit determines that the time synchronization system is a node to be synchronized, decode the clock synchronization signal received by the receiving unit to obtain a clock signal and a synchronization signal;
- a unified calendar time unit for unifying the calendar time of each clock bus device on the clock bus;
- the unified calendar time unit further comprising: a clock source node broadcast unit, configured to: when the clock source selecting unit determines that the time synchronization system is the clock source node, broadcast a calendar time to the node to be synchronized at a first moment;
- a recording unit configured to record, when the clock source selecting unit determines that the time synchronization system is the to-be-synchronized node, a calendar time of the clock source node broadcast by the clock source node;
- a sending time control unit configured to: when the clock source selecting unit determines that the time synchronization system is the clock source node, control to pass the clock synchronization signal generated by the clock synchronization signal generating unit to the second time Transmitting a clock bus to the node to be synchronized; the second time interval is spaced apart from the first time by a first predetermined time interval, and the clock synchronization signal comprises a clock signal and a synchronization signal;
- An operation unit configured to: when the clock source selecting unit determines that the time synchronization system is the node to be synchronized and the clock synchronization signal decoding unit obtains the synchronization signal, add the calendar time recorded by the recording unit The calendar time after the first predetermined time interval is taken as the node to be synchronized.
- the present invention discloses the following technical effects:
- a time bus device on the clock bus is selected as a clock source node to generate a clock synchronization signal; the clock source node broadcasts a calendar time at a first time; and the node to be synchronized records the calendar time;
- the clock source node sends the clock synchronization signal to the node to be synchronized at a second time; the node to be synchronized decodes the clock synchronization signal to obtain the synchronization signal; when the node to be synchronized obtains the synchronization signal And adding the recorded calendar time to the first predetermined time interval between the second time and the first time as the calendar time of the node to be synchronized.
- DRAWINGS 1 is a flowchart of a time synchronization method according to Embodiment 1 of the present invention.
- FIG. 2 is a schematic diagram of application hardware of a time synchronization method according to an embodiment of the present invention
- FIG. 3 is a timing diagram of a time synchronization method according to Embodiment 2 of the present invention.
- FIG. 4 is a structural diagram of a time synchronization system according to an embodiment of the present invention.
- FIG. 1 is a flowchart of a time synchronization method according to Embodiment 1 of the present invention
- FIG. 2 is a schematic diagram of application hardware when a clock bus device is specifically a substrate management controller according to an embodiment of the present invention.
- the clock source node generates a clock synchronization signal, where the clock synchronization signal includes a clock signal and a synchronization signal;
- the clock synchronization signal may be obtained by Manchester coding the clock signal and the synchronization signal.
- the Complex Programmable Logic Device (CPLD) device in the clock source node is responsible for generating a clock signal (specifically, 32768 Hz), and the synchronization signal is also called a second synchronization signal (specifically, ⁇ ).
- the signals can be mixed together by Manchester coding.
- the clock source node broadcasts a calendar time of the clock source node to the to-be-synchronized node at a first moment.
- the clock source node may specifically broadcast the calendar time of the clock source node to the node to be synchronized at the start time of the second.
- the node to be synchronized records a calendar time of the clock source node.
- the clock source node transmits the clock synchronization signal to the node to be synchronized through the clock bus at a second time, and the second time interval is separated from the first time by a first predetermined time interval,
- the clock synchronization signal is generated by the clock source node, including the clock signal and the synchronization signal.
- the first predetermined time interval may be one second, two seconds, etc., and may be set as needed. Of course, the set first predetermined time interval should be greater than the calendar time of the clock source node from the clock source node to the waiting time. Synchronization section, ⁇ required duration.
- the clock source node passes the clock synchronization signal through the clock bus, which can be specifically used
- An RS-485 differential signal is transmitted to the node to be synchronized.
- the RS-485 differential signal is used to transmit the real-time clock, it can support BMC time synchronization of long-distance cross-machine rejection.
- the CPLD of the clock source node may be a clock synchronization signal, which may be a Manchester clock signal, and sent to an RS-485 interface chip, and the clock synchronization signal is transmitted to other each to be synchronized on the time bus through the RS-485 bus. node.
- a clock synchronization signal which may be a Manchester clock signal
- the clock synchronization signal is transmitted to other each to be synchronized on the time bus through the RS-485 bus. node.
- the node to be synchronized decodes the clock synchronization signal to obtain the clock signal and the synchronization signal.
- the node to be synchronized when the synchronization signal is obtained, adds the recorded calendar time of the clock source node to the first predetermined time interval as the calendar time of the node to be synchronized.
- the node to be synchronized After receiving the Manchester-coded clock synchronization signal, the node to be synchronized transmits the clock synchronization signal to the CPLD of the clock bus device for decoding, and the CPLD obtains the clock signal and the synchronization signal, the clock signal and
- the synchronization signal may be a 32768 Hz clock signal and a 1 Hz signal as described above.
- the clock signal is used as a real-time clock signal of a node to be synchronized, and is used to unify a clock frequency;
- the synchronization signal is simultaneously used as an external interrupt trigger signal of the BMC to implement time synchronization.
- a time bus device on the clock bus is selected to generate a clock synchronization signal for the clock source node; the clock source node broadcasts a calendar time; the node to be synchronized records the calendar time; the clock source The node sends the clock synchronization signal to the node to be synchronized at a first time interval; the node to be synchronized decodes the clock synchronization signal to obtain the synchronization signal; when the node to be synchronized obtains the synchronization signal,
- the recorded calendar time of the clock source node is added to the calendar time of the node to be synchronized after the first predetermined time interval.
- the node to be synchronized can be used as the clock signal of the node to be synchronized after adding the received calendar time to the first predetermined time interval, thereby realizing each time bus device on the same time bus. Accurate synchronization between times provides support for advanced features such as troubleshooting and increases system availability.
- the node to be synchronized uses the clock signal as its own clock signal.
- the clock source node continuously sends the clock synchronization signal to the node to be synchronized through the clock bus.
- the clock synchronization signal includes a clock signal and a synchronization signal, and the node to be synchronized receives the real-time clock synchronization signal of the clock source node to obtain the clock signal therein. , as its own clock signal for unified clock frequency. Therefore, after synchronizing with the calendar time of the clock source node, the clock signal is further consistent with the clock signal frequency of the clock source node.
- the method in the embodiment of the present invention can further implement fault redundancy of the synchronous clock source.
- a clock node is elected as a new clock source node, thereby ensuring system reliability.
- the one clock bus device on the selected clock bus is a clock source node, and the other clock bus devices on the clock bus are nodes to be synchronized, which may specifically include the following steps:
- each clock bus device on the clock bus detects whether the received on the clock bus is received a clock synchronization signal, wherein each of the clock bus devices is sequentially programmed from 1 No., and the number of each clock bus device is different;
- the clock bus device numbered N in each clock bus device does not receive the clock synchronization signal in N time intervals, the clock bus device numbered N sets itself as the clock source node;
- the clock bus device numbered N in each clock bus device receives the clock synchronization signal in N time intervals, the clock bus device numbered N sets itself as the node to be synchronized.
- the time bus can be notified, the time bus notifies that the clock bus device as the clock source node is closed, and the device management module DMS can also be notified, and the device management module DMS can pass the service.
- the data channel, the clock bus device that is notified as the clock source node is turned off.
- other time nodes on the clock bus other than the clock source node that is, all clock bus devices that are nodes to be synchronized, can elect a clock bus device as a new clock source node.
- FIG. 3 the figure is a timing diagram of a time synchronization method according to an embodiment of the present invention.
- the time synchronization method of the embodiment of the present invention may further include the following steps after the step of generating a clock synchronization signal by the clock source node, where the clock synchronization signal includes a clock signal and a synchronization signal:
- the clock source node broadcasts the calendar time of the clock source node to the node to be synchronized at the start time of the second.
- the clock source node does not send the calendar time to the node to be synchronized through the time bus, but is sent by means of a broadcast.
- the clock source node broadcasts the calendar time to the node to be synchronized through the service network at the start time of the whole second.
- the calendar time is accurate to the time of milliseconds, for example: 2012/2/13 09:22:10:300» Due to the high precision of the calendar time, the preconditions for providing high-precision log time synchronization are provided.
- the node to be synchronized records the calendar time.
- the clock source node transmits the clock synchronization signal to the node to be synchronized through the clock bus at a next full second time;
- the node to be synchronized decodes the clock synchronization signal to obtain the clock signal and the synchronization signal;
- the node to be synchronized When the node to be synchronized obtains the synchronization signal, that is, the second synchronization signal, the node to be synchronized adds one second of the received calendar time as the calendar time of the node to be synchronized, that is, the CLK time.
- the calendar time of all time bus devices of the clock bus is unified, it is ensured that the clock signals of each node to be synchronized and the clock source node are at the same time, and are accurate to the millisecond level.
- the clock bus device in the time synchronization method of the embodiment of the present invention may specifically be a substrate management controller.
- FIG. 4 the figure is a structural diagram of a time synchronization system according to an embodiment of the present invention.
- the time synchronization system of the embodiment of the present invention comprises: a clock source selecting unit 11, a clock synchronization signal encoding unit 12, a transmitting unit 13, a receiving unit 15 and a clock synchronization signal decoding unit 14, and a unified calendar time unit.
- the clock source selecting unit 11 is configured to determine whether the time synchronization system is a clock source node or a node to be synchronized.
- the clock source selection unit 11 may specifically include:
- a detecting unit configured to detect whether the clock synchronization signal transmitted on the clock bus is received when the time synchronization system is powered on or the clock synchronization signal on the clock bus is lost;
- a determining unit configured to set itself as the clock source node if the clock synchronization signal is not received within N time intervals according to the detection result of the detecting unit; if the clock is received in N time slots
- the synchronization signal sets itself to the node to be synchronized, and the N is the number of the clock bus device, wherein each clock bus device is sequentially numbered from 1 and the number of each clock bus device is different.
- the clock synchronization signal generating unit 12 is configured to generate a clock synchronization signal when the clock source selecting unit determines that the time synchronization system is a clock source node, where the clock synchronization signal includes a clock signal and a synchronization signal.
- the clock synchronization signal generating unit 12 specifically obtains the clock synchronization signal by Manchester clock coding of the clock signal and the synchronization signal.
- the sending unit 13 is configured to: when the clock source selecting unit determines that the time synchronization system is a clock source node, transmit the clock synchronization signal generated by the clock synchronization signal generating unit to the node to be synchronized through the clock bus;
- the receiving unit 15 is configured to receive the clock synchronization signal transmitted by the sending unit 13 when the clock source selecting unit determines that the time synchronization system is a node to be synchronized.
- the clock synchronization signal decoding unit 14 is configured to: when the clock source selecting unit determines that the time synchronization system is a node to be synchronized, decode the clock synchronization signal received by the receiving unit 15 to obtain a clock signal and a synchronization signal.
- a unified calendar time unit that unifies the calendar time of each clock bus device on the clock bus.
- the unified calendar time unit specifically includes:
- a clock source node broadcast unit configured to: when the clock source selecting unit determines that the time synchronization system is the clock source node, broadcast a calendar time to the node to be synchronized at a first moment;
- a recording unit configured to record, when the clock source selecting unit determines that the time synchronization system is the to-be-synchronized node, a calendar time of the clock source node broadcast by the clock source node;
- a sending time control unit configured to: when the clock source selecting unit determines that the time synchronization system is the clock source node, control to pass the clock synchronization signal generated by the clock synchronization signal generating unit to the second time Transmitting a clock bus to the node to be synchronized; the second time interval is spaced apart from the first time by a first predetermined time interval, and the clock synchronization signal comprises a clock signal and a synchronization signal;
- An operation unit configured to: when the clock source selecting unit determines that the time synchronization system is the clock synchronization signal decoding unit of the to-be-synchronized node, obtain the synchronization signal, add the calendar time The calendar time of the node to be synchronized, that is, the CLK time, after the first predetermined time interval.
- the first notification unit is configured to notify the device management module to close the clock source node after determining that the clock synchronization signal is lost when the clock source selection unit determines that the time synchronization system is a to-be-synchronized node.
- the clock source selecting unit 11 elects a time bus device from the time bus device on the clock bus as the node to be synchronized as a new clock source node.
- the time synchronization method and system provided by the present invention can be used for clock synchronization of each node in other embedded systems, in addition to real-time clock synchronization between fault-tolerant computer BMCs.
- this solution can provide a perfect clock synchronization scheme due to the large precision deviation caused by the software clock synchronization protocol.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
- Electric Clocks (AREA)
Abstract
本发明实施例公开了一种时间同步方法包括:选择时钟总线上一个时钟总线设备为时钟源节点,时钟总线上的其他时钟总线设备为待同步节点;时钟源节点产生时钟同步信号,时钟同步信号包括时钟信号和同步信号;时钟源节点在第一时刻向待同步节点广播时钟源节点的日历时间;待同步节点记录日历时间;时钟源节点在与第二时刻将时钟同步信号通过时钟总线传输到待同步节点;待同步节点解码时钟同步信号获得时钟信号和同步信号;待同步节点获得同步信号时,待同步节点将时钟源节点的日历时间加上第一预定时间间隔后作为待同步节点的日历时间。本发明实施例所述方法及系统能够实现时间总线设备之间的时间的精确同步。
Description
一种时间同步方法及系统
技术领域 本发明涉及基板管理控制器系统技术领域, 特别是涉及一种时间同步 方法及系统。 背景技术
在容错计算机中,基板管理控制器( Baseboard Management Controller, BMC ) 的一个很重要的功能就是事件日志记录( System Event Log, SEL ) 功能。 BMC通过与主机之间系统接口、 本地的传感器总线等接口获得主 板上的各种事件与报警,并根据 B M C本地的时间为每个事件打上时间戳, 并生成事件日志。 按照现有的智能型平台管理接口 ( Intelligent Platform Management Interface , IPMI )规范, 事件日志的时间戳的精度为秒级。 在容错计算机的应用中一般都允许多个节点组成一个硬件分区, 硬件 分区中的 CPU通过互联总线连接。 BMC负责将本节点的 SEL记录上送给 更高一级的设备管理模块 (Device Management Software , DMS ) , DMS 分析、 处理由 BMC上送的各类 SEL, 并据此生成各类故障处理策略。 由于在同一硬分区中的各个节点的硬件具有相关性, 当某一故障发生 时, 在很短的时间内各个节点的 BMC可能上报多条事件记录。 为了故障 处理模块能够正确地诊断与处理故障, 因此要求 DMS正确区分各个事件 发生的先后顺序。 发明内容
有鉴于此, 本发明的目的在于提供一种时间同步方法及系统, 实现时 间总线设备之间的时间的精确同步。 本发明提供一种时间同步方法, 包括:
选择时钟总线上一个时钟总线设备为时钟源节点, 所述时钟总线上的其 他时钟总线设备为待同步节点;
所述时钟源节点在第一时刻向所述待同步节点广播所述时钟源节点的日 历时间;
所述待同步节点记录所述时钟源节点的日历时间;
所述时钟源节点在第二时刻将时钟同步信号通过所述时钟总线传输到所 述待同步节点, 所述第二时刻与所述第一时刻间隔第一预定时间间隔, 所述 时钟同步信号为时钟源节点产生的, 包括时钟信号和同步信号;
所述待同步节点解码所述时钟同步信号获得所述时钟信号和所述同步信 号;
所述待同步节点在获得所述同步信号时, 将记录的所述时钟源节点的曰 历时间加上所述第一预定时间间隔后作为所述待同步节点的日历时间。
本发明还提供一种时间同步系统, 所述系统包括:
时钟源选取单元, 用于确定本时间同步系统是时钟源节点还是待同步节 点;
时钟同步信号产生单元, 用于当所述时钟源选取单元确定本时间同步系 统是时钟源节点时, 产生时钟同步信号, 所述时钟同步信号包括时钟信号和 同步信号;
发送单元, 用于当所述时钟源选取单元确定本时间同步系统是时钟源节 点时, 将所述时钟同步信号产生单元产生的所述时钟同步信号通过所述时钟 总线传输到待同步节点;
接收单元, 用于当所述时钟源选取单元确定本时间同步系统是待同步节 点时, 接收时钟源节点通过所述时钟总线传输的时钟同步信号;
时钟同步信号解码单元, 用于当所述时钟源选取单元确定本时间同步系 统是待同步节点时, 解码所述接收单元接收到的所述时钟同步信号, 获得时 钟信号和同步信号;
统一日历时间单元,用于统一时钟总线上各个时钟总线设备的日历时间; 所述统一日历时间单元进一步包括:
时钟源节点广播单元, 用于当所述时钟源选取单元确定本时间同步系统 是所述时钟源节点时, 在第一时刻向所述待同步节点广播日历时间;
记录单元, 用于当所述时钟源选取单元确定本时间同步系统是所述待同 步节点时, 记录所述时钟源节点广播的所述时钟源节点的日历时间;
发送时刻控制单元, 用于当所述时钟源选取单元确定本时间同步系统是 所述时钟源节点时, 控制在第二时刻将所述时钟同步信号产生单元产生的所 述时钟同步信号通过所述时钟总线传输到所述待同步节点; 所述第二时刻与 所述第一时刻间隔第一预定时间间隔, 所述时钟同步信号包括时钟信号和同 步信号;
运算单元, 用于当所述时钟源选取单元确定本时间同步系统是所述待同 步节点且所述时钟同步信号解码单元获得所述同步信号时, 将所述记录单元 记录的所述日历时间加上第一预定时间间隔后作为所述待同步节点的日历时 间。
根据本发明提供的具体实施例, 本发明公开了以下技术效果:
本发明实施例所述时间同步方法, 选择时钟总线上一个时间总线设备为 时钟源节点负责产生时钟同步信号; 所述时钟源节点在第一时刻广播日历时 间; 待同步节点记录所述日历时间; 所述时钟源节点在第二时刻发送所述时 钟同步信号到所述待同步节点; 所述待同步节点解码所述时钟同步信号获得 所述同步信号; 所述待同步节点获得所述同步信号时, 将记录的所述日历时 间加上第二时刻与第一时刻之间的第一预定时间间隔后作为所述待同步节点 的日历时间。 由于同步信号的存在, 可以使得所述待同步节点将接收到的日 历时间加上第一预定时间间隔后作为该待同步节点的时钟信号, 从而实现同 一时间总线上的各个时间总线设备之间时间的精确同步, 为故障诊断等高级 功能提供支持, 提高系统可用性。 附图说明
图 1为本发明实施例一的时间同步方法流程图;
图 2是本发明实施例所述时间同步方法应用硬件示意图;
图 3为本发明实施例二的时间同步方法时序图;
图 4为本发明实施例的时间同步系统结构图。
具体实施方式
为使本发明的上述目的、 特征和优点能够更加明显易懂, 下面结合附图 和具体实施方式对本发明作进一步详细的说明。
有鉴于此, 本发明的目的在于提供一种时间同步方法及系统, 实现时间 总线设备之间时间的精确同步。
参见图 1和图 2 , 图 1为本发明实施例一的时间同步方法流程图; 图 2 是本发明实施例所述方法中时钟总线设备具体为基板管理控制器时的应用硬 件示意图。
本发明第一实施例所述时间同步方法, 包括:
S100、 选择时钟总线上一个时钟总线设备为时钟源节点, 所述时钟总线 上的其他时钟总线设备为待同步节点;
S200、 所述时钟源节点产生时钟同步信号, 所述时钟同步信号包括时钟 信号和同步信号;
所述时钟同步信号可以是将所述时钟信号和同步信号通过曼彻斯特编码 获得。
所述时钟源节点中的复杂可编程逻辑器件( Complex Programmable Logic Device, CPLD )器件负责产生时钟信号 (具体可以为 32768Hz ) , 以及同步 信号也称秒同步信号 (具体可以为 ΙΗζ ) , 这两个信号具体可以通过曼彻斯 特编码混合到一起。
S300、 所述时钟源节点在第一时刻向所述待同步节点广播所述时钟源节 点的日历时间。
所述时钟源节点具体可以在整秒开始时刻向所述待同步节点广播所述时 钟源节点的日历时间。
S400、 所述待同步节点记录所述时钟源节点的日历时间。
S500、 所述时钟源节点在第二时刻将所述时钟同步信号通过所述时钟总 线传输到所述待同步节点, 所述第二时刻与所述第一时刻间隔第一预定时间 间隔, 所述时钟同步信号为时钟源节点产生的, 包括时钟信号和同步信号。
第一预定时间间隔可以是一秒、 两秒等, 具体可以根据需要进行设定, 当然, 设定的第一预定时间间隔应该要大于所述时钟源节点的日历时间从时 钟源节点传递到待同步节, ^所需的时长。
所述时钟源节点将所述时钟同步信号通过所述时钟总线, 具体可以釆用
RS-485差分信号传输到所述待同步节点。
由于釆用 RS-485差分信号传输实时时钟,因此可以支持长距离跨机拒间 的 BMC时间同步。
具体地, 所述时钟源节点的 CPLD将时钟同步信号, 具体可以为曼彻斯 特时钟信号, 发送到 RS-485接口芯片, 所述时钟同步信号通过 RS-485总线 传输到时间总线上的其他各个待同步节点。
S600、 所述待同步节点解码所述时钟同步信号获得所述时钟信号和所述 同步信号;
S700、 所述待同步节点在获得所述同步信号时, 将记录的所述时钟源节 点的日历时间加上所述第一预定时间间隔后作为所述待同步节点的日历时 间。
所述待同步节点接收到曼彻斯特编码的所述时钟同步信号后, 将该时钟 同步信号传输给该时钟总线设备的 CPLD进行解码, CPLD获得所述时钟信 号和所述同步信号, 所述时钟信号和所述同步信号可以是前文所述的 32768Hz时钟信号和 1Hz信号。
其中所述时钟信号作为待同步节点的实时时钟信号,用于统一时钟频率;
所述同步信号同时作为 BMC的外部中断触发信号, 用于实现时间的同步。 本发明实施例所述时间同步方法, 选择时钟总线上一个时间总线设备为 时钟源节点负责产生时钟同步信号; 所述时钟源节点广播日历时间; 待同步 节点记录所述日历时间; 所述时钟源节点在第一时间间隔发送所述时钟同步 信号到所述待同步节点; 所述待同步节点解码所述时钟同步信号获得所述同 步信号; 所述待同步节点在获得所述同步信号时, 将记录的所述时钟源节点 的日历时间加上所述第一预定时间间隔后作为所述待同步节点的日历时间。 由于同步信号的存在, 可以使得所述待同步节点将接收到的日历时间加上所 述第一预定时间间隔后作为该待同步节点的时钟信号, 从而实现同一时间总 线上的各个时间总线设备之间时间的精确同步, 为故障诊断等高级功能提供 支持, 提高系统可用性。
本发明实施例所述方法, 进一步还可以包括:
所述待同步节点将所述时钟信号作为自身的时钟信号。
时钟源节点会通过时钟总线向待同步节点持续地发送所述时钟同步信 号, 时钟同步信号中包括时钟信号和同步信号, 而待同步节点接收时钟源节 点的实时时钟同步信号, 获得其中的时钟信号, 作为自身的时钟信号用于统 一时钟频率。 从而实现了与时钟源节点的日历时间同步后, 进一步做到时钟 信号也与时钟源节点的时钟信号频率完全一致。
本发明实施例所述方法进一步可以实现同步时钟源的故障冗余, 当时钟 源出现故障时, 会选举一个时钟节点作为新的时钟源节点, 从而保证系统可 靠性。
所述选择时钟总线上一个时钟总线设备为时钟源节点, 所述时钟总线上 的其他时钟总线设备为待同步节点, 具体可以包括以下步骤:
当所述时钟总线上的时钟总线设备上电或所述时钟总线上所述时钟同步 信号丟失时, 所述时钟总线上的每个时钟总线设备检测是否收到所述时钟总 线上传递的所述时钟同步信号, 其中所述每个时钟总线设备从 1开始顺序编
号, 且所述每个时钟总线设备的编号不同;
若所述每个时钟总线设备中编号为 N的时钟总线设备在 N个时间间隔内 没有收到所述时钟同步信号, 则所述编号为 N的时钟总线设备设置自己为所 述时钟源节点;
若所述每个时钟总线设备中编号为 N的时钟总线设备在 N个时间间隔内 收到所述时钟同步信号, 则所述编号为 N的时钟总线设备设置自己为所述待 同步节点。
所述待同步节点发现总线时钟同步信号丟失后, 可以通知时间总线, 时 间总线通知作为所述时钟源节点的时钟总线设备关闭, 也可以通知设备管理 模块 DMS, 所述设备管理模块 DMS可以通过业务数据通道, 通知作为所述 时钟源节点的时钟总线设备关闭。 然后, 所述时钟总线上的除该时钟源节点 外的其他时间节点, 即所有作为待同步节点的时钟总线设备可以选举一个时 钟总线设备作为新的时钟源节点。
参见图 3 , 该图为本发明实施例的时间同步方法时序图。
本发明实施例的时间同步方法, 在所述时钟源节点产生时钟同步信号, 所述时钟同步信号包括时钟信号和同步信号的步骤后, 进一步可以包括以下 步骤:
所述时钟源节点在整秒开始时刻向所述待同步节点广播所述时钟源节点 的日历时间。
所述时钟源节点不是通过时间总线向待同步节点发送日历时间, 而是通 过广播的方式发送, 所述时钟源节点在整秒开始时刻具体是通过业务网络向 待同步节点广播日历时间。
所述日历时间精确到毫秒的时间, 例如: 2012/2/13 09:22:10:300» 由于日历时间的精度很高, 为提供高精度的日志时间同步提供了前提条 件。
所述待同步节点记录所述日历时间。
所述时钟源节点在下一整秒时刻将所述时钟同步信号通过所述时钟总线 传输到所述待同步节点;
所述待同步节点解码所述时钟同步信号获得所述时钟信号和所述同步信 号;
所述待同步节点获得所述同步信号即秒同步信号时, 所述待同步节点将 接收到的所述日历时间加一秒后作为所述待同步节点的日历时间即 CLK 时 间。
本发明实施例由于统一了所述时钟总线所有时间总线设备的日历时间, 因此可以保证各个待同步节点与时钟源节点的时钟信号是同一时刻, 且精确 到毫秒级。
本发明实施例所述时间同步方法中的时钟总线设备具体可以为基板管理 控制器。
参见图 4, 该图为本发明实施例的时间同步系统结构图。
本发明实施例的时间同步系统, 包括: 时钟源选取单元 11、 时钟同步信 号编码单元 12、 发送单元 13、 接收单元 15和时钟同步信号解码单元 14, 以 及统一日历时间单元。
时钟源选取单元 11 , 用于确定本时间同步系统是时钟源节点还是待同步 节点。
所述时钟源选取单元 11具体可以包括:
检测单元, 用于当本时间同步系统上电或所述时钟总线上所述时钟同步 信号丟失时, 检测是否收到所述时钟总线上传递的所述时钟同步信号;
确定单元, 用于根据检测单元的检测结果, 若在 N个时间间隔内没有收 到所述时钟同步信号, 则设置自己为所述时钟源节点; 若在 N个时隙内收到 所述时钟同步信号, 则设置自己为所述待同步节点, 所述 N为时钟总线设备 的编号, 其中所述每个时钟总线设备从 1开始顺序编号, 且所述每个时钟总 线设备的编号不同。
时钟同步信号产生单元 12 , 用于当所述时钟源选取单元确定本时间同步 系统是时钟源节点时, 产生时钟同步信号, 所述时钟同步信号包括时钟信号 和同步信号。
时钟同步信号产生单元 12 具体是将所述时钟信号和同步信号通过曼彻 斯特编码获得所述时钟同步信号。
发送单元 13 , 用于当所述时钟源选取单元确定本时间同步系统是时钟源 节点时, 将所述时钟同步信号产生单元产生的所述时钟同步信号通过所述时 钟总线传输到待同步节点;
接收单元 15 , 用于当所述时钟源选取单元确定本时间同步系统是待同步 节点时, 接收发送单元 13传输的时钟同步信号。
时钟同步信号解码单元 14 , 用于当所述时钟源选取单元确定本时间同步 系统是待同步节点时, 解码所述接收单元 15接收到的所述时钟同步信号, 获 得时钟信号和同步信号。
统一日历时间单元,用于统一时钟总线上各个时钟总线设备的日历时间。 所述统一日历时间单元具体包括:
时钟源节点广播单元, 用于当所述时钟源选取单元确定本时间同步系统 是所述时钟源节点时, 在第一时刻向所述待同步节点广播日历时间;
记录单元, 用于当所述时钟源选取单元确定本时间同步系统是所述待同 步节点时, 记录所述时钟源节点广播的所述时钟源节点的日历时间;
发送时刻控制单元, 用于当所述时钟源选取单元确定本时间同步系统是 所述时钟源节点时, 控制在第二时刻将所述时钟同步信号产生单元产生的所 述时钟同步信号通过所述时钟总线传输到所述待同步节点; 所述第二时刻与 所述第一时刻间隔第一预定时间间隔, 所述时钟同步信号包括时钟信号和同 步信号;
运算单元, 用于当所述时钟源选取单元确定本时间同步系统是所述待同 步节点所述时钟同步信号解码单元获得所述同步信号时, 将所述日历时间加
上第一预定时间间隔后作为所述待同步节点的日历时间即 CLK时间。
本发明实施例所述时间同步系统还可以进一步包括:
第一通知单元, 用于当所述时钟源选取单元确定本时间同步系统是待同 步节点时, 确定所述时钟同步信号丟失后, 通知设备管理模块关闭所述时钟 源节点。
当所述时钟源节点关闭时, 所述时钟源选取单元 11 , 从所述时钟总线上 的作为所述待同步节点的时间总线设备中选举一个时间总线设备作为新的时 钟源节点。
本所提供的时间同步方法和系统, 除了可以用于容错计算机 BMC之间 的实时时钟同步外,也同样可以用于其他嵌入式系统中各个节点的时钟同步。 特别对于那些通过 I2C、 串口等低速总线连接的设备, 由于使用软件时钟同 步协议会带来较大的精度偏差, 在这类应用场合本方案可以提供一种完善的 的时钟同步方案。
以上对本发明所提供的时间同步方法和系统, 进行了详细介绍, 本文中 只是用于帮助理解本发明方法及其核心思想; 同时, 对于本领域的一般技术 人员, 依据本发明的思想, 在具体实施方式及应用范围上均会有改变之处。 综上所述, 本说明书内容不应理解为对本发明的限制。
Claims
1、 一种时间同步方法, 其特征在于, 所述方法包括:
选择时钟总线上一个时钟总线设备为时钟源节点, 所述时钟总线上的 其他时钟总线设备为待同步节点;
所述时钟源节点在第一时刻向所述待同步节点广播所述时钟源节点 的日历时间;
所述待同步节点记录所述时钟源节点的日历时间;
所述时钟源节点在第二时刻将时钟同步信号通过所述时钟总线传输 到所述待同步节点, 所述第二时刻与所述第一时刻间隔第一预定时间间 隔, 所述时钟同步信号为时钟源节点产生的, 包括时钟信号和同步信号; 所述待同步节点解码所述时钟同步信号获得所述时钟信号和所述同 步信号;
所述待同步节点在获得所述同步信号时, 将记录的所述时钟源节点的 日历时间加上所述第一预定时间间隔后作为所述待同步节点的日历时间。
2、 根据权利要求 1 所述的时间同步方法, 其特征在于, 所述方法还 包括:
所述待同步节点将所述时钟信号作为自身的时钟信号。
3、 根据权利要求 2 所述的时间同步方法, 其特征在于, 所述时钟源 节点将所述时钟同步信号通过所述时钟总线传输到所述待同步节点, 具体 为: 所述时钟源节点将所述时钟同步信号通过所述时钟总线釆用 RS-485 差分信号传输到所述待同步节点。
4、 根据权利要求 1 至 3任一项所述的时间同步方法, 其特征在于, 所述时钟同步信号是将所述时钟信号和所述同步信号通过曼彻斯特编码 获得。
5、 根据权利要求 1 至 3任一项所述的时间同步方法, 其特征在于, 所述选择时钟总线上一个时钟总线设备为时钟源节点, 所述时钟总线上的
其他时钟总线设备为待同步节点, 包括以下步骤:
当所述时钟总线上的时钟总线设备上电或所述时钟总线上所述时钟 同步信号丟失时, 所述时钟总线上的每个时钟总线设备检测是否收到所述 时钟总线上传递的所述时钟同步信号, 其中所述每个时钟总线设备从 1开 始顺序编号, 且所述每个时钟总线设备的编号不同;
若所述每个时钟总线设备中编号为 N的时钟总线设备在 N个时间间 隔内没有收到所述时钟同步信号,则所述编号为 N的时钟总线设备设置自 己为所述时钟源节点;
若所述每个时钟总线设备中编号为 N的时钟总线设备在 N个时隙内 收到所述时钟同步信号,则所述编号为 N的时钟总线设备设置自己为所述 待同步节点。
6、 根据权利要求 1 至 3任一项所述的时间同步方法, 其特征在于, 所述方法进一步包括:
所述待同步节点确定所述时钟同步信号丟失后, 通知设备管理模块; 所述设备管理模块通知所述时钟源节点关闭。
7、 根据权利要求 1 至 3任一项所述的时间同步系统, 其特征在于, 所述时钟总线设备具体为基板管理控制器。
8、 一种时间同步系统, 其特征在于, 所述系统包括:
时钟源选取单元, 用于确定本时间同步系统是时钟源节点还是待同步 节点; 系统是时钟源节点时, 产生时钟同步信号, 所述时钟同步信号包括时钟信 号和同步信号;
节点时, 将所述时钟同步信号产生单元产生的所述时钟同步信号通过所述 时钟总线传输到待同步节点;
节点时, 接收时钟源节点通过所述时钟总线传输的时钟同步信号; 系统是待同步节点时, 解码所述接收单元接收到的所述时钟同步信号, 获 得时钟信号和同步信号;
统一日历时间单元, 用于统一时钟总线上各个时钟总线设备的日历时 间;
所述统一日历时间单元进一步包括: 统是所述时钟源节点时, 在第一时刻向所述待同步节点广播日历时间; 同步节点时, 记录所述时钟源节点广播的所述时钟源节点的日历时间; 是所述时钟源节点时, 控制在第二时刻将所述时钟同步信号产生单元产生 的所述时钟同步信号通过所述时钟总线传输到所述待同步节点; 所述第二 时刻与所述第一时刻间隔第一预定时间间隔, 所述时钟同步信号包括时钟 信号和同步信号; 同步节点且所述时钟同步信号解码单元获得所述同步信号时, 将所述记录 单元记录的所述日历时间加上第一预定时间间隔后作为所述待同步节点 的日历时间。
9、 根据权利要求 8 所述的时间同步系统, 其特征在于, 所述时钟同 步信号编码单元是将所述时钟信号和同步信号通过曼彻斯特编码获得所 述第一时钟同步信号。
10、 根据权利要求 8或 9所述的时间同步系统, 其特征在于, 所述时 钟源选取单元包括:
检测单元 , 用于当本时间同步系统上电或所述时钟总线上所述时钟同 步信号丟失时, 检测是否收到所述时钟总线上传递的所述时钟同步信号; 确定单元, 用于根据检测单元的检测结果, 若在 Ν个时间间隔内没有 收到所述时钟同步信号, 则设置自己为所述时钟源节点, 若在 Ν个时隙内 收到所述时钟同步信号, 则设置自己为所述待同步节点, 所述 Ν为时钟总 线设备的编号, 其中所述每个时钟总线设备从 1开始顺序编号, 且所述每 个时钟总线设备的编号不同。
11、 根据权利要求 8或 9所述的时间同步系统, 其特征在于, 所述系 统进一步包括: 同步节点时, 确定所述时钟同步信号丟失后, 通知设备管理模块关闭所述 时钟源节点。
12、 根据权利要求 8或 9所述的时间同步系统, 其特征在于, 所述系 统具体为基板管理控制器。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210222784.3 | 2012-06-29 | ||
CN201210222784.3A CN102752065B (zh) | 2012-06-29 | 2012-06-29 | 一种时间同步方法及系统 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2014000434A1 true WO2014000434A1 (zh) | 2014-01-03 |
Family
ID=47031987
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2013/070459 WO2014000434A1 (zh) | 2012-06-29 | 2013-01-15 | 一种时间同步方法及系统 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN102752065B (zh) |
WO (1) | WO2014000434A1 (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9276900B1 (en) | 2015-03-19 | 2016-03-01 | Igneous Systems, Inc. | Network bootstrapping for a distributed storage system |
US9305666B2 (en) | 2014-05-07 | 2016-04-05 | Igneous Systems, Inc. | Prioritized repair of data storage failures |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102752065B (zh) * | 2012-06-29 | 2015-09-09 | 华为技术有限公司 | 一种时间同步方法及系统 |
CN104978301B (zh) * | 2014-04-09 | 2019-08-13 | Nxp股份有限公司 | 基于i2c总线协议的双线差分总线收发系统及i2c双线差分通讯方法 |
CN104978291B (zh) * | 2014-04-09 | 2019-10-22 | Nxp股份有限公司 | 基于i2c总线协议的单线接口总线收发系统系统及i2c单线通讯方法 |
CN104597878A (zh) * | 2014-12-31 | 2015-05-06 | 重庆川仪自动化股份有限公司 | 工业控制系统的控制器时间同步方法 |
CN107295624B (zh) * | 2016-03-30 | 2021-11-26 | 日本电气株式会社 | 节点同步方法和采用该方法的节点 |
CN108599916A (zh) * | 2018-05-10 | 2018-09-28 | 烽火通信科技股份有限公司 | 一种集群内部时钟布线系统及时钟同步方法 |
CN111831054B (zh) * | 2019-04-19 | 2022-07-19 | 北京猎户星空科技有限公司 | 一种异步系统时钟同步方法、装置、系统和存储介质 |
CN112821976B (zh) * | 2020-12-31 | 2023-03-24 | 锐捷网络股份有限公司 | 一种本地时钟同步的保持方法及装置 |
CN113726466B (zh) * | 2021-07-21 | 2023-12-01 | 歌尔股份有限公司 | 一种可穿戴设备及其信号采集方法 |
CN116300381A (zh) * | 2022-12-30 | 2023-06-23 | 惠州市德赛西威汽车电子股份有限公司 | 汽车座舱系统高精度时授时实现方法、系统及存储介质 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1022857A2 (en) * | 1999-01-25 | 2000-07-26 | Sun Microsystems, Inc. | Phase locked loop and method that provide fail-over redundant clocking |
CN101394264A (zh) * | 2007-09-21 | 2009-03-25 | 华为技术有限公司 | 周期性报文传递的监控方法及装置 |
CN102291232A (zh) * | 2011-09-01 | 2011-12-21 | 中兴通讯股份有限公司 | 一种时钟同步方法及装置 |
CN102752065A (zh) * | 2012-06-29 | 2012-10-24 | 华为技术有限公司 | 一种时间同步方法及系统 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6981063B1 (en) * | 1999-01-19 | 2005-12-27 | Siemens Aktiengesellschaft | Method for time synchronization of a computer network, and computer network with time synchronization |
US7197657B1 (en) * | 2003-04-03 | 2007-03-27 | Advanced Micro Devices, Inc. | BMC-hosted real-time clock and non-volatile RAM replacement |
CN1584757A (zh) * | 2004-05-21 | 2005-02-23 | 杨桂臣 | 自动校准同步计时定时器 |
CN100527661C (zh) * | 2006-09-21 | 2009-08-12 | 华为技术有限公司 | 一种实现多时钟同步的方法及系统 |
CN100440805C (zh) * | 2006-11-06 | 2008-12-03 | 华为技术有限公司 | 一种atca中jtag器件远程维护的方法及系统 |
-
2012
- 2012-06-29 CN CN201210222784.3A patent/CN102752065B/zh not_active Expired - Fee Related
-
2013
- 2013-01-15 WO PCT/CN2013/070459 patent/WO2014000434A1/zh active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1022857A2 (en) * | 1999-01-25 | 2000-07-26 | Sun Microsystems, Inc. | Phase locked loop and method that provide fail-over redundant clocking |
CN101394264A (zh) * | 2007-09-21 | 2009-03-25 | 华为技术有限公司 | 周期性报文传递的监控方法及装置 |
CN102291232A (zh) * | 2011-09-01 | 2011-12-21 | 中兴通讯股份有限公司 | 一种时钟同步方法及装置 |
CN102752065A (zh) * | 2012-06-29 | 2012-10-24 | 华为技术有限公司 | 一种时间同步方法及系统 |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9305666B2 (en) | 2014-05-07 | 2016-04-05 | Igneous Systems, Inc. | Prioritized repair of data storage failures |
US9276900B1 (en) | 2015-03-19 | 2016-03-01 | Igneous Systems, Inc. | Network bootstrapping for a distributed storage system |
Also Published As
Publication number | Publication date |
---|---|
CN102752065A (zh) | 2012-10-24 |
CN102752065B (zh) | 2015-09-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2014000434A1 (zh) | 一种时间同步方法及系统 | |
CN103856360B (zh) | 一种同步链路故障检测方法及装置 | |
CA2675644C (en) | Facilitating recovery in a coordinated timing network | |
US7783736B2 (en) | Definition of an active stratum-1 server in a coordinated timing network | |
US9112626B2 (en) | Employing configuration information to determine the role of a server in a coordinated timing network | |
WO2017118148A1 (zh) | 适用于时间同步网的快速部署系统及方法 | |
JP2014520419A (ja) | 高可用性グランド・マスタ・クロックを実装するためのネットワークおよび方法 | |
JP5120097B2 (ja) | 時間同期システムおよび時間同期装置 | |
WO2016106908A1 (zh) | 一种sdh网络中的时钟同步方法及系统 | |
US9007889B2 (en) | Communication device and communication system with failure detection capabilities | |
KR20190002906A (ko) | PTP(precision time protocol) 시스템에서의 시간 동기 장애 복구 방법 및 그 장치 | |
US20050172167A1 (en) | Communication fault containment via indirect detection | |
JP2008017070A (ja) | ネットワーク装置及びそれに用いる冗長切替え方法並びにそのプログラム | |
KR20240145447A (ko) | Ptp 네트워크에서 마스터 클락 오류 시 시각 동기화 장치 | |
MacKay et al. | A novel approach to the adaptation of PTP to an NTP network | |
CN118826935A (zh) | 时间同步故障处理方法、装置、电子设备及存储介质 | |
JP2011120184A (ja) | データ伝送装置及びデータ伝送方法 | |
JPWO2008050456A1 (ja) | コンピュータシステム、データ中継装置およびコンピュータシステム制御方法 | |
JPH08137711A (ja) | Ras機構 |
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: 13810565 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: 13810565 Country of ref document: EP Kind code of ref document: A1 |