JP6869058B2 - Time output device and time output method - Google Patents
Time output device and time output method Download PDFInfo
- Publication number
- JP6869058B2 JP6869058B2 JP2017048110A JP2017048110A JP6869058B2 JP 6869058 B2 JP6869058 B2 JP 6869058B2 JP 2017048110 A JP2017048110 A JP 2017048110A JP 2017048110 A JP2017048110 A JP 2017048110A JP 6869058 B2 JP6869058 B2 JP 6869058B2
- Authority
- JP
- Japan
- Prior art keywords
- time
- unit
- measured
- difference
- rtc
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims description 18
- 238000005259 measurement Methods 0.000 claims 1
- 238000004891 communication Methods 0.000 description 9
- 238000001514 detection method Methods 0.000 description 9
- 238000012545 processing Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 230000010355 oscillation Effects 0.000 description 6
- 230000008569 process Effects 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 239000013078 crystal Substances 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 238000012423 maintenance Methods 0.000 description 2
- 239000003990 capacitor Substances 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Landscapes
- Electric Clocks (AREA)
Description
本発明は、時刻出力装置、および時刻出力方法に関する。 The present invention relates to a time output device and a time output method.
近年、日本標準時を取得して、取得した標準時刻を元に時刻を打刻して、打刻した時刻をネットワーク上の機器に高精度に配信するタイムサーバーが用いられている。このようなタイムサーバーでは、例えば電話回線による時刻供給システム等の時刻源から配信された時刻情報を、高精度、高分解能なシステムクロックで打刻し、所定のタイミングで、補助用の時計であるRTC(Real Time Clock)に書き込む。そして、例えばメンテナンスの際にタイムサーバーの電源がオフ状態にされたとき、システムクロックは消滅するため、次に電源がオン状態になったとき、RTCからの時刻情報をシステムクロックに対して読み込む。 In recent years, a time server that acquires Japan Standard Time, stamps the time based on the acquired standard time, and distributes the stamped time to devices on the network with high accuracy has been used. In such a time server, time information distributed from a time source such as a time supply system by a telephone line is stamped with a high-precision, high-resolution system clock, and an auxiliary clock is used at a predetermined timing. Write to RTC (Real Time Clock). Then, for example, when the power of the time server is turned off during maintenance, the system clock is extinguished. Therefore, when the power is turned on next time, the time information from the RTC is read into the system clock.
このように時刻を保持する装置では、時刻情報を秒以上の時刻情報と秒未満の時刻情報とに分け、秒以上の時刻情報に、時計の特性に応じた第1の時間を加える。そして、時刻を保持する装置では、クロック発生器の周期時間毎に、該周期時間を秒未満の時刻情報に加算し、秒未満の時刻情報が秒以上に桁上がりしたか否かを判断する。そして、時刻を保持する装置では、秒未満の時刻情報の桁上がりをトリガーに、第1の時間が加えられた秒以上の時刻情報を、時計に設定する。これにより、時刻を保持する装置は、第1の時間でRTCの特性を吸収でき、秒未満の精度で前記時計の時刻を合わせることができ、秒未満の桁を有しない時計であっても秒未満の精度で時刻を設定することができる(例えば特許文献1参照)。 In the device that holds the time in this way, the time information is divided into time information of seconds or more and time information of less than seconds, and a first time according to the characteristics of the timepiece is added to the time information of seconds or more. Then, in the device that holds the time, for each cycle time of the clock generator, the cycle time is added to the time information of less than a second, and it is determined whether or not the time information of less than a second is carried by a second or more. Then, in the device that holds the time, the time information of the second or more to which the first time is added is set in the clock, triggered by the carry of the time information of less than a second. As a result, the device that holds the time can absorb the characteristics of the RTC in the first time, can set the time of the clock with an accuracy of less than seconds, and even a clock having no digits less than seconds can be in seconds. The time can be set with an accuracy less than (see, for example, Patent Document 1).
特許文献1に記載の技術を使用すると、再起動後のタイムサーバーは、起動直後からほぼ正確な時刻を保持し、再起動後すぐに時刻配信をすることも可能となる。
しかしならが、特許文献1に記載の技術では、タイムサーバーの電源をオフする前に、秒未満の時刻情報が桁上がりをするタイミングを計測し、そのタイミングを見計らってRTCに秒以上の時刻情報を設定する。このため、特許文献1に記載の技術では、タイムサーバーの電源をすぐにはオフできず、また、オフするまでに、秒未満での高精度な処理も必要となっていた。
By using the technique described in
However, in the technique described in
本発明は、上記の問題点に鑑みてなされたものであって、再起動の直後であっても信頼のある時刻情報を、簡素な仕組みで出力することができる時刻出力装置、および時刻出力方法を提供することを目的とする。 The present invention has been made in view of the above problems, and is a time output device and a time output method capable of outputting reliable time information by a simple mechanism even immediately after a restart. The purpose is to provide.
上記目的を達成するため、本発明の一態様に係る時刻出力装置(タイムサーバー2)は、時刻を計時する第1計時部(時刻取得部22、発振回路23)と、時刻を計時し、所定時刻毎に割り込み信号を出力し、電源がオフ状態の間も計時を継続する第2計時部(RTC25、補助電源26)と、前記割り込み信号が出力されたとき、前記第1計時部が計時した時刻と、前記第2計時部が計時した時刻との時差を第1時差として算出して保持する時差算出部(214)と、自装置が再起動され、前記割り込み信号が出力されたとき、前記第2計時部が計時した時刻に前記第1時差を加算して補正した時刻を前記第1計時部に設定する時刻設定部(RTC設定部212)と、を備え、前記時刻設定部は、電源がオフ状態になるとき、前記第1計時部が計時した時刻を前記第2計時部に設定し、前記第2計時部は、前記第1計時部が計時した時刻が設定された後に秒を更新したとき、割り込み信号を出力する。
In order to achieve the above object, the time output device (time server 2) according to one aspect of the present invention measures the time with the first time unit (
また、本発明の一態様に係る時刻出力装置において、前記第1計時部は、所定のタイミングで標準時刻に設定され、前記標準時刻に基づいて第1の精度で時刻を計時し、前記第2計時部は、前記第1の精度よりも低い第2の精度で時刻を計時するようにしてもよい。 Further, in the time output device according to one aspect of the present invention, the first time unit is set to a standard time at a predetermined timing, and the time is measured with the first accuracy based on the standard time, and the second time is measured. The timekeeping unit may time the time with a second accuracy lower than the first accuracy.
また、本発明の一態様に係る時刻出力装置において、前記時刻設定部は、電源がオフ状態になるときの前記第2計時部が計時した時刻と、電源がオン状態になったときの前記第2計時部が計時した時刻との時差を第2時差として算出し、算出した前記第2時差が閾値(時差閾値)以内の場合、自装置が再起動され、前記割り込み信号が出力されたとき、前記第2計時部が計時した時刻に前記第1時差を加算して補正した時刻を前記第1計時部に設定するようにしてもよい。 Further, in the time output device according to one aspect of the present invention, the time setting unit uses the time measured by the second timekeeping unit when the power is turned off and the time when the power is turned on. 2 The time difference from the time measured by the timekeeping unit is calculated as the second time difference, and if the calculated second time difference is within the threshold (time difference threshold), the own device is restarted and the interrupt signal is output. The time corrected by adding the first time difference to the time measured by the second time unit may be set in the first time unit.
また、本発明の一態様に係る時刻出力装置において、前記閾値は、前記第2計時部が計時する時刻の誤差に基づき、前記時刻出力装置に許容される誤差以内となる時間であるようにしてもよい。 Further, in the time output device according to one aspect of the present invention, the threshold value is set to be within the error allowed by the time output device based on the time error measured by the second timekeeping unit. May be good.
上記目的を達成するため、本発明の一態様に係る時刻出力方法は、時刻を計時する第1計時部と、時刻を計時し、電源がオフ状態の間も計時を継続する第2計時部と、を有する時刻出力装置の時刻出力方法であって、第2計時部が、所定時刻毎に割り込み信号を出力するステップと、時差算出部が、前記割り込み信号が出力されたとき、前記第1計時部によって計時した時刻と、前記第2計時部によって計時した時刻との時差を第1時差として算出して保持する時差算出ステップと、時刻設定部が、自装置が再起動され、前記割り込み信号が出力されたとき、前記第2計時部によって計時した時刻に前記第1時差を加算して補正した時刻を前記第1計時部に設定するステップと、前記時刻設定部が、電源がオフ状態になるとき、前記第1計時部が計時した時刻を前記第2計時部に設定するステップと、前記第2計時部が、前記第1計時部が計時した時刻が設定された後に秒を更新したとき、割り込み信号を出力するステップと、を含む。 In order to achieve the above object, the time output method according to one aspect of the present invention includes a first time unit that measures the time and a second time unit that measures the time and continues the time even when the power is off. A time output method of a time output device having the above, wherein the second time counting unit outputs an interrupt signal at predetermined time intervals, and the time difference calculation unit outputs the interrupt signal, the first time counting unit. The time difference calculation step of calculating and holding the time difference between the time measured by the unit and the time measured by the second time unit as the first time difference, and the time setting unit restarts its own device and the interrupt signal is output. When output, the step of setting the time corrected by adding the first time difference to the time measured by the second time unit to the first time unit and the time setting unit are turned off. When the step of setting the time measured by the first time unit to the second time portion and when the second time unit updates the seconds after the time measured by the first time unit is set. Includes a step to output an interrupt signal.
本発明によれば、再起動の直後であっても信頼のある時刻情報を出力することができる。 According to the present invention, reliable time information can be output even immediately after a restart.
以下、本発明の実施の形態について図面を参照しながら説明する。なお、以下の例では、標準時刻として日本の標準時刻の例を説明するが、標準時刻は他国の標準時刻やGMT(Greenwich Mean Time;グリニッジ標準時)等であってもよい。なお、以下の例では、時刻出力装置の例としてタイムサーバーを例に説明する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the following example, the standard time of Japan will be described as the standard time, but the standard time may be the standard time of another country, GMT (Greenwich Mean Time), or the like. In the following example, a time server will be described as an example of the time output device.
図1は、時刻管理システム1の概略構成図である。図1に示すように、時刻管理システム1は、タイムサーバー2(時刻出力装置)、GPS3、テレホンJJY4、長波JJY5、FM時報6、クライアント7−1、クライアント7−2、クライアント7−3、…を含んで構成される。
以下の説明において、クライアント7−1、クライアント7−2、クライアント7−3、…のうちの1つを特定しない場合は、クライアント7という。また、タイムサーバー2は、ネットワーク8を介してクライアント7と接続されている。ネットワーク8は、例えばインターネット・プロトコルを用いるネットワークである。
FIG. 1 is a schematic configuration diagram of the
In the following description, when one of client 7-1, client 7-2, client 7-3, ... Is not specified, it is referred to as client 7. Further, the
タイムサーバー2は、例えば、GPS3、テレホンJJY4、長波JJY5、FM時報6のうち少なくとも1つの時刻源から時刻を取得する。なお、時刻源はこれらに限られず、例えばNTP(Network Time Protocol)サーバー等であってもよい。タイムサーバー2は、取得した時刻を、高精度、高分解能なシステムクロックで打刻し、所定のタイミングで、補助用の時計であるRTC(Real Time Clock)に書き込む。タイムサーバー2は、電源がオフ状態にされたとき、RTCとシステムクロックとの時差を算出して記憶する。タイムサーバー2は、電源がオフ状態の間、RTCを自走させて時刻計時を継続する。タイムサーバー2は、次に電源がオン状態になったとき、RTCの時刻を取得し、取得した時刻を記憶させた時差を用いて補正する。タイムサーバー2は、オフ状態になっていた時間が所定の時間内であり精度が保たれている場合、補正した時刻をNTPによって、ネットワーク8を介してクライアントに提供する。
The
GPS3は、Global Positioning System(全地球測位システム)である。GPS3が送信する信号には、衛星自身の位置(軌道)や、電波を発信した時刻が含まれている。時刻の精度は、±1[ms]である。
テレホンJJY4は、電話回線による時刻供給システムである。時刻の精度は、±10[ms]である。
GPS3 is a Global Positioning System (Global Positioning System). The signal transmitted by the
The telephone JJY4 is a time supply system using a telephone line. The accuracy of the time is ± 10 [ms].
長波JJY5は、30−300kHzの周波数帯で放送されている長波JJYの電波、いわゆる電波時計の電波に含まれる時報である。時刻の精度は、±100[ms]である。
FM時報6は、FM周波数帯域で放送されている日本放送協会(NHK)の時報である。なお、NHKの時報は、0.1秒継続する440Hzの予報音を1秒間隔で3回送信し、その1秒後に1秒継続し減衰する880Hzの正報音を送信するという構成となっている。時刻の精度は、±100[ms]である。
The long wave JJY5 is a time signal included in the radio wave of the long wave JJY broadcast in the frequency band of 30 to 300 kHz, that is, the radio wave of the so-called radio clock. The accuracy of the time is ± 100 [ms].
FM time signal 6 is a time signal of the Japan Broadcasting Corporation (NHK) broadcast in the FM frequency band. The NHK time signal is configured to transmit a 440 Hz forecast sound that lasts for 0.1 seconds three times at 1-second intervals, and then transmits an 880 Hz positive sound that continues for 1 second and attenuates 1 second later. There is. The accuracy of the time is ± 100 [ms].
クライアント7は、例えば、サーバー、パーソナルコンピュータである。クライアント7は、タイムサーバー2から提供される時刻を取得して、現在時刻を調整する。
The client 7 is, for example, a server or a personal computer. The client 7 acquires the time provided by the
次に、タイムサーバー2の構成例を説明する。
図2は、本実施形態に係るタイムサーバー2の構成例を示すブロック図である。図2に示すように、タイムサーバー2は、制御部21、時刻取得部22(第1計時部)、発振回路23(第1計時部)、RTC25(第2計時部)、補助電源26(第2計時部)、記憶部27、および通信部28を備えている。制御部21は、計時部211、RTC設定部212(時刻設定部)、検出部213、および時差算出部214を備えている。
Next, a configuration example of the
FIG. 2 is a block diagram showing a configuration example of the
制御部21は、時刻取得部22が取得した時刻に合わせて、発振回路23が生成した第1の周波数でシステムクロックを計時する。制御部21は、システムクロックの時刻を、通信部28を制御してクライアント7へ提供する。制御部21は、タイムサーバー2の電源がオフ状態にされたとき、システムクロックとRTC25との時差を記憶部27に記憶させる。制御部21は、再起動時、RTC25の時刻を記憶部27に記憶させた時差を用いて補正する。制御部21は、補正した時刻を、通信部28を制御してクライアント7へ提供する。制御部21は、再起動後、時刻取得部22が時刻情報を取得できたとき、システムクロックを時刻取得部22が取得した時刻に合わせる。
The
計時部211は、制御部21が出力した第1の周波数を用いてシステムクロックの計時を行う。計時部211は、時刻取得部22が出力した時刻情報を用いてシステムクロックを合わせる。計時部211は、再起動後、RTC設定部212から出力された時刻にシステムクロックを合わせる。計時部211は、このように合わせたシステムクロックを、時刻取得部22が時刻情報を出力するまで使用する。なお、システムクロックの時刻の精度は、例えば0.1ppmである。
The
RTC設定部212は、所定のタイミングのとき、システムクロックの時刻にRTC25の時刻を合わせる。RTC設定部212は、例えば、検出部213がオン情報を出力したとき、システムクロックの時刻にRTC25の時刻を合わせる。RTC設定部212は、検出部213がオフ情報を出力したとき、またはその後にRTC25が割り込みハンドラを起動したとき、RTC25の時刻(オフ時刻)を取得して記憶部27に記憶させる。RTC設定部212は、検出部213がオン情報を出力したとき、またはその後にRTC25が割り込みハンドラを起動したとき、RTC25の時刻(オン時刻)を取得して記憶部27に記憶させる。
The
検出部213は、メンテナンス等の何らかの要因により、タイムサーバー2がオフ状態にされたこと、およびオン状態にされたことを検出する。検出部213は、タイムサーバー2がオフ状態にされたことを示すオフ情報をRTC設定部212に出力する。検出部213は、タイムサーバー2がオン状態にされたことを示すオン情報をRTC設定部212に出力する。
The
時差算出部214は、RTC25が割り込みハンドラを起動したとき、RTC25の時刻(オフ時刻)とシステムクロックとの時差を第1時差として算出し、算出した第1時差を記憶部27に記憶させる。RTC設定部212(時刻設定部)は、再起動後、RTC25が割り込みハンドラを起動したとき、RTC25の時刻(オン時刻)を取得し、取得した時刻(オン時刻)とオフ時刻との第2時差を算出する。RTC設定部212は、算出した第2時差が、記憶部27が記憶する時差閾値以内であるか否かを判別する。RTC設定部212は、第2時差が時差閾値以内である場合、オン時刻を、第1時差を用いて補正し、補正した時刻情報を計時部211へ出力する。RTC設定部212は、第2時差が時差閾値より大きい場合、時刻を計時部211へ出力しない。ここで、時差閾値は、RTC25の誤差に基づく時間であり、例えば数時間である。例えば、RTC25の誤差が±5ppmであり、1日あたり±400[ms]の場合、タイムサーバー2に許容される誤差が±100[ms]程度であれば、100/400、すなわち6時間(=24時間/4)が時差閾値である。すなわち、本実施形態では、RTC25が発する時刻(割り込みハンドラを起動したとき)について、((オン時刻)−(オフ時刻))<時差閾値の関係を保てる場合に、オフ時にずれていた時間を加算することで、再起動後の時刻を補正する。
When the
時刻取得部22は、例えば、GPS3、テレホンJJY4、長波JJY5、FM時報6のうち少なくとも1つの時刻源から時刻を取得し、取得した時刻情報を制御部21へ出力する。
発振回路23は、例えば水晶発振器を含む。発振回路23は、発振器と組み合わせることで第1の周波数の信号を生成し、生成した第1の周波数の信号を制御部21に出力する。第1の周波数は、例えば500[MHz]〜1[GHz]である。なお、発振器は、TCXO(温度補償水晶発振器)、OCXO(恒温槽付水晶発振器)等であってもよい。
The
The
RTC25は、RTC設定部212によって所定のタイミングで時刻が設定される。なお、RTC25に書き込める時刻および読み出せる時刻は、例えば秒単位である。RTC25は、時刻設定後、自部で時刻を計時する。RTC25は、所定の時間毎(例えば秒毎)、時刻を更新したときに、割り込みハンドラを起動する。RTC25は、タイムサーバー2の電源がオフ状態の間も、補助電源26からの電力を用いて時間を計時する。なお、RTC25の時間の常温での精度は、例えば±5ppmであり、1日あたり±400[ms]である。
補助電源26は、例えば、二次電池、電気二重層キャパシタ等のスーパーキャパシタである。
The time of the
The
記憶部27は、タイムサーバー2の制御に必要なプログラム、時差閾値、RTC25とシステムクロックとの第1時差、オフ時刻を記憶する。
通信部28は、制御部21の制御に応じて、時刻情報を、ネットワーク8を介してクライアント7へ提供する。
The
The
次に、時刻設定の手順例を、図3〜図5を用いて説明する。
図3は、本実施形態に係る再起動時の処理例を示すシーケンス図である。図4は、本実施形態に係る電源がオフ状態にされたときの処理例を示すフローチャートである。図5は、本実施形態に係る電源がオン状態にされたときの処理例を示すフローチャートである。
図3において、横軸は時刻を表す。ここで、RTC25の精度は±5ppm、タイムサーバーに許容される誤差は±100[ms]とし、その結果、時差閾値は6時間であるものとする。
Next, an example of the time setting procedure will be described with reference to FIGS. 3 to 5.
FIG. 3 is a sequence diagram showing an example of processing at the time of restart according to the present embodiment. FIG. 4 is a flowchart showing a processing example when the power supply according to the present embodiment is turned off. FIG. 5 is a flowchart showing a processing example when the power supply according to the present embodiment is turned on.
In FIG. 3, the horizontal axis represents time. Here, it is assumed that the accuracy of the RTC25 is ± 5 ppm, the error allowed for the time server is ± 100 [ms], and as a result, the time difference threshold is 6 hours.
まず、電源がオフ状態にされたときの手順例を、図3と図4を用いて説明する。
(ステップS1)RTC設定部212は、検出部213がオフ情報を出力したとき、計時部211が計時したシステムクロックの時刻を取得し、取得した時刻の秒以下を切り捨てた時刻を記憶部27に記憶させる。図3の例では、取得した時刻が1:23:45.89(1時23分45.89秒)であり、記憶部27に記憶される記憶が1:23:45(1時23分45秒)である。
First, an example of the procedure when the power is turned off will be described with reference to FIGS. 3 and 4.
(Step S1) When the
(ステップS2)RTC設定部212は、取得した時刻にRTC25の時刻を合わせる。これにより、図3に示す例では、RTC設定部212は、RTC25の時刻を1:23:45(1時23分45秒)に合わせる(設定する)。
(Step S2) The
(ステップS3)RTC25は、秒を更新したときに割り込みハンドラを起動する。図3に示す例では、1:23:46.00(1時23分46.00秒)のとき、割り込みハンドラが起動される。 (Step S3) The RTC25 activates an interrupt handler when the seconds are updated. In the example shown in FIG. 3, the interrupt handler is activated at 1:23: 46.00 (1:23:46.00).
(ステップS4)時差算出部214は、RTC25から割り込みハンドラが起動されたときのシステムクロックの時刻とRTC25の時刻を取得し、取得した時刻をオフ時刻として記憶部27に記憶させる。図3に示す例では、システムクロックの時刻が1:23:46.67(1時23分46.67秒)であり、RTC25の時刻が1:23:46(1時23分46秒)である。
(Step S4) The time
(ステップS5)時差算出部214は、RTC25の時刻とシステムクロックとの時差を第1時差として算出し、算出した第1時差を記憶部27に記憶させる。図3に示す例では、RTC25の時刻が1:23:46.00であり、システムクロックの時刻が1:23:46.67であるため、第1時差が0.67である。
(Step S5) The time
次に、電源がオン状態にされたときの手順例を、図3と図5を用いて説明する。なお、図3に示す例では、シャットダウンされていた期間(電源がオフ状態の期間)が1分1秒間である。 Next, an example of the procedure when the power is turned on will be described with reference to FIGS. 3 and 5. In the example shown in FIG. 3, the shutdown period (the period in which the power is off) is 1 minute and 1 second.
(ステップS11)RTC25は、シャットダウンされている期間、補助電源26の電力によって計時を継続する。続けて、RTC25は、秒を更新したときに割り込みハンドラを起動する。図3に示す例では、RTC25は、1:24:47.00(1時24分47.00秒)のとき、割り込みハンドラを起動する。
(Step S11) The
(ステップS12)RTC設定部212は、RTC25が割り込みハンドラを起動したときのRTC25の時刻を取得し、取得した時刻をオン時刻として記憶部27に記憶させる。図3に示す例では、RTC25の時刻が1:23:47(1時23分47秒)である。
(Step S12) The
(ステップS13)RTC設定部212は、オン時刻とオフ時刻との第2時差を算出し、算出した第2時差が時差閾値以内であるか否かを判別する。RTC設定部212は、第2時差が時差閾値以内であると判定した場合、オン時刻に第1時差を加算して補正する。図3に示す例では、オフ時刻とオン時刻との第2時差が1分1秒(=1:24:47−1:23:46)であり、時差閾値(6時間)以下であるため、オン時刻1:24:47.00に第1時差の0.67を加算して時刻を1:24:47.67(1時24分47.67秒)に補正する。
(Step S13) The
(ステップS14)RTC設定部212は、補正した時刻にシステムクロックに設定する。図3に示す例では、RTC設定部212は、システムクロックを1:24:47.67(1時24分47.67秒)に設定する。
(Step S14) The
以上のように、本実施形態では、RTC25とシステムクロックとの時差をシャットダウン直前に取得し、再起動後に自走しているRTC25の時刻に時差を加算してシステムクロックとして運用するようにした。ここで、第1時差は、シャットダウン直前のものであるため、再起動後、RTC25をこの時差で補正した時刻の精度は、シャットダウン直前の時刻の精度である。すなわち、実施形態によれば、再起動後に設定されるシステムクロックの精度は、シャットダウン直前の同等の精度を実現することができる。
これにより、時刻情報を取得できるまで、このように補正したシステムクロックを用いて、サービスの提供を継続することができる。タイムサーバー2が、GPS3からしか時報を取得できない場合は、全てのデータを受信して時刻の情報を使用できるまで、最大12.5分かかる。また、タイムサーバー2が、FM時報6からしか時報を取得できない場合は、時報が1時間に一回のため、再起動後、次に時報を取得できるまで最大59分59秒かかる。このような場合であっても、本実施形態によれば、シャットダウンされている時間がRTC25に誤差に基づいて許容範囲内であれば、再起動後であっても直ちにサービスの提供を再開することができる。また、シャットダウンの直前に、従来技術のように高精度なタイミングでRTC25に時刻を書き込む処理が不要であり、タイムサーバー2としての作業負荷も軽減できる。
As described above, in the present embodiment, the time difference between the RTC25 and the system clock is acquired immediately before shutdown, and the time difference is added to the time of the RTC25 running on its own after restarting to operate as the system clock. Here, since the first time difference is immediately before shutdown, the accuracy of the time when the RTC25 is corrected by this time difference after restarting is the accuracy of the time immediately before shutdown. That is, according to the embodiment, the accuracy of the system clock set after the restart can be the same as the accuracy immediately before the shutdown.
As a result, the service can be continued to be provided by using the system clock corrected in this way until the time information can be acquired. If the
<変形例>
ここで、図3に示した処理の変形例を説明する。
図3を用いて説明した例では、制御部21が、シャットダウン前にシステムクロックの時刻をRTC25へ書き込み、その後、RTC25が秒を更新したときに時差を取得するようにしたが、これに限られない。RTC25は、毎秒毎に割り込みハンドラを起動しているため、毎秒、システムクロックとRTC25との時差を記憶するようにしてもよい。
図6は、本実施形態に係る再起動時の処理の変形例を示すシーケンス図である。なお、図6に示す例では、ステップS21の前に、システムクロックの時刻をRTC25へ書き込んである。
<Modification example>
Here, a modified example of the process shown in FIG. 3 will be described.
In the example described with reference to FIG. 3, the
FIG. 6 is a sequence diagram showing a modified example of the process at the time of restart according to the present embodiment. In the example shown in FIG. 6, the time of the system clock is written to the
(ステップS21)RTC設定部212は、秒毎に割り込みハンドラを起動する。
(ステップS22)時差算出部214は、RTC25が割り込みハンドラを起動したときのシステムクロックの時刻とRTC25の時刻を取得し、取得した時刻をオフ時刻として記憶部27に記憶させる。
(Step S21) The
(Step S22) The time
(ステップS23)RTC設定部212は、秒毎に割り込みハンドラを時差算出部214へ出力する。
(ステップS24)時差算出部214は、RTC25が割り込みハンドラを起動したときのシステムクロックの時刻とRTC25の時刻を取得し、取得したオフ時刻を記憶部27に上書きして更新する。図6に示す例では、ステップS24で算出した第1時差が、シャットダウン直前のシステムクロックとRTC25の時差である。なお、時差算出部214は、1秒前(ステップS22)に算出した時差と、現在(ステップS24)との時差を比較し、変化していない場合は、記憶部27に算出した第1時差を書き込まないようにしてもよい。
(Step S23) The
(Step S24) The time
(ステップS25〜ステップS28)RTC25とRTC設定部212は、ステップS25〜S28の処理をステップS11〜S14の処理と同様に行う。
(Steps S25 to S28) The RTC25 and the
以上のように、図6に示した変形例によれば、毎秒、システムクロックとRTC25との時差を算出して記憶部27に記憶させるようにした。これにより、変形例によれば、毎秒、時差を更新しているため、シャットダウン直前の時差を記憶部27に保持することができ、この保持された時差を用いてRTC25から取得した時刻を補正してサービスの提供を継続することができる。再起動後にシステムクロックに設定される時刻の精度は、シャットダウン直前に取得したRTC25の時刻を、システムクロックとRTC25の時差で補正した時刻の精度であるため、シャットダウン前のシステムクロックの時刻の精度と同等である。すなわち、変形例においても、再起動後に設定されるシステムクロックの精度は、シャットダウン直前の精度と同等である。
このため変形例によれば、RTC25の時刻が仮に1年以上ずれていたとしても、時差を毎秒更新しているため、シャットダウンの直前を意識した特別な処理は不要であり、保持された時差を用いてRTC25から取得した時刻を補正してサービスの提供を継続することができる。
As described above, according to the modification shown in FIG. 6, the time difference between the system clock and the
Therefore, according to the modified example, even if the time of RTC25 is deviated by one year or more, the time difference is updated every second, so that no special processing is required in consideration of immediately before shutdown, and the retained time difference can be determined. It can be used to correct the time acquired from the
なお、上述した例では、時刻出力装置としてタイムサーバー2を例に説明したが、これに限られない。図2の構成の時刻出力装置を、パーソナルコンピュータ、サーバー、タブレット端末、携帯電子機器等に適用することもできる。
In the above-mentioned example, the
なお、本発明における制御部21の機能の全てまたは一部を実現するためのプログラムをコンピュータ読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピュータシステムに読み込ませ、実行することにより制御部21が行う処理を行ってもよい。なお、ここでいう「コンピュータシステム」とは、OSや周辺機器等のハードウェアを含むものとする。また、「コンピュータシステム」は、ホームページ提供環境(あるいは表示環境)を備えたWWWシステムも含むものとする。また、「コンピュータ読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM、CD−ROM等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置のことをいう。さらに「コンピュータ読み取り可能な記録媒体」とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムが送信された場合のサーバーやクライアントとなるコンピュータシステム内部の揮発性メモリ(RAM)のように、一定時間プログラムを保持しているものも含むものとする。
A program for realizing all or a part of the functions of the
また、上記プログラムは、このプログラムを記憶装置等に格納したコンピュータシステムから、伝送媒体を介して、あるいは、伝送媒体中の伝送波により他のコンピュータシステムに伝送されてもよい。ここで、プログラムを伝送する「伝送媒体」は、インターネット等のネットワーク(通信網)や電話回線等の通信回線(通信線)のように情報を伝送する機能を有する媒体のことをいう。また、上記プログラムは、前述した機能の一部を実現するためのものであってもよい。さらに、前述した機能をコンピュータシステムにすでに記録されているプログラムとの組み合わせで実現できるもの、いわゆる差分ファイル(差分プログラム)であってもよい。 Further, the program may be transmitted from a computer system in which this program is stored in a storage device or the like to another computer system via a transmission medium or by a transmission wave in the transmission medium. Here, the "transmission medium" for transmitting a program refers to a medium having a function of transmitting information, such as a network (communication network) such as the Internet or a communication line (communication line) such as a telephone line. Further, the above program may be for realizing a part of the above-mentioned functions. Further, it may be a so-called difference file (difference program) that can realize the above-mentioned function in combination with a program already recorded in the computer system.
1…時刻管理システム、2…タイムサーバー、3…GPS、4…テレホンJJY、5…長波JJY、6…FM時報、7,7−1,7−2,7−3…クライアント、21…制御部、22…時刻取得部、23…発振回路、25…RTC、26…補助電源、27…記憶部、28…通信部、211…計時部、212…RTC設定部、213…検出部、214…時差算出部 1 ... Time management system, 2 ... Time server, 3 ... GPS, 4 ... Telephone JJY, 5 ... Long wave JJY, 6 ... FM time signal, 7,7-1,7-2,7-3 ... Client, 21 ... Control unit , 22 ... Time acquisition unit, 23 ... Oscillation circuit, 25 ... RTC, 26 ... Auxiliary power supply, 27 ... Storage unit, 28 ... Communication unit, 211 ... Time signal unit, 212 ... RTC setting unit, 213 ... Detection unit, 214 ... Time difference Calculation unit
Claims (5)
時刻を計時し、所定時刻毎に割り込み信号を出力し、電源がオフ状態の間も計時を継続する第2計時部と、
前記割り込み信号が出力されたとき、前記第1計時部が計時した時刻と、前記第2計時部が計時した時刻との時差を第1時差として算出して保持する時差算出部と、
自装置が再起動され、前記割り込み信号が出力されたとき、前記第2計時部が計時した時刻に前記第1時差を加算して補正した時刻を前記第1計時部に設定する時刻設定部と、
を備え、
前記時刻設定部は、電源がオフ状態になるとき、前記第1計時部が計時した時刻を前記第2計時部に設定し、
前記第2計時部は、前記第1計時部が計時した時刻が設定された後に秒を更新したとき、割り込み信号を出力する時刻出力装置。 The first timekeeping part that measures the time and
The second clock section that clocks the time, outputs an interrupt signal at predetermined time intervals, and continues timing even when the power is off.
When the interrupt signal is output, the time difference calculation unit calculates and holds the time difference between the time measured by the first timekeeping unit and the time measured by the second timekeeping unit as the first time difference.
When the own device is restarted and the interrupt signal is output, the time setting unit that sets the time corrected by adding the first time difference to the time measured by the second time unit in the first time unit. ,
Equipped with a,
When the power is turned off, the time setting unit sets the time measured by the first time unit to the second time unit.
Said second time counting unit, when the first clock unit updates the seconds after being set time of clocking, the time output device you output an interrupt signal.
前記第2計時部は、前記第1の精度よりも低い第2の精度で時刻を計時する、請求項1に記載の時刻出力装置。 The first time unit is set to a standard time at a predetermined timing, and the time is measured with the first accuracy based on the standard time.
The time output device according to claim 1, wherein the second time unit measures the time with a second accuracy lower than the first accuracy.
電源がオフ状態になるときの前記第2計時部が計時した時刻と、電源がオン状態になったときの前記第2計時部が計時した時刻との時差を第2時差として算出し、算出した前記第2時差が閾値以内の場合、自装置が再起動され、前記割り込み信号が出力されたとき、前記第2計時部が計時した時刻に前記第1時差を加算して補正した時刻を前記第1計時部に設定する、請求項1または請求項2に記載の時刻出力装置。 The time setting unit
The time difference between the time measured by the second time section when the power is turned off and the time measured by the second time section when the power is turned on is calculated and calculated as the second time difference. When the second time difference is within the threshold value, when the own device is restarted and the interrupt signal is output, the time corrected by adding the first time difference to the time measured by the second time unit is the time corrected. 1 The time output device according to claim 1 or 2, which is set in the time section.
第2計時部が、所定時刻毎に割り込み信号を出力するステップと、
時差算出部が、前記割り込み信号が出力されたとき、前記第1計時部によって計時した時刻と、前記第2計時部によって計時した時刻との時差を第1時差として算出して保持する時差算出ステップと、
時刻設定部が、自装置が再起動され、前記割り込み信号が出力されたとき、前記第2計時部によって計時した時刻に前記第1時差を加算して補正した時刻を前記第1計時部に設定するステップと、
前記時刻設定部が、電源がオフ状態になるとき、前記第1計時部が計時した時刻を前記第2計時部に設定するステップと、
前記第2計時部が、前記第1計時部が計時した時刻が設定された後に秒を更新したとき、割り込み信号を出力するステップと、
を含む時刻出力方法。 It is a time output method of a time output device having a first time unit that measures the time and a second time unit that measures the time and continues the time measurement even when the power is off.
The step that the second timekeeping part outputs an interrupt signal at predetermined time intervals,
When the interrupt signal is output, the time difference calculation unit calculates and holds the time difference between the time measured by the first time unit and the time measured by the second time unit as the first time difference. When,
When the own device is restarted and the interrupt signal is output, the time setting unit sets the time corrected by adding the first time difference to the time measured by the second time unit in the first time unit. Steps to do and
When the time setting unit turns off the power, the step of setting the time measured by the first timekeeping unit to the second timekeeping unit, and
A step of outputting an interrupt signal when the second clock unit updates the seconds after the time measured by the first clock unit is set.
Time output method including.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017048110A JP6869058B2 (en) | 2017-03-14 | 2017-03-14 | Time output device and time output method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017048110A JP6869058B2 (en) | 2017-03-14 | 2017-03-14 | Time output device and time output method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2018151274A JP2018151274A (en) | 2018-09-27 |
JP6869058B2 true JP6869058B2 (en) | 2021-05-12 |
Family
ID=63680946
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2017048110A Active JP6869058B2 (en) | 2017-03-14 | 2017-03-14 | Time output device and time output method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6869058B2 (en) |
-
2017
- 2017-03-14 JP JP2017048110A patent/JP6869058B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2018151274A (en) | 2018-09-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7701390B2 (en) | Time adjustment device, timekeeping device with a time adjustment device, and a time adjustment method | |
JP4600480B2 (en) | Electronic clock | |
JP5428167B2 (en) | Time correction device, time measuring device with time correction device, and time correction method | |
JP6435762B2 (en) | Electronic device, program, and date / time information acquisition method | |
EP2487550B1 (en) | Electronic timepiece and reception control method for an electronic timepiece | |
JP5374912B2 (en) | Time correction device, time measuring device with time correction device, and time correction method | |
US9869977B2 (en) | Radio-controlled timepiece | |
JP6327183B2 (en) | Radio wave receiver, radio wave clock, signal acquisition method and program | |
JP2009145318A (en) | Time adjustment device, timepiece with time adjustment device, and time adjustment method | |
US9448539B2 (en) | Electronic timepiece and reception control method of an electronic timepiece | |
JP6772700B2 (en) | Positioning equipment, electronic clocks, positioning control methods, and programs | |
US9952561B2 (en) | Radio timepiece, method for acquiring leap second correction information and recording medium | |
JP6040670B2 (en) | Electronic clock and satellite signal receiving method of electronic clock | |
JP6508096B2 (en) | Satellite radio wave receiver, radio wave clock, date and time information output method, and program | |
JP3796380B2 (en) | Time correction information output device and automatic time correction clock | |
JP6888575B2 (en) | Electronic clock and information acquisition method | |
JP6583353B2 (en) | Electronic clock, date acquisition control method and program | |
JP6131554B2 (en) | Electronic clock and satellite signal receiving method of electronic clock | |
JP6394008B2 (en) | Electronic clock and date data correction method | |
JP6869058B2 (en) | Time output device and time output method | |
US7064619B1 (en) | Method and apparatus for restarting a GPS-based timing system without a GPS signal | |
JP6866760B2 (en) | Electronic clock, date and time acquisition control method and program | |
JP6493574B2 (en) | Radio wave receiver, radio wave clock, signal acquisition method and program | |
JP2009036673A (en) | Time adjustment device, time measuring device with time adjustment device, and time adjustment method | |
JPH07318669A (en) | Dual clock system for information machine |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD03 | Notification of appointment of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7423 Effective date: 20181102 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20200114 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20201217 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20210105 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210302 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20210323 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20210413 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6869058 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |