JP2012204912A - Clock synchronization device and clock synchronization method - Google Patents

Clock synchronization device and clock synchronization method Download PDF

Info

Publication number
JP2012204912A
JP2012204912A JP2011065457A JP2011065457A JP2012204912A JP 2012204912 A JP2012204912 A JP 2012204912A JP 2011065457 A JP2011065457 A JP 2011065457A JP 2011065457 A JP2011065457 A JP 2011065457A JP 2012204912 A JP2012204912 A JP 2012204912A
Authority
JP
Japan
Prior art keywords
packet
clock
synchronization
transmission
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2011065457A
Other languages
Japanese (ja)
Inventor
Shinichiro Matsui
伸一郎 松井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics Corp
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 Renesas Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2011065457A priority Critical patent/JP2012204912A/en
Publication of JP2012204912A publication Critical patent/JP2012204912A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

PROBLEM TO BE SOLVED: To solve the following problem: in executing clock synchronization using PTP defined in IEEE1588, a traffic of the whole network increases as a result of a synchronization packet being frequently transmitted onto the network by multi-cast.SOLUTION: A clock synchronization device includes: reception means of receiving clock fluctuation information that is information about clock fluctuations; determination means of determining a transmission interval of a synchronization packet transmitted to a transmission source of the clock fluctuation information based on the clock fluctuation information; generation means of generating a synchronization packet; and transmission means of transmitting the generated synchronization packet to the transmission source of the clock fluctuation information at the determined transmission interval.

Description

本発明はクロック同期装置及びクロック同期方法に関し、特に同期用通信の調整機能を有するクロック同期装置及びクロック同期方法に関する。   The present invention relates to a clock synchronization apparatus and a clock synchronization method, and more particularly to a clock synchronization apparatus and a clock synchronization method having a synchronization communication adjustment function.

ネットワークにつながるノード間で時刻の同期をとる方式の代表的なものとして、IEEE1588の規格で定められているPrecision Timer Protocol(以下PTPと称す)を用いる方式がある。当該PTPを用いた同期方法は、非特許文献1に具体的に開示されている。   As a representative method for synchronizing time between nodes connected to a network, there is a method using a Precision Timer Protocol (hereinafter referred to as PTP) defined in the IEEE 1588 standard. The synchronization method using the PTP is specifically disclosed in Non-Patent Document 1.

PTPでは、各スレーブは、自分の時計の針が進む速さ(内部タイマのカウントアップ・スピード)をマスタに合わせるため、Phase Change Rate(位相変化率、以下Driftと称す)と呼ばれる手法を用いる。図10に、上記PTPにおけるDrift調整手順を示す。   In PTP, each slave uses a technique called Phase Change Rate (phase change rate, hereinafter referred to as Drift) in order to adjust the speed at which its clock hand advances (the count-up speed of the internal timer) to the master. FIG. 10 shows the Drift adjustment procedure in the PTP.

まず、マスタが同期用パケット1(以下、Syncと称す)を各スレーブへマルチキャストで送信し、送信した時間(t0 k)を記憶する(1)。 各スレーブは、Syncを受信した時間(t1 k)を記憶する(2)。マスタが同期用パケット2(以下、Follow_upと称す)に、t0 kをのせて各スレーブにマルチキャストで送信する(3)。各スレーブは、受信したFollow_upパケット内に含まれるt0 kを取得する(4)。マスタが一定間隔を空けてSyncを再度送信し、送信した時間(t0 k+1)を記憶する(5)。各スレーブは、Syncを受信した時間(t1 k+1)を記憶する(6)。マスタがFollow_upにt0 k+1をのせて再送信する(7)。各スレーブは、受信したFollow_upパケット内に含まれるt0 k+1を取得する(8)。 First, the master transmits a synchronization packet 1 (hereinafter referred to as Sync) to each slave by multicast, and stores the transmission time (t 0 k ) (1). Each slave stores the time (t 1 k ) at which the Sync is received (2). The master puts t 0 k on the synchronization packet 2 (hereinafter referred to as Follow_up) and transmits it to each slave by multicast (3). Each slave acquires t 0 k included in the received Follow_up packet (4). The master transmits Sync again at regular intervals, and stores the transmission time (t 0 k + 1 ) (5). Each slave stores the time (t 1 k + 1 ) at which the Sync is received (6). The master transmits t 0 k + 1 in Follow_up and retransmits (7). Each slave acquires t 0 k + 1 included in the received Follow_up packet (8).

図11に、ネッワークにつながるマスタと各スレーブとの同期用パケットの流れを示す。マスタから全スレーブへ、同期用パケット(Sync、Follow_up)がマルチキャストで送信される。   FIG. 11 shows a flow of synchronization packets between the master and each slave connected to the network. A synchronization packet (Sync, Follow_up) is transmitted by multicast from the master to all slaves.

各スレーブは、上記手順により取得したt0 k、t0 k+1、t1 k、t1 k+1の4値からDrift = (Δ1-Δ0)/Δ0 を算出する。ここで、Δ0=t0 k+1 − t0 kであり、Δ1=t1 k+1 − t1 k である。各スレーブはDrift値が0になるよう自分の内部タイマを調整する。 Each slave calculates Drift = (Δ1−Δ0) / Δ0 from the four values t 0 k , t 0 k + 1 , t 1 k , and t 1 k + 1 acquired by the above procedure. Here, Δ0 = t 0 k + 1 −t 0 k and Δ1 = t 1 k + 1 −t 1 k . Each slave adjusts its internal timer so that the Drift value is zero.

なお、各スレーブの内部タイマの調整方法について、物理的に変動する発振器を制御することはできないため、実際には、内部タイマのカウント値を一定時間毎に調整する。例えば、Drift値を算出した結果、Drift=0.1の場合には、当該スレーブは、内部タイマが10カウントアップする毎にカウント値を−1する(時計の針を巻き戻す)。また、Drift=-0.1の場合には当該スレーブは、タイマが10カウントアップする毎にカウント値を+1する(時計の針を進める)。   As for the adjustment method of the internal timer of each slave, the oscillator that physically fluctuates cannot be controlled, so in practice, the count value of the internal timer is adjusted at regular intervals. For example, when the drift value is calculated and Drift = 0.1, the slave decrements the count value by 10 every time the internal timer counts up (rewinds the clock hands). If Drift = −0.1, the slave increments the count value by 1 (the clock hand is advanced) every time the timer counts up by 10.

「IEEE Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems」 IEEE Std 1588.-2008IEEE Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems IEEE Std 1588.-2008

上記非特許文献1で規定されているPTPの場合、同期用パケット(Sync、Follow_up)の送信間隔は、各スレーブのクロック変動、およびシステムに要求される同期精度に基づいて、0.125、0.25、0.5、1、2、8、16、64秒のいずれかから予め選択される。このため、クロック変動が大きいスレーブが1台でもあれば、ワーストケースで125ms毎にマスタからマルチキャストで全スレーブへ同期用パケットが送信されることになる。   In the case of PTP defined in Non-Patent Document 1, the transmission interval of synchronization packets (Sync, Follow_up) is 0.125, 0.25, 0.5 based on the clock fluctuation of each slave and the synchronization accuracy required for the system. , 1, 2, 8, 16, or 64 seconds. For this reason, if there is even one slave with a large clock fluctuation, a synchronization packet is transmitted from the master to all slaves by multicast every 125 ms in the worst case.

従って、同期用パケットがネットワーク上に頻繁にマルチキャストで送信されることにより、ネットワーク全体のトラフィックが増加するという問題が生じていた。   Therefore, there has been a problem that traffic of the entire network increases due to frequent multicast packets being transmitted over the network by multicast.

本発明のクロック同期装置は、クロック変動に関する情報であるクロック変動情報を受信する受信手段と、前記クロック変動情報に基づいて、前記クロック変動情報の送信元へ送信する同期用パケットの送信間隔を決定する決定手段と、同期用パケットを生成する生成手段と、前記生成した同期用パケットを、前記決定された送信間隔で前記クロック変動情報の送信元へ送信する送信手段と、を具備する。当該構成により、スレーブ側でのクロック変動に応じて適切に同期用パケットの送信間隔を決定することができ、ネットワークに流れる同期用パケットの量を軽減することができる。   The clock synchronization device of the present invention determines a transmission interval of a synchronization packet to be transmitted to a transmission source of the clock fluctuation information based on the clock fluctuation information, receiving means for receiving clock fluctuation information which is information relating to clock fluctuation. Determination means for generating, generation means for generating a synchronization packet, and transmission means for transmitting the generated synchronization packet to the transmission source of the clock fluctuation information at the determined transmission interval. With this configuration, the transmission interval of synchronization packets can be appropriately determined according to clock fluctuations on the slave side, and the amount of synchronization packets flowing through the network can be reduced.

