JP2015059851A - Time correction device, time correction method, and computer program - Google Patents

Time correction device, time correction method, and computer program Download PDF

Info

Publication number
JP2015059851A
JP2015059851A JP2013194179A JP2013194179A JP2015059851A JP 2015059851 A JP2015059851 A JP 2015059851A JP 2013194179 A JP2013194179 A JP 2013194179A JP 2013194179 A JP2013194179 A JP 2013194179A JP 2015059851 A JP2015059851 A JP 2015059851A
Authority
JP
Japan
Prior art keywords
time
unit
correction
leap
check
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.)
Pending
Application number
JP2013194179A
Other languages
Japanese (ja)
Inventor
裕照 山川
Hiroteru Yamakawa
裕照 山川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2013194179A priority Critical patent/JP2015059851A/en
Publication of JP2015059851A publication Critical patent/JP2015059851A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a technology for more shortening time required for the correction of time without generating backtracking in time.SOLUTION: The time correction device includes: a reference clock section 11 for clocking reference time; a device clock section 12 for clocking device time; a check time detection section 13 for detecting check time; and a time correction section 14 for, when the check time arrives, comparing the reference time with the device time, and for, when the device time delays from the reference time, inputting the reference time to the device clock section 12 to set the reference time as the device time, and for, when the device time advances from the reference time, allowing the device clock section 12 to stop to clock the device time only in a period of a difference between the reference time and the device time.

Description

本発明は、コンピュータ・システムにおける時刻を補正する技術に関する。   The present invention relates to a technique for correcting time in a computer system.

コンピュータ・システムにおいて、内部に保持している時刻に後戻りが発生すると、動作に不具合を起こす可能性がある。したがって、このようなコンピュータ・システムでは、内部の時刻と実時刻とに差がある場合、時刻の後戻りが発生しないように補正するのが通常である。   In a computer system, if a backward movement occurs at the time stored in the computer system, it may cause a malfunction. Therefore, in such a computer system, when there is a difference between the internal time and the actual time, it is usually corrected so that the time does not return.

このような時刻の補正に、NTP(Network Time Protocol)を用いることがよく知られている。NTPでは、時刻を徐々に同期させるslewモードが用意されている。NTPクライアントは、slewモードを指定することにより、NTPサーバから通知される実時刻より内部の時刻が進んでいる場合でも、時刻を後戻りさせることなく補正することが可能である。   It is well known to use NTP (Network Time Protocol) for such time correction. In NTP, a slew mode for gradually synchronizing time is prepared. By specifying the slew mode, the NTP client can correct the time without going back even if the internal time is ahead of the actual time notified from the NTP server.

また、このような時刻の補正に関連する技術が、特許文献1に記載されている。この関連技術は、内部の時刻と実時刻との誤差に応じて、内部の時刻を計時するパルス信号の周期を可変とする。具体的には、この関連技術は、誤差がない場合、通常周期のパルスを発生する通常パルス発生器を選択して時刻装置に入力する。また、この関連技術は、内部の時刻が実時刻より遅れていれば、通常周期より短い(例えば1/2倍の)パルスを発生する遅れ補正用パルス発生器を選択して時刻装置に入力する。また、この関連技術は、内部の時刻が実時刻より進んでいれば、通常周期より長い(例えば2倍の)パルスを発生する進み補正用パルス発生器を選択して時刻装置に入力する。   A technique related to such time correction is described in Patent Document 1. In this related technique, the period of the pulse signal for measuring the internal time is made variable in accordance with the error between the internal time and the actual time. Specifically, in the related technique, when there is no error, a normal pulse generator that generates a pulse having a normal cycle is selected and input to the time device. Also, in this related technique, if the internal time is delayed from the actual time, a delay correction pulse generator that generates a pulse shorter than the normal cycle (for example, 1/2 times) is selected and input to the time device. . In this related technique, if the internal time is ahead of the actual time, the advance correction pulse generator that generates a pulse longer than the normal period (for example, twice) is selected and input to the time device.

特公昭62−37354号Japanese Patent Publication No.62-37354

しかしながら、上述の関連技術には、以下の課題がある。   However, the related art described above has the following problems.

一般的に利用されているNTPの場合、slewモードにおける補正は、毎秒0.5ms(ミリ秒)ずつと定められている。したがって、例えば、内部の時刻と実時刻との間に1秒の誤差が生じている場合、NTPクライアントは、時刻の補正を完了させるまでに2000秒(33分20秒)を要する。例えば、内部の時刻と実時刻とに誤差がない状態で閏秒が発生したことを想定する。この場合、NTPクライアントは、閏秒による1秒の誤差が発生してから33分20秒間、実時刻との誤差を解消できない状態となる。   In the case of NTP generally used, the correction in the slew mode is set to 0.5 ms (millisecond) per second. Therefore, for example, when an error of 1 second occurs between the internal time and the actual time, the NTP client requires 2000 seconds (33 minutes and 20 seconds) to complete the time correction. For example, it is assumed that a leap second has occurred with no error between the internal time and the actual time. In this case, the NTP client is in a state where the error from the actual time cannot be resolved for 33 minutes and 20 seconds after an error of 1 second due to leap seconds occurs.

また、特許文献1に記載された関連技術は、内部の時刻が実時刻より進んでいる場合、通常の周期より長いパルスを時刻装置に入力するため、誤差の解消までに、誤差よりも長い時間を要する。例えば、進み補正用パルス発生器が、通常の2倍の周期のパルスを発生する場合、この関連技術は、1秒の進みを補正するまでに2秒の補正時間を要する。   Further, in the related art described in Patent Document 1, when the internal time is ahead of the actual time, a pulse longer than the normal cycle is input to the time device, so that the time longer than the error is eliminated before the error is eliminated. Cost. For example, when the advance correction pulse generator generates a pulse having a period twice as normal, this related technique requires a correction time of 2 seconds to correct the advance of 1 second.

このように、これらの関連技術では、時刻の補正に要する時間が長いという課題があった。   Thus, these related techniques have a problem that the time required for time correction is long.

本発明は、上述の課題を解決するためになされたもので、時刻の後戻りを発生させることなく、時刻の補正に要する時間をより短縮する技術を提供することを目的とする。   The present invention has been made to solve the above-described problems, and an object of the present invention is to provide a technique for further shortening the time required for time correction without causing a time return.

本発明の時刻補正装置は、基準時刻を計時する基準時計部と、装置時刻を計時する装置時計部と、時刻補正処理を行うか否かをチェックするよう設定されたチェック時刻になったことを検出するチェック時刻検出部と、前記チェック時刻に、前記基準時刻および前記装置時刻を比較し、前記装置時刻が前記基準時刻より遅れている場合、前記基準時刻を前記装置時計部に入力して前記装置時刻とし、前記装置時刻が前記基準時刻より進んでいる場合、前記基準時刻および前記装置時刻の差分の期間だけ、前記装置時計部による計時を停止させる時刻補正部と、を備える。   The time correction device according to the present invention has a reference clock unit for measuring the reference time, a device clock unit for measuring the device time, and a check time set to check whether or not to perform time correction processing. The check time detection unit to detect, the reference time and the device time are compared with the check time, and when the device time is delayed from the reference time, the reference time is input to the device clock unit A time correction unit configured to stop the time measurement by the device clock unit during a difference period between the reference time and the device time when the device time is ahead of the reference time.

また、本発明の時刻補正方法は、基準時刻を計時する基準時計部と、装置時刻を計時する装置時計部とを用いて、設定されたチェック時刻になると、前記基準時刻および前記装置時刻を比較し、前記装置時刻が前記基準時刻より遅れている場合、前記基準時刻を前記装置時計部に入力して前記装置時刻とし、前記装置時刻が前記基準時刻より進んでいる場合、前記基準時刻および前記装置時刻の差分の期間だけ、前記装置時計部による計時を停止させる。   In addition, the time correction method of the present invention compares the reference time and the device time when the set check time is reached by using the reference clock unit that measures the reference time and the device clock unit that measures the device time. When the device time is delayed from the reference time, the reference time is input to the device clock unit as the device time, and when the device time is ahead of the reference time, the reference time and the The time counting by the device clock unit is stopped only during the difference of the device time.

