JP2013029319A - Slave device, electronic apparatus system, master device, time synchronization method, and program - Google Patents
Slave device, electronic apparatus system, master device, time synchronization method, and program Download PDFInfo
- Publication number
- JP2013029319A JP2013029319A JP2011163534A JP2011163534A JP2013029319A JP 2013029319 A JP2013029319 A JP 2013029319A JP 2011163534 A JP2011163534 A JP 2011163534A JP 2011163534 A JP2011163534 A JP 2011163534A JP 2013029319 A JP2013029319 A JP 2013029319A
- Authority
- JP
- Japan
- Prior art keywords
- message
- time
- master device
- slave device
- receiving
- 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
Links
Images
Abstract
Description
本発明は、マスタ装置と時刻同期を行うスレーブ装置、時刻同期を行うマスタ装置と複数のスレーブ装置とで構成する電子機器システム、スレーブ装置と時刻同期を行うマスタ装置、マスタ装置とスレーブ装置との時刻同期方法およびプログラムに関する。 The present invention relates to a slave device that performs time synchronization with a master device, an electronic device system that includes a master device that performs time synchronization and a plurality of slave devices, a master device that performs time synchronization with a slave device, and a master device and a slave device. The present invention relates to a time synchronization method and a program.
Ethernet(登録商標)等のネットワークを用いた時刻同期方法として、IEEE1588規格によるマスタ装置からスレーブ装置への時刻パケットの通信(PTP:Precision Time Protocol)による方法がある。IEEE1588方式において、ネットワークで接続されたマスタ装置とスレーブ装置とで構成される場合、スレーブ装置の時刻同期精度は、スレーブ装置に実装された発振器の安定度及びマスタ装置との時刻パケット通信を行うネットワークの負荷状態に依存する。 As a time synchronization method using a network such as Ethernet (registered trademark), there is a method by time packet communication (PTP: Precision Time Protocol) from a master device to a slave device according to the IEEE 1588 standard. In the IEEE 1588 system, when configured by a master device and a slave device connected via a network, the time synchronization accuracy of the slave device is the network that performs the time packet communication with the stability of the oscillator mounted on the slave device and the master device. Depends on the load state.
ここで、マスタ装置とネットワーク上で接続されているスレーブ装置が電源起動後に新規に時刻パケット通信により時刻同期を行う場合、スレーブ装置の電源起動初期には、時刻同期精度はスレーブ装置内部の発振器の安定度に依存する。電源起動後の時間経過によってスレーブ装置内部の発振器の安定度が向上すると、時刻同期精度はマスタ装置との時刻パケット通信を行うネットワークの負荷状態に依存する。これは、スレーブ装置の電源起動直後では発振器が安定していないため、たとえばマスタ装置から受信した時刻に対し、スレーブ装置の発振器の安定度が低いことによる誤差が加わり、マスタ装置との正確なオフセット時間差が求められないためである。 Here, when a slave device connected to the master device on the network newly performs time synchronization by time packet communication after the power is turned on, the time synchronization accuracy is the value of the oscillator in the slave device at the initial stage of power-on of the slave device. Depends on stability. When the stability of the oscillator in the slave device is improved as time elapses after the power is turned on, the time synchronization accuracy depends on the load state of the network that performs time packet communication with the master device. This is because the oscillator is not stable immediately after power-on of the slave device, so for example, an error due to the low stability of the oscillator of the slave device is added to the time received from the master device, and an accurate offset from the master device This is because the time difference cannot be obtained.
スレーブ装置に実装された発振器の周波数が電源起動後の時間経過とともに安定し、時刻同期に支障のない精度の範囲内になることにより、この問題は回避される。一方、ネットワークによるマスタ装置とスレーブ装置との間の時刻パケット通信は、1つのマスタ装置に接続されるスレーブ装置が多いほど、ネットワーク負荷が大きくなる。また、時刻パケット通信以外のデータパケット通信の影響を受けることにより、さらにネットワーク負荷が大きくなる。ネットワーク負荷が大きいほど揺らぎが大きくなり、揺らぎの大きさによっては1回のパケット通信では時刻精度が低い場合がある。このため、通常は複数回の時刻パケット通信の結果を用いて時刻精度を高めることになる。 This problem is avoided by the fact that the frequency of the oscillator mounted on the slave device stabilizes with the passage of time after the power is turned on and falls within the accuracy range that does not interfere with time synchronization. On the other hand, in the time packet communication between the master device and the slave device via the network, the network load increases as the number of slave devices connected to one master device increases. Further, the network load is further increased due to the influence of data packet communication other than time packet communication. The greater the network load, the greater the fluctuation. Depending on the magnitude of the fluctuation, the time accuracy may be low in one packet communication. For this reason, the time accuracy is usually increased by using a result of a plurality of time packet communications.
特許文献1では、ネットワークのトラフィックを不必要に増加させることなく、応答性よく時刻補正をすることができる技術が開示されている。特許文献1のクライアント装置では、時刻補正要求の送信間隔は誤差に基づいて決定される。送信間隔は、誤差が大きいときは短く、誤差が小さいときは長くなるように決定される。したがって、ネットワークのトラフィックを不必要に増加させることなく、時刻補正をすることができる。
特許文献2では、スレーブ装置でマスタ装置との時刻同期化を正確に実現する電子機器システムが提案されている。特許文献2の電子機器システムでは、スレーブ装置の時計部の時刻補正を、従来のように誤差が含まれるオフセット(Offset)の演算結果を使用しないで行うことにより、スレーブ装置ではマスタ装置との時刻同期化を高精度で実現する。
特許文献3には、スレーブ装置においてマスタ装置との完全な時刻同期化を実現する電子機器システムが提示されている。この電子機器システムでは、マスタ装置からスレーブ装置に時刻情報がカウンタ値で送られることで、マスタ装置でカウンタ値を例えばナノセコンド(ns)単位の値に変換する処理、およびスレーブ装置でナノセコンド(ns)単位の値をカウンタ値に変換する処理は行われない。そのため、マスタ装置からスレーブ装置に供給される時刻情報は、変換時の演算誤差を含まない正確な時刻情報となる。これにより、スレーブ装置ではマスタ装置との時刻同期化をより高精度に実現できる。
IEEE1588を用いたネットワーク構成によるマスタ装置と複数のスレーブ装置の運用環境下で、新たにスレーブ装置を接続する場合、スレーブ装置を電源起動すると、スレーブ装置に実装された発振器の周波数が安定していない状態で、かつ既に運用されているネットワーク負荷の環境下でマスタ装置との時刻パケット通信を行うこととなるため、所定の時刻同期精度を満足するまでの同期引き込み時間が長くなる可能性がある。 When a slave device is newly connected in an operating environment of a master device with a network configuration using IEEE 1588 and a plurality of slave devices, when the slave device is powered on, the frequency of the oscillator mounted on the slave device is not stable In this state, the time packet communication with the master device is performed under an already operated network load environment, and therefore there is a possibility that the synchronization pull-in time until a predetermined time synchronization accuracy is satisfied is prolonged.
特許文献1〜3に記載の技術は、IEEE1588を用いたネットワーク構成によるマスタ装置と複数のスレーブ装置の時刻同期において、スレーブ装置の初期起動時の時刻同期精度の低下を防ぎ、ネットワークへの負荷を軽減し、かつ、時刻同期までの時間を短縮するものではない。
The techniques described in
本発明は、上述のような事情に鑑みてなされたもので、マスタ装置と複数のスレーブ装置とのネットワークを介する時刻同期において、スレーブ装置の初期起動時の時刻同期精度の低下を防ぎ、ネットワークへの負荷を軽減し、かつ、時刻同期までの時間を短縮することができるスレーブ装置、電子機器システム、マスタ装置、時刻同期方法およびプログラムを提供することを目的とする。 The present invention has been made in view of the circumstances as described above. In the time synchronization through the network between the master device and the plurality of slave devices, the time synchronization accuracy at the time of initial activation of the slave device is prevented, and the network is provided. An object of the present invention is to provide a slave device, an electronic device system, a master device, a time synchronization method, and a program that can reduce the load on the device and reduce the time until time synchronization.
本発明の第1の観点に係るスレーブ装置は、
マスタ装置とネットワークを介して時刻同期を行うスレーブ装置であって、
時刻情報を生成するタイマと、
前記時刻情報を生成するためのクロックを発生させる発振器と、
所定の間隔でカウントアップするカウンタと、
前記カウンタの値が所定の値を超えた場合に、前記マスタ装置が他のスレーブ装置と時刻同期を行っているビジー状態であるか否かを判定する判定手段と、
前記判定手段が前記ビジー状態でないと判定した場合、前記マスタ装置に時刻同期の開始を要求する第1メッセージを送信する第1送信手段と、
前記マスタ装置から、前記マスタ装置と前記スレーブ装置との間のオフセット時間差を求めるための第2メッセージと、前記第2メッセージが前記マスタ装置から送信された時刻を含むフォローアップメッセージとを受信する第1受信手段と、
前記第1受信手段が前記第2メッセージを受信した時刻と、前記フォローアップメッセージに含まれる前記第2メッセージが前記マスタ装置から送信された時刻とに基づいて、前記オフセット時間差を算出するオフセット算出手段と、
前記第1受信手段が前記マスタ装置から前記フォローアップメッセージを受信したのちに、前記マスタ装置に前記マスタ装置と前記スレーブ装置との間の伝搬遅延時間を求めるための第3メッセージを送信する第2送信手段と、
前記マスタ装置から前記第3メッセージを前記マスタ装置が受信した時刻を含む第4メッセージを受信する第2受信手段と、
前記第2送信手段が前記第3メッセージを送信した時刻と、前記第4メッセージに含まれる前記第3メッセージを前記マスタ装置が受信した時刻とに基づいて、前記伝搬遅延時間を算出する遅延時間算出手段と、
前記オフセット時間差および前記伝搬遅延時間に基づいて、前記タイマの時刻を補正する補正手段と、
を備えることを特徴とする。
A slave device according to the first aspect of the present invention provides:
A slave device that performs time synchronization with a master device via a network,
A timer for generating time information;
An oscillator for generating a clock for generating the time information;
A counter that counts up at predetermined intervals;
A determination means for determining whether or not the master device is busy performing time synchronization with other slave devices when the value of the counter exceeds a predetermined value;
A first transmission unit configured to transmit a first message requesting the master device to start time synchronization when the determination unit determines that the busy state is not present;
A second message for receiving an offset time difference between the master device and the slave device and a follow-up message including a time when the second message is transmitted from the master device from the master device. One receiving means;
Offset calculating means for calculating the offset time difference based on the time when the first receiving means receives the second message and the time when the second message included in the follow-up message is transmitted from the master device. When,
After the first receiving means receives the follow-up message from the master device, a second message is transmitted to the master device for determining a propagation delay time between the master device and the slave device. A transmission means;
Second receiving means for receiving a fourth message including a time at which the master device has received the third message from the master device;
Delay time calculation for calculating the propagation delay time based on the time at which the second transmission means transmits the third message and the time at which the master device receives the third message included in the fourth message. Means,
Correction means for correcting the time of the timer based on the offset time difference and the propagation delay time;
It is characterized by providing.
本発明の第2の観点に係る電子機器システムは、
ネットワークを介して時刻同期を行うマスタ装置と2以上のスレーブ装置とを備える電子機器システムであって、
前記スレーブ装置はそれぞれ、
時刻情報を生成するタイマ、
前記時刻情報を生成するためのクロックを発生させる発振器、
所定の間隔でカウントアップするカウンタ、
前記カウンタの値が所定の値を超えた場合に、前記マスタ装置が他のスレーブ装置と時刻同期を行っているビジー状態であるか否かを判定する判定手段、
前記判定手段が前記ビジー状態でないと判定した場合、前記マスタ装置に時刻同期の開始を要求する第1メッセージを送信する第1送信手段、
前記マスタ装置から、前記マスタ装置と前記スレーブ装置との間のオフセット時間差を求めるための第2メッセージと、前記第2メッセージが前記マスタ装置から送信された時刻を含むフォローアップメッセージとを受信する第1受信手段、
前記第1受信手段が前記第2メッセージを受信した時刻と、前記フォローアップメッセージに含まれる前記第2メッセージが前記マスタ装置から送信された時刻とに基づいて、前記オフセット時間差を算出するオフセット算出手段、
前記第1受信手段が前記マスタ装置から前記フォローアップメッセージを受信したのちに、前記マスタ装置に前記マスタ装置と前記スレーブ装置との間の伝搬遅延時間を求めるための第3メッセージを送信する第2送信手段、
前記マスタ装置から前記第3メッセージを前記マスタ装置が受信した時刻を含む第4メッセージを受信する第2受信手段、
前記第2送信手段が前記第3メッセージを送信した時刻と、前記第4メッセージに含まれる前記第3メッセージを前記マスタ装置が受信した時刻とに基づいて、前記伝搬遅延時間を算出する遅延時間算出手段、および、
前記オフセット時間差および前記伝搬遅延時間に基づいて、前記タイマの時刻を補正する補正手段、
を含み、
前記マスタ装置は、
前記スレーブ装置から前記第1メッセージを受信する第3受信手段、
前記第3受信手段が前記スレーブ装置から前記第1メッセージを受信すると、前記第2メッセージと、前記フォローアップメッセージとを、前記第1メッセージを受信した相手の前記スレーブ装置である対象スレーブ装置に送信する第3送信手段、
前記第3送信手段が前記第2メッセージを前記対象スレーブ装置に送信すると、前記ビジー状態であることを示す第5メッセージを、前記対象スレーブ装置以外の前記スレーブ装置に送信する第4送信手段、
前記対象スレーブ装置から前記第3メッセージを受信する第4受信手段、および、
前記第4受信手段が前記対象スレーブ装置から前記第3メッセージを受信すると、前記対象スレーブ装置に前記第4メッセージを送信する第5送信手段、
を含むことを特徴とする。
An electronic device system according to a second aspect of the present invention is:
An electronic device system including a master device that performs time synchronization via a network and two or more slave devices,
Each of the slave devices is
A timer that generates time information,
An oscillator for generating a clock for generating the time information;
A counter that counts up at predetermined intervals,
A determination unit that determines whether or not the master device is busy performing time synchronization with another slave device when the value of the counter exceeds a predetermined value;
A first transmission unit configured to transmit a first message requesting the master device to start time synchronization when the determination unit determines that the busy state is not present;
A second message for receiving an offset time difference between the master device and the slave device and a follow-up message including a time when the second message is transmitted from the master device from the master device. 1 receiving means,
Offset calculating means for calculating the offset time difference based on the time when the first receiving means receives the second message and the time when the second message included in the follow-up message is transmitted from the master device. ,
After the first receiving means receives the follow-up message from the master device, a second message is transmitted to the master device for determining a propagation delay time between the master device and the slave device. Transmission means,
Second receiving means for receiving a fourth message including a time at which the master device has received the third message from the master device;
Delay time calculation for calculating the propagation delay time based on the time at which the second transmission means transmits the third message and the time at which the master device receives the third message included in the fourth message. Means and
Correction means for correcting the time of the timer based on the offset time difference and the propagation delay time;
Including
The master device is
Third receiving means for receiving the first message from the slave device;
When the third receiving unit receives the first message from the slave device, the second message and the follow-up message are transmitted to the target slave device that is the slave device of the other party that received the first message. Third transmitting means for
A fourth transmission unit configured to transmit a fifth message indicating the busy state to the slave device other than the target slave device when the third transmission unit transmits the second message to the target slave device;
Fourth receiving means for receiving the third message from the target slave device; and
Fifth transmission means for transmitting the fourth message to the target slave device when the fourth reception means receives the third message from the target slave device;
It is characterized by including.
本発明の第3の観点に係るマスタ装置は、
2以上のスレーブ装置とネットワークを介して時刻同期を行うマスタ装置であって、
前記スレーブ装置から時刻同期の開始を要求する第1メッセージを受信する第3受信手段と、
前記第3受信手段が前記スレーブ装置から前記第1メッセージを受信すると、前記マスタ装置と前記スレーブ装置との間のオフセット時間差を求めるための第2メッセージと、前記第2メッセージを送信した時刻を含むフォローアップメッセージとを、前記第1メッセージを受信した相手の前記スレーブ装置である対象スレーブ装置に送信する第3送信手段と、
前記第3送信手段が前記第2メッセージを前記対象スレーブ装置に送信すると、前記ビジー状態であることを示す第5メッセージを、前記対象スレーブ装置以外の前記スレーブ装置に送信する第4送信手段と、
前記対象スレーブ装置から前記マスタ装置と前記スレーブ装置との間の伝搬遅延時間を求めるための第3メッセージを受信する第4受信手段と、
前記第4受信手段が前記対象スレーブ装置から前記第3メッセージを受信すると、前記対象スレーブ装置に前記第3メッセージを受信した時刻を含む第4メッセージを送信する第5送信手段と、
を備えることを特徴とする。
The master device according to the third aspect of the present invention is:
A master device that performs time synchronization with two or more slave devices via a network,
Third receiving means for receiving a first message for requesting start of time synchronization from the slave device;
When the third receiving unit receives the first message from the slave device, the third receiving unit includes a second message for obtaining an offset time difference between the master device and the slave device, and a time when the second message is transmitted. A third transmission means for transmitting a follow-up message to a target slave device that is the slave device of the other party that received the first message;
A fourth transmission unit configured to transmit a fifth message indicating the busy state to the slave device other than the target slave device when the third transmission unit transmits the second message to the target slave device;
A fourth receiving means for receiving a third message for obtaining a propagation delay time between the master device and the slave device from the target slave device;
When the fourth receiving unit receives the third message from the target slave device, a fifth transmitting unit that transmits a fourth message including the time when the third message is received to the target slave device;
It is characterized by providing.
本発明の第4の観点に係る時刻同期方法は、
ネットワークを介して時刻同期を行うマスタ装置と2以上のスレーブ装置とを備える電子機器システムにおいて、時刻情報を生成するためのクロックを発生させる発振器と、所定の間隔でカウントアップするカウンタとを備える前記スレーブ装置が実行する
前記カウンタの値が所定の値を超えた場合に、前記マスタ装置が他のスレーブ装置と時刻同期を行っているビジー状態であるか否かを判定する判定ステップと、
前記判定ステップで前記ビジー状態でないと判定した場合、前記マスタ装置に時刻同期の開始を要求する第1メッセージを送信する第1送信ステップと、
前記マスタ装置が実行する
前記スレーブ装置から前記第1メッセージを受信する第3受信ステップと、
前記第3受信ステップで前記スレーブ装置から前記第1メッセージを受信すると、前記マスタ装置と前記スレーブ装置との間のオフセット時間差を求めるための第2メッセージと、前記第2メッセージを送信した時刻を含むフォローアップメッセージとを、前記第1メッセージを受信した相手の前記スレーブ装置である対象スレーブ装置に送信する第3送信ステップと、
前記第3送信ステップで前記第2メッセージを前記対象スレーブ装置に送信すると、前記ビジー状態であることを示す第5メッセージを、前記対象スレーブ装置以外の前記スレーブ装置に送信する第4送信ステップと、
前記対象スレーブ装置が実行する
前記マスタ装置から、前記第2メッセージと、前記フォローアップメッセージとを受信する第1受信ステップと、
前記第1受信ステップで前記第2メッセージを受信した時刻と、前記フォローアップメッセージに含まれる前記第2メッセージが前記マスタ装置から送信された時刻とに基づいて、前記オフセット時間差を算出するオフセット算出ステップと、
前記第1受信ステップで前記マスタ装置から前記フォローアップメッセージを受信したのちに、前記マスタ装置に前記マスタ装置と前記スレーブ装置との間の伝搬遅延時間を求めるための第3メッセージを送信する第2送信ステップと、
前記マスタ装置が実行する
前記対象スレーブ装置から前記第3メッセージを受信する第4受信ステップと、
前記第4受信ステップで前記対象スレーブ装置から前記第3メッセージを受信すると、前記対象スレーブ装置に前記第3メッセージを受信した時刻を含む前記第4メッセージを送信する第5送信ステップと、
前記対象スレーブ装置が実行する
前記マスタ装置から前記第4メッセージを受信する第2受信ステップと、
前記第3メッセージを送信した時刻と、前記第4メッセージに含まれる前記第3メッセージを前記マスタ装置が受信した時刻とに基づいて、前記伝搬遅延時間を算出する遅延時間算出ステップと、
前記オフセット時間差および前記伝搬遅延時間に基づいて、前記タイマの時刻を補正する補正ステップと、
を備えることを特徴とする。
The time synchronization method according to the fourth aspect of the present invention is:
In an electronic device system including a master device that performs time synchronization via a network and two or more slave devices, the oscillator includes a clock that generates a clock for generating time information, and a counter that counts up at a predetermined interval A determination step of determining whether or not the master device is busy performing time synchronization with another slave device when the value of the counter executed by the slave device exceeds a predetermined value;
A first transmission step of transmitting a first message requesting the master device to start time synchronization when it is determined that the busy state is not determined in the determination step;
A third receiving step for receiving the first message from the slave device, which is executed by the master device;
When the first message is received from the slave device in the third receiving step, a second message for obtaining an offset time difference between the master device and the slave device and a time at which the second message is transmitted are included. A third transmission step of transmitting a follow-up message to a target slave device that is the slave device of the other party that received the first message;
A fourth transmission step of transmitting a fifth message indicating the busy state to the slave device other than the target slave device when the second message is transmitted to the target slave device in the third transmission step;
A first receiving step of receiving the second message and the follow-up message from the master device, executed by the target slave device;
Offset calculating step for calculating the offset time difference based on the time when the second message is received in the first receiving step and the time when the second message included in the follow-up message is transmitted from the master device. When,
A second message for transmitting a third message for determining a propagation delay time between the master device and the slave device after receiving the follow-up message from the master device in the first receiving step; Sending step;
A fourth reception step of receiving the third message from the target slave device, executed by the master device;
When receiving the third message from the target slave device in the fourth reception step, a fifth transmission step of transmitting the fourth message including the time when the third message is received to the target slave device;
A second receiving step for receiving the fourth message from the master device, executed by the target slave device;
A delay time calculating step of calculating the propagation delay time based on a time when the third message is transmitted and a time when the master device receives the third message included in the fourth message;
A correction step of correcting the time of the timer based on the offset time difference and the propagation delay time;
It is characterized by providing.
本発明の第5の観点に係るプログラムは、コンピュータを、
時刻情報を生成するタイマ、
前記時刻情報を生成するためのクロックを発生させる発振器、
所定の間隔でカウントアップするカウンタ、
前記カウンタの値が所定の値を超えた場合に、前記マスタ装置が他のスレーブ装置と時刻同期を行っているビジー状態であるか否かを判定する判定手段、
前記判定手段が前記ビジー状態でないと判定した場合、前記マスタ装置に時刻同期の開始を要求する第1メッセージを送信する第1送信手段、
前記マスタ装置から、前記マスタ装置と前記スレーブ装置との間のオフセット時間差を求めるための第2メッセージと、前記第2メッセージが前記マスタ装置から送信された時刻を含むフォローアップメッセージとを受信する第1受信手段、
前記第1受信手段が前記第2メッセージを受信した時刻と、前記フォローアップメッセージに含まれる前記第2メッセージが前記マスタ装置から送信された時刻とに基づいて、前記オフセット時間差を算出するオフセット算出手段、
前記第1受信手段が前記マスタ装置から前記フォローアップメッセージを受信したのちに、前記マスタ装置に前記マスタ装置と前記スレーブ装置との間の伝搬遅延時間を求めるための第3メッセージを送信する第2送信手段、
前記マスタ装置から前記第3メッセージを前記マスタ装置が受信した時刻を含む第4メッセージを受信する第2受信手段、
前記第2送信手段が前記第3メッセージを送信した時刻と、前記第4メッセージに含まれる前記第3メッセージを前記マスタ装置が受信した時刻とに基づいて、前記伝搬遅延時間を算出する遅延時間算出手段、および、
前記オフセット時間差および前記伝搬遅延時間に基づいて、前記タイマの時刻を補正する補正手段、
として機能させることを特徴とする。
A program according to a fifth aspect of the present invention provides a computer,
A timer that generates time information,
An oscillator for generating a clock for generating the time information;
A counter that counts up at predetermined intervals,
A determination unit that determines whether or not the master device is busy performing time synchronization with another slave device when the value of the counter exceeds a predetermined value;
A first transmission unit configured to transmit a first message requesting the master device to start time synchronization when the determination unit determines that the busy state is not present;
A second message for receiving an offset time difference between the master device and the slave device and a follow-up message including a time when the second message is transmitted from the master device from the master device. 1 receiving means,
Offset calculating means for calculating the offset time difference based on the time when the first receiving means receives the second message and the time when the second message included in the follow-up message is transmitted from the master device. ,
After the first receiving means receives the follow-up message from the master device, a second message is transmitted to the master device for determining a propagation delay time between the master device and the slave device. Transmission means,
Second receiving means for receiving a fourth message including a time at which the master device has received the third message from the master device;
Delay time calculation for calculating the propagation delay time based on the time at which the second transmission means transmits the third message and the time at which the master device receives the third message included in the fourth message. Means and
Correction means for correcting the time of the timer based on the offset time difference and the propagation delay time;
It is made to function as.
本発明によれば、マスタ装置と複数のスレーブ装置とのネットワークを介する時刻同期において、スレーブ装置の初期起動時の時刻同期精度の低下を防ぎ、ネットワークへの負荷を軽減し、かつ、時刻同期までの時間を短縮することができる。 According to the present invention, in time synchronization via a network between a master device and a plurality of slave devices, a decrease in time synchronization accuracy at the time of initial startup of the slave device is prevented, a load on the network is reduced, and time synchronization is also achieved. Can be shortened.
本実施の形態において、第1メッセージはAnnounce Message 1、第2メッセージはAnnounce Message 2、フォローアップメッセージはFollow Up Message、第3メッセージはDelay Request Message、第4メッセージはDelay Response Message、第5メッセージは、Announce Message 3である。
In this embodiment, the first message is Announce
以下、本発明を実施するための形態について図を参照して詳細に説明する。なお図中、同一または同等の部分には同一の符号を付す。 Hereinafter, embodiments for carrying out the present invention will be described in detail with reference to the drawings. In the drawings, the same or equivalent parts are denoted by the same reference numerals.
図1は、本発明の実施の形態に係る電子機器システムの構成例を示すブロック図である。電子機器システム100は、ネットワーク上のマスタ装置M1とX個のスレーブ装置S1〜SXとから構成される。マスタ装置M1は、スレーブ装置S1〜SXに対してそれぞれパス21〜Xで接続されており、それぞれのスレーブ装置S1〜SXに対して時刻同期を行う。本実施の形態では、時刻同期としてIEEE1588を採用しており、PTPによって時刻同期を行う。PTPでは、システムが備えるすべての装置のタイマのうち、最も正確なタイマに同期する。すなわち、最も正確なタイマを有する装置をマスタ装置とし、それ以外の装置をスレーブ装置とする。このため、マスタ装置は変更される可能性がある。
FIG. 1 is a block diagram illustrating a configuration example of an electronic device system according to an embodiment of the present invention. The
図2は、PTPを用いる時刻同期を説明する図である。IEEE1588規格で定義されたPTPによる時刻同期の一般的な動作フローの例を示す。ここでは、マスタ装置がSync Messageを送出したときのマスタ装置の時刻を00:00として説明する。まず、マスタ装置から時刻00:00にマスタ装置とスレーブ装置との間のオフセット時間差を求めるためのSync Messageをスレーブ装置へ送出する。次に、マスタ装置から時刻00:00にSync Messageを送出したことを伝えるFollow Up Messageをスレーブ装置へ送出する。 FIG. 2 is a diagram for explaining time synchronization using PTP. An example of a general operation flow of time synchronization by PTP defined in the IEEE 1588 standard is shown. Here, it is assumed that the time of the master device when the master device sends a Sync Message is 0:00. First, the master device transmits a Sync Message for obtaining an offset time difference between the master device and the slave device to the slave device at time 0:00. Next, a Follow Up Message is transmitted from the master device to the slave device indicating that the Sync Message has been transmitted at time 0:00.
スレーブ装置は、時刻00:06にSync Messageを受信し、時刻00:08にFollow UP Messageを受信する。スレーブ装置は、Sync Messageを受信した時刻00:06と、Follow UP Messageに含まれるマスタ装置からSync Messageが送出された時刻00:00とに基づいて、オフセット時間差{00:06−00:00=00:06}を算出し、時刻00:08からオフセット時間差00:06を引いて、時刻00:02にするオフセット補正を行なう。 The slave device receives a Sync Message at time 00:06 and receives a Follow UP Message at time 00:08. The slave device, based on the time 00:06 at which the Sync Message is received and the time 00:00 at which the Sync Message is transmitted from the master device included in the Follow UP Message, the offset time difference {00: 06-00: 00 = 00:06} is calculated, and offset correction 00:06 is subtracted from time 00:08 to perform offset correction at time 00:02.
次に、マスタ装置とスレーブ装置の間の伝搬遅延時間を求めるために、スレーブ装置からオフセット補正後の時刻00:06にマスタ装置とスレーブ装置との間の伝搬遅延時間を求めるためのDelay Request Messageをマスタ装置へ送出する。マスタ装置は、時刻00:12にDelay Request Messageを受信したことを伝えるDelay Response Messageを時刻00:13にスレーブ装置へ送出する。 Next, in order to obtain the propagation delay time between the master device and the slave device, a Delay Request Message for obtaining the propagation delay time between the master device and the slave device at time 00:06 after offset correction from the slave device. Is sent to the master device. The master device sends a Delay Response Message that tells that the Delay Request Message has been received at time 00:12 to the slave device at time 00:13.
スレーブ装置は、オフセット補正後の時刻00:13にDelay Response Messageを受信する。スレーブ装置は、Delay Request Messageを送信したオフセット補正後の時刻00:06と、Delay Response Messageに含まれるマスタ装置がDelay Request Messageを受信した時刻00:12とに基づいて、マスタ装置とスレーブ装置との伝搬遅延時間{(00:12−00:06)/2=00:03}を算出し、オフセット補正後の時刻00:15に伝搬遅延時間00:03を足して、時刻00:18にする伝搬遅延補正を行なう。以上によりマスタ装置とスレーブ装置の時刻同期が行なわれる。 The slave device receives the Delay Response Message at time 00:13 after the offset correction. Based on the time 00:06 after offset correction at which the Delay Request Message was transmitted and the time 00:12 at which the master device included in the Delay Response Message received the Delay Request Message, the slave device The propagation delay time {(00: 12-00: 06) / 2 = 00: 03} is calculated, and the propagation delay time 00:03 is added to the time 00:15 after offset correction to obtain the time 00:18. Propagation delay correction is performed. Thus, time synchronization between the master device and the slave device is performed.
図3は、実施の形態に係るスレーブ装置の構成の一例を示すブロック図である。スレーブ装置S1は、カウンタ11、判定部12、送信部13、受信部14、発振器15、タイマ16および処理部17を備える。スレーブ装置S2〜SXも同様の構成である。
FIG. 3 is a block diagram illustrating an example of a configuration of the slave device according to the embodiment. The slave device S1 includes a
カウンタ11は、スレーブ装置S1を起動すると、所定の間隔で(たとえば1秒ごと)にカウントアップする。カウンタ11は、カウンタ値を判定部12に送る。
When the slave device S1 is activated, the
判定部12は、カウンタ11から受け取ったカウンタ値が所定の値以上になった場合、マスタ装置M1が他のスレーブ装置と時刻同期を行っているビジー状態であるか否かを判定する判定処理を行う。所定の値とは、たとえば、タイマ16にクロックを供給する発振器15が安定するまでの時間を示す値、あるいは、発振器15が安定する時間から判定処理を実行する最短時間を引いた時間を示す値であって、あらかじめ設定されている。
When the counter value received from the
送信部13は、マスタ装置M1に各種Messageを送信する。送信部13は、判定部12がビジー状態でないと判定した場合に、時刻同期の開始を要求するAnnounce Message 1をマスタ装置M1に送信する。送信部13は、判定部12がビジー状態であると判定した場合は、Announce Message 1をマスタ装置M1に送信しない。
The
受信部14は、マスタ装置M1から各種メッセージを受信する。受信部14は、マスタ装置M1から、マスタ装置M1とスレーブ装置S1との間のオフセット時間差を求めるためのAnnounce Message 2を受信し、Announce Message 2がマスタ装置M1から送信された時刻を含むFollow UP Messageを受信する。受信部14は、マスタ装置M1から受信したAnnounce Message 2およびFollow UP Messageを処理部17に送る。
The receiving
送信部13は、受信部14がマスタ装置M1からFollow UP Messageを受信すると、送信部13は、マスタ装置M1とスレーブ装置S1との間の伝搬遅延時間を求めるためのDelay Request Messageをマスタ装置M1に送信する。
When the receiving
受信部14は、マスタ装置M1がDelay Request Messageを受信した時刻を含むDelay Response Messageを受信する。受信部14は、マスタ装置M1から受信したDelay Response Messageを処理部17に送る。また、受信部14は、マスタ装置M1からビジー状態であることを示すAnnounce Message 3を受信した場合は、Announce Message 3を判定部12に送る。
The receiving
送信部13は、判定部12がビジー状態でないと判定してから、時刻同期のための各Messageを送信するので、衝突を考慮する必要がなく、通常の時刻パケット通信よりも送信間隔を短くして送信することができる。
Since the
発振器15は、時刻情報を生成するためのクロックを発生させてタイマ16に供給する。
The
タイマ16は、発振器15から供給されるクロックに基づいて計時し、時刻情報を生成する。なお、タイマ16はカウンタ11により構成され、カウンタ11は、発振器15が発生させるクロックに従ってカウントアップしてもよい。
The
処理部17は、受信部14から受け取ったFollow UP Messageに含まれるAnnounce Message 2がマスタ装置M1から送信された時刻と、受信部14がAnnounce Message 2を受信した時刻との差に基づいて、オフセット時間差を算出し、タイマ16の時刻のオフセット補正を行う。また、処理部17は、受信部14から受け取ったDelay Response Messageに含まれるマスタ装置M1がDelay Request Messageを受信した時刻と、送信部13がDelay Request Messageを送信した時刻との差に基づいて、伝搬遅延時間を算出し、タイマ16の伝搬時間補正を行う。このようにして、処理部17は、タイマ16の時刻とマスタ装置M1の時刻とを同期させる。
The
図4は、実施の形態に係る電子機器システムにおける時刻同期を説明する図である。図4の例では、便宜上、電子機器システム100は、マスタ装置1とスレーブ装置S1およびスレーブ装置S2とで構成され、スレーブ装置S1の時刻同期を実行する場合を示す。
FIG. 4 is a diagram for explaining time synchronization in the electronic device system according to the embodiment. In the example of FIG. 4, for convenience, the
スレーブ装置S1が起動すると、カウンタ11がカウントアップを開始する。カウンタ11のカウンタ値がN以上になってから、受信部14がAnnounce Message 3を受信せずに所定の時間(10秒)経過すると、判定部12は、マスタ装置M1が他のスレーブ装置と時刻同期を行っているビジー状態ではないと判定する。カウンタ値Nは、タイマ16にクロックを供給する発振器15が安定するまでの時間を示す値、あるいは、発振器15が安定する時間から判定処理を実行する最短時間を引いた時間を示す値である。
When the slave device S1 is activated, the
判定部12がビジー状態ではないと判定した時刻00:15に、送信部13は、時刻同期の開始を要求するAnnounce Message 1をマスタ装置M1に送信する。マスタ装置M1は、時刻00:03にAnnounce Message 1を受信すると、時刻00:04に、マスタ装置M1とスレーブ装置S1との間のオフセット時間差を求めるためのAnnounce Message 2をスレーブ装置S1に対して送信する。同時に、マスタ装置M1がビジー状態になったことを示すAnnounce Message 3をスレーブ装置S2に対して送信する。そして、Announce Message 2を送出した時刻00:04を含むFollow UP Messageを時刻00:05にスレーブ装置S1へ送出する。
At time 00:15 when the
スレーブ装置S1の受信部14は、時刻00:22にAnnounce Message 2を受信し、時刻00:23にFollow UP Messageを受信する。処理部17は、受信部14がAnnounce Message 2を受信した時刻00:22と、Follow UP Messageに含まれるマスタ装置からAnnounce Message 2が送信された時刻00:04とに基づいて、マスタ装置とのオフセット時間差{00:22−00:04=00:18}を算出し、時刻00:23からオフセット時間差00:18を引いて、時刻00:05にするオフセット補正を行なう。
The receiving
次に、スレーブ装置S1の送信部13は、オフセット補正後の時刻00:06にマスタ装置とスレーブ装置の間の伝搬遅延時間を求めるためのDelay Request Messageをマスタ装置M1に送信する。マスタ装置は、Delay Request Messageを受信した時刻00:12を含むDelay Response Messageを時刻00:13にスレーブ装置S1に送信する。
Next, the
スレーブ装置S1の受信部14は、オフセット補正後の時刻00:13にDelay Response Messageを受信する。処理部17は、送信部13がDelay Request Messageを送信したオフセット補正後の時刻00:06と、Delay Response Messageに含まれるマスタ装置M1がDelay Request Messageを受信した時刻00:12とに基づいて、マスタ装置M1とスレーブ装置S1との伝搬遅延時間{(00:12−00:06)/2=00:03}を算出し、オフセット補正後の時刻00:15に伝搬遅延時間00:03を足して、時刻00:18にする伝搬遅延補正を行なう。以上によりマスタ装置とスレーブ装置の時刻同期が行なわれる。
The receiving
一方、スレーブ装置S2は、カウンタ11のカウンタ値がN以上になってから、所定の時間(10秒)が経過するよりも前の時刻00:02にマスタ装置M1からAnnounce Message 3を受信する。これにより、判定部12は、ビジー状態であると判定する。その後、所定の時間(10秒)が経過する時刻00:12までにAnnounce Message 3を受信しないので、判定部12は、ビジー状態が解除されたと判定する。判定部12がビジー状態でないと判定したので、送信部13は、時刻00:13に時刻同期の開始を要求するAnnounce Message 1をマスタ装置M1に送信する。
On the other hand, the slave device S2 receives the Announce
図5は、実施の形態に係るスレーブ装置の時刻同期の動作の一例を示すフローチャートである。ここでは、スレーブ装置S1の時刻同期の動作の一例を説明する。スレーブ装置S2〜SXも同様の時刻同期の動作を行う。スレーブ装置S1の電源が起動すると同時にスレーブ装置S1内部のカウンタ11が起動し(ステップS11)、カウントアップを開始する。カウンタ値がN以上になっていない場合には(ステップS12;NO)、発振器15の安定度が悪く時刻同期に使用できないものとし、時刻同期を開始せずにステップS12を繰り返す。カウンタ値Nは、タイマ16にクロックを供給する発振器15が安定するまでの時間を示す値、あるいは、発振器15が安定する時間から判定処理を実行する最短時間を引いた時間を示す値である。
FIG. 5 is a flowchart illustrating an example of the time synchronization operation of the slave device according to the embodiment. Here, an example of the operation of time synchronization of the slave device S1 will be described. The slave devices S2 to SX perform the same time synchronization operation. At the same time as the power supply of the slave device S1 is activated, the
カウンタ値がN以上になった場合には(ステップS12;YES)、発振器15の安定度が時刻同期に使用できる安定度に達したものとし、判定部12は、マスタ装置M1が他のスレーブ装置と時刻同期を行っているビジー状態であるか否かを判定する(ステップS13)。
When the counter value is greater than or equal to N (step S12; YES), it is assumed that the stability of the
判定部12がビジー状態であると判定した場合(ステップS13;YES)、マスタ装置M1のビジー状態が解除されるまで、ステップS13を繰り返す。判定部12がビジー状態でないと判定した場合(ステップS13;NO)、送信部13は、時刻同期の開始を要求するAnnounce Message 1をマスタ装置M1に送信する(ステップS14)。
When the
マスタ装置M1は、スレーブ装置S1からのAnnounce Message 1を受信すると、マスタ装置M1とスレーブ装置S1との間のオフセット時間差を求めるためのAnnounce Message 2をスレーブ装置S1に対して送信する。同時に、マスタ装置M1がビジー状態になったことを示すAnnounce Message 3をその他のスレーブ装置に対して送信する。あるいは、マスタ装置M1は、ステーブ装置S1との時刻同期を開始してビジー状態になったことを、その他のスレーブ装置に報知するために、ステーブ装置S1を宛先とするAnnounce Message 2をブロードキャストしてもよい。そして、マスタ装置M1は、Announce Message 2を送信した時刻を含むFollow UP Messageをスレーブ装置S1に送信する。
When master device M1 receives Announce
マスタ装置M1は、複数のスレーブ装置からAnnounce Message 1を同時に受信した場合は、これらのスレーブ装置のうちいずれかを無作為に選出し、選出したスレーブ装置に対してAnnounce Message 2を送信してもよい。この場合、マスタ装置M1は、選出しなかったスレーブ装置に対してAnnounce Message 3を送信する。選出されなかったスレーブ装置は、Announce Message 3を受信すると、マスタ装置M1がビジー状態であると判定し、その後マスタ装置M1がビジー状態でなくなったと判定した場合にあらためてAnnounce Message 1を送信する。
When the master device M1 receives the Announce
スレーブ装置S1の受信部14がマスタ装置M1からAnnounce Message 2を受信し(ステップS15)、マスタ装置M1からAnnounce Message 2が送信された時刻を含むFollow UP Messageを受信すると(ステップS16)、処理部17は、Follow UP Messageに含まれるマスタ装置M1からAnnounce Message 2が送信された時刻と、受信部14がAnnounce Message 2を受信した時刻とに基づいてオフセット時間差を算出し(ステップS17)、タイマ16のオフセット補正を行う(ステップS18)。
When the receiving
次に、送信部13は、マスタ装置M1とスレーブ装置S1との間の伝搬遅延時間を求めるためのDelay Request Messageを通常の時刻パケット通信よりも短い送信間隔でマスタ装置M1に送信する(ステップS19)。ここでの送信間隔とは、受信部14がFollow UP Messageを受信してから送信部13がDelay Request Messageを送信するまでの時間である。他のスレーブ装置からマスタ装置M1にMessageが送信されることがないので、通常の時刻パケット通信よりも送信間隔を短くしたDelay Request Messageをマスタ装置M1に送信することが可能となる。これにより、時刻同期完了までの期間を通常よりも短くすることが可能となる。
Next, the
マスタ装置M1は、スレーブ装置S1からのDelay Request Messageを受信すると、Delay Request Messageを受信した時刻を含むDelay Response Messageをスレーブ装置S1に送信する。 When receiving the Delay Request Message from the slave device S1, the master device M1 transmits a Delay Response Message including the time when the Delay Request Message is received to the slave device S1.
スレーブ装置S1の受信部14がマスタ装置M1からDelay Response Messageを受信すると(ステップS20)、処理部17は、Delay Response Messageに含まれるマスタ装置M1がDelay Request Messageを受信した時刻と、送信部13がDelay Request Messageを送信した時刻とに基づいて伝搬遅延時間を算出し(ステップS21)、タイマ16の伝搬遅延補正を行い(ステップS22)、処理を終了する。
When the
図6は、実施の形態に係るスレーブ装置の判定処理の動作の一例を示すフローチャートである。ここでは、スレーブ装置S1が図6のステップS13行う判定処理の動作の一例を説明する。スレーブ装置S2〜SXも同様の判定処理の動作を行う。スレーブ装置S1の受信部14がマスタ装置M1からAnnounce Message 3を受信した場合(ステップS31;YES)、判定部12は、ビジー状態であると判定し(ステップS32)、ステップS33を実行する。受信部14がマスタ装置M1からAnnounce Message 3を受信しない場合(ステップS31;NO)、所定の時間経過したか否かを判定する(ステップS33)。
FIG. 6 is a flowchart illustrating an example of operation of determination processing of the slave device according to the embodiment. Here, an example of the operation of the determination process performed by the slave device S1 in step S13 of FIG. 6 will be described. The slave devices S2 to SX perform the same determination processing operation. When the receiving
ここでの所定の時間とは、マスタ装置M1からAnnounce Message 3が送信される間隔の最大値よりも長い時間である。図5のフローのように、ステップS18〜ステップS20を1度のみ実行することが決まっている場合は、Announce Message 3が送信されてから時刻同期が終了するまでの時間の最大値よりも長い時間に設定する。すなわち、所定の時間とは、マスタ装置M1のビジー状態が解除されたと想定しうる時間である。
The predetermined time here is a time longer than the maximum value of the interval at which the Announce
所要時間が経過していない場合には(ステップS33;NO)、ステップS31に戻り、ステップS31〜ステップS33を繰り返す。所要時間が経過した場合には(ステップS33;YES)、ビジー状態でないと判定し(ステップS34)、処理を終了する。 If the required time has not elapsed (step S33; NO), the process returns to step S31, and steps S31 to S33 are repeated. If the required time has elapsed (step S33; YES), it is determined that the state is not busy (step S34), and the process ends.
以上説明したように、本実施の形態の電子機器システム100によれば、スレーブ装置の電源起動後の発振器が安定するまでの所定の時間はマスタ装置との時刻パケット通信を実施しないようにしたことにより、初期起動時の時刻同期精度の劣化を防ぐことができ、ネットワークへの負荷を軽減することができる。さらに、マスタ装置がビジー状態でないことを確認してから、時刻同期を開始するので、衝突を考慮する必要がなく、通常の時刻パケット通信よりも送信間隔を短くしてメッセージを送信することができ、時刻同期までの時間を短縮することができる。
As described above, according to the
上述の実施の形態では、スレーブ装置は、発振器15が安定するのを待って、時刻同期を行った。しかし本発明はこれに限らず、発振器15が安定する前から伝搬遅延時間の算出を繰り返し行って、所定の回数行ったときに、その結果から発振器15が安定したときの伝搬遅延時間を予測してもよい。また、発振器15が安定する前から伝搬遅延時間の算出を繰り返し行って、前回の伝搬遅延時間と今回の伝搬遅延時間との差が閾値以下になった場合に、伝搬遅延時間の算出の繰り返しを終了してもよい。
In the above-described embodiment, the slave device performs time synchronization after the
図7は、他の実施の形態に係るスレーブ装置の時刻同期の動作の一例を示すフローチャートである。図7の実施の形態では、発振器15が安定する前から伝搬遅延時間の算出を繰り返し行って、所定の回数行ったときに、その結果から発振器15が安定したときの伝搬遅延時間を予測する。ここでは、スレーブ装置S1の時刻同期の動作の一例を説明する。スレーブ装置S2〜SXも同様の時刻同期の動作を行う。スレーブ装置S1の電源が起動すると同時にスレーブ装置S1内部のカウンタ11が起動し(ステップS41)、カウントアップを開始する。カウンタ値がN1以上になっていない場合には(ステップS42;NO)、ステップS42を繰り返す。カウンタ値N1は、発振器15が安定する時間よりも短い時間を示す値、あるいは、発振器15が安定する時間から判定処理を実行する最短時間を引いた時間よりも短い時間を示す値である。
FIG. 7 is a flowchart illustrating an example of a time synchronization operation of a slave device according to another embodiment. In the embodiment of FIG. 7, the propagation delay time is repeatedly calculated before the
カウンタ値がN1以上になった場合には(ステップS42;YES)、判定部12は、マスタ装置M1が他のスレーブ装置と時刻同期を行っているビジー状態であるか否かを判定する(ステップS43)。判定部12がビジー状態であると判定した場合(ステップS43;YES)、マスタ装置M1のビジー状態が解除されるまで、ステップS43を繰り返す。マスタ装置M1がビジー状態でない場合(ステップS43;NO)、送信部13は、時刻同期の開始を要求するAnnounce Message 1をマスタ装置M1に送信する(ステップS44)。
When the counter value is equal to or greater than N1 (step S42; YES), the
マスタ装置M1は、スレーブ装置S1からのAnnounce Message 1を受信すると、マスタ装置M1とスレーブ装置S1との間のオフセット時間差を求めるためのAnnounce Message 2をスレーブ装置S1に対して送信する。同時に、マスタ装置M1がビジー状態になったことを示すAnnounce Message 3をその他のスレーブ装置に対して送信する。あるいは、マスタ装置M1は、ステーブ装置S1との時刻同期を開始してビジー状態になったことを、その他のスレーブ装置に報知するために、ステーブ装置S1を宛先とするAnnounce Message 2をブロードキャストしてもよい。そして、マスタ装置M1は、Announce Message 2を送信した時刻を含むFollow UP Messageをスレーブ装置S1に送信する。
When master device M1 receives Announce
スレーブ装置S1の受信部14がマスタ装置M1からAnnounce Message 2を受信し(ステップS45)、マスタ装置M1からAnnounce Message 2が送信された時刻を含むFollow UP Messageを受信すると(ステップS46)、処理部17は、Follow UP Messageに含まれるマスタ装置M1からAnnounce Message 2が送信された時刻と、受信部14がAnnounce Message 2を受信した時刻とに基づいてオフセット時間差を算出し(ステップS47)、タイマ16のオフセット補正を行う(ステップS48)。
When the receiving
次に、送信部13は、マスタ装置M1とスレーブ装置S1との間の伝搬遅延時間を求めるためのDelay Request Messageを通常の時刻パケット通信よりも短い送信間隔でマスタ装置M1に送信する(ステップS49)。ここでの送信間隔とは、受信部14がFollow UP Messageを受信してから送信部13がDelay Request Messageを送信するまでの時間である。
Next, the
マスタ装置M1は、スレーブ装置S1からのDelay Request Messageを受信すると、Delay Request Messageを受信した時刻を含むDelay Response Messageをスレーブ装置S1に送信する。同時に、マスタ装置M1がビジー状態であることを示すAnnounce Message 3をその他のスレーブ装置に対して送信する。あるいは、マスタ装置M1は、ステーブ装置S1との時刻同期のためビジー状態であることを、その他のスレーブ装置に報知するために、ステーブ装置S1を宛先とするDelay Response Messageをブロードキャストしてもよい。
When receiving the Delay Request Message from the slave device S1, the master device M1 transmits a Delay Response Message including the time when the Delay Request Message is received to the slave device S1. At the same time, Announce
スレーブ装置S1の受信部14がマスタ装置M1からDelay Response Messageを受信すると(ステップS50)、処理部17は、送信部13がDelay Request Messageを送信した時刻と、Delay Response Messageに含まれるマスタ装置M1がDelay Request Messageを受信した時刻とに基づいて伝搬遅延時間を算出する(ステップS51)。ステップS49〜ステップS51を所定の回数繰り返していない場合(ステップS52;NO)、ステップS49に戻り、ステップS49〜ステップS52を繰り返す。ステップS49〜ステップS51を所定の回数繰り返した場合(ステップS52;YES)、処理部17は、タイマ16の伝搬遅延補正を行う(ステップS52)。こうして、所定の回数分の伝搬遅延時間が算出される。
When the receiving
処理部17は、所定の回数分の伝搬遅延時間から、発振器15が安定したときの伝搬遅延時間を予測し(ステップS53)、予測した伝搬遅延時間に基づいて、タイマ16の伝搬遅延補正を行い(ステップS54)、処理を終了する。
The
所定の回数は、発振器15が安定したときの同期時刻を予測可能な程度の回数であればよい。また、処理部17は、発振器15が安定したときの伝搬遅延時間を予測して伝搬遅延補正を行うとともに、伝搬遅延補正の補正値に基づいて、発振器15が安定しないことによる誤差を算出し、改めてオフセット補正を行ってもよい。
The predetermined number of times may be a number enough to predict the synchronization time when the
図7の例では、所定の回数ステップS49〜ステップS52を繰り返す。このとき、送信部13は、通常の時刻パケット通信よりも短い送信間隔でDelay Request Messageをマスタ装置M1に送信する。ここでの送信間隔とは、受信部14がDelay Response Messageを受信してから送信部13が次のDelay Request Messageを送信するまでの時間である。
In the example of FIG. 7, step S49 to step S52 are repeated a predetermined number of times. At this time, the
この実施の形態によれば、スレーブ装置の発振器15が安定する前から複数回伝搬遅延時間を算出し、その伝搬遅延時間の変移から発振器15が安定したときの伝搬遅延時間を予測することにより、時刻同期までの時間をさらに短縮することができる。
According to this embodiment, the propagation delay time is calculated a plurality of times before the
図8は、他の実施の形態に係るスレーブ装置の時刻同期の動作の一例を示すフローチャートである。図8の実施の形態では、発振器15が安定する前から伝搬遅延時間の算出を繰り返し行って、前回の伝搬遅延時間と今回の伝搬遅延時間との差が閾値以下になった場合に、伝搬遅延時間の算出の繰り返しを終了する。ここでは、スレーブ装置S1の時刻同期の動作の一例を説明する。スレーブ装置S2〜SXも同様の時刻同期の動作を行う。スレーブ装置S1の電源が起動すると同時にスレーブ装置S1内部のカウンタ11が起動し(ステップS61)、カウントアップを開始する。カウンタ値がN1以上になっていない場合には(ステップS62;NO)、ステップS62を繰り返す。カウンタ値N1は、発振器15が安定する時間よりも短い時間を示す値、あるいは、発振器15が安定する時間から判定処理を実行する最短時間を引いた時間よりも短い時間を示す値である。
FIG. 8 is a flowchart illustrating an example of a time synchronization operation of a slave device according to another embodiment. In the embodiment of FIG. 8, the propagation delay time is repeatedly calculated before the
カウンタ値がN1以上になった場合には(ステップS62;YES)、判定部12は、マスタ装置M1が他のスレーブ装置と時刻同期を行っているビジー状態であるか否かを判定する(ステップS63)。判定部12がビジー状態であると判定した場合(ステップS63;YES)、マスタ装置M1のビジー状態が解除されるまで、ステップS63を繰り返す。マスタ装置M1がビジー状態でない場合(ステップS63;NO)、送信部13は、時刻同期の開始を要求するAnnounce Message 1をマスタ装置M1に送信する(ステップS64)。
When the counter value is equal to or greater than N1 (step S62; YES), the
マスタ装置M1は、スレーブ装置S1からのAnnounce Message 1を受信すると、マスタ装置M1とスレーブ装置S1との間のオフセット時間差を求めるためのAnnounce Message 2をスレーブ装置S1に対して送信する。同時に、マスタ装置M1がビジー状態になったことを示すAnnounce Message 3をその他のスレーブ装置に対して送信する。あるいは、マスタ装置M1は、ステーブ装置S1との時刻同期を開始してビジー状態になったことを、その他のスレーブ装置に報知するために、ステーブ装置S1を宛先とするAnnounce Message 2をブロードキャストしてもよい。そして、マスタ装置M1は、Announce Message 2を送信した時刻を含むFollow UP Messageをスレーブ装置S1に送信する。
When master device M1 receives Announce
スレーブ装置S1の受信部14がマスタ装置M1からAnnounce Message 2を受信し(ステップS65)、マスタ装置M1からAnnounce Message 2が送信された時刻を含むFollow UP Messageを受信すると(ステップS66)、処理部17は、Follow UP Messageに含まれるマスタ装置M1からAnnounce Message 2が送信された時刻と、受信部14がAnnounce Message 2を受信した時刻とに基づいてオフセット時間差を算出し(ステップS67)、タイマ16のオフセット補正を行う(ステップS68)。
When the receiving
次に、送信部13は、マスタ装置M1とスレーブ装置S1との間の伝搬遅延時間を求めるためのDelay Request Messageを通常の時刻パケット通信よりも短い送信間隔でマスタ装置M1に送信する(ステップS69)。ここでの送信間隔とは、受信部14がFollow UP Messageを受信してから送信部13がDelay Request Messageを送信するまでの時間である。
Next, the
マスタ装置M1は、スレーブ装置S1からのDelay Request Messageを受信すると、Delay Request Messageを受信した時刻を含むDelay Response Messageをスレーブ装置S1に送信する。同時に、マスタ装置M1がビジー状態であることを示すAnnounce Message 3をその他のスレーブ装置に対して送信する。あるいは、マスタ装置M1は、ステーブ装置S1との時刻同期のためビジー状態であることを、その他のスレーブ装置に報知するために、ステーブ装置S1を宛先とするDelay Response Messageをブロードキャストしてもよい。
When receiving the Delay Request Message from the slave device S1, the master device M1 transmits a Delay Response Message including the time when the Delay Request Message is received to the slave device S1. At the same time, Announce
スレーブ装置S1の受信部14がマスタ装置M1からDelay Response Messageを受信すると(ステップS70)、処理部17は、送信部13がDelay Request Messageを送信した時刻と、Delay Response Messageに含まれるマスタ装置M1がDelay Request Messageを受信した時刻とに基づいて伝搬遅延時間を算出する(ステップS71)。前回算出した伝搬遅延時間と、今回算出した伝搬遅延時間との差が閾値(たとえば1秒)以下でなかった場合(ステップS72;NO)、ステップS69に戻り、ステップS69〜ステップS72を繰り返す。前回算出した伝搬遅延時間と、今回算出した伝搬遅延時間との差が閾値(たとえば1秒)以下であった場合(ステップS72;YES)、処理部17は、今回算出した伝搬遅延時間に基づいて、タイマ16の伝搬遅延補正を行い(ステップS73)、処理を終了する。
When the
ステップS51で判定する閾値は、0以上の値であって、求められている時刻同期精度の許容範囲内であればよい。また、処理部17は、値が収束した伝搬遅延時間に基づいて伝搬遅延補正を行うとともに、伝搬遅延補正の補正値に基づいて、発振器15が安定しないことによる誤差を算出し、改めてオフセット補正を行ってもよい。
The threshold value determined in step S51 may be a value equal to or greater than 0 and within the allowable range of time synchronization accuracy that is obtained. Further, the
図8の例では、ステップS69〜ステップS72を繰り返す。このとき、送信部13は、通常の時刻パケット通信よりも短い送信間隔でDelay Request Messageをマスタ装置M1に送信する。ここでの送信間隔とは、受信部14がDelay Response Messageを受信してから送信部13が次のDelay Request Messageを送信するまでの時間である。
In the example of FIG. 8, step S69 to step S72 are repeated. At this time, the
この実施の形態によれば、スレーブ装置の発振器15が安定する前から伝搬遅延時間の算出を繰り返し行い、その伝搬遅延時間の値が所定の範囲まで収束したときの伝搬遅延時間の算出の繰り返しを終了することにより、時刻同期までの時間をさらに短縮することができる。
According to this embodiment, the propagation delay time is repeatedly calculated before the
図9は、他の実施の形態に係る電子機器システムにおける時刻同期を説明する図である。図6、図7および図8のフローチャートを参照しながら、図9を用いて本実施の形態に係る電子機器システム100における時刻同期の動作フローの例を説明する。図9の例では、便宜上、電子機器システム100は、マスタ装置1とスレーブ装置S1およびスレーブ装置S2とで構成され、スレーブ装置S1の時刻同期を実行する場合を示す。
FIG. 9 is a diagram illustrating time synchronization in an electronic device system according to another embodiment. An example of an operation flow of time synchronization in
スレーブ装置S1が起動し(ステップS41、ステップS61)、スレーブ装置S1のカウンタ11のカウンタ値がN以上になり(ステップS42、ステップS62;YES)、Announce Message 3を受信せずに(ステップS31;NO)、所定の時間(12秒)経過すると(ステップS33;NO)、判定部12は、マスタ装置M1はビジー状態ではないと判定する(ステップS43、ステップS63;NO)。判定部12がビジー状態ではないと判定した時刻00:15に、送信部13は、時刻同期の開始を要求するAnnounce Message 1をマスタ装置M1に送信する(ステップS44、ステップS64)。マスタ装置M1は、時刻00:03にAnnounce Message 1を受信すると、時刻00:04に、マスタ装置M1とスレーブ装置S1との間のオフセット時間差を求めるためのAnnounce Message 2をスレーブ装置S1に対して送信する。同時に、マスタ装置M1がビジー状態になったことを示すAnnounce Message 3をスレーブ装置S2に対して送信する。そして、Announce Message 2を送出した時刻00:04を含むFollow UP Messageを時刻00:05にスレーブ装置S1へ送出する。
The slave device S1 is activated (step S41, step S61), the counter value of the
スレーブ装置S1の受信部14は、時刻00:22にAnnounce Message 2を受信し(ステップS45、ステップS65)、時刻00:23にFollow UP Messageを受信する(ステップS46、ステップS66)。処理部17は、受信部14がAnnounce Message 2を受信した時刻00:22と、Follow UP Messageに含まれるマスタ装置からAnnounce Message 2が送信された時刻00:04とに基づいて、マスタ装置とのオフセット時間差{00:22−00:04=00:18}を算出し(ステップS47、ステップS67)、時刻00:23からオフセット時間差00:18を引いて、時刻00:05にするオフセット補正を行なう(ステップS48、ステップS68)。
The receiving
次に、スレーブ装置S1の送信部13は、オフセット補正後の時刻00:06にマスタ装置とスレーブ装置の間の伝搬遅延時間を求めるためのDelay Request Messageをマスタ装置M1に送信する(ステップS49、ステップS69)。マスタ装置は、Delay Request Messageを受信した時刻00:12を含むDelay Response Messageを時刻00:13にスレーブ装置S1に送信する。
Next, the
スレーブ装置S1の受信部14は、オフセット補正後の時刻00:13にDelay Response Messageを受信する(ステップS50、ステップS70)。処理部17は、送信部13がDelay Request Messageを送信したオフセット補正後の時刻00:06と、Delay Response Messageに含まれるマスタ装置M1がDelay Request Messageを受信した時刻00:12とに基づいて、マスタ装置M1とスレーブ装置S1との伝搬遅延時間{(00:12−00:06)/2=00:03}を算出する(ステップS51、ステップS71)。
The receiving
ここで、所定の回数(2回)伝搬遅延時間の算出を繰り返していない(ステップS52;NO)、あるいは、前回算出した伝搬遅延時間がないので(ステップS72;NO)、スレーブ装置S1の送信部13は、オフセット補正後の時刻00:13にマスタ装置とスレーブ装置の間の伝搬遅延時間を求めるためのDelay Request Messageをマスタ装置M1に再度送信する(ステップS49、ステップS69)。マスタ装置は、Delay Request Messageを受信した時刻00:20を含むDelay Response Messageを時刻00:21にスレーブ装置S1に送信する。
Here, the calculation of the propagation delay time is not repeated a predetermined number of times (twice) (step S52; NO), or there is no propagation delay time calculated last time (step S72; NO), so the transmission unit of the
スレーブ装置S1の受信部14は、オフセット補正後の時刻00:21にDelay Response Messageを受信する(ステップS50、ステップS70)。処理部17は、送信部13がDelay Request Messageを送信したオフセット補正後の時刻00:14と、Delay Response Messageに含まれるマスタ装置M1がDelay Request Messageを受信した時刻00:20とに基づいて、マスタ装置M1とスレーブ装置S1との伝搬遅延時間{(00:20−00:14)/2=00:03}を算出する(ステップS51、ステップS71)。
The receiving
所定の回数(2回)伝搬遅延時間の算出を繰り返した(ステップS52;YES)、ので、1回目に算出した伝搬遅延時間3秒と、2回目に算出した伝搬遅延時間3秒とに基づいて、発振器15が安定したときの伝搬遅延時間は3秒と予測する(ステップS53)。
Since the calculation of the propagation delay time is repeated a predetermined number of times (twice) (step S52; YES), based on the
あるいは、前回算出した伝搬遅延時間3秒と、今回算出した伝搬遅延時間3秒との差が閾値(1秒)以下であるので(ステップS72;YES)、伝搬遅延時間は3秒とする。 Alternatively, since the difference between the previously calculated propagation delay time of 3 seconds and the currently calculated propagation delay time of 3 seconds is equal to or less than the threshold (1 second) (step S72; YES), the propagation delay time is set to 3 seconds.
処理部17は、オフセット補正後の時刻00:23に伝搬遅延時間00:03を足して、時刻00:26にする伝搬遅延補正を行なう(ステップS54、ステップS73)。以上によりマスタ装置とスレーブ装置の時刻同期が行なわれる。
The
一方、スレーブ装置S2は、カウンタ11のカウンタ値がN以上になってから(ステップS42、ステップS62;YES)、所定の時間(12秒)が経過するよりも前の時刻00:02にマスタ装置M1からAnnounce Message 3を受信する(ステップS31;YES)。これにより、判定部12は、ビジー状態であると判定する(ステップS32)。また、所定の時間(12秒)が経過する前の時刻00:13にマスタ装置M1からAnnounce Message 3を受信する(ステップS31)。これにより、判定部12は、ビジー状態であると判定する(ステップS32)。さらに、所定の時間(12秒)が経過する前の時刻00:21にマスタ装置M1からAnnounce Message 3を受信する(ステップS31)。これにより、判定部12は、ビジー状態であると判定する(ステップS32)。そして、所定の時間(12秒)が経過する時刻00:33までにAnnounce Message 3を受信していないので(ステップS33;YES)、判定部12は、マスタ装置M1のビジー状態が解除されたと判定する(ステップS34)。判定部12がビジー状態でないと判定したので、送信部13は、時刻00:34に時刻同期の開始を要求するAnnounce Message 1をマスタ装置M1に送信する(ステップS44、ステップS64)。
On the other hand, the slave device S2 receives the master device at time 00:02 before a predetermined time (12 seconds) elapses after the counter value of the
図10は、実施の形態に係るスレーブ装置のハードウェア構成例を示すブロック図である。スレーブ装置S1〜SXは、図10に示すように、制御部31、主記憶部32、外部記憶部33、操作部34、表示部35および発振器36を備える。主記憶部32、外部記憶部33、操作部34、表示部35および発振器36はいずれも内部バス30を介して制御部31に接続されている。
FIG. 10 is a block diagram illustrating a hardware configuration example of the slave device according to the embodiment. As illustrated in FIG. 10, the slave devices S <b> 1 to SX include a
制御部31はCPU(Central Processing Unit)等から構成され、外部記憶部33に記憶されている制御プログラム30に従って、カウンタ11、送信部13、受信部14、タイマ16および処理部17の各処理を実行する。
The
主記憶部32はRAM(Random-Access Memory)等から構成され、外部記憶部33に記憶されている制御プログラム30をロードし、制御部31の作業領域として用いられる。
The
外部記憶部33は、フラッシュメモリ、ハードディスク、DVD−RAM(Digital Versatile Disc Random-Access Memory)、DVD−RW(Digital Versatile Disc ReWritable)等の不揮発性メモリから構成され、スレーブ装置S1〜SXの処理を制御部31に行わせるためのプログラムをあらかじめ記憶し、また、制御部31の指示に従って、このプログラムが記憶するデータを制御部31に供給し、制御部31から供給されたデータを記憶する。
The
操作部34はキーボードやテンキーなどのポインティングデバイス等と、キーボードやテンキー等を内部バス30に接続するインタフェース装置から構成されている。さらに操作部34は音声入力装置を備えることとしてもよい。ユーザがカウンタ値Nや閾値時刻同期の間隔αなどの入力を行う場合は、操作部34を介して、指示が制御部31に供給される。
The
表示部35は、CRT(Cathode Ray Tube)またはLCD(Liquid Crystal Display)などから構成され、制御部31から送られてきた情報を表示する。ユーザがカウンタ値Nや閾値時刻同期の間隔αなどの入力を行う場合は、表示部35は、操作画面を表示する。
The
発振器37は、所定の周波数のクロックを発生させて、制御部31に供給する。発振器37は、発振器15として機能する。
The oscillator 37 generates a clock having a predetermined frequency and supplies it to the
図3に示すスレーブ装置S1(スレーブ装置S2〜SX)のカウンタ11、送信部13、受信部14、発振器15、タイマ16および処理部17の処理は、制御プログラム30が、制御部31、主記憶部32、外部記憶部33、操作部34、表示部35、発振器36および発振器37などを資源として用いて処理することによって実行する。
The processing of the
その他、前記のハードウェア構成やフローチャートは一例であり、任意に変更および修正が可能である。 In addition, the hardware configuration and the flowchart described above are merely examples, and can be arbitrarily changed and modified.
制御部31、主記憶部32、外部記憶部33、操作部34、内部バス30などから構成される時刻同期処理を行う中心となる部分は、専用のシステムによらず、通常のコンピュータシステムを用いて実現可能である。たとえば、前記の動作を実行するためのコンピュータプログラムを、コンピュータが読み取り可能な記録媒体(フレキシブルディスク、CD−ROM、DVD−ROM等)に格納して配布し、当該コンピュータプログラムをコンピュータにインストールすることにより、前記の処理を実行するスレーブ装置S1〜SXを構成してもよい。また、インターネット等の通信ネットワーク上のサーバ装置が有する記憶装置に当該コンピュータプログラムを格納しておき、通常のコンピュータシステムがダウンロード等することでスレーブ装置S1〜SXを構成してもよい。
The central part that performs the time synchronization process including the
また、スレーブ装置S1〜SXの機能を、OS(オペレーティングシステム)とアプリケーションプログラムの分担、またはOSとアプリケーションプログラムとの協働により実現する場合などには、アプリケーションプログラム部分のみを記録媒体や記憶装置に格納してもよい。 Further, when the functions of the slave devices S1 to SX are realized by sharing an OS (operating system) and an application program or by cooperation between the OS and the application program, only the application program portion is stored in a recording medium or a storage device. It may be stored.
また、搬送波にコンピュータプログラムを重畳し、通信ネットワークを介して配信することも可能である。たとえば、通信ネットワーク上の掲示板(BBS, Bulletin Board System)に前記コンピュータプログラムを掲示し、ネットワークを介して前記コンピュータプログラムを配信してもよい。そして、このコンピュータプログラムを起動し、OSの制御下で、他のアプリケーションプログラムと同様に実行することにより、前記の処理を実行できるように構成してもよい。 It is also possible to superimpose a computer program on a carrier wave and distribute it via a communication network. For example, the computer program may be posted on a bulletin board (BBS, Bulletin Board System) on a communication network, and the computer program may be distributed via the network. The computer program may be started and executed in the same manner as other application programs under the control of the OS, so that the above-described processing may be executed.
上記の実施形態の一部又は全部は、以下の付記のようにも記載されうるが、以下には限られない。 A part or all of the above-described embodiment can be described as in the following supplementary notes, but is not limited thereto.
(付記1)
マスタ装置とネットワークを介して時刻同期を行うスレーブ装置であって、
時刻情報を生成するタイマと、
前記時刻情報を生成するためのクロックを発生させる発振器と、
所定の間隔でカウントアップするカウンタと、
前記カウンタの値が所定の値を超えた場合に、前記マスタ装置が他のスレーブ装置と時刻同期を行っているビジー状態であるか否かを判定する判定手段と、
前記判定手段が前記ビジー状態でないと判定した場合、前記マスタ装置に時刻同期の開始を要求する第1メッセージを送信する第1送信手段と、
前記マスタ装置から、前記マスタ装置と前記スレーブ装置との間のオフセット時間差を求めるための第2メッセージと、前記第2メッセージが前記マスタ装置から送信された時刻を含むフォローアップメッセージとを受信する第1受信手段と、
前記第1受信手段が前記第2メッセージを受信した時刻と、前記フォローアップメッセージに含まれる前記第2メッセージが前記マスタ装置から送信された時刻とに基づいて、前記オフセット時間差を算出するオフセット算出手段と、
前記第1受信手段が前記マスタ装置から前記フォローアップメッセージを受信したのちに、前記マスタ装置に前記マスタ装置と前記スレーブ装置との間の伝搬遅延時間を求めるための第3メッセージを送信する第2送信手段と、
前記マスタ装置から前記第3メッセージを前記マスタ装置が受信した時刻を含む第4メッセージを受信する第2受信手段と、
前記第2送信手段が前記第3メッセージを送信した時刻と、前記第4メッセージに含まれる前記第3メッセージを前記マスタ装置が受信した時刻とに基づいて、前記伝搬遅延時間を算出する遅延時間算出手段と、
前記オフセット時間差および前記伝搬遅延時間に基づいて、前記タイマの時刻を補正する補正手段と、
を備えることを特徴とするスレーブ装置。
(Appendix 1)
A slave device that performs time synchronization with a master device via a network,
A timer for generating time information;
An oscillator for generating a clock for generating the time information;
A counter that counts up at predetermined intervals;
A determination means for determining whether or not the master device is busy performing time synchronization with other slave devices when the value of the counter exceeds a predetermined value;
A first transmission unit configured to transmit a first message requesting the master device to start time synchronization when the determination unit determines that the busy state is not present;
A second message for receiving an offset time difference between the master device and the slave device and a follow-up message including a time when the second message is transmitted from the master device from the master device. One receiving means;
Offset calculating means for calculating the offset time difference based on the time when the first receiving means receives the second message and the time when the second message included in the follow-up message is transmitted from the master device. When,
After the first receiving means receives the follow-up message from the master device, a second message is transmitted to the master device for determining a propagation delay time between the master device and the slave device. A transmission means;
Second receiving means for receiving a fourth message including a time at which the master device has received the third message from the master device;
Delay time calculation for calculating the propagation delay time based on the time at which the second transmission means transmits the third message and the time at which the master device receives the third message included in the fourth message. Means,
Correction means for correcting the time of the timer based on the offset time difference and the propagation delay time;
A slave device comprising:
(付記2)
前記第2送信手段が、前記マスタ装置に前記第3メッセージを送信し、
前記第2受信手段が、前記マスタ装置から前記第4メッセージを受信し、および、
前記遅延時間算出手段が、前記第2送信手段が前記第3メッセージを送信した時刻と、前記第4メッセージに含まれる前記第3メッセージを前記マスタ装置が受信した時刻とに基づいて、前記伝搬遅延時間を算出する、
伝搬遅延時間算出処理を所定の周期で繰り返し、
前記補正手段は、前記オフセット時間差と、前記伝搬遅延時間算出処理で算出した複数の前記伝搬遅延時間とに基づいて、前記タイマの時刻を補正することを特徴とする付記1に記載のスレーブ装置。
(Appendix 2)
The second transmission means transmits the third message to the master device;
The second receiving means receives the fourth message from the master device; and
The propagation time based on the time when the delay time calculating means transmits the third message by the second transmitting means and the time when the master device receives the third message included in the fourth message. Calculate the time,
Repeat the propagation delay time calculation process at a predetermined cycle,
The slave device according to
(付記3)
前記伝搬遅延時間算出処理を繰り返し、前記伝搬遅延時間算出処理を所定の回数行って算出した複数の前記伝搬遅延時間に基づいて、前記発振器が安定したときの前記伝搬遅延時間を予測する予測手段をさらに備え、
前記補正手段は、前記オフセット時間差と、前記予測手段が予測した前記伝搬遅延時間とに基づいて、前記タイマの時刻を補正することを特徴とする付記2に記載のスレーブ装置。
(Appendix 3)
Predicting means for predicting the propagation delay time when the oscillator is stable based on the plurality of propagation delay times calculated by repeating the propagation delay time calculating process and performing the propagation delay time calculating process a predetermined number of times. In addition,
The slave device according to
(付記4)
前記伝搬遅延時間算出処理を繰り返し、前記伝搬遅延時間算出処理で算出した前記伝搬遅延時間と、それより前に算出した前記伝搬遅延時間との差が閾値以下になった場合に、
前記補正手段は、前記オフセット時間差と、最後に算出した前記伝搬遅延時間とに基づいて、前記タイマの時刻を補正することを特徴とする付記2に記載のスレーブ装置。
(Appendix 4)
When the propagation delay time calculation process is repeated, and the difference between the propagation delay time calculated in the propagation delay time calculation process and the propagation delay time calculated before is less than or equal to a threshold value,
3. The slave device according to
(付記5)
前記所定の値は、前記スレーブ装置が起動してから前記発振器が安定することを示す時間を表す前記カウンタの値であることを特徴とする付記1に記載のスレーブ装置。
(Appendix 5)
2. The slave device according to
(付記6)
ネットワークを介して時刻同期を行うマスタ装置と2以上のスレーブ装置とを備える電子機器システムであって、
前記スレーブ装置はそれぞれ、
時刻情報を生成するタイマ、
前記時刻情報を生成するためのクロックを発生させる発振器、
所定の間隔でカウントアップするカウンタ、
前記カウンタの値が所定の値を超えた場合に、前記マスタ装置が他のスレーブ装置と時刻同期を行っているビジー状態であるか否かを判定する判定手段、
前記判定手段が前記ビジー状態でないと判定した場合、前記マスタ装置に時刻同期の開始を要求する第1メッセージを送信する第1送信手段、
前記マスタ装置から、前記マスタ装置と前記スレーブ装置との間のオフセット時間差を求めるための第2メッセージと、前記第2メッセージが前記マスタ装置から送信された時刻を含むフォローアップメッセージとを受信する第1受信手段、
前記第1受信手段が前記第2メッセージを受信した時刻と、前記フォローアップメッセージに含まれる前記第2メッセージが前記マスタ装置から送信された時刻とに基づいて、前記オフセット時間差を算出するオフセット算出手段、
前記第1受信手段が前記マスタ装置から前記フォローアップメッセージを受信したのちに、前記マスタ装置に前記マスタ装置と前記スレーブ装置との間の伝搬遅延時間を求めるための第3メッセージを送信する第2送信手段、
前記マスタ装置から前記第3メッセージを前記マスタ装置が受信した時刻を含む第4メッセージを受信する第2受信手段、
前記第2送信手段が前記第3メッセージを送信した時刻と、前記第4メッセージに含まれる前記第3メッセージを前記マスタ装置が受信した時刻とに基づいて、前記伝搬遅延時間を算出する遅延時間算出手段、および、
前記オフセット時間差および前記伝搬遅延時間に基づいて、前記タイマの時刻を補正する補正手段、
を含み、
前記マスタ装置は、
前記スレーブ装置から前記第1メッセージを受信する第3受信手段、
前記第3受信手段が前記スレーブ装置から前記第1メッセージを受信すると、前記第2メッセージと、前記フォローアップメッセージとを、前記第1メッセージを受信した相手の前記スレーブ装置である対象スレーブ装置に送信する第3送信手段、
前記第3送信手段が前記第2メッセージを前記対象スレーブ装置に送信すると、前記ビジー状態であることを示す第5メッセージを、前記対象スレーブ装置以外の前記スレーブ装置に送信する第4送信手段、
前記対象スレーブ装置から前記第3メッセージを受信する第4受信手段、および、
前記第4受信手段が前記対象スレーブ装置から前記第3メッセージを受信すると、前記対象スレーブ装置に前記第4メッセージを送信する第5送信手段、
を含むことを特徴とする電子機器システム。
(Appendix 6)
An electronic device system including a master device that performs time synchronization via a network and two or more slave devices,
Each of the slave devices is
A timer that generates time information,
An oscillator for generating a clock for generating the time information;
A counter that counts up at predetermined intervals,
A determination unit that determines whether or not the master device is busy performing time synchronization with another slave device when the value of the counter exceeds a predetermined value;
A first transmission unit configured to transmit a first message requesting the master device to start time synchronization when the determination unit determines that the busy state is not present;
A second message for receiving an offset time difference between the master device and the slave device and a follow-up message including a time when the second message is transmitted from the master device from the master device. 1 receiving means,
Offset calculating means for calculating the offset time difference based on the time when the first receiving means receives the second message and the time when the second message included in the follow-up message is transmitted from the master device. ,
After the first receiving means receives the follow-up message from the master device, a second message is transmitted to the master device for determining a propagation delay time between the master device and the slave device. Transmission means,
Second receiving means for receiving a fourth message including a time at which the master device has received the third message from the master device;
Delay time calculation for calculating the propagation delay time based on the time at which the second transmission means transmits the third message and the time at which the master device receives the third message included in the fourth message. Means and
Correction means for correcting the time of the timer based on the offset time difference and the propagation delay time;
Including
The master device is
Third receiving means for receiving the first message from the slave device;
When the third receiving unit receives the first message from the slave device, the second message and the follow-up message are transmitted to the target slave device that is the slave device of the other party that received the first message. Third transmitting means for
A fourth transmission unit configured to transmit a fifth message indicating the busy state to the slave device other than the target slave device when the third transmission unit transmits the second message to the target slave device;
Fourth receiving means for receiving the third message from the target slave device; and
Fifth transmission means for transmitting the fourth message to the target slave device when the fourth reception means receives the third message from the target slave device;
An electronic device system comprising:
(付記7)
2以上のスレーブ装置とネットワークを介して時刻同期を行うマスタ装置であって、
前記スレーブ装置から時刻同期の開始を要求する第1メッセージを受信する第3受信手段と、
前記第3受信手段が前記スレーブ装置から前記第1メッセージを受信すると、前記マスタ装置と前記スレーブ装置との間のオフセット時間差を求めるための第2メッセージと、前記第2メッセージを送信した時刻を含むフォローアップメッセージとを、前記第1メッセージを受信した相手の前記スレーブ装置である対象スレーブ装置に送信する第3送信手段と、
前記第3送信手段が前記第2メッセージを前記対象スレーブ装置に送信すると、前記ビジー状態であることを示す第5メッセージを、前記対象スレーブ装置以外の前記スレーブ装置に送信する第4送信手段と、
前記対象スレーブ装置から前記マスタ装置と前記スレーブ装置との間の伝搬遅延時間を求めるための第3メッセージを受信する第4受信手段と、
前記第4受信手段が前記対象スレーブ装置から前記第3メッセージを受信すると、前記対象スレーブ装置に前記第3メッセージを受信した時刻を含む第4メッセージを送信する第5送信手段と、
を備えることを特徴とするマスタ装置。
(Appendix 7)
A master device that performs time synchronization with two or more slave devices via a network,
Third receiving means for receiving a first message for requesting start of time synchronization from the slave device;
When the third receiving unit receives the first message from the slave device, the third receiving unit includes a second message for obtaining an offset time difference between the master device and the slave device, and a time when the second message is transmitted. A third transmission means for transmitting a follow-up message to a target slave device that is the slave device of the other party that received the first message;
A fourth transmission unit configured to transmit a fifth message indicating the busy state to the slave device other than the target slave device when the third transmission unit transmits the second message to the target slave device;
A fourth receiving means for receiving a third message for obtaining a propagation delay time between the master device and the slave device from the target slave device;
When the fourth receiving unit receives the third message from the target slave device, a fifth transmitting unit that transmits a fourth message including the time when the third message is received to the target slave device;
A master device comprising:
(付記8)
前記第4送信手段は、前記第5送信手段が前記第4メッセージを送信する度に、前記対象スレーブ装置以外の前記スレーブ装置に前記第5メッセージを送信することを特徴とする付記7に記載のマスタ装置。
(Appendix 8)
The appendix 7 according to appendix 7, wherein the fourth transmitting unit transmits the fifth message to the slave device other than the target slave device every time the fifth transmitting unit transmits the fourth message. Master device.
(付記9)
ネットワークを介して時刻同期を行うマスタ装置と2以上のスレーブ装置とを備える電子機器システムにおいて、時刻情報を生成するためのクロックを発生させる発振器と、所定の間隔でカウントアップするカウンタとを備える前記スレーブ装置が実行する
前記カウンタの値が所定の値を超えた場合に、前記マスタ装置が他のスレーブ装置と時刻同期を行っているビジー状態であるか否かを判定する判定ステップと、
前記判定ステップで前記ビジー状態でないと判定した場合、前記マスタ装置に時刻同期の開始を要求する第1メッセージを送信する第1送信ステップと、
前記マスタ装置が実行する
前記スレーブ装置から前記第1メッセージを受信する第3受信ステップと、
前記第3受信ステップで前記スレーブ装置から前記第1メッセージを受信すると、前記マスタ装置と前記スレーブ装置との間のオフセット時間差を求めるための第2メッセージと、前記第2メッセージを送信した時刻を含むフォローアップメッセージとを、前記第1メッセージを受信した相手の前記スレーブ装置である対象スレーブ装置に送信する第3送信ステップと、
前記第3送信ステップで前記第2メッセージを前記対象スレーブ装置に送信すると、前記ビジー状態であることを示す第5メッセージを、前記対象スレーブ装置以外の前記スレーブ装置に送信する第4送信ステップと、
前記対象スレーブ装置が実行する
前記マスタ装置から、前記第2メッセージと、前記フォローアップメッセージとを受信する第1受信ステップと、
前記第1受信ステップで前記第2メッセージを受信した時刻と、前記フォローアップメッセージに含まれる前記第2メッセージが前記マスタ装置から送信された時刻とに基づいて、前記オフセット時間差を算出するオフセット算出ステップと、
前記第1受信ステップで前記マスタ装置から前記フォローアップメッセージを受信したのちに、前記マスタ装置に前記マスタ装置と前記スレーブ装置との間の伝搬遅延時間を求めるための第3メッセージを送信する第2送信ステップと、
前記マスタ装置が実行する
前記対象スレーブ装置から前記第3メッセージを受信する第4受信ステップと、
前記第4受信ステップで前記対象スレーブ装置から前記第3メッセージを受信すると、前記対象スレーブ装置に前記第3メッセージを受信した時刻を含む前記第4メッセージを送信する第5送信ステップと、
前記対象スレーブ装置が実行する
前記マスタ装置から前記第4メッセージを受信する第2受信ステップと、
前記第3メッセージを送信した時刻と、前記第4メッセージに含まれる前記第3メッセージを前記マスタ装置が受信した時刻とに基づいて、前記伝搬遅延時間を算出する遅延時間算出ステップと、
前記オフセット時間差および前記伝搬遅延時間に基づいて、前記タイマの時刻を補正する補正ステップと、
を備えることを特徴とする時刻同期方法。
(Appendix 9)
In an electronic device system including a master device that performs time synchronization via a network and two or more slave devices, the oscillator includes a clock that generates a clock for generating time information, and a counter that counts up at a predetermined interval A determination step of determining whether or not the master device is busy performing time synchronization with another slave device when the value of the counter executed by the slave device exceeds a predetermined value;
A first transmission step of transmitting a first message requesting the master device to start time synchronization when it is determined that the busy state is not determined in the determination step;
A third receiving step for receiving the first message from the slave device, which is executed by the master device;
When the first message is received from the slave device in the third receiving step, a second message for obtaining an offset time difference between the master device and the slave device and a time at which the second message is transmitted are included. A third transmission step of transmitting a follow-up message to a target slave device that is the slave device of the other party that received the first message;
A fourth transmission step of transmitting a fifth message indicating the busy state to the slave device other than the target slave device when the second message is transmitted to the target slave device in the third transmission step;
A first receiving step of receiving the second message and the follow-up message from the master device, executed by the target slave device;
Offset calculating step for calculating the offset time difference based on the time when the second message is received in the first receiving step and the time when the second message included in the follow-up message is transmitted from the master device. When,
A second message for transmitting a third message for determining a propagation delay time between the master device and the slave device after receiving the follow-up message from the master device in the first receiving step; Sending step;
A fourth reception step of receiving the third message from the target slave device, executed by the master device;
When receiving the third message from the target slave device in the fourth reception step, a fifth transmission step of transmitting the fourth message including the time when the third message is received to the target slave device;
A second receiving step for receiving the fourth message from the master device, executed by the target slave device;
A delay time calculating step of calculating the propagation delay time based on a time when the third message is transmitted and a time when the master device receives the third message included in the fourth message;
A correction step of correcting the time of the timer based on the offset time difference and the propagation delay time;
A time synchronization method comprising:
(付記10)
前記スレーブ装置が実行する
前記第2送信ステップと、
前記マスタ装置が実行する
前記第4受信ステップと、
前記第5送信ステップと、
前記対象スレーブ装置が実行する
前記第2受信ステップと、
前記遅延時間算出ステップと、
を含む伝搬遅延時間算出処理を所定の周期で繰り返し、
前記補正ステップでは、前記オフセット時間差と、前記伝搬遅延時間算出処理で算出した複数の前記伝搬遅延時間とに基づいて、前記タイマの時刻を補正することを特徴とする付記9に記載の時刻同期方法。
(Appendix 10)
The second transmission step executed by the slave device;
The fourth receiving step executed by the master device;
The fifth transmission step;
The second receiving step executed by the target slave device;
The delay time calculating step;
The propagation delay time calculation process including is repeated at a predetermined cycle,
The time synchronization method according to appendix 9, wherein in the correction step, the time of the timer is corrected based on the offset time difference and the plurality of propagation delay times calculated in the propagation delay time calculation process. .
(付記11)
前記伝搬遅延時間算出処理を繰り返し、前記伝搬遅延時間算出処理を所定の回数行って算出した複数の前記伝搬遅延時間に基づいて、前記発振器が安定したときの前記伝搬遅延時間を予測する予測ステップをさらに備え、
前記補正ステップでは、前記オフセット時間差と、前記予測手段が予測した前記伝搬遅延時間とに基づいて、前記タイマの時刻を補正することを特徴とする付記10に記載の時刻同期方法。
(Appendix 11)
Predicting the propagation delay time when the oscillator is stabilized based on the plurality of propagation delay times calculated by repeating the propagation delay time calculation process and performing the propagation delay time calculation process a predetermined number of times. In addition,
The time synchronization method according to claim 10, wherein in the correction step, the time of the timer is corrected based on the offset time difference and the propagation delay time predicted by the prediction means.
(付記12)
前記伝搬遅延時間算出処理を繰り返し、前記伝搬遅延時間算出処理で算出した前記伝搬遅延時間と、それより前に算出した前記伝搬遅延時間との差が閾値以下になった場合に、
前記補正ステップでは、前記オフセット時間差と、最後に算出した前記伝搬遅延時間とに基づいて、前記タイマの時刻を補正することを特徴とする付記10に記載の時刻同期方法。
(Appendix 12)
When the propagation delay time calculation process is repeated, and the difference between the propagation delay time calculated in the propagation delay time calculation process and the propagation delay time calculated before is less than or equal to a threshold value,
The time synchronization method according to claim 10, wherein in the correction step, the time of the timer is corrected based on the offset time difference and the propagation delay time calculated last.
(付記13)
前記所定の値は、前記スレーブ装置が起動してから前記発振器が安定することを示す時間を表す前記カウンタの値であることを特徴とする付記9に記載の時刻同期方法。
(Appendix 13)
The time synchronization method according to claim 9, wherein the predetermined value is a value of the counter indicating a time indicating that the oscillator is stabilized after the slave device is activated.
(付記14)
前記第4送信ステップでは、前記第5送信ステップで前記第4メッセージを送信する度に、前記対象スレーブ装置以外の前記スレーブ装置に前記第5メッセージを送信することを特徴とする付記9ないし13に記載の時刻同期方法。
(Appendix 14)
In the fourth transmission step, the fifth message is transmitted to the slave device other than the target slave device every time the fourth message is transmitted in the fifth transmission step. The time synchronization method described.
(付記15)
コンピュータを
時刻情報を生成するタイマ、
前記時刻情報を生成するためのクロックを発生させる発振器、
所定の間隔でカウントアップするカウンタ、
前記カウンタの値が所定の値を超えた場合に、前記マスタ装置が他のスレーブ装置と時刻同期を行っているビジー状態であるか否かを判定する判定手段、
前記判定手段が前記ビジー状態でないと判定した場合、前記マスタ装置に時刻同期の開始を要求する第1メッセージを送信する第1送信手段、
前記マスタ装置から、前記マスタ装置と前記スレーブ装置との間のオフセット時間差を求めるための第2メッセージと、前記第2メッセージが前記マスタ装置から送信された時刻を含むフォローアップメッセージとを受信する第1受信手段、
前記第1受信手段が前記第2メッセージを受信した時刻と、前記フォローアップメッセージに含まれる前記第2メッセージが前記マスタ装置から送信された時刻とに基づいて、前記オフセット時間差を算出するオフセット算出手段、
前記第1受信手段が前記マスタ装置から前記フォローアップメッセージを受信したのちに、前記マスタ装置に前記マスタ装置と前記スレーブ装置との間の伝搬遅延時間を求めるための第3メッセージを送信する第2送信手段、
前記マスタ装置から前記第3メッセージを前記マスタ装置が受信した時刻を含む第4メッセージを受信する第2受信手段、
前記第2送信手段が前記第3メッセージを送信した時刻と、前記第4メッセージに含まれる前記第3メッセージを前記マスタ装置が受信した時刻とに基づいて、前記伝搬遅延時間を算出する遅延時間算出手段、および、
前記オフセット時間差および前記伝搬遅延時間に基づいて、前記タイマの時刻を補正する補正手段、
として機能させることを特徴とするプログラム。
(Appendix 15)
A timer that generates time information for the computer,
An oscillator for generating a clock for generating the time information;
A counter that counts up at predetermined intervals,
A determination unit that determines whether or not the master device is busy performing time synchronization with another slave device when the value of the counter exceeds a predetermined value;
A first transmission unit configured to transmit a first message requesting the master device to start time synchronization when the determination unit determines that the busy state is not present;
A second message for receiving an offset time difference between the master device and the slave device and a follow-up message including a time when the second message is transmitted from the master device from the master device. 1 receiving means,
Offset calculating means for calculating the offset time difference based on the time when the first receiving means receives the second message and the time when the second message included in the follow-up message is transmitted from the master device. ,
After the first receiving means receives the follow-up message from the master device, a second message is transmitted to the master device for determining a propagation delay time between the master device and the slave device. Transmission means,
Second receiving means for receiving a fourth message including a time at which the master device has received the third message from the master device;
Delay time calculation for calculating the propagation delay time based on the time at which the second transmission means transmits the third message and the time at which the master device receives the third message included in the fourth message. Means and
Correction means for correcting the time of the timer based on the offset time difference and the propagation delay time;
A program characterized by functioning as
M1 マスタ装置
S1、S2、SX スレーブ装置
11 カウンタ
12 判定部
13 送信部
14 受信部
15 発振器
16 タイマ
17 処理部
31 制御部
32 主記憶部
33 外部記憶部
34 操作部
35 表示部
36 発振器
100 電子機器システム
M1 Master device S1, S2, SX Slave device
11 counter
12 Judgment part
13 Transmitter
14 Receiver
15 Oscillator
16 timer
17 Processing section
31 Control unit
32 Main memory
33 External storage
34 Operation unit
35 Display section
36 Oscillator
100 Electronic equipment system
Claims (10)
時刻情報を生成するタイマと、
前記時刻情報を生成するためのクロックを発生させる発振器と、
所定の間隔でカウントアップするカウンタと、
前記カウンタの値が所定の値を超えた場合に、前記マスタ装置が他のスレーブ装置と時刻同期を行っているビジー状態であるか否かを判定する判定手段と、
前記判定手段が前記ビジー状態でないと判定した場合、前記マスタ装置に時刻同期の開始を要求する第1メッセージを送信する第1送信手段と、
前記マスタ装置から、前記マスタ装置と前記スレーブ装置との間のオフセット時間差を求めるための第2メッセージと、前記第2メッセージが前記マスタ装置から送信された時刻を含むフォローアップメッセージとを受信する第1受信手段と、
前記第1受信手段が前記第2メッセージを受信した時刻と、前記フォローアップメッセージに含まれる前記第2メッセージが前記マスタ装置から送信された時刻とに基づいて、前記オフセット時間差を算出するオフセット算出手段と、
前記第1受信手段が前記マスタ装置から前記フォローアップメッセージを受信したのちに、前記マスタ装置に前記マスタ装置と前記スレーブ装置との間の伝搬遅延時間を求めるための第3メッセージを送信する第2送信手段と、
前記マスタ装置から前記第3メッセージを前記マスタ装置が受信した時刻を含む第4メッセージを受信する第2受信手段と、
前記第2送信手段が前記第3メッセージを送信した時刻と、前記第4メッセージに含まれる前記第3メッセージを前記マスタ装置が受信した時刻とに基づいて、前記伝搬遅延時間を算出する遅延時間算出手段と、
前記オフセット時間差および前記伝搬遅延時間に基づいて、前記タイマの時刻を補正する補正手段と、
を備えることを特徴とするスレーブ装置。 A slave device that performs time synchronization with a master device via a network,
A timer for generating time information;
An oscillator for generating a clock for generating the time information;
A counter that counts up at predetermined intervals;
A determination means for determining whether or not the master device is busy performing time synchronization with other slave devices when the value of the counter exceeds a predetermined value;
A first transmission unit configured to transmit a first message requesting the master device to start time synchronization when the determination unit determines that the busy state is not present;
A second message for receiving an offset time difference between the master device and the slave device and a follow-up message including a time when the second message is transmitted from the master device from the master device. One receiving means;
Offset calculating means for calculating the offset time difference based on the time when the first receiving means receives the second message and the time when the second message included in the follow-up message is transmitted from the master device. When,
After the first receiving means receives the follow-up message from the master device, a second message is transmitted to the master device for determining a propagation delay time between the master device and the slave device. A transmission means;
Second receiving means for receiving a fourth message including a time at which the master device has received the third message from the master device;
Delay time calculation for calculating the propagation delay time based on the time at which the second transmission means transmits the third message and the time at which the master device receives the third message included in the fourth message. Means,
Correction means for correcting the time of the timer based on the offset time difference and the propagation delay time;
A slave device comprising:
前記第2受信手段が、前記マスタ装置から前記第4メッセージを受信し、および、
前記遅延時間算出手段が、前記第2送信手段が前記第3メッセージを送信した時刻と、前記第4メッセージに含まれる前記第3メッセージを前記マスタ装置が受信した時刻とに基づいて、前記伝搬遅延時間を算出する、
伝搬遅延時間算出処理を所定の周期で繰り返し、
前記補正手段は、前記オフセット時間差と、前記伝搬遅延時間算出処理で算出した複数の前記伝搬遅延時間とに基づいて、前記タイマの時刻を補正することを特徴とする請求項1に記載のスレーブ装置。 The second transmission means transmits the third message to the master device;
The second receiving means receives the fourth message from the master device; and
The propagation time based on the time when the delay time calculating means transmits the third message by the second transmitting means and the time when the master device receives the third message included in the fourth message. Calculate the time,
Repeat the propagation delay time calculation process at a predetermined cycle,
2. The slave device according to claim 1, wherein the correction unit corrects the time of the timer based on the offset time difference and the plurality of propagation delay times calculated by the propagation delay time calculation process. .
前記補正手段は、前記オフセット時間差と、前記予測手段が予測した前記伝搬遅延時間とに基づいて、前記タイマの時刻を補正することを特徴とする請求項2に記載のスレーブ装置。 Predicting means for predicting the propagation delay time when the oscillator is stable based on the plurality of propagation delay times calculated by repeating the propagation delay time calculating process and performing the propagation delay time calculating process a predetermined number of times. In addition,
The slave device according to claim 2, wherein the correction unit corrects the time of the timer based on the offset time difference and the propagation delay time predicted by the prediction unit.
前記補正手段は、前記オフセット時間差と、最後に算出した前記伝搬遅延時間とに基づいて、前記タイマの時刻を補正することを特徴とする請求項2に記載のスレーブ装置。 When the propagation delay time calculation process is repeated, and the difference between the propagation delay time calculated in the propagation delay time calculation process and the propagation delay time calculated before is less than or equal to a threshold value,
The slave device according to claim 2, wherein the correction unit corrects the time of the timer based on the offset time difference and the propagation delay time calculated last.
前記スレーブ装置はそれぞれ、
時刻情報を生成するタイマ、
前記時刻情報を生成するためのクロックを発生させる発振器、
所定の間隔でカウントアップするカウンタ、
前記カウンタの値が所定の値を超えた場合に、前記マスタ装置が他のスレーブ装置と時刻同期を行っているビジー状態であるか否かを判定する判定手段、
前記判定手段が前記ビジー状態でないと判定した場合、前記マスタ装置に時刻同期の開始を要求する第1メッセージを送信する第1送信手段、
前記マスタ装置から、前記マスタ装置と前記スレーブ装置との間のオフセット時間差を求めるための第2メッセージと、前記第2メッセージが前記マスタ装置から送信された時刻を含むフォローアップメッセージとを受信する第1受信手段、
前記第1受信手段が前記第2メッセージを受信した時刻と、前記フォローアップメッセージに含まれる前記第2メッセージが前記マスタ装置から送信された時刻とに基づいて、前記オフセット時間差を算出するオフセット算出手段、
前記第1受信手段が前記マスタ装置から前記フォローアップメッセージを受信したのちに、前記マスタ装置に前記マスタ装置と前記スレーブ装置との間の伝搬遅延時間を求めるための第3メッセージを送信する第2送信手段、
前記マスタ装置から前記第3メッセージを前記マスタ装置が受信した時刻を含む第4メッセージを受信する第2受信手段、
前記第2送信手段が前記第3メッセージを送信した時刻と、前記第4メッセージに含まれる前記第3メッセージを前記マスタ装置が受信した時刻とに基づいて、前記伝搬遅延時間を算出する遅延時間算出手段、および、
前記オフセット時間差および前記伝搬遅延時間に基づいて、前記タイマの時刻を補正する補正手段、
を含み、
前記マスタ装置は、
前記スレーブ装置から前記第1メッセージを受信する第3受信手段、
前記第3受信手段が前記スレーブ装置から前記第1メッセージを受信すると、前記第2メッセージと、前記フォローアップメッセージとを、前記第1メッセージを受信した相手の前記スレーブ装置である対象スレーブ装置に送信する第3送信手段、
前記第3送信手段が前記第2メッセージを前記対象スレーブ装置に送信すると、前記ビジー状態であることを示す第5メッセージを、前記対象スレーブ装置以外の前記スレーブ装置に送信する第4送信手段、
前記対象スレーブ装置から前記第3メッセージを受信する第4受信手段、および、
前記第4受信手段が前記対象スレーブ装置から前記第3メッセージを受信すると、前記対象スレーブ装置に前記第4メッセージを送信する第5送信手段、
を含むことを特徴とする電子機器システム。 An electronic device system including a master device that performs time synchronization via a network and two or more slave devices,
Each of the slave devices is
A timer that generates time information,
An oscillator for generating a clock for generating the time information;
A counter that counts up at predetermined intervals,
A determination unit that determines whether or not the master device is busy performing time synchronization with another slave device when the value of the counter exceeds a predetermined value;
A first transmission unit configured to transmit a first message requesting the master device to start time synchronization when the determination unit determines that the busy state is not present;
A second message for receiving an offset time difference between the master device and the slave device and a follow-up message including a time when the second message is transmitted from the master device from the master device. 1 receiving means,
Offset calculating means for calculating the offset time difference based on the time when the first receiving means receives the second message and the time when the second message included in the follow-up message is transmitted from the master device. ,
After the first receiving means receives the follow-up message from the master device, a second message is transmitted to the master device for determining a propagation delay time between the master device and the slave device. Transmission means,
Second receiving means for receiving a fourth message including a time at which the master device has received the third message from the master device;
Delay time calculation for calculating the propagation delay time based on the time at which the second transmission means transmits the third message and the time at which the master device receives the third message included in the fourth message. Means and
Correction means for correcting the time of the timer based on the offset time difference and the propagation delay time;
Including
The master device is
Third receiving means for receiving the first message from the slave device;
When the third receiving unit receives the first message from the slave device, the second message and the follow-up message are transmitted to the target slave device that is the slave device of the other party that received the first message. Third transmitting means for
A fourth transmission unit configured to transmit a fifth message indicating the busy state to the slave device other than the target slave device when the third transmission unit transmits the second message to the target slave device;
Fourth receiving means for receiving the third message from the target slave device; and
Fifth transmission means for transmitting the fourth message to the target slave device when the fourth reception means receives the third message from the target slave device;
An electronic device system comprising:
前記スレーブ装置から時刻同期の開始を要求する第1メッセージを受信する第3受信手段と、
前記第3受信手段が前記スレーブ装置から前記第1メッセージを受信すると、前記マスタ装置と前記スレーブ装置との間のオフセット時間差を求めるための第2メッセージと、前記第2メッセージを送信した時刻を含むフォローアップメッセージとを、前記第1メッセージを受信した相手の前記スレーブ装置である対象スレーブ装置に送信する第3送信手段と、
前記第3送信手段が前記第2メッセージを前記対象スレーブ装置に送信すると、前記ビジー状態であることを示す第5メッセージを、前記対象スレーブ装置以外の前記スレーブ装置に送信する第4送信手段と、
前記対象スレーブ装置から前記マスタ装置と前記スレーブ装置との間の伝搬遅延時間を求めるための第3メッセージを受信する第4受信手段と、
前記第4受信手段が前記対象スレーブ装置から前記第3メッセージを受信すると、前記対象スレーブ装置に前記第3メッセージを受信した時刻を含む第4メッセージを送信する第5送信手段と、
を備えることを特徴とするマスタ装置。 A master device that performs time synchronization with two or more slave devices via a network,
Third receiving means for receiving a first message for requesting start of time synchronization from the slave device;
When the third receiving unit receives the first message from the slave device, the third receiving unit includes a second message for obtaining an offset time difference between the master device and the slave device, and a time when the second message is transmitted. A third transmission means for transmitting a follow-up message to a target slave device that is the slave device of the other party that received the first message;
A fourth transmission unit configured to transmit a fifth message indicating the busy state to the slave device other than the target slave device when the third transmission unit transmits the second message to the target slave device;
A fourth receiving means for receiving a third message for obtaining a propagation delay time between the master device and the slave device from the target slave device;
When the fourth receiving unit receives the third message from the target slave device, a fifth transmitting unit that transmits a fourth message including the time when the third message is received to the target slave device;
A master device comprising:
前記カウンタの値が所定の値を超えた場合に、前記マスタ装置が他のスレーブ装置と時刻同期を行っているビジー状態であるか否かを判定する判定ステップと、
前記判定ステップで前記ビジー状態でないと判定した場合、前記マスタ装置に時刻同期の開始を要求する第1メッセージを送信する第1送信ステップと、
前記マスタ装置が実行する
前記スレーブ装置から前記第1メッセージを受信する第3受信ステップと、
前記第3受信ステップで前記スレーブ装置から前記第1メッセージを受信すると、前記マスタ装置と前記スレーブ装置との間のオフセット時間差を求めるための第2メッセージと、前記第2メッセージを送信した時刻を含むフォローアップメッセージとを、前記第1メッセージを受信した相手の前記スレーブ装置である対象スレーブ装置に送信する第3送信ステップと、
前記第3送信ステップで前記第2メッセージを前記対象スレーブ装置に送信すると、前記ビジー状態であることを示す第5メッセージを、前記対象スレーブ装置以外の前記スレーブ装置に送信する第4送信ステップと、
前記対象スレーブ装置が実行する
前記マスタ装置から、前記第2メッセージと、前記フォローアップメッセージとを受信する第1受信ステップと、
前記第1受信ステップで前記第2メッセージを受信した時刻と、前記フォローアップメッセージに含まれる前記第2メッセージが前記マスタ装置から送信された時刻とに基づいて、前記オフセット時間差を算出するオフセット算出ステップと、
前記第1受信ステップで前記マスタ装置から前記フォローアップメッセージを受信したのちに、前記マスタ装置に前記マスタ装置と前記スレーブ装置との間の伝搬遅延時間を求めるための第3メッセージを送信する第2送信ステップと、
前記マスタ装置が実行する
前記対象スレーブ装置から前記第3メッセージを受信する第4受信ステップと、
前記第4受信ステップで前記対象スレーブ装置から前記第3メッセージを受信すると、前記対象スレーブ装置に前記第3メッセージを受信した時刻を含む前記第4メッセージを送信する第5送信ステップと、
前記対象スレーブ装置が実行する
前記マスタ装置から前記第4メッセージを受信する第2受信ステップと、
前記第3メッセージを送信した時刻と、前記第4メッセージに含まれる前記第3メッセージを前記マスタ装置が受信した時刻とに基づいて、前記伝搬遅延時間を算出する遅延時間算出ステップと、
前記オフセット時間差および前記伝搬遅延時間に基づいて、前記タイマの時刻を補正する補正ステップと、
を備えることを特徴とする時刻同期方法。 In an electronic device system including a master device that performs time synchronization via a network and two or more slave devices, the oscillator includes a clock that generates a clock for generating time information, and a counter that counts up at a predetermined interval A determination step of determining whether or not the master device is busy performing time synchronization with another slave device when the value of the counter executed by the slave device exceeds a predetermined value;
A first transmission step of transmitting a first message requesting the master device to start time synchronization when it is determined that the busy state is not determined in the determination step;
A third receiving step for receiving the first message from the slave device, which is executed by the master device;
When the first message is received from the slave device in the third receiving step, a second message for obtaining an offset time difference between the master device and the slave device and a time at which the second message is transmitted are included. A third transmission step of transmitting a follow-up message to a target slave device that is the slave device of the other party that received the first message;
A fourth transmission step of transmitting a fifth message indicating the busy state to the slave device other than the target slave device when the second message is transmitted to the target slave device in the third transmission step;
A first receiving step of receiving the second message and the follow-up message from the master device, executed by the target slave device;
Offset calculating step for calculating the offset time difference based on the time when the second message is received in the first receiving step and the time when the second message included in the follow-up message is transmitted from the master device. When,
A second message for transmitting a third message for determining a propagation delay time between the master device and the slave device after receiving the follow-up message from the master device in the first receiving step; Sending step;
A fourth reception step of receiving the third message from the target slave device, executed by the master device;
When receiving the third message from the target slave device in the fourth reception step, a fifth transmission step of transmitting the fourth message including the time when the third message is received to the target slave device;
A second receiving step for receiving the fourth message from the master device, executed by the target slave device;
A delay time calculating step of calculating the propagation delay time based on a time when the third message is transmitted and a time when the master device receives the third message included in the fourth message;
A correction step of correcting the time of the timer based on the offset time difference and the propagation delay time;
A time synchronization method comprising:
時刻情報を生成するタイマ、
前記時刻情報を生成するためのクロックを発生させる発振器、
所定の間隔でカウントアップするカウンタ、
前記カウンタの値が所定の値を超えた場合に、前記マスタ装置が他のスレーブ装置と時刻同期を行っているビジー状態であるか否かを判定する判定手段、
前記判定手段が前記ビジー状態でないと判定した場合、前記マスタ装置に時刻同期の開始を要求する第1メッセージを送信する第1送信手段、
前記マスタ装置から、前記マスタ装置と前記スレーブ装置との間のオフセット時間差を求めるための第2メッセージと、前記第2メッセージが前記マスタ装置から送信された時刻を含むフォローアップメッセージとを受信する第1受信手段、
前記第1受信手段が前記第2メッセージを受信した時刻と、前記フォローアップメッセージに含まれる前記第2メッセージが前記マスタ装置から送信された時刻とに基づいて、前記オフセット時間差を算出するオフセット算出手段、
前記第1受信手段が前記マスタ装置から前記フォローアップメッセージを受信したのちに、前記マスタ装置に前記マスタ装置と前記スレーブ装置との間の伝搬遅延時間を求めるための第3メッセージを送信する第2送信手段、
前記マスタ装置から前記第3メッセージを前記マスタ装置が受信した時刻を含む第4メッセージを受信する第2受信手段、
前記第2送信手段が前記第3メッセージを送信した時刻と、前記第4メッセージに含まれる前記第3メッセージを前記マスタ装置が受信した時刻とに基づいて、前記伝搬遅延時間を算出する遅延時間算出手段、および、
前記オフセット時間差および前記伝搬遅延時間に基づいて、前記タイマの時刻を補正する補正手段、
として機能させることを特徴とするプログラム。 A timer that generates time information for the computer,
An oscillator for generating a clock for generating the time information;
A counter that counts up at predetermined intervals,
A determination unit that determines whether or not the master device is busy performing time synchronization with another slave device when the value of the counter exceeds a predetermined value;
A first transmission unit configured to transmit a first message requesting the master device to start time synchronization when the determination unit determines that the busy state is not present;
A second message for receiving an offset time difference between the master device and the slave device and a follow-up message including a time when the second message is transmitted from the master device from the master device. 1 receiving means,
Offset calculating means for calculating the offset time difference based on the time when the first receiving means receives the second message and the time when the second message included in the follow-up message is transmitted from the master device. ,
After the first receiving means receives the follow-up message from the master device, a second message is transmitted to the master device for determining a propagation delay time between the master device and the slave device. Transmission means,
Second receiving means for receiving a fourth message including a time at which the master device has received the third message from the master device;
Delay time calculation for calculating the propagation delay time based on the time at which the second transmission means transmits the third message and the time at which the master device receives the third message included in the fourth message. Means and
Correction means for correcting the time of the timer based on the offset time difference and the propagation delay time;
A program characterized by functioning as
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011163534A JP2013029319A (en) | 2011-07-26 | 2011-07-26 | Slave device, electronic apparatus system, master device, time synchronization method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011163534A JP2013029319A (en) | 2011-07-26 | 2011-07-26 | Slave device, electronic apparatus system, master device, time synchronization method, and program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2013029319A true JP2013029319A (en) | 2013-02-07 |
Family
ID=47786507
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011163534A Withdrawn JP2013029319A (en) | 2011-07-26 | 2011-07-26 | Slave device, electronic apparatus system, master device, time synchronization method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2013029319A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101550552B1 (en) * | 2014-09-19 | 2015-09-07 | 성균관대학교산학협력단 | Apparatus for adjusting time synchronization period and method for determinating time synchronization period |
KR101593822B1 (en) * | 2014-09-02 | 2016-02-15 | 주식회사 엘지유플러스 | Apparatus for providing communication service, control method thereof, recording medium for recording program for executing the control method, application saved in the recording medium for executing the control method being combined with hardware |
JP2017096651A (en) * | 2015-11-18 | 2017-06-01 | 日本電気株式会社 | Time synchronization method, vibration sensor, vibration detection device, program, and recording medium |
CN114489237A (en) * | 2021-12-24 | 2022-05-13 | 北京万集科技股份有限公司 | Time synchronization method, control system, and computer-readable storage medium |
CN117560758A (en) * | 2024-01-08 | 2024-02-13 | 深圳市城市公共安全技术研究院有限公司 | Time synchronization correction method, device, equipment and storage medium |
-
2011
- 2011-07-26 JP JP2011163534A patent/JP2013029319A/en not_active Withdrawn
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101593822B1 (en) * | 2014-09-02 | 2016-02-15 | 주식회사 엘지유플러스 | Apparatus for providing communication service, control method thereof, recording medium for recording program for executing the control method, application saved in the recording medium for executing the control method being combined with hardware |
KR101550552B1 (en) * | 2014-09-19 | 2015-09-07 | 성균관대학교산학협력단 | Apparatus for adjusting time synchronization period and method for determinating time synchronization period |
US10594424B2 (en) | 2014-09-19 | 2020-03-17 | Research & Business Foundation Sungkyunkwan University | Time synchronization slave apparatus capable of adjusting time synchronization period, and method of determining time synchronization period |
JP2017096651A (en) * | 2015-11-18 | 2017-06-01 | 日本電気株式会社 | Time synchronization method, vibration sensor, vibration detection device, program, and recording medium |
CN114489237A (en) * | 2021-12-24 | 2022-05-13 | 北京万集科技股份有限公司 | Time synchronization method, control system, and computer-readable storage medium |
CN117560758A (en) * | 2024-01-08 | 2024-02-13 | 深圳市城市公共安全技术研究院有限公司 | Time synchronization correction method, device, equipment and storage medium |
CN117560758B (en) * | 2024-01-08 | 2024-03-22 | 深圳市城市公共安全技术研究院有限公司 | Time synchronization correction method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6240048B2 (en) | Communication apparatus and communication system | |
JP2013029319A (en) | Slave device, electronic apparatus system, master device, time synchronization method, and program | |
JP6413787B2 (en) | COMMUNICATION DEVICE, PROGRAM, AND METHOD | |
US10034241B2 (en) | Wireless communication device and system | |
JP6488195B2 (en) | Communication device for time synchronization | |
JP2013083451A (en) | Time control device, time control method, and program | |
JP2013083450A (en) | Time control device, time control method, and program | |
JP6132734B2 (en) | Time synchronization system and apparatus | |
JP2016537842A (en) | Method for synchronizing a node with a data sink and a node for forming a wireless network | |
JP2014027437A (en) | Communication device, communication system, synchronization processing method, and program | |
JP6707209B1 (en) | Time synchronization system, master device, slave device and program | |
JP2016139846A (en) | Time synchronization system, master unit and slave unit, and time synchronization method | |
JP2013251878A (en) | Communication device, control device, and program | |
JP6394452B2 (en) | Wireless communication apparatus, wireless communication method, and program | |
JP2015188159A (en) | Slave node, time synchronization method, and computer program | |
US20170117980A1 (en) | Time synchronization for network device | |
JP6240635B2 (en) | Wireless communication method and wireless communication system | |
JP6384318B2 (en) | COMMUNICATION DEVICE, COMMUNICATION DEVICE SYNCHRONIZATION METHOD, COMMUNICATION PROGRAM, AND COMMUNICATION SYSTEM | |
JP2013175852A (en) | Time synchronization system, master unit, slave unit, time synchronization method and time synchronization program | |
JP2015188152A (en) | Slave node, control server, time synchronization destination determination method, and computer program | |
JP2012204912A (en) | Clock synchronization device and clock synchronization method | |
JP2013074338A (en) | Time server, terminal, time synchronization system, time synchronization method, and program | |
CN106507468B (en) | A kind of wireless sensor network time synchronization method and system | |
JP2017183938A (en) | Network system, communication device, and communication method | |
JP2013168884A (en) | Time synchronization system, time transmission apparatus, time reception apparatus, time synchronization method and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20141007 |