また、本発明のクロック同期装置は、同期用パケットを受信する受信手段と、前記受信手段で受信した同期用パケットの受信タイミングを検出する検出手段と、前記受信された同期用パケットに含まれる送信タイミング情報と、前記検出された受信タイミングとに基づいて、ドリフト値を計算する計算手段と、前記ドリフト値に基づいてクロック変動に関する情報を算出する算出手段と、前記算出されたクロック変動に関する情報を含めてパケットを生成する生成手段と、前記生成されたパケットを送信する送信手段と、を具備する。当該構成により、自装置のクロック変動に関する情報をフィードバックすることで、マスタ側では適切な同期用パケット送信間隔を決定することができ、ネットワークに流れる同期用パケットの量を軽減することができる。   The clock synchronization apparatus of the present invention includes a receiving unit that receives a synchronization packet, a detection unit that detects a reception timing of the synchronization packet received by the receiving unit, and a transmission included in the received synchronization packet. Calculation means for calculating a drift value based on timing information and the detected reception timing; calculation means for calculating information on clock fluctuation based on the drift value; and information on the calculated clock fluctuation. And generating means for generating a packet including the transmitting means for transmitting the generated packet. With this configuration, it is possible to determine an appropriate synchronization packet transmission interval on the master side by feeding back information related to the clock fluctuation of the own device, and to reduce the amount of synchronization packets flowing through the network.

また、本発明のクロック同期方法は、クロック変動に関する情報であるクロック変動情報を受信し、前記クロック変動情報に基づいて、前記クロック変動情報の送信元へ送信する同期用パケットの送信間隔を決定し、同期用パケットを生成し、前記生成した同期用パケットを、前記決定した送信間隔で前記クロック変動情報の送信元へ送信する。当該クロック同期方法によれば、スレーブ側でのクロック変動に応じて適切に同期用パケットの送信間隔を決定することができ、ネットワークに流れる同期用パケットの量を軽減することができる。   The clock synchronization method of the present invention receives clock fluctuation information that is information relating to clock fluctuation, and determines a transmission interval of a synchronization packet to be transmitted to a transmission source of the clock fluctuation information based on the clock fluctuation information. Then, a synchronization packet is generated, and the generated synchronization packet is transmitted to the transmission source of the clock fluctuation information at the determined transmission interval. According to the clock synchronization method, the transmission interval of the synchronization packet can be appropriately determined according to the clock fluctuation on the slave side, and the amount of the synchronization packet flowing through the network can be reduced.

また、本発明のクロック同期方法は、同期用パケットを受信し、前記受信した同期用パケットの受信タイミングを検出し、前記受信した同期用パケットに含まれる送信タイミング情報と前記検出した受信タイミングとに基づいてドリフト値を計算し、前記ドリフト値に基づいてクロック変動に関する情報を算出し、前記算出したクロック変動に関する情報を含めてパケットを生成し、前記生成したパケットを送信する。当該クロック同期方法によれば、クロック変動に関する情報をフィードバックすることで、マスタ側で適切な同期用パケット送信間隔を決定することができ、ネットワークに流れる同期用パケットの量を軽減することができる。   In the clock synchronization method of the present invention, the synchronization packet is received, the reception timing of the received synchronization packet is detected, and the transmission timing information included in the received synchronization packet and the detected reception timing are detected. A drift value is calculated based on the information, clock fluctuation information is calculated based on the drift value, a packet including the calculated clock fluctuation information is generated, and the generated packet is transmitted. According to the clock synchronization method, an appropriate synchronization packet transmission interval can be determined on the master side by feeding back information on clock fluctuation, and the amount of synchronization packets flowing in the network can be reduced.

本発明によれば、同期用パケットがネットワーク上に頻繁にマルチキャストで送信されることを抑制することができるため、ネットワーク全体のトラフィックを軽減することができる。     According to the present invention, since the synchronization packet can be suppressed from being frequently transmitted by multicast on the network, the traffic of the entire network can be reduced.

実施の形態1にかかるマスタ装置のブロック図である。1 is a block diagram of a master device according to a first embodiment; 実施の形態1にかかるスレーブ装置のブロック図である。1 is a block diagram of a slave device according to a first embodiment; 実施の形態1にかかるクロック同期方法のシーケンス図である。FIG. 3 is a sequence diagram of a clock synchronization method according to the first exemplary embodiment. 実施の形態1にかかる同期用パケットの流れを示した概念図である。FIG. 3 is a conceptual diagram showing a flow of a synchronization packet according to the first embodiment. 実施の形態1にかかる同期用パケットの流れを示した概念図である。FIG. 3 is a conceptual diagram showing a flow of a synchronization packet according to the first embodiment. 実施の形態1にかかるクロック変動量と同期用通信タイミングとの関係を示した概念図である。FIG. 3 is a conceptual diagram illustrating a relationship between a clock fluctuation amount and synchronization communication timing according to the first exemplary embodiment; 実施の形態1にかかるクロック変動量と同期用通信タイミングとの関係を示した概念図である。FIG. 3 is a conceptual diagram illustrating a relationship between a clock fluctuation amount and synchronization communication timing according to the first exemplary embodiment; 実施の形態2にかかるスレーブ装置のブロック図である。FIG. 3 is a block diagram of a slave device according to a second embodiment. 実施の形態2にかかるマスタ装置のブロック図である。FIG. 3 is a block diagram of a master device according to a second embodiment. 背景技術にかかるクロック同期方法のシーケンス図である。It is a sequence diagram of the clock synchronization method concerning background art. 背景技術にかかる同期用パケットの流れを示した概念図である。It is the conceptual diagram which showed the flow of the packet for a synchronization concerning background art.

まず、本発明の概要について説明する。本発明のシステムでは、マスタとスレーブがネットワークで接続されている。マスタは、同期用パケットを送信し、スレーブは、受信した同期用パケットに基づいて内部タイマを調整する。さらに、本発明のシステムでは、スレーブは自分のクロック変動を把握し、当該クロック変動に関する情報(以下、クロック変動情報と称す)をマスタへ通知する。マスタは、受信した当該クロック変動情報に基づいて、適切な同期通信方法(送信アドレス、通信間隔等)を動的に選択した上で同期用パケットをスレーブに送信する。当該構成により、ネットワークのトラフィックを軽減し、また、各スレーブのCPU負荷を軽減することができる。以下、本発明の実施の形態について具体的に説明する。   First, an outline of the present invention will be described. In the system of the present invention, a master and a slave are connected via a network. The master transmits a synchronization packet, and the slave adjusts an internal timer based on the received synchronization packet. Further, in the system of the present invention, the slave grasps its own clock fluctuation and notifies the master of information related to the clock fluctuation (hereinafter referred to as clock fluctuation information). The master dynamically selects an appropriate synchronous communication method (transmission address, communication interval, etc.) based on the received clock fluctuation information, and transmits a synchronization packet to the slave. With this configuration, network traffic can be reduced and the CPU load on each slave can be reduced. Hereinafter, embodiments of the present invention will be specifically described.

(実施の形態1)
以下、図面を参照して本発明の実施の形態について説明する。図1に、本実施の形態1にかかる同期システムを構成するマスタ装置100のブロック図を示す。
(Embodiment 1)
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 shows a block diagram of a master device 100 constituting the synchronization system according to the first embodiment.

マスタ装置100は、パケット受信部110と、送信間隔制御部120と、送信アドレス制御部130と、発振器140と、内部タイマ150と、送信タイミング検出部160と、パケット生成部170と、パケット送信部180と、から構成される。   The master device 100 includes a packet receiving unit 110, a transmission interval control unit 120, a transmission address control unit 130, an oscillator 140, an internal timer 150, a transmission timing detection unit 160, a packet generation unit 170, and a packet transmission unit. 180.

パケット受信部110は、各スレーブから送信されるクロック変動に関する情報を含むパケットを受信する。ここで、クロック変動に関する情報とは、例えばクロック変動量などがある。以下、受信するクロック変動に関する情報はクロック変動量であるとして説明する。   The packet receiving unit 110 receives a packet including information regarding clock fluctuation transmitted from each slave. Here, the information regarding the clock fluctuation includes, for example, a clock fluctuation amount. Hereinafter, description will be made assuming that the received clock fluctuation information is the clock fluctuation amount.

パケット受信部110は、受信した上記パケットに含まれるクロック変動量を、送信間隔制御部120及び送信アドレス制御部130へ出力する。また、パケット受信部110は、当該クロック変動量の送信元スレーブを特定するために、受信した上記パケットの送信元アドレスも合わせて送信間隔制御部120及び送信アドレス制御部130へ出力する。   The packet receiving unit 110 outputs the clock fluctuation amount included in the received packet to the transmission interval control unit 120 and the transmission address control unit 130. In addition, the packet receiving unit 110 also outputs the transmission source address of the received packet to the transmission interval control unit 120 and the transmission address control unit 130 in order to specify the transmission source slave of the clock fluctuation amount.