また、本発明のコンピュータ・プログラムは、基準時刻を計時する基準時計部と、装置時刻を計時する装置時計部とを用いて、時刻補正処理を行うか否かをチェックするよう設定されたチェック時刻になったことを検出するチェック時刻検出ステップと、前記チェック時刻に、前記基準時刻および前記装置時刻を比較し、前記装置時刻が前記基準時刻より遅れている場合、前記基準時刻を前記装置時計部に入力して前記装置時刻とし、前記装置時刻が前記基準時刻より進んでいる場合、前記基準時刻および前記装置時刻の差分の期間だけ、前記装置時計部による計時を停止させる時刻補正ステップと、をコンピュータ装置に実行させる。   Further, the computer program of the present invention uses a reference clock unit that counts the reference time and a device clock unit that counts the device time, so that a check time set to check whether or not to perform time correction processing is checked. A check time detecting step for detecting that the reference time and the device time are compared with the check time, and if the device time is delayed from the reference time, the reference time is set to the device clock unit. And the time correction step of stopping the time measurement by the device clock unit only during the period of difference between the reference time and the device time when the device time is ahead of the reference time. Cause the computer device to execute.

本発明は、時刻の後戻りを発生させることなく、時刻の補正に要する時間をより短縮する技術を提供することができる。   The present invention can provide a technique for further reducing the time required for correcting the time without causing a time return.

本発明の第1の実施の形態としての時刻補正装置の構成を示すブロック図である。It is a block diagram which shows the structure of the time correction apparatus as the 1st Embodiment of this invention. 本発明の第1の実施の形態としての時刻補正装置の動作を説明するフローチャートである。It is a flowchart explaining operation | movement of the time correction apparatus as the 1st Embodiment of this invention. 本発明の第2の実施の形態としての時刻補正装置の構成を示すブロック図である。It is a block diagram which shows the structure of the time correction apparatus as the 2nd Embodiment of this invention. 本発明の第2の実施の形態における時刻補正部の構成の一例を説明するブロック図である。It is a block diagram explaining an example of a structure of the time correction part in the 2nd Embodiment of this invention. 本発明の第2の実施の形態としての時刻補正装置の時刻補正動作を説明するフローチャートである。It is a flowchart explaining the time correction operation | movement of the time correction apparatus as the 2nd Embodiment of this invention. 本発明の第2の実施の形態としての時刻補正装置の装置時刻読み出し応答動作を説明するフローチャートである。It is a flowchart explaining the apparatus time read-out response operation | movement of the time correction apparatus as the 2nd Embodiment of this invention. 本発明の第2の実施の形態としての時刻補正装置が装置時刻の遅れを補正する動作の一例を説明する図である。It is a figure explaining an example of the operation | movement which the time correction apparatus as the 2nd Embodiment of this invention correct | amends the delay of apparatus time. 本発明の第2の実施の形態としての時刻補正装置が装置時刻の進みを補正する動作の一例を説明する図である。It is a figure explaining an example of the operation | movement which the time correction apparatus as the 2nd Embodiment of this invention correct | amends advance of apparatus time. 本発明の第2の実施の形態としての時刻補正装置が閏秒の挿入による装置時刻の進みを補正する動作の一例を説明する図である。It is a figure explaining an example of the operation | movement which the time correction apparatus as the 2nd Embodiment of this invention correct | amends advance of the apparatus time by insertion of leap second.

以下、本発明の実施の形態について、図面を参照して詳細に説明する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

(第1の実施の形態)
本発明の第1の実施の形態としての時刻補正装置1の構成を図1に示す。図1において、時刻補正装置1は、基準時計部11と、装置時計部12と、チェック時刻検出部13と、時刻補正部14とを含む。
(First embodiment)
FIG. 1 shows a configuration of a time correction apparatus 1 as a first embodiment of the present invention. In FIG. 1, the time correction device 1 includes a reference clock unit 11, a device clock unit 12, a check time detection unit 13, and a time correction unit 14.

基準時計部11は、基準時刻を計時する。基準時刻とは、後述の装置時計部12における装置時刻を補正する際に基準となる時刻である。例えば、基準時計部11は、任意のタイミングで外部のNTPサーバから受信される時刻データに基づいて計時を行うことにより、基準時刻を表す情報を生成してもよい。また、基準時計部11は、図示しないパルス発生器から入力されるクロック信号により計時を行う。   The reference clock unit 11 measures the reference time. The reference time is a reference time when correcting the device time in the device clock unit 12 described later. For example, the reference clock unit 11 may generate information representing the reference time by measuring time based on time data received from an external NTP server at an arbitrary timing. In addition, the reference clock unit 11 measures time with a clock signal input from a pulse generator (not shown).

装置時計部12は、自装置における時刻(装置時刻)を計時する。また、装置時計部12は、図示しないパルス発生器から入力されるクロック信号により計時を行う。   The device clock unit 12 measures the time (device time) in the device itself. In addition, the device clock unit 12 measures time with a clock signal input from a pulse generator (not shown).

チェック時刻検出部13は、後述の時刻補正部14により次に時刻補正処理を実行する時刻(チェック時刻)を保持する。そして、チェック時刻検出部13は、基準時刻が、保持しているチェック時刻になったことを検出し、時刻補正部14に通知する。例えば、チェック時刻検出部13は、基準時計部11における基準時刻が、保持しているチェック時刻に等しくなると、時刻補正部14に、チェック時刻になったことを表す信号を送信するようにしてもよい。   The check time detection unit 13 holds the time (check time) at which the time correction process is executed next by the time correction unit 14 described later. Then, the check time detection unit 13 detects that the reference time has reached the held check time, and notifies the time correction unit 14 of it. For example, when the reference time in the reference clock unit 11 becomes equal to the held check time, the check time detection unit 13 may transmit a signal indicating that the check time has been reached to the time correction unit 14. Good.

時刻補正部14は、チェック時刻になると、基準時刻および装置時刻を比較し、比較結果に基づき時刻補正処理を行うよう構成される。具体的には、時刻補正部14は、装置時刻が基準時刻より遅れている場合、基準時刻を、装置時計部12に入力して装置時刻とする。また、時刻補正部14は、装置時刻が基準時刻より進んでいる場合、基準時刻および装置時刻の差分の期間だけ、装置時計部12による計時を停止させる。   The time correction unit 14 is configured to compare the reference time and the device time when the check time comes and to perform time correction processing based on the comparison result. Specifically, when the device time is delayed from the reference time, the time correction unit 14 inputs the reference time to the device clock unit 12 and sets it as the device time. In addition, when the device time is ahead of the reference time, the time correction unit 14 stops the time measurement by the device clock unit 12 only during the difference between the reference time and the device time.

以上のように構成された時刻補正装置1の動作について、図2を参照して説明する。   The operation of the time correction apparatus 1 configured as described above will be described with reference to FIG.

図2では、まず、チェック時刻検出部13は、基準時刻がチェック時刻になると、時刻補正部14に対して信号を送出する(ステップS1でYes)。   In FIG. 2, first, the check time detector 13 sends a signal to the time corrector 14 when the reference time reaches the check time (Yes in step S1).

次に、時刻補正部14は、基準時刻および装置時刻を比較する(ステップS2)。   Next, the time correction unit 14 compares the reference time with the device time (step S2).

ここで、装置時刻が基準時刻より遅れている場合、時刻補正部14は、基準時刻を装置時計部12に入力し、装置時刻とする(ステップS3)。   Here, when the device time is delayed from the reference time, the time correction unit 14 inputs the reference time to the device clock unit 12 and sets it as the device time (step S3).

一方、装置時刻が基準時刻より進んでいる場合、時刻補正部14は、基準時刻および装置時刻の差分の期間だけ、装置時計部12による計時を停止させる(ステップS4)。   On the other hand, when the device time is ahead of the reference time, the time correction unit 14 stops the time measurement by the device clock unit 12 only during the difference between the reference time and the device time (step S4).

以上で、時刻補正装置1の動作の説明を終了する。   Above, description of operation | movement of the time correction apparatus 1 is complete | finished.