送信間隔制御部120は、パケット受信部110から入力した上記クロック変動量に基づいて、当該情報の送信元であるスレーブに対する同期用パケットの送信間隔を決定する。同期用パケットの送信間隔としては、予め複数の送信間隔が定められている。送信間隔制御部120は、入力した上記クロック変動に関する情報に基づいて、上記定められている送信間隔の中から適切な送信間隔を選択することで、同期用パケットの送信間隔を決定する。例えば、入力したクロック変動量が所定の基準値よりも大きい場合には、送信間隔制御部120は、同期用パケットの送信間隔を短く設定する。   Based on the clock fluctuation amount input from the packet receiver 110, the transmission interval controller 120 determines the transmission interval of the synchronization packet for the slave that is the transmission source of the information. A plurality of transmission intervals are determined in advance as the transmission intervals of the synchronization packets. The transmission interval control unit 120 determines the transmission interval of the synchronization packet by selecting an appropriate transmission interval from the determined transmission intervals based on the input information regarding the clock fluctuation. For example, when the input clock fluctuation amount is larger than a predetermined reference value, the transmission interval control unit 120 sets the transmission interval of the synchronization packet to be short.

送信アドレス制御部130は、パケット受信部110から入力した上記クロック変動量に基づいて、当該クロック変動量の送信元であるスレーブに対する同期用パケットの送信方式(マルチキャストかユニキャスト)を選択する。例えば、入力したクロック変動量が所定の基準値よりも大きい場合には、送信アドレス制御部130は、当該クロック変動量の送信元に対する同期用パケットの送信方式としてユニキャストを選択する。送信アドレス制御部130は、選択した送信方式を送信アドレス情報としてパケット生成部170へ出力する。   Based on the clock fluctuation amount input from the packet receiver 110, the transmission address control unit 130 selects a transmission method (multicast or unicast) of the synchronization packet for the slave that is the transmission source of the clock fluctuation amount. For example, when the input clock fluctuation amount is larger than a predetermined reference value, the transmission address control unit 130 selects unicast as the transmission method of the synchronization packet for the transmission source of the clock fluctuation amount. The transmission address control unit 130 outputs the selected transmission method to the packet generation unit 170 as transmission address information.

発振器140は、内部タイマ150のソースクロックを生成する発振器であり、一定の周波数を有するクロック信号を発生させて内部タイマ150に出力する。発振器140は、例えばインダクタンスとキャパシタを組み合わせたLC発振器や、抵抗とキャパシタを組み合わせたRC発振器、水晶を用いた水晶発振器などで構成される。   The oscillator 140 is an oscillator that generates a source clock of the internal timer 150, generates a clock signal having a certain frequency, and outputs the clock signal to the internal timer 150. The oscillator 140 includes, for example, an LC oscillator that combines an inductance and a capacitor, an RC oscillator that combines a resistor and a capacitor, a crystal oscillator that uses a crystal, and the like.

内部タイマ150は、発振器140からクロック信号を入力し、当該クロック信号をカウントしてカウント値を生成する。生成したカウント値は、送信タイミング検出部160に出力される。   The internal timer 150 receives a clock signal from the oscillator 140 and counts the clock signal to generate a count value. The generated count value is output to the transmission timing detection unit 160.

送信タイミング検出部160は、パケット送信部180から送信される同期用パケットの送信タイミングを検出する。より具体的には、パケット送信部180が送信する同期用パケットのうち、Syncパケットの送信タイミングを検出する。送信タイミング検出部160は、内部タイマ150よりカウント値を入力し、パケット送信部180がSyncパケットを送信した時点におけるカウント値を求める。送信タイミング検出部160は、当該求めたカウント値を同期用パケットの送信タイミングを示す送信タイミング情報としてパケット生成部170へ出力する。   The transmission timing detection unit 160 detects the transmission timing of the synchronization packet transmitted from the packet transmission unit 180. More specifically, among the synchronization packets transmitted by the packet transmission unit 180, the transmission timing of the Sync packet is detected. The transmission timing detection unit 160 receives the count value from the internal timer 150 and obtains the count value when the packet transmission unit 180 transmits the Sync packet. The transmission timing detection unit 160 outputs the obtained count value to the packet generation unit 170 as transmission timing information indicating the transmission timing of the synchronization packet.

パケット生成部170は、同期用パケットを生成する。同期用パケットにはSyncパケットとFollow_upパケットの2種類のパケットを生成する。Syncパケットは、マスタとスレーブにおけるクロックのずれを検出するために送信される検出用パケットであり、ヘッダに当該パケットがSyncパケットであることを示す識別子が付されている。一方、Follow_upパケットは、Syncパケットの後に生成されるパケットであり、Follow_upパケットは、当該Syncパケットがパケット送信部180から送信された送信タイミングに関する情報を含む。パケット生成部170は、送信タイミング検出部160から出力される送信タイミング情報を入力し、当該送信タイミング情報を格納してFollow_upパケットを生成する。パケット生成部170は、送信アドレス制御部130で選択された送信方法に基づいて、パケットの送信先アドレスをユニキャストアドレス又はマルチキャストアドレスのいずれかから選択して同期用パケットを生成し、生成した同期用パケットをパケット送信部180に出力する。   The packet generator 170 generates a synchronization packet. Two types of packets, a Sync packet and a Follow_up packet, are generated as the synchronization packet. The Sync packet is a detection packet transmitted to detect a clock shift between the master and the slave, and an identifier indicating that the packet is a Sync packet is attached to the header. On the other hand, the Follow_up packet is a packet generated after the Sync packet, and the Follow_up packet includes information related to the transmission timing at which the Sync packet is transmitted from the packet transmission unit 180. The packet generation unit 170 receives the transmission timing information output from the transmission timing detection unit 160, stores the transmission timing information, and generates a Follow_up packet. Based on the transmission method selected by the transmission address control unit 130, the packet generation unit 170 selects a packet destination address from either a unicast address or a multicast address, generates a synchronization packet, and generates the generated synchronization The packet is output to the packet transmitter 180.

パケット送信部180は、送信間隔制御部120から指定される送信間隔で、パケット生成部170から入力した同期用パケットを各スレーブへ送信する。この時、同期用パケットの送信先アドレスがユニキャストアドレスであれば、当該同期用パケットは、ユニキャスト方式でパケット送信部180より送信される。一方、同期用パケットの送信先アドレスがマルチキャストアドレスであれば、当該同期用パケットはマルチキャスト方式でパケット送信部180より送信される。   The packet transmission unit 180 transmits the synchronization packet input from the packet generation unit 170 to each slave at the transmission interval specified by the transmission interval control unit 120. At this time, if the transmission destination address of the synchronization packet is a unicast address, the synchronization packet is transmitted from the packet transmission unit 180 in a unicast manner. On the other hand, if the transmission destination address of the synchronization packet is a multicast address, the synchronization packet is transmitted from the packet transmission unit 180 in a multicast manner.

次に、本実施の形態1にかかる同期システムを構成するスレーブ装置200について説明する。図2に、当該スレーブ装置200のブロック図を示す。   Next, the slave device 200 configuring the synchronization system according to the first embodiment will be described. FIG. 2 shows a block diagram of the slave device 200.

スレーブ装置200は、パケット受信部210と、発振器220と、内部タイマ230と、受信タイミング検出部240と、Drift値計算部250と、タイマ補正部260と、クロック変動量算出部270と、パケット生成部280と、パケット送信部290と、から構成される。   The slave device 200 includes a packet reception unit 210, an oscillator 220, an internal timer 230, a reception timing detection unit 240, a drift value calculation unit 250, a timer correction unit 260, a clock fluctuation amount calculation unit 270, and packet generation. Unit 280 and a packet transmission unit 290.

パケット受信部210は、マスタから同期用パケット(Syncパケット、Follow_upパケット)を受信する。パケット受信部210は、受信した同期用パケットのうち、Follow_upパケットに含まれるFollow_up情報をDrift値計算部250へ出力する。ここでFollow_up情報には、当該Follow_upパケットを受信するに先だって受信したSyncパケットのマスタ側での送信タイミングに関する情報が含まれている。   The packet receiving unit 210 receives a synchronization packet (Sync packet, Follow_up packet) from the master. The packet reception unit 210 outputs Follow_up information included in the Follow_up packet among the received synchronization packets to the Drift value calculation unit 250. Here, the Follow_up information includes information regarding the transmission timing on the master side of the Sync packet received prior to receiving the Follow_up packet.

発振器220は、内部タイマ230のソースクロックを生成する発振器であり、一定の周波数を有するクロック信号を発生させて内部タイマ230に出力する。発振器220は、マスタ装置が有する発振器140と同様、インダクタンスとキャパシタを組み合わせたLC発振器や、抵抗とキャパシタを組み合わせたRC発振器、水晶を用いた水晶発振器などで構成される。   The oscillator 220 is an oscillator that generates a source clock of the internal timer 230, generates a clock signal having a certain frequency, and outputs the clock signal to the internal timer 230. Similarly to the oscillator 140 included in the master device, the oscillator 220 includes an LC oscillator combining an inductance and a capacitor, an RC oscillator combining a resistor and a capacitor, a crystal oscillator using a crystal, and the like.

内部タイマ230は、発振器220からクロック信号を入力し、当該クロック信号をカウントしてカウント値を生成する。また、内部タイマ230は、後述するタイマ補正部260からタイマ補正信号を入力し、当該タイマ補正信号に基づいて上記カウント値の補正を行う。例えば、タイマ補正信号が、タイマのカウント値をnカウント進める内容の信号であったならば、内部タイマ230は、クロック信号をカウントすることで生成したカウント値をnカウント進める補正を行う。一方、タイマ補正信号が、タイマのカウント値をmカウント戻す内容の信号であったならば、内部タイマ230は、クロック信号をカウントすることで生成したカウント値をmカウント戻す補正を行う。内部タイマ230は、補正後のカウント値を受信タイミング検出部240へ出力する。   The internal timer 230 receives a clock signal from the oscillator 220 and counts the clock signal to generate a count value. The internal timer 230 receives a timer correction signal from a timer correction unit 260 described later, and corrects the count value based on the timer correction signal. For example, if the timer correction signal is a signal that advances the count value of the timer by n counts, the internal timer 230 performs correction to advance the count value generated by counting the clock signal by n counts. On the other hand, if the timer correction signal is a signal that returns the count value of the timer to m counts, the internal timer 230 performs correction to return the count value generated by counting the clock signal to m counts. The internal timer 230 outputs the corrected count value to the reception timing detection unit 240.

受信タイミング検出部240は、パケット受信部210で受信された同期用パケットの受信タイミングを検出する。より具体的には、受信タイミング検出部240は、パケット受信部210で受信される同期用パケットのうちSyncパケットの受信タイミングを検出する。受信タイミング検出部240は、内部タイマ150より補正済みカウント値を入力し、パケット受信部210がSyncパケットを受信した時点におけるカウント値を求める。受信タイミング検出部240は、当該求めたカウント値を同期用パケットの受信タイミングを示す受信タイミング情報としてDrift値計算部250へ出力する。   The reception timing detection unit 240 detects the reception timing of the synchronization packet received by the packet reception unit 210. More specifically, the reception timing detection unit 240 detects the reception timing of the Sync packet among the synchronization packets received by the packet reception unit 210. The reception timing detection unit 240 receives the corrected count value from the internal timer 150, and obtains the count value when the packet reception unit 210 receives the Sync packet. The reception timing detection unit 240 outputs the obtained count value to the drift value calculation unit 250 as reception timing information indicating the reception timing of the synchronization packet.

Drift値計算部250は、パケット受信部210より入力したFollow_up情報と、受信タイミング検出部240より入力した受信タイミング情報と、に基づいてDrift値を計算する。当該Drift値計算部250におけるDrift値の計算方法は、背景技術と同一の計算方法を採用することができる。すなわち、以下の手順によりDrift値を求めることができる。   The drift value calculation unit 250 calculates a drift value based on the Follow_up information input from the packet reception unit 210 and the reception timing information input from the reception timing detection unit 240. The calculation method of the drift value in the drift value calculation unit 250 can employ the same calculation method as that of the background art. That is, the drift value can be obtained by the following procedure.

Drift値計算部250は、パケット受信部210がSyncパケットを受信した時間(t1 k)を取得する(1)。当該t1 kは、受信タイミング検出部240より、受信タイミング情報と言う形でDrift値計算部250へ入力される。 The drift value calculation unit 250 acquires the time (t 1 k ) when the packet reception unit 210 receives the Sync packet (1). The t 1 k is input from the reception timing detection unit 240 to the drift value calculation unit 250 in the form of reception timing information.

次に、Drift値計算部250は、マスタ装置が上記Syncパケットを送信した時間(t0 k)を取得する(2)。当該t0 kは、パケット受信部210が受信したFollow_upパケット内にFollow_up情報と言う形で含まれており、パケット受信部210よりDrift値計算部250へ入力される。 Next, the drift value calculation unit 250 acquires the time (t 0 k ) when the master device transmits the Sync packet (2). The t 0 k is included in the Follow_up packet received by the packet receiver 210 in the form of Follow_up information, and is input from the packet receiver 210 to the drift value calculator 250.

次に、Drift値計算部250は、パケット受信部210がSyncパケットを再度受信した時間(t1 k+1)を取得する(3)。当該t1 k+1は、上記t1 kと同様、受信タイミング検出部240で求められて、Drift値計算部250へ入力される。 Next, the drift value calculation unit 250 acquires the time (t 1 k + 1 ) when the packet reception unit 210 receives the Sync packet again (3). The t 1 k + 1 is obtained by the reception timing detection unit 240 and input to the drift value calculation unit 250 in the same manner as t 1 k .

次に、Drift値計算部250は、パケット受信部210が再度受信したFollow_upパケット内に含まれる、マスタが上記Syncパケットを送信した時間(t0 k+1)、を取得する(4)。当該t0 k+1も上記t0 kと同様、パケット受信部210が再度受信したFollow_upパケット内にFollow_up情報と言う形で含まれており、パケット受信部210よりDrift値計算部250へ入力される。 Next, the drift value calculation unit 250 obtains the time (t 0 k + 1 ) when the master transmits the Sync packet included in the Follow_up packet received again by the packet reception unit 210 (4). The t 0 k + 1 is included in the form of Follow_up information in the Follow_up packet received again by the packet receiving unit 210 in the same manner as t 0 k, and is input to the drift value calculating unit 250 from the packet receiving unit 210. The

Drift値計算部250は、上記取得したt0 k、t0 k+1、t1 k、t1 k+1の4値からDrift値 = (Δ1-Δ0)/Δ0を算出する。ここで、Δ0=t0 k+1 − t0 kであり、Δ1=t1 k+1 − t1 k である。求められたDrift値は、タイマ補正部260及びクロック変動量算出部270へ出力される。 The Drift value calculation unit 250 calculates Drift value = (Δ1−Δ0) / Δ0 from the obtained four values of t 0 k , t 0 k + 1 , t 1 k and t 1 k + 1 . Here, Δ0 = t 0 k + 1 −t 0 k and Δ1 = t 1 k + 1 −t 1 k . The obtained drift value is output to the timer correction unit 260 and the clock fluctuation amount calculation unit 270.

タイマ補正部260は、Drift値計算部250から出力されたDrift値に基づいて、タイマ補正信号を生成し、内部タイマ230へ出力する。例えば、Drift値計算部250において上記計算方法で計算されたDrift値が、0.1の場合には、タイマ補正部260は、10カウントアップする毎にカウント値を−1させるタイマ補正信号を生成して内部タイマ230へ出力する。また、Drift値が−0.1の場合には、タイマ補正部260は、10カウントアップする毎にカウント値を+1させるタイマ補正信号を生成して内部タイマ230へ出力する。内部タイマ230では、上述したように当該タイマ補正信号に基づいてカウント値の補正が行われる。   The timer correction unit 260 generates a timer correction signal based on the drift value output from the drift value calculation unit 250 and outputs the timer correction signal to the internal timer 230. For example, when the drift value calculated by the above calculation method in the drift value calculation unit 250 is 0.1, the timer correction unit 260 generates a timer correction signal that causes the count value to be -1 every time the count is incremented by 10 And output to the internal timer 230. When the drift value is −0.1, the timer correction unit 260 generates a timer correction signal that increments the count value every time it counts up by 10 and outputs it to the internal timer 230. In the internal timer 230, the count value is corrected based on the timer correction signal as described above.

クロック変動量算出部270は、Drift値計算部250より出力されたDrift値を入力し、Drift値の変化を観察して自身のスレーブ装置におけるクロックの変動量を算出する。クロック変動量算出部270は、算出したクロック変動量をパケット生成部280へ出力する。   The clock fluctuation amount calculation unit 270 receives the drift value output from the drift value calculation unit 250, observes the change in the drift value, and calculates the clock fluctuation amount in its own slave device. The clock fluctuation amount calculation unit 270 outputs the calculated clock fluctuation amount to the packet generation unit 280.

パケット生成部280は、クロック変動量算出部270より出力されたクロック変動量を含めてパケットを生成する。パケット生成部280は、当該パケットの送信先アドレスをマスタ装置のアドレスに、送信元アドレスを自装置のアドレスに設定してパケットを生成する。パケット生成部280は、生成したパケットをパケット送信部290へ出力する。   The packet generation unit 280 generates a packet including the clock fluctuation amount output from the clock fluctuation amount calculation unit 270. The packet generation unit 280 generates a packet by setting the transmission destination address of the packet to the address of the master device and the transmission source address to the address of the own device. The packet generator 280 outputs the generated packet to the packet transmitter 290.

パケット送信部290は、パケット生成部280より出力されたパケットをマスタ装置へ送信する。   The packet transmission unit 290 transmits the packet output from the packet generation unit 280 to the master device.

このように、スレーブ装置200は、自身のクロック変動量をマスタへ通知するフィードバック機能を有する。   As described above, the slave device 200 has a feedback function of notifying the master of the amount of clock fluctuation of the slave device 200.

次に、本発明の同期システムの動作について説明する。図3は、本発明の同期システムの動作の流れを示したシーケンス図である。   Next, the operation of the synchronization system of the present invention will be described. FIG. 3 is a sequence diagram showing a flow of operation of the synchronization system of the present invention.