次に、本発明の第1の実施の形態の効果について述べる。   Next, effects of the first exemplary embodiment of the present invention will be described.

本発明の第1の実施の形態としての時刻補正装置は、時刻の後戻りを発生させることなく、時刻の補正に要する時間をより短縮することができる。   The time correction apparatus as the first embodiment of the present invention can further reduce the time required for time correction without causing a time return.

その理由は、基準時計部が基準時刻を計時し、装置時計部が装置時刻を計時し、チェック時刻検出部が、基準時刻がチェック時刻になったことを検出すると、時刻補正部が、基準時刻および装置時刻を比較し、装置時刻が基準時刻より遅れている場合、基準時刻を装置時計部に入力して装置時刻とし、装置時刻が基準時刻より進んでいる場合、基準時刻および装置時刻の差分の期間だけ、装置時計部による計時を停止させるからである。   The reason is that when the reference clock unit measures the reference time, the device clock unit measures the device time, and when the check time detection unit detects that the reference time is the check time, the time correction unit If the device time is delayed from the reference time, the reference time is input to the device clock unit as the device time, and if the device time is ahead of the reference time, the difference between the reference time and the device time This is because the time counting by the device clock unit is stopped only during the period of time.

これにより、本実施の形態は、装置時刻が基準時刻より遅れている場合は、即時に装置時刻を基準時刻に補正することができる。また、本実施の形態は、装置時刻が基準時刻より進んでいる場合は、その差分期間で装置時刻を基準時刻に補正することができる。その結果、本実施の形態は、基準時刻および装置時刻の差分より長い時間を補正に要する前述の関連技術と比べて、補正に要する時間を大幅に短縮することができる。   Thereby, this embodiment can immediately correct the apparatus time to the reference time when the apparatus time is delayed from the reference time. Further, in the present embodiment, when the device time is ahead of the reference time, the device time can be corrected to the reference time in the difference period. As a result, the present embodiment can significantly reduce the time required for correction as compared to the above-described related art that requires a longer time than the difference between the reference time and the apparatus time.

(第2の実施の形態)
次に、本発明の第2の実施の形態について図面を参照して詳細に説明する。なお、本実施の形態の説明において参照する各図面において、本発明の第1の実施の形態と同一の構成および同様に動作するステップには同一の符号を付して本実施の形態における詳細な説明を省略する。
(Second Embodiment)
Next, a second embodiment of the present invention will be described in detail with reference to the drawings. Note that, in each drawing referred to in the description of the present embodiment, the same reference numerals are given to the same configuration and steps that operate in the same manner as in the first embodiment of the present invention, and the detailed description in the present embodiment. Description is omitted.

本発明の第2の実施の形態としての時刻補正装置2の構成を図3に示す。図3において、時刻補正装置2は、本発明の第1の実施の形態としての時刻補正装置1に対して、時刻補正部14に替えて時刻補正部24を備え、さらに、閏秒補正部25を備える点が異なる。   The structure of the time correction apparatus 2 as the 2nd Embodiment of this invention is shown in FIG. In FIG. 3, the time correction device 2 includes a time correction unit 24 instead of the time correction unit 14 with respect to the time correction device 1 as the first embodiment of the present invention, and further includes a leap second correction unit 25. Is different.

閏秒補正部25は、次のチェック時刻までに閏秒の発生予定があることを検出すると、その発生予定時刻を新たなチェック時刻として、チェック時刻検出部13に設定する。そして、閏秒補正部25は、基準時計部11から出力される基準時刻を、閏秒の発生予定内容に基づいて補正する。   When the leap second correcting unit 25 detects that a leap second is scheduled to occur before the next check time, the leap second correcting unit 25 sets the estimated occurrence time as a new check time in the check time detecting unit 13. Then, the leap second correction unit 25 corrects the reference time output from the reference clock unit 11 based on the planned leap second generation content.

例えば、閏秒補正部25は、NTPサーバから受信される時刻データ(NTPパケット)に含まれるLI(Leap Indicator)ビットに基づいて、閏秒の挿入および削除のいずれかが発生するかを検出可能である。また、閏秒補正部25は、LIビットが設定されたNTPパケットの示す時刻に基づいて、閏秒の発生予定時刻を検出可能である。これは、閏秒の挿入または削除が、UTC(Coordinated Universal Time)における1日の最後の秒で発生することと、LIビットが24時間前から設定されることとによる。   For example, the leap second correction unit 25 can detect whether a leap second is inserted or deleted based on a LI (Leap Indicator) bit included in time data (NTP packet) received from an NTP server. It is. Further, the leap second correction unit 25 can detect the leap second occurrence scheduled time based on the time indicated by the NTP packet in which the LI bit is set. This is because leap second insertion or deletion occurs in the last second of the day in UTC (Coordinated Universal Time) and the LI bit is set from 24 hours ago.

また、閏秒補正部25は、閏秒の挿入があることを検出した場合、基準時計部11から出力される基準時刻から1秒減算した値を、閏秒補正後の時刻として出力すればよい。また、閏秒補正部25は、閏秒の削除があることを検出した場合、基準時計部11から出力される基準時刻に対して1秒加算した値を、閏秒補正後の時刻として出力すればよい。   In addition, when the leap second correction unit 25 detects that a leap second is inserted, the leap second correction unit 25 may output a value obtained by subtracting one second from the reference time output from the reference clock unit 11 as the time after the leap second correction. . When the leap second correction unit 25 detects that the leap second is deleted, the leap second correction unit 25 outputs a value obtained by adding 1 second to the reference time output from the reference clock unit 11 as the time after the leap second correction. That's fine.

なお、閏秒補正部25は、閏秒の発生予定を検出しない場合は、基準時計部11から出力される基準時刻をそのまま出力すればよい。   In addition, the leap second correction part 25 should just output the reference | standard time output from the reference | standard timepiece part 11 as it is, when the generation plan of leap second is not detected.

時刻補正部24は、本発明の第1の実施の形態における時刻補正部14と略同様に構成されるが、以下の2点が異なる。   The time correction unit 24 is configured in substantially the same manner as the time correction unit 14 in the first embodiment of the present invention, but differs in the following two points.

時刻補正部24は、基準時刻および装置時刻の比較結果に基づいて動作する際に、基準時刻として、閏秒補正部25によって補正された基準時刻を用いる。   When the time correction unit 24 operates based on the comparison result between the reference time and the device time, the reference time corrected by the leap second correction unit 25 is used as the reference time.

また、時刻補正部24は、装置時計部12による計時の停止中に装置時計部12に対する装置時刻の読み出し要求があると、次のように動作するよう構成される。具体的には、時刻補正部24は、装置時計部12にその時点で保持されている装置時刻を所定単位だけ進めてから読み出し要求に応答させる。そして、時刻補正部24は、装置時計部12による計時の停止期間を、装置時計部12において装置時刻を進めたのと同じ長さだけ延長させる。   The time correction unit 24 is configured to operate as follows when there is a device time read request to the device clock unit 12 while the device clock unit 12 stops timing. Specifically, the time correction unit 24 causes the device clock unit 12 to advance the device time held at that time by a predetermined unit and then responds to the read request. Then, the time correction unit 24 extends the stop period of time measurement by the device clock unit 12 by the same length as the device clock time is advanced in the device clock unit 12.

例えば、時刻補正部24は、図4に示すように構成されていてもよい。図4において、時刻補正部24は、比較器241と、タイマ入力セレクタ242と、タイマ243と、比較器244と、クロックセレクタ245と、装置時計部入力セレクタ246とを含む。なお、図4では、図面の都合上、時刻補正部24を示す破線の図形の内部に装置時計部12を示しているが、本発明の時刻補正部が装置時計部を含むことを必ずしも示すものではない。   For example, the time correction unit 24 may be configured as shown in FIG. 4, the time correction unit 24 includes a comparator 241, a timer input selector 242, a timer 243, a comparator 244, a clock selector 245, and a device clock unit input selector 246. In FIG. 4, for convenience of the drawing, the device clock unit 12 is shown inside the broken line graphic indicating the time correction unit 24, but the time correction unit of the present invention does not necessarily indicate that the device clock unit is included. is not.