まず、マスタから各スレーブへ同期用パケット(Syncパケット、Follow_upパケット)をマルチキャストで送信する(ステップ001)。なお、この段階では、マスタは、各スレーブにおけるDrift変動の緩急に関してなんら情報を有していないため、マスタは、同期用パケットを比較的短い間隔でマルチキャストする。   First, a synchronization packet (Sync packet, Follow_up packet) is transmitted by multicast from the master to each slave (step 001). At this stage, the master does not have any information about the drift fluctuation in each slave, so the master multicasts the synchronization packet at a relatively short interval.

各スレーブは、上記送信される同期用パケットに基づいてDrift値を計算し、内部タイマの調整をおこなうと共に、クロック変動量を算出する(ステップ002)。具体的には、各スレーブ内に配置されたクロック変動量算出部は、一定期間のDrift値の最小値(min)と最大値(max)からクロック変動量を算出する。ここで、クロック変動量算出部がDrift値を比較する期間の長さについては、予めシステムで定められていても良いし、どれだけの長さの期間についてDrift値を比較するかに関する情報がマスタから各スレーブに対して通知される構成であっても良い。   Each slave calculates a drift value based on the transmitted synchronization packet, adjusts an internal timer, and calculates a clock fluctuation amount (step 002). Specifically, the clock fluctuation amount calculation unit arranged in each slave calculates the clock fluctuation amount from the minimum value (min) and the maximum value (max) of the drift value for a certain period. Here, the length of the period in which the clock fluctuation amount calculation unit compares the drift value may be determined in advance by the system, and information on how long the drift value is compared is the master. May be configured to notify each slave.

各スレーブは、クロック変動量算出部で求めた自身のクロック変動量をマスタへ通知する(ステップ003)。   Each slave notifies the master of the clock fluctuation amount obtained by the clock fluctuation amount calculation unit (step 003).

マスタは、各スレーブから通知されたクロック変動量に基づいて、スレーブ毎に同期用パケットに関する適切な送信方法(マルチキャストかユニキャスト)および送信間隔を選択する(ステップ004)。   Based on the clock fluctuation amount notified from each slave, the master selects an appropriate transmission method (multicast or unicast) and transmission interval for the synchronization packet for each slave (step 004).

マスタは、ステップ004で選択した送信方法と送信間隔で同期用通信を行う(ステップ005)。  The master performs synchronization communication at the transmission method and transmission interval selected in step 004 (step 005).

上記シーケンスにおけるパケットの流れを、図4及び図5に示すネットワーク・トポロジーを用いて概念的に示す。図4に示すネットワークには、マスタ300と、スレーブ310〜340の4つのスレーブが接続されている。   The flow of packets in the above sequence is conceptually shown using the network topology shown in FIGS. In the network shown in FIG. 4, a master 300 and four slaves 310 to 340 are connected.

図4において、マスタ300は、スレーブ310〜340にマルチキャストで同期用パケット(Syncパケット、Follow_upパケット)を送信する(1)。各スレーブは、受信した同期用パケットを用いて各々のクロック変動を求め、マスタへ通知する(2)。   In FIG. 4, the master 300 transmits a synchronization packet (Sync packet, Follow_up packet) to the slaves 310 to 340 by multicast (1). Each slave calculates each clock variation using the received synchronization packet and notifies the master (2).

ここで、スレーブ340は、クロック変動が大きく、スレーブ310〜330はクロック変動が小さかったとする。この時、マスタ300内の送信アドレス制御部は、各スレーブから通知されたクロック変動量に基づいて、スレーブ310宛ての同期用パケットをユニキャストで、一方、スレーブ310〜330宛ての同期用パケットをマルチキャストで送信すると決定する。また、マスタ内の送信間隔制御部は、スレーブ340宛ての同期用パケットを0.125秒間隔で、一方、スレーブ310〜330宛ての同期用パケットを64秒間隔で送信すると決定する。マスタ内のパケット送信部は、図5に示すように、送信アドレス制御部及び送信間隔制御部で決定されたこれらの内容に基づいて同期用パケットを各スレーブへ送信する。   Here, it is assumed that the slave 340 has a large clock fluctuation, and the slaves 310 to 330 have a small clock fluctuation. At this time, the transmission address control unit in the master 300 unicasts the synchronization packet addressed to the slave 310 based on the clock fluctuation amount notified from each slave, while the synchronization packet addressed to the slaves 310 to 330 is transmitted. Decide to send by multicast. Also, the transmission interval control unit in the master determines that the synchronization packet addressed to the slave 340 is transmitted at 0.125 second intervals, while the synchronization packet addressed to the slaves 310 to 330 is transmitted at 64 second intervals. As shown in FIG. 5, the packet transmission unit in the master transmits a synchronization packet to each slave based on these contents determined by the transmission address control unit and the transmission interval control unit.

上記手順によって同期用パケットが送信されることにより、ネットワーク全体としてのトラフィックを軽減することができる。すなわち、図5のように、スレーブ340が接続されている経路3へは125ms毎に頻繁に同期用パケットが流れるが、経路1、2へは64秒毎にしか流れない。従って、従来技術の場合と比べて、経路1、経路2へ流れる同期用パケットの送信量の削減が達成されている。   By transmitting the synchronization packet by the above procedure, the traffic of the entire network can be reduced. That is, as shown in FIG. 5, the synchronization packet frequently flows every 125 ms to the path 3 to which the slave 340 is connected, but flows to the paths 1 and 2 only every 64 seconds. Therefore, compared with the case of the prior art, the transmission amount of the synchronization packet flowing in the route 1 and the route 2 is reduced.

一般的に、Drift値の変動が激しいノードにおいては、同期通信の間隔を狭く保たないと変化に追従できず同期精度を満たせなくなる。通常、マスタのクロックは高精度であり、Drift = (Δ1-Δ0)/Δ0で定義されることから、一定期間の連続するDrift値のmin、maxの差をクロック変動量として扱うことができる。   In general, in a node where the drift value fluctuates drastically, the synchronization accuracy cannot be satisfied because the change cannot be followed unless the interval of the synchronous communication is kept narrow. Usually, the master clock has high accuracy and is defined by Drift = (Δ1−Δ0) / Δ0. Therefore, the difference between min and max of the Drift values that are continuous for a certain period can be handled as the clock fluctuation amount.

図6と図7に、Drift値の変動が急である場合と緩やかである場合とについて、それぞれ、必要となる同期用通信の頻度を模式的に示す。   FIG. 6 and FIG. 7 schematically show the necessary frequency of communication for synchronization, respectively, when the drift value changes suddenly and slowly.

図6のように、クロック変動量(Driftの変化量)が大きいノードについては、同期通信の間隔を狭く保たないと変化に追従できず同期精度を満たせなくなる。一方、図7のように、クロック変動量が小さいノードについては、同期開始後一定期間は短い間隔で同期をとり、Drift値の変動が緩やかであることを確認した後に、途中から同期通信間隔を広くすることができる。このように同期通信間隔を変更しても同期精度への影響は少ない。なお、ここで言う同期通信間隔とは同期用パケットの送信間隔のことである。   As shown in FIG. 6, a node having a large clock fluctuation amount (drift change amount) cannot follow the change unless the interval of the synchronous communication is kept narrow, and cannot satisfy the synchronization accuracy. On the other hand, as shown in FIG. 7, for a node with a small clock fluctuation amount, synchronization is performed at a short interval for a certain period after the start of synchronization, and after confirming that the drift value fluctuates gently, Can be wide. Thus, even if the synchronous communication interval is changed, the influence on the synchronization accuracy is small. The synchronous communication interval referred to here is a transmission interval of synchronization packets.

以上のように、本発明の同期システムにおいて、マスタ装置は、クロック変動に関する情報であるクロック変動情報を受信する受信手段と、前記クロック変動情報に基づいて、前記クロック変動情報の送信元へ送信する同期用パケットの送信間隔を決定する決定手段と、同期用パケットを生成する生成手段と、前記生成した同期用パケットを、前記決定された送信間隔で前記クロック変動情報の送信元へ送信する送信手段と、を具備する。また、スレーブ装置は、同期用パケットを受信する受信手段と、前記受信手段で受信した同期用パケットの受信タイミングを検出する検出手段と、前記受信された同期用パケットに含まれる送信タイミング情報と、前記検出された受信タイミングとに基づいて、ドリフト値を計算する計算手段と、前記ドリフト値に基づいてクロック変動に関する情報を算出する算出手段と、前記算出されたクロック変動に関する情報を含めてパケットを生成する生成手段と、前記生成されたパケットを送信する送信手段と、を具備する。このように構成することで、ネットワーク全体の同期用パケットのトラフィックを軽減することができる。     As described above, in the synchronization system of the present invention, the master device transmits the clock fluctuation information, which is information related to clock fluctuation, to the transmission source of the clock fluctuation information based on the clock fluctuation information. Determination means for determining the transmission interval of the synchronization packet, generation means for generating the synchronization packet, and transmission means for transmitting the generated synchronization packet to the transmission source of the clock fluctuation information at the determined transmission interval And. Further, the slave device includes a receiving unit that receives the synchronization packet, a detection unit that detects a reception timing of the synchronization packet received by the receiving unit, transmission timing information included in the received synchronization packet, A packet including a calculation means for calculating a drift value based on the detected reception timing, a calculation means for calculating information on clock fluctuation based on the drift value, and information on the calculated clock fluctuation. Generating means for generating; and transmitting means for transmitting the generated packet. With this configuration, it is possible to reduce the traffic of the synchronization packet in the entire network.