比較器241は、チェック時刻検出部13からチェック時刻の検出信号(enable信号)が入力されると、閏秒補正部25から出力される基準時刻および装置時計部12から出力される装置時刻を比較する。そして、比較器241は、装置時刻が基準時刻より遅れていることを表す遅れ信号または進んでいることを表す進み信号と、進んでいる場合の基準時刻および装置時刻の差分を表す信号とを出力する。なお、比較器241は、基準時刻および装置時刻が等しい場合には、これらの信号を出力しなければよい。   When the check time detection signal (enable signal) is input from the check time detection unit 13, the comparator 241 compares the reference time output from the leap second correction unit 25 and the device time output from the device clock unit 12. To do. Then, the comparator 241 outputs a delay signal indicating that the device time is delayed from the reference time or an advance signal indicating that the device time is advanced, and a signal indicating a difference between the reference time and the device time when the device time is advanced. To do. Note that the comparator 241 may not output these signals when the reference time and the apparatus time are equal.

タイマ入力セレクタ242は、比較器241からの進み信号および差分信号、または、タイマ243のタイマ値に対する加算信号および減算信号を、タイマ243に入力する。   The timer input selector 242 inputs the advance signal and difference signal from the comparator 241, or the addition signal and subtraction signal for the timer value of the timer 243 to the timer 243.

タイマ243は、比較器241からの差分信号の示す差分をタイマ値の初期値として、タイマ値が0となるまで減算を行う。また、タイマ243は、タイマ値を、比較器244に出力する。また、タイマ243は、タイマ値の減算中に装置時刻読み出し信号が入力されると、タイマ値を所定単位だけ加算する。図4では、装置時刻の動作周波数1KHzに対応する時刻の最小単位1msを所定単位として加算している。   The timer 243 uses the difference indicated by the difference signal from the comparator 241 as an initial value of the timer value and performs subtraction until the timer value becomes zero. The timer 243 outputs the timer value to the comparator 244. The timer 243 adds the timer value by a predetermined unit when a device time read signal is input during subtraction of the timer value. In FIG. 4, the minimum unit of 1 ms corresponding to the operating frequency of 1 kHz of the apparatus time is added as a predetermined unit.

比較器244は、タイマ値が0より大きい場合に、クロック停止信号をクロックセレクタ245に入力する。また、比較器244は、タイマ値が0より大きい場合に、タイマ243に、減算を続けることを示す減算信号(図4では、「−1ms(ミリ秒)」)を出力する。   The comparator 244 inputs a clock stop signal to the clock selector 245 when the timer value is greater than zero. Further, when the timer value is larger than 0, the comparator 244 outputs a subtraction signal (“−1 ms (millisecond)” in FIG. 4) indicating that the subtraction is continued to the timer 243.

クロックセレクタ245は、外部から入力されるクロック信号(図4では、1KHz(キロヘルツ))を、装置時計部入力セレクタ246を介して装置時計部12に出力する。これにより、装置時計部12は、装置時刻を1msずつ歩進して計時を行う。また、クロックセレクタ245は、比較器244からのクロック停止信号が入力されると、クロック信号を出力しない。これにより、装置時計部12は、装置時刻の計時を停止する。また、クロックセレクタ245は、クロック停止信号が入力されるときに、装置時刻読み出し信号が入力されると、クロック信号を1回分出力する。これにより、装置時計部12は、計時の停止中であっても、装置時刻読み出し要求に応じて、装置時刻を、時刻の最小単位(図4では1ms)だけ歩進する。   The clock selector 245 outputs an externally input clock signal (1 kHz (kilohertz) in FIG. 4) to the device clock unit 12 via the device clock unit input selector 246. Thereby, the device clock unit 12 measures the device time by incrementing the device time by 1 ms. Further, when the clock stop signal from the comparator 244 is input, the clock selector 245 does not output the clock signal. As a result, the device clock unit 12 stops measuring the device time. The clock selector 245 outputs a clock signal for one time when a device time read signal is input when a clock stop signal is input. Thereby, the device clock unit 12 advances the device time by the minimum unit of time (1 ms in FIG. 4) in response to the device time read request even when the time measurement is stopped.

装置時計部入力セレクタ246は、比較器241からの遅れ信号が入力されると、閏秒補正部25からの基準時刻を、装置時計部12に対して出力する。これにより、装置時計部12の保持する装置時刻は、基準時刻と同一になる。   When the delay signal from the comparator 241 is input, the device clock unit input selector 246 outputs the reference time from the leap second correction unit 25 to the device clock unit 12. Thereby, the device time held by the device clock unit 12 becomes the same as the reference time.

以上のように構成された時刻補正装置2の動作について、図5〜図6を参照して説明する。   The operation of the time correction apparatus 2 configured as described above will be described with reference to FIGS.

まず、時刻補正装置2の時刻補正処理を図5に示す。   First, the time correction process of the time correction apparatus 2 is shown in FIG.

図5では、まず、閏秒補正部25は、チェック時刻検出部13に設定されているチェック時刻までの間に、閏秒の発生予定があることを検出する(ステップS11でYes)。前述のように、閏秒補正部25は、外部から受信されるNTPパケットのLIビットに基づいて、閏秒の発生予定を検出してもよい。   In FIG. 5, first, the leap second correction unit 25 detects that a leap second is scheduled to occur before the check time set in the check time detection unit 13 (Yes in step S <b> 11). As described above, the leap second correction unit 25 may detect the occurrence schedule of leap seconds based on the LI bit of the NTP packet received from the outside.

次に、閏秒補正部25は、閏秒の発生予定時刻を新たなチェック時刻として、チェック時刻検出部13に設定する。また、閏秒補正部25は、閏秒の発生予定内容(挿入または削除)に基づいて、基準時計部11から出力される基準時刻に対する補正を行う(ステップS12)。前述のように、閏秒補正部25は、閏秒の挿入がある場合、基準時刻から1秒減算した値を出力し、閏秒の削除がある場合、基準時刻に対して1秒加算した値を出力すればよい。   Next, the leap second correction unit 25 sets the leap second generation scheduled time in the check time detection unit 13 as a new check time. Further, the leap second correction unit 25 corrects the reference time output from the reference clock unit 11 based on the scheduled generation contents (insertion or deletion) of the leap second (step S12). As described above, the leap second correction unit 25 outputs a value obtained by subtracting 1 second from the reference time when leap seconds are inserted, and a value obtained by adding 1 second to the reference time when leap seconds are deleted. Should be output.

次に、チェック時刻検出部13は、閏秒補正部25から出力される基準時刻がチェック時刻になると、時刻補正部24に対してenable信号を送出する(ステップS13でYes)。   Next, when the reference time output from the leap second correction unit 25 becomes the check time, the check time detection unit 13 sends an enable signal to the time correction unit 24 (Yes in step S13).

次に、時刻補正部24は、閏秒補正後の基準時刻および装置時刻を比較する(ステップS14)。   Next, the time correction unit 24 compares the reference time after leap second correction and the device time (step S14).

具体的には、比較器241は、閏秒補正部25から出力される基準時刻および装置時計部12から出力される装置時刻を比較し、比較結果として、進み信号または遅れ信号と、進んでいる場合は差分信号とを出力する。なお、前述のように、比較器241は、基準時刻および装置時刻が等しい場合には、これらの信号を出力しない。   Specifically, the comparator 241 compares the reference time output from the leap second correction unit 25 and the device time output from the device clock unit 12, and advances the advance signal or the delay signal as the comparison result. In this case, a difference signal is output. As described above, the comparator 241 does not output these signals when the reference time and the apparatus time are equal.

ここで、装置時刻が、閏秒補正部25からの基準時刻より遅れている場合、時刻補正部24は、閏秒補正部25からの基準時刻を装置時計部12に入力し、装置時刻とする(ステップS15)。   Here, when the device time is delayed from the reference time from the leap second correction unit 25, the time correction unit 24 inputs the reference time from the leap second correction unit 25 to the device clock unit 12 and sets it as the device time. (Step S15).

具体的には、比較器241から遅れ信号が出力されて装置時計部入力セレクタ246に入力されると、装置時計部入力セレクタ246は、閏秒補正部25からの基準時刻を、装置時計部12に対して出力する。   Specifically, when a delay signal is output from the comparator 241 and input to the device clock unit input selector 246, the device clock unit input selector 246 sets the reference time from the leap second correction unit 25 as the device clock unit 12. Output for.

一方、装置時刻が、閏秒補正部25からの基準時刻より進んでいる場合、時刻補正部24は、閏秒補正部25からの基準時刻および装置時刻の差分の期間だけ、装置時計部12による計時を停止させる(ステップS16)。   On the other hand, when the device time is ahead of the reference time from the leap second correction unit 25, the time correction unit 24 uses the device clock unit 12 only during the difference between the reference time from the leap second correction unit 25 and the device time. Timekeeping is stopped (step S16).

具体的には、比較器241から進み信号および差分信号がタイマ入力セレクタ242を介してタイマ243に入力されると、タイマ243は、差分信号を初期値としてタイマ値が0になるまで減算を開始する。そして、比較器244は、タイマ値が0より大きい場合、クロック停止信号をクロックセレクタ245に出力し、装置時計部12へのクロックの供給を停止する。そして、タイマ243のタイマ値が0になると、比較器244は、クロック停止信号の出力を停止し、装置時計部12へのクロックの供給を開始させる。   Specifically, when the advance signal and the difference signal are input from the comparator 241 to the timer 243 via the timer input selector 242, the timer 243 starts subtraction until the timer value becomes 0 with the difference signal as an initial value. To do. When the timer value is greater than 0, the comparator 244 outputs a clock stop signal to the clock selector 245 and stops supplying the clock to the device clock unit 12. When the timer value of the timer 243 reaches 0, the comparator 244 stops outputting the clock stop signal and starts supplying the clock to the device clock unit 12.

以上で、時刻補正処理の説明を終了する。   Above, description of a time correction process is complete | finished.

次に、時刻補正装置2の装置時刻読み出し応答処理を図6に示す。   Next, device time read response processing of the time correction device 2 is shown in FIG.

図6では、まず、時刻補正部24は、装置時刻の読み出し要求を受信する(ステップS21でYes)。   In FIG. 6, first, the time correction unit 24 receives a device time read request (Yes in step S <b> 21).

次に、時刻補正部24は、装置時計部12による計時を停止中である場合(ステップS22でYes)、装置時計部12に保持されている装置時刻を所定単位だけ進めるとともに、計時の停止期間を所定単位だけ延長する(ステップS23)。   Next, the time correction unit 24 advances the device time held by the device clock unit 12 by a predetermined unit when the time measurement by the device clock unit 12 is stopped (Yes in step S22), and the timing stop period. Is extended by a predetermined unit (step S23).

具体的には、タイマ243は、タイマ値が0より大きいときに装置時刻読み出し信号を受信すると、タイマ値を所定単位だけ加算する。ここで、タイマ243は、タイマ値を減算中であるため、減算を行うとともに加算を行うことになる。したがって、タイマ値は、プラスマイナス0となり変化しない。   Specifically, when the timer 243 receives the device time read signal when the timer value is greater than 0, the timer 243 adds the timer value by a predetermined unit. Here, since the timer 243 is subtracting the timer value, the timer 243 performs subtraction and addition. Therefore, the timer value becomes plus or minus 0 and does not change.

そして、時刻補正装置2は、ステップS23で所定単位だけ進んだ装置時刻を応答すればよい。   And the time correction apparatus 2 should just respond with the apparatus time which advanced only the predetermined unit by step S23.

以上で、装置時刻読み出し応答処理の説明を終了する。   This is the end of the description of the apparatus time read response process.

次に、時刻補正装置2の動作を具体例で示す。ここでは、基準時計部11および装置時計部12の動作周波数は1KHzであるものとする。   Next, the operation of the time correction device 2 will be shown as a specific example. Here, it is assumed that the operating frequency of the reference clock unit 11 and the device clock unit 12 is 1 KHz.

<閏秒の発生がなく、装置時刻が基準時刻より遅れている場合の動作例>
まず、閏秒の発生がなく、装置時刻が基準時刻より1秒遅れている場合の時刻補正装置2の動作について、図7を参照して説明する。なお、閏秒の発生が検出されないため、閏秒補正部25から出力される基準時刻は、基準時計部11が計時する補正前の基準時刻と同一である。
<Example of operation when there is no leap second and the device time is behind the reference time>
First, the operation of the time correction apparatus 2 when there is no occurrence of leap seconds and the apparatus time is delayed by 1 second from the reference time will be described with reference to FIG. Since the occurrence of leap seconds is not detected, the reference time output from the leap second correction unit 25 is the same as the reference time before correction that the reference clock unit 11 measures.

ここで、チェック時刻検出部13には、チェック時刻として、9時00分00秒000ms(以下、ミリ秒単位の数値を省略し、9:00:00と記載する)が設定されているものとする。   Here, the check time detection unit 13 is set with 9: 00: 00: 000 ms (hereinafter, the numerical value in milliseconds is omitted and described as 9:00: 00) as the check time. To do.

まず、基準時刻が9:00:00になると、チェック時刻検出部13は、比較器241へenable信号を出力する(ステップS13でYes)。   First, when the reference time reaches 9:00: 00, the check time detection unit 13 outputs an enable signal to the comparator 241 (Yes in step S13).

次に、比較器241は、装置時刻(8:59:59)と基準時刻(9:00:00)とを比較し、遅れ信号を出力する(ステップS14で「遅れている」)。   Next, the comparator 241 compares the apparatus time (8:59:59) with the reference time (9:00:00) and outputs a delay signal (“delayed” in step S14).

そして、装置時計部入力セレクタ246は、閏秒補正部25からの基準時刻を装置時計部12に出力し、装置時計部12は、基準時刻を装置時刻として計時を続ける(ステップS15)。   Then, the device clock unit input selector 246 outputs the reference time from the leap second correction unit 25 to the device clock unit 12, and the device clock unit 12 continues to count time using the reference time as the device time (step S15).

その結果、装置時計部12の装置時刻は、基準時計部11の基準時刻と同一となり、装置時計部12の遅れが補正される。   As a result, the device time of the device clock unit 12 becomes the same as the reference time of the reference clock unit 11, and the delay of the device clock unit 12 is corrected.

<閏秒の発生がなく、装置時刻が基準時刻より進んでいる場合の動作例>
次に、閏秒の発生がなく、装置時刻が基準時刻より2秒進んでいる場合の時刻補正装置2の動作について、図8を参照して説明する。なお、上述の具体例と同様に、閏秒の発生が検出されないため、閏秒補正部25から出力される基準時刻は、基準時計部11が計時する補正前の基準時刻と同一である。
<Example of operation when no leap second occurs and the device time is ahead of the reference time>
Next, the operation of the time correction apparatus 2 when there is no leap second occurrence and the apparatus time is advanced by 2 seconds from the reference time will be described with reference to FIG. Since the occurrence of leap seconds is not detected as in the above-described specific example, the reference time output from the leap second correction unit 25 is the same as the reference time before correction counted by the reference clock unit 11.

また、上述の具体例と同様に、チェック時刻検出部13には、チェック時刻として、9:00:00が設定されているものとする。   Similarly to the above-described specific example, it is assumed that 9:00:00 is set as the check time in the check time detection unit 13.

まず、基準時刻が9:00:00になると、チェック時刻検出部13は、比較器241へenable信号を出力する(ステップS13でYes)。   First, when the reference time reaches 9:00: 00, the check time detection unit 13 outputs an enable signal to the comparator 241 (Yes in step S13).

次に、比較器241は、装置時刻(9:00:02)と基準時刻(9:00:00)とを比較し、進み信号と、基準時刻および装置時刻の差分(2秒)を表す差分信号とを出力する(ステップS14で「進んでいる」)。   Next, the comparator 241 compares the device time (9:00:02) with the reference time (9:00:00), and compares the advance signal with the difference representing the difference between the reference time and the device time (2 seconds). The signal is output (“advance” in step S14).