また、各スレーブ装置では、同期用パケット受信時、受信パケット解析、Drift値計算、内部タイマ補正の処理をソフトウェアで実行する。ワークストケースでは、125ms毎に本処理が実行されるため、例えば処理時間が10msの場合、CPUが常に8%(=10ms/125ms)占有される。また、処理中は、パケット送受信要求への応答が保留されるため、通信のリアルタイム性が損なわれる。これに対し、同期間隔を125msから64秒したスレーブ装置では、CPU占有率は約0.01%(10ms/64秒)となり大幅に軽減される上、通信のリアルタイム性も向上する。   In each slave device, processing of received packet analysis, drift value calculation, and internal timer correction is executed by software when a synchronization packet is received. In the work case, this processing is executed every 125 ms, and therefore, for example, when the processing time is 10 ms, the CPU is always occupied by 8% (= 10 ms / 125 ms). In addition, since the response to the packet transmission / reception request is suspended during processing, the real-time property of communication is impaired. On the other hand, in a slave device with a synchronization interval of 125 ms to 64 seconds, the CPU occupancy rate is about 0.01% (10 ms / 64 seconds), which is greatly reduced, and the real-time nature of communication is also improved.

また、上記説明では、クロック変動量の大きいスレーブに対してユニキャストで同期用パケットを送信する場合について説明したがこれに限るものではない。例えば、当該スレーブの属するドメインにクロック変動量の小さい他のスレーブが存在する場合は、マルチキャストとユニキャストを混ぜて送信する構成であっても良い。すなわち、クロック変動量の小さいスレーブに合わせて、これらの装置が属しているドメインにマルチキャストで同期用パケットを送信する。そして、当該マルチキャストによる送信間隔を埋める形でクロック変動量の大きいスレーブにユニキャストで個別に同期用パケットを送信する。クロック変動量の小さいスレーブは、少ない頻度でマルチキャスト送信される同期用パケットを用いてタイマ補正を行うため、CPUの処理負荷を小さくすることができる。また、クロック変動量の大きいスレーブは、マルチキャスト及びユニキャストで送信される同期用パケットの両方を用いてタイマ補正を行うため、適切にタイマ補正を行うことができる。   In the above description, the case where the synchronization packet is transmitted by unicast to the slave having a large clock fluctuation amount is described, but the present invention is not limited to this. For example, when there is another slave with a small amount of clock fluctuation in the domain to which the slave belongs, a configuration in which multicast and unicast are mixed and transmitted may be used. That is, a synchronization packet is transmitted by multicast to a domain to which these devices belong in accordance with a slave having a small clock fluctuation amount. Then, a synchronization packet is individually transmitted by unicast to a slave having a large clock fluctuation amount so as to fill the transmission interval by the multicast. Since the slave with a small amount of clock fluctuation performs timer correction using a synchronization packet that is multicast-transmitted with a low frequency, the processing load on the CPU can be reduced. In addition, since the slave with a large clock fluctuation amount performs the timer correction using both the multicast and unicast synchronization packets, the timer correction can be appropriately performed.

また、マスタは、各スレーブから送信されるDrift値に基づいて、当該スレーブがクロック変動量を算出してフィードバック送信する頻度を求め、スレーブに通知する構成を更に備えていても良い。このように構成することで各スレーブからマスタに対するDrift値の通知頻度を適切に調節することができ、トラフィックを低減することができる。   The master may further include a configuration in which the slave calculates the clock fluctuation amount based on the drift value transmitted from each slave, obtains the frequency of feedback transmission, and notifies the slave. With this configuration, it is possible to appropriately adjust the notification frequency of the drift value from each slave to the master, and to reduce traffic.

(実施の形態2)
本実施の形態2における同期システムでは、実施の形態1において各スレーブが行っていたクロック変動量算出機能をマスタ側へ移行することで、スレーブ側の構成を単純化している。以下、図面を用いて説明する。
(Embodiment 2)
In the synchronization system according to the second embodiment, the configuration on the slave side is simplified by shifting the clock fluctuation amount calculation function performed by each slave in the first embodiment to the master side. Hereinafter, it demonstrates using drawing.

図8及び図9にそれぞれ本実施の形態2の発明のスレーブ装置400及びマスタ装置500の構成を示す。なお、図1、図2の構成要素と同一機能ブロックについては一部説明を省略する。   8 and 9 show the configurations of the slave device 400 and the master device 500 of the invention of the second embodiment, respectively. A part of the same functional blocks as those in FIG. 1 and FIG.

スレーブ装置400は、パケット受信部210と、発振器220と、内部タイマ230と、受信タイミング検出部240と、Drift値計算部250と、タイマ補正部260と、パケット生成部480と、パケット送信部290と、から構成される。   The slave device 400 includes a packet reception unit 210, an oscillator 220, an internal timer 230, a reception timing detection unit 240, a drift value calculation unit 250, a timer correction unit 260, a packet generation unit 480, and a packet transmission unit 290. And.

パケット生成部480は、Drift値計算部250で求められたDrift値を入力し、当該Drift値を含めてパケットを生成する。パケットの送信先アドレスはマスタ装置のアドレスとなる。パケット生成部280は、生成したパケットをパケット送信部290へ出力する。パケット送信部290は、パケット生成部480より入力したパケットをマスタ装置500へ送信する。なお、その他のブロックは図2のスレーブ装置200のブロックと同一であるため説明を省略する。   The packet generator 480 receives the drift value obtained by the drift value calculator 250 and generates a packet including the drift value. The transmission destination address of the packet is the address of the master device. The packet generator 280 outputs the generated packet to the packet transmitter 290. The packet transmission unit 290 transmits the packet input from the packet generation unit 480 to the master device 500. The other blocks are the same as the blocks of the slave device 200 in FIG.

次に、マスタ装置500について説明する。マスタ装置500は、パケット受信部510と、クロック変動量算出部590と、送信間隔制御部120と、送信アドレス制御部130と、発振器140と、内部タイマ150と、送信タイミング検出部160と、パケット生成部170とパケット送信部180と、から構成される。   Next, the master device 500 will be described. The master device 500 includes a packet reception unit 510, a clock fluctuation amount calculation unit 590, a transmission interval control unit 120, a transmission address control unit 130, an oscillator 140, an internal timer 150, a transmission timing detection unit 160, a packet The generation unit 170 and the packet transmission unit 180 are configured.

パケット受信部510は、各スレーブから送信されるクロック変動に関する情報を含むパケットを受信する。ここで、クロック変動に関する情報には各スレーブ装置で求められたDrift値が含まれる。パケット受信部510で受信された上記パケットに含まれるクロック変動に関する情報は、クロック変動量算出部590へ出力される。また、パケット受信部510は、受信したパケットの送信元アドレスから当該Drift値を送信したスレーブ装置を特定し、当該送信元アドレスもクロック変動量算出部590へ出力する。   The packet receiving unit 510 receives a packet including information regarding clock fluctuation transmitted from each slave. Here, the information regarding the clock fluctuation includes a drift value obtained by each slave device. Information regarding the clock fluctuation included in the packet received by the packet receiver 510 is output to the clock fluctuation calculator 590. Further, the packet reception unit 510 identifies the slave device that has transmitted the Drift value from the transmission source address of the received packet, and outputs the transmission source address to the clock fluctuation amount calculation unit 590.

クロック変動量算出部590は、パケット受信部510から出力されたDrift値に基づいて各スレーブ装置におけるクロック変動量を算出する。より具体的には、パケット受信部510より出力されるDrift値を、パケット受信部510より出力される当該drift値の送信元アドレスに基づいて、スレーブ装置毎に管理する。クロック変動量算出部590は、入力したDrift値の変化を観察してスレーブ装置毎にクロックの変動量を算出する。例えば、クロック変動量算出部590は、一定期間のDrift値の最大値と最小値の差分を求め、その大きさからクロック変動量を算出する。算出されたクロック変動量は、送信間隔制御部120及び送信アドレス制御部130へ出力される。なお、その他のブロックは図1のマスタ装置のブロックと同一であるため説明を省略する。   The clock fluctuation amount calculation unit 590 calculates the clock fluctuation amount in each slave device based on the drift value output from the packet reception unit 510. More specifically, the drift value output from the packet receiving unit 510 is managed for each slave device based on the transmission source address of the drift value output from the packet receiving unit 510. The clock fluctuation amount calculation unit 590 observes the change in the input drift value and calculates the clock fluctuation amount for each slave device. For example, the clock fluctuation amount calculation unit 590 obtains the difference between the maximum value and the minimum value of the drift value for a certain period, and calculates the clock fluctuation amount from the magnitude. The calculated clock fluctuation amount is output to the transmission interval control unit 120 and the transmission address control unit 130. The other blocks are the same as the blocks of the master device in FIG.