そして、タイマ243は、差分(2秒)をタイマ値の初期値として1msの減算を開始する。また、比較器244は、タイマ243から出力されるタイマ値の値が0より大きい間、クロック停止信号を出力して、装置時計部12へのクロック信号の供給を停止する(ステップS16)。このため、装置時計部12は、1msずつの歩進を停止する。そして、比較器244は、タイマ243から出力されるタイマ値の値が0となった時点で、クロック停止信号の出力を停止し、装置時計部12へのクロック信号の供給を開始する。このため、装置時計部12は、1msずつの歩進を再開する。   Then, the timer 243 starts subtraction of 1 ms using the difference (2 seconds) as the initial value of the timer value. The comparator 244 outputs a clock stop signal while the value of the timer value output from the timer 243 is greater than 0, and stops the supply of the clock signal to the device clock unit 12 (step S16). For this reason, the device clock unit 12 stops stepping by 1 ms. The comparator 244 stops outputting the clock stop signal when the value of the timer value output from the timer 243 becomes 0, and starts supplying the clock signal to the device clock unit 12. For this reason, the device clock unit 12 resumes stepping by 1 ms.

その結果、装置時計部12は、基準時刻に対して進んでいた2秒間だけ計時を停止することになり、進みが補正される。   As a result, the device clock unit 12 stops timing for 2 seconds, which has been advanced with respect to the reference time, and the advance is corrected.

<装置時計部12の計時停止中に装置時刻の読み出しに応答する場合の動作例>
次に、装置時計部12の計時停止中に装置時刻の読み出しがあった場合の動作について説明する。
<Operation example when responding to reading of device time while device clock unit 12 stops measuring time>
Next, the operation when the device time is read while the device clock unit 12 stops timing will be described.

まず、クロックセレクタ245は、計時停止中(クロック停止信号の入力があるとき)に、装置時刻の読み出し信号を受け取ると、装置時計部12に対して1回分のクロックを供給する。これにより、装置時計部12は、装置時刻を1msだけ進める。   First, the clock selector 245 supplies a clock for one time to the device clock unit 12 when receiving a device time read signal while the time is stopped (when a clock stop signal is input). Thereby, the device clock unit 12 advances the device time by 1 ms.

同時に、タイマ243は、タイマ値を1ms加算する。ここで、タイマ243は、タイマ値の減算(−1ms)を行っている。したがって、タイマ値は±0msとなり、タイマ値が0になるまでの期間が1ms延長される。   At the same time, the timer 243 adds 1 ms to the timer value. Here, the timer 243 performs subtraction (−1 ms) of the timer value. Therefore, the timer value becomes ± 0 ms, and the period until the timer value becomes 0 is extended by 1 ms.

このように、装置時計部12は、計時停止中でも、装置時刻の読み出しごとに、装置時刻を1msづつ更新するので、装置時刻の読み出しの順序性を保証する。また、タイマ243は、計時停止中の装置時刻の読み出しに応じて装置時刻が1ms更新されるごとに、タイマ期間を1msずつ延長するので、進みを補正する期間のつじつまがあうことになる。   As described above, the device clock unit 12 updates the device time by 1 ms every time the device time is read even when the time measurement is stopped, and thus guarantees the order of reading the device time. In addition, since the timer 243 extends the timer period by 1 ms every time the apparatus time is updated by 1 ms in response to the reading of the apparatus time during the time stop, the period for correcting the advance is consistent.

<装置時刻および基準時刻の誤差がなく、閏秒の挿入予定がある場合の動作例>
次に閏秒の発生予定がある場合の動作について、図9を参照して説明する。
<Operation example when there is no error in device time and reference time and leap second insertion is planned>
Next, an operation in the case where a leap second is scheduled to occur will be described with reference to FIG.

まず、閏秒補正部25は、チェック時刻検出部13に設定されたチェック時刻までに、閏秒の挿入予定があることを検出する(ステップS11でYes)。閏秒の挿入時刻は、9:00:00の直前であるものとする。   First, the leap second correction unit 25 detects that a leap second is scheduled to be inserted by the check time set in the check time detection unit 13 (Yes in step S11). It is assumed that the leap second insertion time is immediately before 9:00.

そこで、閏秒補正部25は、チェック時刻検出部13に、新たなチェック時刻として、閏秒の挿入の発生直後の9:00:00を設定する。また、閏秒補正部25は、基準時計部11から出力される基準時刻に、1秒減算した値を出力する(ステップS12)。   Therefore, the leap second correction unit 25 sets 9:00: 00 immediately after the occurrence of leap second insertion as a new check time in the check time detection unit 13. Further, the leap second correction unit 25 outputs a value obtained by subtracting one second from the reference time output from the reference clock unit 11 (step S12).

そして、閏秒補正部25から出力される基準時刻が9:00:00になると、チェック時刻検出部13は、比較器241へenable信号を出力する(ステップS13でYes)。   When the reference time output from the leap second correction unit 25 reaches 9: 00: 00: 00, the check time detection unit 13 outputs an enable signal to the comparator 241 (Yes in step S13).

次に、比較器241は、装置時刻(9:00:01)と、閏秒補正部25から出力される基準時刻(9:00:00)とを比較し、進み信号および差分信号(1秒)を出力する(ステップS14で「進んでいる」)。   Next, the comparator 241 compares the device time (9:00:01) with the reference time (9:00:00) output from the leap second correction unit 25, and compares the advance signal and the difference signal (1 second). ) Is output (“advance” in step S14).

次に、タイマ243は、差分(1秒)をタイマ値として1msの減算を開始する。そして、前述の「閏秒の発生がなく、装置時刻が基準時刻より進んでいる場合の動作例」の場合と同様に動作することにより、装置時計部12は、1msずつの歩進を1秒間停止し、その後再開する(ステップS16)。   Next, the timer 243 starts subtraction of 1 ms using the difference (1 second) as a timer value. Then, by operating in the same manner as in the above-described “example of operation when the leap second does not occur and the device time is ahead of the reference time”, the device clock unit 12 increments by 1 ms for 1 second. Stop and then resume (step S16).

その結果、時刻補正装置2は、実時刻と装置時刻との閏秒の挿入による誤差の補正を、閏秒発生直後に開始し、1秒間で補正を完了することができる。   As a result, the time correction device 2 can start correcting the error by inserting a leap second between the actual time and the device time immediately after the occurrence of the leap second, and can complete the correction in one second.

以上で、具体例の説明を終了する。   This is the end of the description of the specific example.

次に、本発明の第2の実施の形態の効果について述べる。   Next, the effect of the second exemplary embodiment of the present invention will be described.

本発明の第2の実施の形態としての時刻補正装置は、時刻の後戻りを発生させることなく、閏秒の補正に要する時間をより短縮することができる。   The time correction apparatus according to the second embodiment of the present invention can further reduce the time required to correct leap seconds without causing a time return.

その理由は、閏秒補正部が、次のチェック時刻までに閏秒の発生予定があることを検出すると、その発生予定時刻を新たなチェック時刻としてチェック時刻検出部に設定し、基準時刻を閏秒の発生予定内容に基づいて補正し、時刻補正部が、閏秒補正後の基準時刻と装置時刻との比較に基づいて、装置時刻が閏秒補正後の基準時刻より遅れている場合、閏秒補正後の基準時刻を装置時計部に入力して装置時刻とし、装置時刻が閏秒補正後の基準時刻より進んでいる場合、閏秒補正後の基準時刻および装置時刻の差分の期間だけ、装置時計部による計時を停止させるからである。   The reason is that when the leap second correction unit detects that a leap second is scheduled to occur before the next check time, the leap second correction unit sets the expected occurrence time as a new check time in the check time detection unit and sets the reference time as If the device time is delayed from the reference time after the leap second correction based on the comparison between the reference time after the leap second correction and the device time, When the reference time after the second correction is input to the device clock unit as the device time and the device time is ahead of the reference time after the leap second correction, only the difference between the reference time after the leap second correction and the device time, This is because the timing by the device clock unit is stopped.

これにより、本実施の形態は、閏秒の発生直後に時刻の補正を開始し、閏秒の削除の場合には、即時に、装置時刻を閏秒補正後の基準時刻に補正することができる。また、本実施の形態は、閏秒の発生直後に時刻の補正を開始し、閏秒の挿入の場合には、挿入された閏秒の期間(1秒間)で、装置時刻を、閏秒補正後の基準時刻に補正することができる。   Thereby, the present embodiment starts time correction immediately after the occurrence of leap seconds, and in the case of deletion of leap seconds, the apparatus time can be immediately corrected to the reference time after leap second correction. . In the present embodiment, time correction is started immediately after the occurrence of leap seconds. When leap seconds are inserted, the apparatus time is corrected for leap seconds in the inserted leap second period (1 second). It can be corrected to a later reference time.

また、本実施の形態は、装置時刻の進みの補正のために装置時計部の計時を停止させながらも、自装置から読み出される装置時刻の順序性を保証することができる。   In addition, the present embodiment can guarantee the order of the device times read from the own device while stopping the time measurement of the device clock unit to correct the advance of the device time.

その理由は、時刻補正部が、装置時刻の進みによる装置時計部の停止中に装置時刻の読み出し要求があると、装置時計部に保持される装置時刻を所定単位だけ進めてから読み出し要求に応答させるとともに、装置時計部の計時停止期間を所定単位だけ延長させるからである。   The reason for this is that if the time correction unit makes a request to read the device time while the device clock is stopped due to the advance of the device time, the device time held by the device clock is advanced by a predetermined unit and then responds to the read request. This is because the timing stop period of the device clock section is extended by a predetermined unit.

これにより、本実施の形態は、装置時刻の進みの補正のために装置時計部が計時を停止中であっても、装置時刻の読み出しがあるごとに、装置時刻を所定単位づつ更新する。したがって、本実施の形態は、読み出される装置時刻の順序性を保証する。このとき、本実施の形態は、計時停止中の装置時刻の読み出しに応じて装置時刻が所定単位ずつ更新される度に、計時停止期間を所定単位だけ延長するので、装置時刻の進みを問題なく補正できる。   As a result, in the present embodiment, the device time is updated by a predetermined unit every time the device time is read out even when the device clock unit stops counting time to correct the advance of the device time. Therefore, this embodiment guarantees the order of the device times to be read. At this time, in this embodiment, every time the device time is updated by a predetermined unit in response to the reading of the device time during the time stop, the time stop period is extended by a predetermined unit, so that the advancement of the device time can be performed without any problem. Can be corrected.

なお、本実施の形態において、基準時計部および装置時計部の動作周波数を1KHzとする例を中心に説明したが、これらの時計部の動作周波数を限定するものではない。また、計時停止中に装置時刻の読み出しがあった場合に装置時刻を進める単位を1msとする例を中心に説明したが、装置時刻を進める所定単位を限定するものではない。   In the present embodiment, the description has been made centering on an example in which the operating frequency of the reference clock unit and the device clock unit is 1 KHz, but the operating frequency of these clock units is not limited. In addition, although an example in which the unit for advancing the apparatus time is 1 ms when the apparatus time is read while the time is stopped has been described, the predetermined unit for advancing the apparatus time is not limited.

また、本実施の形態において、閏秒補正部が、NTPパケットに基づいて閏秒の発生予定を検出する例について説明したが、NTPパケットに限らず、その他の公知の技術により閏秒の発生予定を検出してもよい。   In the present embodiment, the leap second correction unit has described an example in which the leap second occurrence schedule is detected based on the NTP packet. However, the leap second occurrence schedule is not limited to the NTP packet, and other known techniques are used. May be detected.

また、上述した本発明の各実施の形態において、基準時計部が、NTPサーバから受信される時刻データに基づいて基準時刻を計時する例について説明したが、NTPサーバに限らず、その他の公知の技術により取得可能な時刻に基づいて基準時刻を計時してもよい。   In each of the embodiments of the present invention described above, an example in which the reference clock unit measures the reference time based on time data received from the NTP server has been described. The reference time may be measured based on the time that can be acquired by technology.

また、上述した本発明の各実施の形態において、時刻補正装置の各機能ブロックが、ハードウェア要素により構成される例を中心に説明したが、各機能ブロックの一部、全部、または、それらの組み合わせは、メモリに記憶されたコンピュータ・プログラムを実行するプロセッサにより実現されていてもよい。   Further, in each of the embodiments of the present invention described above, each functional block of the time correction apparatus has been described mainly with respect to examples configured by hardware elements. However, a part, all, or part of each functional block is described. The combination may be realized by a processor that executes a computer program stored in a memory.

また、上述した本発明の各実施の形態において、各フローチャートを参照して説明した時刻補正装置の動作を、本発明のコンピュータ・プログラムとしてコンピュータ装置の記憶装置(記憶媒体)に格納しておき、係るコンピュータ・プログラムを当該CPUが読み出して実行するようにしてもよい。そして、このような場合において、本発明は、係るコンピュータ・プログラムのコードあるいは記憶媒体によって構成される。   In each of the embodiments of the present invention described above, the operation of the time correction apparatus described with reference to each flowchart is stored in a storage device (storage medium) of the computer apparatus as a computer program of the present invention. Such a computer program may be read and executed by the CPU. In such a case, the present invention is constituted by the code of the computer program or a storage medium.

また、上述した各実施の形態は、適宜組み合わせて実施されることが可能である。   Moreover, each embodiment mentioned above can be implemented in combination as appropriate.

また、本発明は、上述した各実施の形態に限定されず、様々な態様で実施されることが可能である。   The present invention is not limited to the above-described embodiments, and can be implemented in various modes.

1、2 時刻補正装置
11 基準時計部
12 装置時計部
13 チェック時刻検出部
14、24 時刻補正部
25 閏秒補正部
241 比較器
242 タイマ入力セレクタ
243 タイマ
244 比較器
245 クロックセレクタ
246 装置時計部入力セレクタ
1, 2 Time correction device 11 Reference clock unit 12 Device clock unit 13 Check time detection unit 14, 24 Time correction unit 25 Leap second correction unit 241 Comparator 242 Timer input selector 243 Timer 244 Comparator 245 Clock selector 246 Device clock unit input selector

Claims (9)