以上説明したように、本実施の形態2における同期システムではマスタ装置が各スレーブ装置のクロック変動量を算出し、各スレーブ装置に対する同期用パケットの送信間隔や送信方法を決定する。マスタ装置に比較的処理能力の高いプロセッサを搭載できる場合には、このように構成されていても良い。   As described above, in the synchronization system according to the second embodiment, the master device calculates the clock fluctuation amount of each slave device, and determines the transmission interval and transmission method of the synchronization packet for each slave device. In the case where a processor having a relatively high processing capability can be mounted on the master device, it may be configured in this way.

なお、本発明は上記実施の形態に限られたものではなく、趣旨を逸脱しない範囲で適宜変更することが可能である。例えば、スレーブ装置の受信タイミング検出部で検出された同期用パケットの受信タイミングをクロック変動に関する情報としてパケットに含めてマスタ装置へフィードバックし、マスタ装置が、クロック変動量を求める構成であっても良い。この場合、マスタ装置内のパケット受信部で受信されたパケットに含まれる上記受信タイミングは、別途設けられたDrift値計算部に入力され、マスタ装置内で各スレーブ装置のDrift値が計算される。計算されたDrift値は、別途設けられたクロック変動量算出部に入力され、クロック変動量が求められる。このように構成されていても良い。また上記Drift値計算部は、求めたDrift値をパケット生成部へ出力し、パケット生成部は当該Drift値を含めてタイマ補正用パケットを生成する構成であっても良い。スレーブ装置は、マスタ装置から送信される上記タイマ補正用パケットに含まれるDrift値に基づいて内部タイマを調節する構成とすれば、各スレーブにDrift値計算部を設けなくてもよい。   Note that the present invention is not limited to the above-described embodiment, and can be changed as appropriate without departing from the spirit of the present invention. For example, the configuration may be such that the reception timing of the synchronization packet detected by the reception timing detection unit of the slave device is included in the packet as information relating to clock fluctuation and fed back to the master device, and the master device calculates the clock fluctuation amount. . In this case, the reception timing included in the packet received by the packet reception unit in the master device is input to a separately provided drift value calculation unit, and the drift value of each slave device is calculated in the master device. The calculated drift value is input to a separately provided clock fluctuation amount calculation unit to obtain the clock fluctuation amount. It may be configured in this way. The drift value calculation unit may output the obtained drift value to the packet generation unit, and the packet generation unit may generate a timer correction packet including the drift value. If the slave device is configured to adjust the internal timer based on the drift value included in the timer correction packet transmitted from the master device, it is not necessary to provide the drift value calculation unit in each slave.

なお、上記説明では、同期用パケットをマルチキャストで送信する場合について説明したが、ドメインを超えて送信したい場合にはブロードキャストで送信することも可能である。   In the above description, the case where the synchronization packet is transmitted by multicast has been described. However, when the packet is transmitted beyond the domain, it can also be transmitted by broadcast.

また、マスタとスレーブは有線で接続されていても良いし、無線で接続されていても良い。   Further, the master and the slave may be connected by wire or may be connected wirelessly.

また、上記で説明したマスタ装置及びスレーブ装置における各処理は、プログラムを用いてソフトウェア的に実行される構成であっても良い。なお、上記プログラムは、コンピュータ・システムがアクセス可能な様々な種類の記憶媒体に格納することが可能である。また、このプログラムは、通信媒体を介して伝達されることが可能である。ここで、記憶媒体には、例えば、フレキシブルディスク、ハードディスク、磁気ディスク、光磁気ディスク、CD−ROM、DVD、ROMカートリッジ、バッテリバックアップ付きRAMメモリカートリッジ、フラッシュメモリカートリッジ、不揮発性RAMカートリッジ等が含まれる。また、通信媒体には、電話回線等の有線通信媒体、マイクロ波回線等の無線通信媒体等が含まれ、インターネットも含まれる。   Further, each process in the master device and the slave device described above may be configured to be executed by software using a program. Note that the program can be stored in various types of storage media accessible by the computer system. The program can be transmitted via a communication medium. Here, the storage medium includes, for example, a flexible disk, a hard disk, a magnetic disk, a magneto-optical disk, a CD-ROM, a DVD, a ROM cartridge, a battery-backed RAM memory cartridge, a flash memory cartridge, a nonvolatile RAM cartridge, and the like. . In addition, the communication medium includes a wired communication medium such as a telephone line, a wireless communication medium such as a microwave line, and the Internet.

100 マスタ装置
110 パケット受信部
120 送信間隔制御部
130 送信アドレス制御部
140 発振器
150 内部タイマ
160 送信タイミング検出部
170 パケット生成部
180 パケット送信部
200 スレーブ装置
210 パケット受信部
220 発振器
230 内部タイマ
240 受信タイミング検出部
250 値計算部
260 タイマ補正部
270 クロック変動量算出部
280 パケット生成部
290 パケット送信部
300 マスタ
310〜340 スレーブ
400 スレーブ装置
480 パケット生成部
500 マスタ装置
510 パケット受信部
590 クロック変動量算出部
100 Master device 110 Packet reception unit 120 Transmission interval control unit 130 Transmission address control unit 140 Oscillator 150 Internal timer 160 Transmission timing detection unit 170 Packet generation unit 180 Packet transmission unit 200 Slave device 210 Packet reception unit 220 Oscillator 230 Internal timer 240 Reception timing Detection unit 250 Value calculation unit 260 Timer correction unit 270 Clock fluctuation amount calculation unit 280 Packet generation unit 290 Packet transmission unit 300 Master 310 to 340 Slave 400 Slave device 480 Packet generation unit 500 Master device 510 Packet reception unit 590 Clock fluctuation amount calculation unit

Claims (13)

クロック変動に関する情報であるクロック変動情報を受信する受信手段と、
前記クロック変動情報に基づいて、前記クロック変動情報の送信元へ送信する同期用パケットの送信間隔を決定する決定手段と、
同期用パケットを生成する生成手段と、
前記生成した同期用パケットを、前記決定された送信間隔で前記クロック変動情報の送信元へ送信する送信手段と、
を具備するクロック同期装置。
Receiving means for receiving clock fluctuation information which is information relating to clock fluctuation;
Determining means for determining a transmission interval of a synchronization packet to be transmitted to a transmission source of the clock fluctuation information based on the clock fluctuation information;
Generating means for generating a synchronization packet;
Transmitting means for transmitting the generated synchronization packet to the transmission source of the clock fluctuation information at the determined transmission interval;
A clock synchronizer.
前記クロック変動情報に基づいて、前記クロック変動情報の送信元へ送信する同期用パケットの送信方式としてマルチキャスト又はユニキャストのいずれかを選択する選択手段を更に具備し、
前記生成手段は、前記選択手段で選択された送信方式に従って同期用パケットを生成し、
前記送信手段は、前記選択手段で選択された送信方式に従って前記同期用パケットを送信する、
請求項1に記載のクロック同期装置。
Based on the clock fluctuation information, further comprising selection means for selecting either multicast or unicast as a transmission method of the synchronization packet to be transmitted to the source of the clock fluctuation information;
The generation means generates a synchronization packet according to the transmission method selected by the selection means,
The transmission means transmits the synchronization packet according to the transmission method selected by the selection means;
The clock synchronization apparatus according to claim 1.
前記決定手段は、クロック変動情報に含まれるクロック変動量が大きいほど、予め定められている送信間隔の候補の中から短い送信間隔を選択することで、前記同期用パケットの送信間隔を決定する、
請求項1に記載のクロック同期装置。
The determination means determines the transmission interval of the synchronization packet by selecting a shorter transmission interval from predetermined transmission interval candidates as the amount of clock variation included in the clock variation information increases.
The clock synchronization apparatus according to claim 1.
前記生成手段は、同期用パケットとしてSyncパケットとFollow_upパケットの2種類のパケットを生成する、
請求項1乃至請求項3のいずれかに記載のクロック同期装置。
The generation means generates two types of packets, Sync packets and Follow_up packets, as synchronization packets.
The clock synchronization apparatus according to claim 1.
前記Syncパケットの送信タイミングを検出する検出手段を更に具備し、
前記生成手段は、前記検出された送信タイミングに関する情報を含めて前記Follow_upパケットを生成する、
請求項4に記載のクロック同期装置。
Further comprising detection means for detecting the transmission timing of the Sync packet;
The generation means generates the Follow_up packet including information on the detected transmission timing.
The clock synchronizer according to claim 4.
クロック信号を発生させる発振手段と、
前記クロック信号を計数してカウント値を求め、前記検出手段に前記カウント値を出力するカウント手段と、
を更に具備し、
前記検出手段は、前記カウント手段から前記カウント値を入力し、前記送信手段が前記Syncパケットを送信した時点におけるカウント値を求めて前記生成手段に出力し、
前記生成手段は、前記検出手段から出力されたカウント値を含めて前記Follow_upパケットを生成する、
請求項5に記載のクロック同期装置。
An oscillating means for generating a clock signal;
Counting means for counting the clock signal to obtain a count value, and outputting the count value to the detection means;
Further comprising
The detection means inputs the count value from the counting means, obtains the count value at the time when the transmission means transmits the Sync packet, and outputs the count value to the generation means,
The generation means generates the Follow_up packet including the count value output from the detection means.
The clock synchronizer according to claim 5.
同期用パケットを受信する受信手段と、
前記受信手段で受信した同期用パケットの受信タイミングを検出する検出手段と、
前記受信された同期用パケットに含まれる送信タイミング情報と、前記検出された受信タイミングとに基づいて、ドリフト値を計算する計算手段と、
前記ドリフト値に基づいてクロック変動に関する情報を算出する算出手段と、
前記算出されたクロック変動に関する情報を含めてパケットを生成する生成手段と、
前記生成されたパケットを送信する送信手段と、
を具備するクロック同期装置。
Receiving means for receiving a synchronization packet;
Detecting means for detecting the reception timing of the synchronization packet received by the receiving means;
Calculation means for calculating a drift value based on the transmission timing information included in the received synchronization packet and the detected reception timing;
Calculating means for calculating information on clock fluctuation based on the drift value;
Generating means for generating a packet including information on the calculated clock fluctuation;
Transmitting means for transmitting the generated packet;
A clock synchronizer.
前記検出手段は、同期用パケットのうち、Syncパケットの受信タイミングを検出し、
前記計算手段は、同期用パケットのうち、Follow_upパケットに含まれる前記Syncパケットの送信タイミングを示す送信タイミング情報と、前記検出されたSyncパケットの受信タイミングとに基づいてドリフト値を計算する、
請求項7に記載のクロック同期装置。
The detection means detects the reception timing of the Sync packet among the synchronization packets,
The calculation means calculates a drift value based on transmission timing information indicating the transmission timing of the Sync packet included in the Follow_up packet among the synchronization packets, and the reception timing of the detected Sync packet.
The clock synchronizer according to claim 7.
前記算出手段は、所定の期間における前記ドリフト値の最大値と最小値の差分を前記クロック変動に関する情報として算出する、
請求項7又は請求項8のいずれかに記載のクロック同期装置。
The calculating means calculates a difference between a maximum value and a minimum value of the drift value in a predetermined period as information on the clock fluctuation;
The clock synchronizer according to claim 7.
クロック信号を発生させる発振手段と、
前記クロック信号を計数してカウント値を求め、前記検出手段に前記カウント値を出力するカウント手段と、
前記計算されたドリフト値に基づいて前記カウント手段のカウント値を調節する調節手段と、
を更に具備し、
前記検出手段は、前記カウント手段から前記カウント値を入力し、前記受信手段が前記Syncパケットを受信した時点におけるカウント値を前記受信タイミングとして前記計算手段に出力する、
請求項8に記載のクロック同期装置。
An oscillating means for generating a clock signal;
Counting means for counting the clock signal to obtain a count value, and outputting the count value to the detection means;
Adjusting means for adjusting the count value of the counting means based on the calculated drift value;
Further comprising
The detecting means inputs the count value from the counting means, and outputs the count value at the time when the receiving means receives the Sync packet as the reception timing to the calculating means.
The clock synchronizer according to claim 8.
クロック変動に関する情報であるクロック変動情報を受信し、
前記クロック変動情報に基づいて、前記クロック変動情報の送信元へ送信する同期用パケットの送信間隔を決定し、
同期用パケットを生成し、
前記生成した同期用パケットを、前記決定した送信間隔で前記クロック変動情報の送信元へ送信する、
クロック同期方法。
Receive clock fluctuation information, which is information about clock fluctuation,
Based on the clock fluctuation information, determine a transmission interval of the synchronization packet to be transmitted to the transmission source of the clock fluctuation information,
Generate a synchronization packet,
Transmitting the generated synchronization packet to the transmission source of the clock fluctuation information at the determined transmission interval;
Clock synchronization method.
前記クロック変動情報に基づいて、前記クロック変動情報の送信元へ送信する同期用パケットの送信方式としてマルチキャスト又はユニキャストのいずれかを選択し、
前記選択した送信方式に従って同期用パケットを生成し、
前記生成した同期用パケットを前記選択した送信方式に従って送信する、
請求項11に記載のクロック同期方法。
Based on the clock fluctuation information, select either multicast or unicast as a transmission method of the synchronization packet to be transmitted to the transmission source of the clock fluctuation information,
Generate a synchronization packet according to the selected transmission method,
Transmitting the generated synchronization packet according to the selected transmission method;
The clock synchronization method according to claim 11.
同期用パケットを受信し、
前記受信した同期用パケットの受信タイミングを検出し、
前記受信した同期用パケットに含まれる送信タイミング情報と前記検出した受信タイミングとに基づいてドリフト値を計算し、
前記ドリフト値に基づいてクロック変動に関する情報を算出し、
前記算出したクロック変動に関する情報を含めてパケットを生成し、
前記生成したパケットを送信する、
クロック同期方法。
Receive synchronization packet,
Detect the reception timing of the received synchronization packet,
Calculate a drift value based on transmission timing information included in the received synchronization packet and the detected reception timing,
Calculating information on clock fluctuations based on the drift value;
Generate a packet including information on the calculated clock fluctuation,
Sending the generated packet;
Clock synchronization method.
JP2011065457A 2011-03-24 2011-03-24 Clock synchronization device and clock synchronization method Withdrawn JP2012204912A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011065457A JP2012204912A (en) 2011-03-24 2011-03-24 Clock synchronization device and clock synchronization method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011065457A JP2012204912A (en) 2011-03-24 2011-03-24 Clock synchronization device and clock synchronization method

Publications (1)

Publication Number Publication Date
JP2012204912A true JP2012204912A (en) 2012-10-22

Family

ID=47185452

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011065457A Withdrawn JP2012204912A (en) 2011-03-24 2011-03-24 Clock synchronization device and clock synchronization method

Country Status (1)

Country Link
JP (1) JP2012204912A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015068806A (en) * 2013-10-01 2015-04-13 株式会社日立製作所 Time synchronization system and time synchronization device
JP2015099983A (en) * 2013-11-18 2015-05-28 東日本電信電話株式会社 Time synchronization system, time synchronization method and computer program
JP2018074534A (en) * 2016-11-04 2018-05-10 大井電気株式会社 Base station and radio device
CN113534657A (en) * 2021-08-05 2021-10-22 浙江中控技术股份有限公司 Self-adaptive adjustment method for local clock of industrial control system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015068806A (en) * 2013-10-01 2015-04-13 株式会社日立製作所 Time synchronization system and time synchronization device
JP2015099983A (en) * 2013-11-18 2015-05-28 東日本電信電話株式会社 Time synchronization system, time synchronization method and computer program
JP2018074534A (en) * 2016-11-04 2018-05-10 大井電気株式会社 Base station and radio device
CN113534657A (en) * 2021-08-05 2021-10-22 浙江中控技术股份有限公司 Self-adaptive adjustment method for local clock of industrial control system
CN113534657B (en) * 2021-08-05 2024-05-07 浙江中控技术股份有限公司 Self-adaptive adjusting method for local clock of industrial control system

Similar Documents

Publication Publication Date Title
JP5358813B2 (en) Network node, time synchronization method, and network system
JP5350787B2 (en) Time synchronization method and apparatus using time stamp
US9553713B2 (en) Method and system for transmitting clock reference streams with timestamps directly to audio/video end nodes in an audio/video bridging network
JP2010062729A (en) Time synchronization method and relay apparatus
WO2014083725A1 (en) Synchronization apparatus, synchronization system, wireless communication apparatus and synchronization method
US9651984B2 (en) Feed-forward time transfer mechanism for time synchronization
CN103916950A (en) Time synchronization method and system
JPWO2012118178A1 (en) Synchronization system, synchronization method, first synchronization device, second synchronization device, and computer program
EP3398272A1 (en) Synchronizing clocks in a network
JP2013083451A (en) Time control device, time control method, and program
JP6132734B2 (en) Time synchronization system and apparatus
JP2012204912A (en) Clock synchronization device and clock synchronization method
JP2013138312A5 (en)
JP2014238357A (en) Reception device, time difference calculation method and program
JP2017069669A (en) Time synchronizing device, base station device, and time synchronizing method
JP2014027437A (en) Communication device, communication system, synchronization processing method, and program
US20220352999A1 (en) Systems and methods for synchronizing device clocks
JP2010177778A (en) Clock supply device and transmission device using the same
JP5675703B2 (en) Communication device, control device, and program
CN102484601A (en) Detection of jitter in a communication network
JP2018088646A (en) Time synchronization device and time synchronization method
JP2013029319A (en) Slave device, electronic apparatus system, master device, time synchronization method, and program
WO2020090664A1 (en) Time synchronization system
JP5391964B2 (en) Clock synchronization method and packet communication system
JP2009239373A (en) Time stamp packet communication system, time stamp packet transmitting apparatus, and time stamp packet receiving apparatus

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20140603