基準時刻を計時する基準時計部と、
装置時刻を計時する装置時計部と、
時刻補正処理を行うか否かをチェックするよう設定されたチェック時刻になったことを検出するチェック時刻検出部と、
前記チェック時刻に、前記基準時刻および前記装置時刻を比較し、前記装置時刻が前記基準時刻より遅れている場合、前記基準時刻を前記装置時計部に入力して前記装置時刻とし、前記装置時刻が前記基準時刻より進んでいる場合、前記基準時刻および前記装置時刻の差分の期間だけ、前記装置時計部による計時を停止させる時刻補正部と、
を備えた時刻補正装置。
A reference clock for measuring the reference time,
A device clock for measuring device time;
A check time detection unit that detects that a check time set to check whether or not to perform time correction processing is reached;
The reference time and the device time are compared with the check time, and when the device time is delayed from the reference time, the reference time is input to the device clock unit as the device time, and the device time is A time correction unit that stops time counting by the device clock unit for a period of difference between the reference time and the device time when the time is ahead of the reference time;
A time correction apparatus comprising:
次の前記チェック時刻までに閏秒の発生予定があることを検出すると、その発生予定時刻を新たなチェック時刻として前記チェック時刻検出部に設定し、前記閏秒の発生予定内容に基づいて、前記基準時刻を補正する閏秒補正部をさらに備え、
前記時刻補正部は、前記基準時刻として、前記閏秒補正部によって補正された基準時刻を用いることを特徴とする請求項1に記載の時刻補正装置。
When it is detected that there is a leap second occurrence schedule by the next check time, the occurrence time is set as a new check time in the check time detection unit, and based on the leap second occurrence schedule content, A leap second correction unit that corrects the reference time is further provided.
The time correction device according to claim 1, wherein the time correction unit uses the reference time corrected by the leap second correction unit as the reference time.
前記時刻補正部は、前記装置時計部の計時停止中に前記装置時刻の読み出し要求があると、前記装置時計部に保持される装置時刻を所定単位だけ進めるとともに、前記装置時計部の計時停止期間を前記所定単位だけ延長させることを特徴とする請求項1または請求項2に記載の時刻補正装置。   The time correction unit advances the device time held by the device clock unit by a predetermined unit when there is a request for reading the device time while the device clock unit is stopped, and the timing stop period of the device clock unit. The time correction device according to claim 1, wherein the time is extended by the predetermined unit. 基準時刻を計時する基準時計部と、装置時刻を計時する装置時計部とを用いて、
設定されたチェック時刻になると、前記基準時刻および前記装置時刻を比較し、前記装置時刻が前記基準時刻より遅れている場合、前記基準時刻を前記装置時計部に入力して前記装置時刻とし、前記装置時刻が前記基準時刻より進んでいる場合、前記基準時刻および前記装置時刻の差分の期間だけ、前記装置時計部による計時を停止させる、時刻補正方法。
Using a reference clock unit that measures the reference time and a device clock unit that measures the device time,
When the set check time is reached, the reference time and the device time are compared, and if the device time is behind the reference time, the reference time is input to the device clock unit as the device time, A time correction method in which, when the device time is ahead of the reference time, the time measurement by the device clock unit is stopped only during a difference between the reference time and the device time.
次の前記チェック時刻までに閏秒の発生予定があることを検出すると、その発生予定時刻を新たなチェック時刻として設定し、
前記閏秒の発生予定内容に基づいて、前記基準時刻を補正し、
前記チェック時刻になると行う処理において、前記基準時刻として、前記閏秒の発生予定内容に基づいて補正された基準時刻を用いることを特徴とする請求項4に記載の時刻補正方法。
When it is detected that there is a leap second occurrence by the next check time, the occurrence occurrence time is set as a new check time,
Correct the reference time based on the planned occurrence of leap seconds,
5. The time correction method according to claim 4, wherein a reference time corrected on the basis of the planned content of the leap second is used as the reference time in the processing performed when the check time is reached.
前記装置時計部の計時停止中に前記装置時刻の読み出し要求があると、前記装置時計部に保持される装置時刻を所定単位だけ進めるとともに、前記装置時計部の計時停止期間を前記所定単位だけ延長させることを特徴とする請求項4または請求項5に記載の時刻補正方法。   If there is a request to read the device time while the device clock is stopped, the device time held by the device clock is advanced by a predetermined unit, and the time stop period of the device clock is extended by the predetermined unit. The time correction method according to claim 4 or 5, wherein: 基準時刻を計時する基準時計部と、装置時刻を計時する装置時計部とを用いて、
時刻補正処理を行うか否かをチェックするよう設定されたチェック時刻になったことを検出するチェック時刻検出ステップと、
前記チェック時刻に、前記基準時刻および前記装置時刻を比較し、前記装置時刻が前記基準時刻より遅れている場合、前記基準時刻を前記装置時計部に入力して前記装置時刻とし、前記装置時刻が前記基準時刻より進んでいる場合、前記基準時刻および前記装置時刻の差分の期間だけ、前記装置時計部による計時を停止させる時刻補正ステップと、
をコンピュータ装置に実行させるコンピュータ・プログラム。
Using a reference clock unit that measures the reference time and a device clock unit that measures the device time,
A check time detection step for detecting that a check time set to check whether or not to perform time correction processing is reached;
The reference time and the device time are compared with the check time, and when the device time is delayed from the reference time, the reference time is input to the device clock unit as the device time, and the device time is If the time is ahead of the reference time, a time correction step of stopping the time measurement by the device clock unit only for the difference between the reference time and the device time; and
Is a computer program that causes a computer device to execute.
次の前記チェック時刻までに閏秒の発生予定があることを検出すると、その発生予定時刻を新たなチェック時刻として設定し、前記閏秒の発生予定内容に基づいて、前記基準時刻を補正する閏秒補正ステップをさらに前記コンピュータ装置に実行させ、
前記時刻補正ステップにおいて、前記基準時刻として、前記閏秒の発生予定内容に基づいて補正された基準時刻を用いることを特徴とする請求項7に記載のコンピュータ・プログラム。
When it is detected that a leap second is scheduled to occur before the next check time, the occurrence time is set as a new check time, and the reference time is corrected based on the details of the leap second occurrence. Further causing the computer device to execute a second correction step;
The computer program according to claim 7, wherein, in the time correction step, a reference time corrected based on the planned leap second content is used as the reference time.
前記時刻補正ステップにおいて、前記装置時計部の計時停止中に前記装置時刻の読み出し要求があると、前記装置時計部に保持される装置時刻を所定単位だけ進めるとともに、前記装置時計部の計時停止期間を前記所定単位だけ延長させることを特徴とする請求項7または請求項8に記載のコンピュータ・プログラム。   In the time correction step, when there is a request for reading the device time during the time stop of the device clock unit, the device time held in the device clock unit is advanced by a predetermined unit, and the time stop period of the device clock unit is 9. The computer program according to claim 7, wherein the computer program is extended by the predetermined unit.
JP2013194179A 2013-09-19 2013-09-19 Time correction device, time correction method, and computer program Pending JP2015059851A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013194179A JP2015059851A (en) 2013-09-19 2013-09-19 Time correction device, time correction method, and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013194179A JP2015059851A (en) 2013-09-19 2013-09-19 Time correction device, time correction method, and computer program

Publications (1)

Publication Number Publication Date
JP2015059851A true JP2015059851A (en) 2015-03-30

Family

ID=52817497

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013194179A Pending JP2015059851A (en) 2013-09-19 2013-09-19 Time correction device, time correction method, and computer program

Country Status (1)

Country Link
JP (1) JP2015059851A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018112425A (en) * 2017-01-10 2018-07-19 株式会社デンソーテン Method for system time synchronization
KR20210125083A (en) 2019-03-20 2021-10-15 엔이씨 플랫폼즈 가부시키가이샤 Broadcast control apparatus, broadcast control method, program, and recording medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018112425A (en) * 2017-01-10 2018-07-19 株式会社デンソーテン Method for system time synchronization
KR20210125083A (en) 2019-03-20 2021-10-15 엔이씨 플랫폼즈 가부시키가이샤 Broadcast control apparatus, broadcast control method, program, and recording medium
US11778128B2 (en) 2019-03-20 2023-10-03 Nec Platforms, Ltd. Broadcasting control apparatus, broadcasting control method, program, and recording medium

Similar Documents

Publication Publication Date Title
US10892840B2 (en) Method and apparatus for TDMA slot synchronization and calibration of master and slave
EP2369438B1 (en) Calibration method of a real time clock signal
US8392730B2 (en) Current sharing method of DC power supply and device thereof
US20140355629A1 (en) Communication apparatus, communication system, and communication method
US9871609B2 (en) Network system, time master station, and time slave station
US9600023B2 (en) Method and data processing unit for providing a timestamp
US20200382233A1 (en) Information processing apparatus and time synchronization method
JP2015059851A (en) Time correction device, time correction method, and computer program
JP5143952B2 (en) Wireless base station
US10222786B2 (en) Numerical control system having synchronous control function between units
KR101290785B1 (en) Apparatus and method for clock synchronization in distributed control system
JP2012128552A (en) Information processing apparatus and time synchronizing method of information processing apparatus
CA3014595C (en) Method and apparatus for tdma slot synchronization and calibration of master and slave
JP4616054B2 (en) Measuring system
JP2017005379A (en) Communication device, communication system, estimation method and program
JP6227196B2 (en) Clock diagnostic device and clock diagnostic method
JP4230808B2 (en) Time synchronization method and communication system
CN112019288B (en) Time synchronization method, service single board and network equipment
JP2004272403A (en) Process input/output device and monitor control system using the same
WO2024001423A1 (en) Method and apparatus for determining dimensional measurement time, and devices
KR102497256B1 (en) System and method for timing synchronization of task execution in multi-core environment
RU2511596C2 (en) Time synchronisation in automated devices
JP2020107959A (en) Communication system
JP5821807B2 (en) Time correction device
KR100762178B1 (en) Timer error correcting method of display apparatus