JP2012202897A - Client terminal, server terminal, time synchronization method, and program - Google Patents
Client terminal, server terminal, time synchronization method, and program Download PDFInfo
- Publication number
- JP2012202897A JP2012202897A JP2011069322A JP2011069322A JP2012202897A JP 2012202897 A JP2012202897 A JP 2012202897A JP 2011069322 A JP2011069322 A JP 2011069322A JP 2011069322 A JP2011069322 A JP 2011069322A JP 2012202897 A JP2012202897 A JP 2012202897A
- Authority
- JP
- Japan
- Prior art keywords
- time
- synchronization
- information
- time synchronization
- server
- 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 client terminal, a server terminal, and the like, and more particularly, to a client terminal, a server terminal, and the like that can perform time synchronization based on highly reliable time information that is accurate.
電子商取引等、各種サーバのログ管理において、時刻は非常に重要な情報であり、各種サーバは、常に正確な時刻を保持する必要がある。従来、サーバの多くは、NTP(Network Time Protocol)による時刻同期を実施している(例えば、特許文献1)。
すなわち、下位のサーバであるNTPクライアントが、上位のサーバであるNTPサーバから時刻情報を受け取り、この時刻情報に基づき、NTPクライアントの時刻をNTPサーバの時刻に同期させる。
In log management of various servers such as electronic commerce, time is very important information, and various servers must always keep accurate time. Conventionally, many servers perform time synchronization by NTP (Network Time Protocol) (for example, Patent Document 1).
That is, an NTP client that is a lower server receives time information from an NTP server that is an upper server, and synchronizes the time of the NTP client with the time of the NTP server based on this time information.
しかしながら、NTPサーバの時刻情報が常に正確であるという保証はなく、正確でない場合であっても、NTPクライアントがその時刻情報に基づいた同期を実施しまうという問題がある。 However, there is no guarantee that the time information of the NTP server is always accurate, and there is a problem that even if it is not accurate, the NTP client performs synchronization based on the time information.
この問題を解消するために、NTPサーバの時刻情報を信頼させる方法が種々考えられている。例えば、NTPサーバからの時刻情報により同期を行う場合に、証明書による認証処理を行うことにより、悪意のあるNTPサーバを排除する方法がある。また、同期する時刻情報を複数得るために複数のNTPサーバを設定して、例えば自身の時刻と最もずれの少ない同期先のNTPサーバを選択する方法もある。 In order to solve this problem, various methods for trusting the time information of the NTP server have been considered. For example, when synchronization is performed based on time information from an NTP server, there is a method of eliminating a malicious NTP server by performing authentication processing using a certificate. There is also a method of setting a plurality of NTP servers in order to obtain a plurality of pieces of time information to be synchronized, and selecting, for example, a synchronization destination NTP server having the least deviation from its own time.
しかしながら、これらの方法では、悪意のあるNTPサーバを排除したり、自身の時刻と大きく異なる時刻情報による同期を行わないようにすることができるが、NTPサーバが提供する時刻情報そのものが正確であるかを判断することはできない。悪意のないサーバであっても、時刻情報は正確でない場合もあり、また、自身の時刻と近い時刻情報であっても、これが正確でない場合も考えられる。 However, with these methods, it is possible to eliminate malicious NTP servers or prevent synchronization with time information that is significantly different from the own time, but the time information itself provided by the NTP server is accurate. I can't judge. Even if it is a non-malicious server, the time information may not be accurate, and even if the time information is close to its own time, this may not be accurate.
本発明は、上記の問題を鑑みてなされたものであり、その目的は、正確であるとの信頼性の高い時刻情報に基づき時刻同期を行うことが可能なクライアント端末やサーバ端末等を提供することである。 The present invention has been made in view of the above problems, and an object of the present invention is to provide a client terminal, a server terminal, or the like that can perform time synchronization based on highly reliable time information that is accurate. That is.
前述した目的を達するために第1の発明は、サーバ端末とネットワークにより接続されたクライアント端末であって、前記サーバ端末に時刻同期要求を送信する送信手段と、前記サーバ端末から、当該サーバ端末が前回時刻同期を実施した時刻、前回時刻同期の時刻のずれ、前回時刻同期の状況を含む同期判定情報と時刻情報を受信する受信手段と、前記同期判定情報を元に、前記サーバ端末が時刻同期を実施していない場合、もしくは、前記サーバ端末が前回時刻同期の調整中かつ前回時刻同期の際の時刻のずれが所定の時間以上の場合、前記時刻情報について、前記クライアント端末の時刻同期を実施しないと判定する判定手段と、前記時刻情報について時刻同期を実施しないと判定されない場合に、前記時刻情報に基づき、時刻同期を実施する時刻同期手段と、を具備することを特徴とするクライアント端末である。 In order to achieve the above-mentioned object, a first invention is a client terminal connected to a server terminal via a network, wherein the server terminal transmits a time synchronization request to the server terminal, and the server terminal Based on the synchronization determination information, the server terminal synchronizes the time based on the synchronization determination information including the time at which the previous time synchronization was performed, the time lag of the previous time synchronization, the synchronization determination information including the status of the previous time synchronization and the time information. If the server terminal is adjusting the previous time synchronization and the time lag during the previous time synchronization is equal to or greater than a predetermined time, the time synchronization of the client terminal is performed for the time information. A determination means for determining that the time synchronization is not performed, and time synchronization based on the time information when it is not determined that the time synchronization is not performed on the time information. A client terminal, characterized by comprising the Hodokosuru time synchronization means.
前記同期判定情報は、前記サーバ端末における所定のイベントの発生状況を含み、前記判定手段は、前記同期判定情報を元に、さらに、所定のイベントの発生後に前記サーバ端末が時刻同期を行っていない場合、前記クライアント端末の時刻同期を実施しないと判定する。 The synchronization determination information includes a state of occurrence of a predetermined event in the server terminal, and the determination unit further performs time synchronization of the server terminal after the generation of the predetermined event based on the synchronization determination information. In this case, it is determined that the time synchronization of the client terminal is not performed.
また、前記判定手段は、さらに、前記サーバ端末から受信した時刻情報と、前記クライアント端末の時刻情報とのずれが、前記クライアント端末の前回時刻同期の際の時刻のずれより所定の時間大きい場合、前記クライアント端末の時刻同期を実施しないと判定する。 In addition, the determination means, further, when the time information received from the server terminal and the time information of the client terminal is larger than the time difference at the time of the previous time synchronization of the client terminal, a predetermined time, It is determined that time synchronization of the client terminal is not performed.
加えて、前記クライアント端末を複数の前記サーバ端末と接続し、前記判定手段は、さらに、複数の前記サーバ端末から受信し、時刻同期を実施しないと判定されなかった時刻情報のいずれか2つに、所定の時間以上のずれがある場合に、前記クライアント端末の時刻同期を実施しないと判定してもよい。 In addition, the client terminal is connected to a plurality of the server terminals, and the determination means further receives any two of the time information received from the plurality of server terminals and determined not to perform time synchronization. When there is a difference of a predetermined time or more, it may be determined that the time synchronization of the client terminal is not performed.
第1の発明により、クライアント端末が、時刻情報の信頼性を示し、時刻同期を行うか否かを判定可能な同期判定情報を時刻情報とともにサーバ端末から受け取る。クライアント端末は、この同期判定情報を元に同期をするか否かを判定し、信頼に足りうる時刻情報に基づく同期を実施することが可能になる。
例えば、サーバ端末が前回時刻同期を実施した時刻や、前回時刻同期の際の時刻のずれ、前回時刻同期の状況などを用いて、サーバ端末が時刻同期を実施していない場合や、サーバ端末が前回時刻同期の調整中かつ前回時刻同期の際の時刻のずれが所定の時間以上の場合には時刻同期を行わないことで、信頼性の低い時刻情報に基づき時刻同期を行う可能性が低くなる。
According to the first aspect of the invention, the client terminal receives the synchronization determination information indicating the reliability of the time information and capable of determining whether to perform the time synchronization from the server terminal together with the time information. The client terminal can determine whether or not to synchronize based on this synchronization determination information, and can perform synchronization based on reliable time information.
For example, when the server terminal is not performing time synchronization using the time when the server terminal performed the previous time synchronization, the time lag during the previous time synchronization, the status of the previous time synchronization, etc. When the time synchronization during the previous time synchronization is being adjusted and the time lag during the previous time synchronization is greater than or equal to a predetermined time, the time synchronization is not performed, thereby reducing the possibility of performing time synchronization based on time information with low reliability. .
さらに、リブートや、ハードウエア障害、手動による時刻変更などのイベント後に時刻同期を行っていないサーバ端末からの時刻情報に基づく時刻同期を排除することで、より信頼性の高い時刻情報に基づく時刻同期が可能になる。 In addition, time synchronization based on more reliable time information is eliminated by eliminating time synchronization based on time information from server terminals that have not performed time synchronization after an event such as reboot, hardware failure, or manual time change. Is possible.
また、クライアント端末の前回時刻同期の際の時刻のずれを用いて同期するか否かの判定を行ったり、複数のサーバ端末から受け取った時刻情報同士のずれを判定に用いることもできる。このように、クライアント端末側の情報や、複数のサーバ端末からの時刻情報同士のずれも判定に利用することで、さらに信頼性の高い時刻情報により時刻同期を行うことが可能になる。 It is also possible to determine whether to synchronize using the time lag at the time of the previous time synchronization of the client terminal, or to use time lags received from a plurality of server terminals for determination. In this way, by using information on the client terminal side and deviation of time information from a plurality of server terminals for determination, time synchronization can be performed with more reliable time information.
第2の発明は、クライアント端末とネットワークにより接続されたサーバ端末であって、当該サーバ端末が前回時刻同期を実施した時刻、前回時刻同期の際の時刻のずれ、前回時刻同期の状況を含む同期判定情報を記憶する記憶手段と、前記クライアント端末からの時刻同期要求を受けて、前記記憶手段により記憶されている前記同期判定情報と時刻情報を前記クライアント端末に送信する送信手段と、を具備し、前記同期判定情報は、前記クライアント端末で、前記サーバ端末が時刻同期を実施していない場合、もしくは、前記サーバ端末が前回時刻同期の調整中かつ前回時刻同期の際の時刻のずれが所定の時間以上の場合、前記時刻情報について、前記クライアント端末の時刻同期を実施しないと判定する際に用いられることを特徴とするサーバ端末である。 A second invention is a server terminal connected to a client terminal via a network, and includes a time at which the server terminal has performed the previous time synchronization, a time lag at the time of the previous time synchronization, and a status of the previous time synchronization. Storage means for storing determination information, and transmission means for receiving the time synchronization request from the client terminal and transmitting the synchronization determination information and time information stored in the storage means to the client terminal. The synchronization determination information is determined when the client terminal is not performing time synchronization or when the server terminal is adjusting the previous time synchronization and the time difference during the previous time synchronization is predetermined. When it is over time, the time information is used when it is determined that time synchronization of the client terminal is not performed. It is a server terminal.
第3の発明は、サーバ端末とクライアント端末がネットワークにより接続されてなる時刻同期システムにおいて時刻同期を行う時刻同期方法であって、前記サーバ端末は、当該サーバ端末が前回時刻同期を実施した時刻、前回時刻同期の際の時刻のずれ、前回時刻同期の状況を含む同期判定情報を記憶する記憶手段を有し、前記クライアント端末からの時刻同期要求を受けて、前記記憶手段で記憶されている前記同期判定情報と時刻情報を送信するステップを実行し、前記クライアント端末は、前記サーバに時刻同期要求を送信するステップと、前記サーバ端末から前記同期判定情報と前記時刻情報を受信するステップと、前記同期判定情報を元に、前記サーバ端末が時刻同期を実施していない場合、もしくは、前記サーバ端末が前回時刻同期の調整中かつ前回時刻同期の際の時刻のずれが所定の時間以上の場合、前記時刻情報について、前記クライアント端末の時刻同期を実施しないと判定するステップと、前記時刻情報について時刻同期を実施しないと判定されない場合に、前記時刻情報に基づき、時刻同期を実施するステップと、を実行することを特徴とする時刻同期方法である。 A third invention is a time synchronization method for performing time synchronization in a time synchronization system in which a server terminal and a client terminal are connected by a network, wherein the server terminal is a time at which the server terminal has performed a previous time synchronization, The storage unit stores synchronization determination information including a time lag at the time of the previous time synchronization and the status of the previous time synchronization, and receives the time synchronization request from the client terminal, and is stored in the storage unit. Transmitting synchronization determination information and time information, wherein the client terminal transmits a time synchronization request to the server, receiving the synchronization determination information and the time information from the server terminal, Based on the synchronization determination information, when the server terminal does not perform time synchronization, or the server terminal Determining that the time synchronization of the client terminal is not performed with respect to the time information, and the time synchronization is not performed with respect to the time information when the time difference during the previous time synchronization is equal to or greater than a predetermined time If it is not determined, the step of performing time synchronization based on the time information is executed.
第4の発明は、コンピュータを、第1の発明のクライアント端末として機能させるためのプログラムである。 A fourth invention is a program for causing a computer to function as the client terminal of the first invention.
本発明により、正確であるとの信頼性の高い時刻情報に基づき時刻同期を行うことが可能なクライアント端末やサーバ端末等を提供することが可能になる。 According to the present invention, it is possible to provide a client terminal, a server terminal, or the like that can perform time synchronization based on highly reliable time information that is accurate.
以下、図面に基づいて本発明の実施形態について説明する。
図1は、本実施形態に係る時刻同期システム1の構成を示す図である。図1に示すように、時刻同期システム1では、NTPサーバ10(サーバ端末)と、NTPクライアント20(クライアント端末)とがネットワーク30で接続される。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 is a diagram illustrating a configuration of a time synchronization system 1 according to the present embodiment. As shown in FIG. 1, in the time synchronization system 1, an NTP server 10 (server terminal) and an NTP client 20 (client terminal) are connected via a
NTPサーバ10とNTPクライアント20は、時刻情報等の授受に関する2者間の相対的な上位・下位関係を示すものであり、NTPサーバ10はNTPクライアント20に時刻情報等を送信する側、NTPクライアント20はNTPサーバ10から時刻情報等を受信し、当該時刻情報に基づき自身の時刻情報をこれにあわせるように時刻同期を行う側を指す。
The
図2は、NTPサーバ10およびNTPクライアント20のハードウエア構成を示す図である。
図2に示すように、NTPサーバ10およびNTPクライアント20は、制御部11、記憶部12、メディア入出力部13、通信制御部14、入力部15、表示部16、周辺機器I/F部17等が、バス18を介して接続された構成である。
FIG. 2 is a diagram illustrating a hardware configuration of the
As shown in FIG. 2, the
制御部11は、CPU(Central Processing Unit)、ROM(Read Only Memory)、RAM(Random Access Memory)等で構成される。
CPUは、記憶部12、ROM、記録媒体等に格納されるプログラムをRAM上のワークメモリ領域に呼び出して実行し、バス18を介して接続された各装置を駆動制御し、時刻同期システム1が行う後述する処理を実現する。ROMは、不揮発性メモリであり、ブートプログラムやBIOS等のプログラム、データ等を恒久的に保持している。RAMは、揮発性メモリであり、記憶部12、ROM、記録媒体等からロードしたプログラム、データ等を一時的に保持するとともに、制御部11が各種処理を行う為に使用するワークエリアを備える。
The
The CPU calls a program stored in the
記憶部12は、HDD(ハードディスクドライブ)等であり、制御部11が実行するプログラム、プログラム実行に必要なデータ、OS(オペレーティングシステム)等が格納される。プログラムに関しては、OS(オペレーティングシステム)に相当する制御プログラムや、後述する処理をコンピュータに実行させるためのアプリケーションプログラムが格納されている。
これらの各プログラムコードは、制御部11により必要に応じて読み出されてRAMに移され、CPUに読み出されて各種の手段として実行される。
The
Each of these program codes is read by the
メディア入出力部13(ドライブ装置)は、データの入出力を行い、例えば、CDドライブ(−ROM、−R、−RW等)、DVDドライブ(−ROM、−R、−RW等)等のメディア入出力装置を有する。
通信制御部14は、通信制御装置、通信ポート等を有し、他のサーバ等の装置との通信を媒介する通信インタフェースであり、ネットワークを介して他の装置との通信制御を行う。ネットワークは、有線、無線を問わない。
The media input / output unit 13 (drive device) inputs / outputs data, for example, media such as a CD drive (-ROM, -R, -RW, etc.), DVD drive (-ROM, -R, -RW, etc.) Has input / output devices.
The
入力部15は、データの入力を行い、例えば、キーボード、マウス等のポインティングデバイス、テンキー等の入力装置を有する。
表示部16は、CRTモニタ、液晶パネル等のディスプレイ装置、およびディスプレイ装置と連携して表示機能を実現するための論理回路等を有する。
The
The
周辺機器I/F(インタフェース)部17は、周辺機器を接続させるためのポートであり、周辺機器I/F部17を介して周辺機器とのデータの送受信を行う。周辺機器I/F部17は、USB等で構成されており、通常複数の周辺機器I/Fを有する。周辺機器との接続形態は有線、無線を問わない。
バス18は、各装置間の制御信号、データ信号等の授受を媒介する経路である。
The peripheral device I / F (interface)
The bus 18 is a path that mediates transmission / reception of control signals, data signals, and the like between the devices.
図3は、本実施形態の時刻同期システム1における機能構成を示す図である。
図3に示すように、NTPサーバ10は、同期要求受信部101、時刻情報/同期判定情報送信部103、ログ情報記録部104を有し、記憶部12に時刻情報105、同期判定情報106、ログ情報107等を記憶する。
FIG. 3 is a diagram showing a functional configuration in the time synchronization system 1 of the present embodiment.
As illustrated in FIG. 3, the
同期要求受信部101は、NTPサーバ10の制御部11が、NTPクライアント20からの同期要求を受信するものである。
時刻情報/同期判定情報送信部103は、NTPサーバ10の制御部11が、NTPサーバ10が有する時刻情報105と、同期判定情報106を、NTPクライアント20に送信するものである。
ログ情報記録部104は、NTPサーバ10の制御部11が、NTPクライアント20から受信した情報を元に、ログ情報107を作成し記憶部12へ記憶するものである。
The synchronization
The time information / synchronization determination
The log information recording unit 104 creates
時刻情報105は、NTPサーバ10の内部時計の情報である。
同期判定情報106は、NTPクライアント20が同期判定に使用するための情報である。
ログ情報107は、NTPクライアント20の同期状況を管理するための情報である。
時刻情報105、同期判定情報106、ログ情報107の詳細は後述する。
The
The
The
Details of the
また、NTPクライアント20は、同期要求送信部201、時刻情報/同期判定情報受信部202、同期判定部203、同期処理部205を有し、記憶部12に時刻情報207、同期判定情報208、同期情報209等を記憶する。
The
同期要求送信部201は、NTPクライアント20の制御部11が、時刻同期を行うための同期要求をNTPサーバ10へ送信するものである。
時刻情報/同期判定情報受信部202は、NTPクライアント20の制御部11が、時刻情報105と、同期判定情報106を、NTPサーバ10から受信するものである。
同期判定部203は、NTPクライアント20の制御部11が、同期判定情報106等に基づき、時刻同期を実施するか否かを判定するものである。
同期処理部205は、NTPクライアント20の制御部11が、同期判定部203が時刻同期を実施すると判定した場合に、時刻情報207を時刻情報105に基づいて同期させるとともに、NTPクライアント20の同期情報209を記録してNTPサーバ10に送信するものである。
The synchronization
In the time information / synchronization determination
The
The
時刻情報207は、NTPクライアント20の内部時計の情報である。
同期判定情報208は、NTPクライアント20が同期判定に使用するための情報である。
同期情報209は、NTPクライアント20の同期状況を示す情報である。
時刻情報207、同期判定情報208、同期情報209の詳細は後述する。
The
The
The
Details of the
次に、図4〜図7に沿って、時刻同期システム1の処理の流れについて説明する。
図4は、時刻同期システム1の処理の流れを示すフローチャートである。
また、図5は、NTPサーバ10のデータである、時刻情報105、同期判定情報106、ログ情報107を説明する図、図6は、NTPクライアント20のデータである、時刻情報207、同期判定情報208、同期情報209を説明する図である。
また、図7は、同期判定処理の流れを示すフローチャートである。
Next, the flow of processing of the time synchronization system 1 will be described with reference to FIGS.
FIG. 4 is a flowchart showing a processing flow of the time synchronization system 1.
5 is a diagram for explaining
FIG. 7 is a flowchart showing the flow of the synchronization determination process.
図4に示すように、まず、NTPクライアント20の制御部11は、NTPサーバ10にNTPクライアント20のIPアドレスを含む時刻同期要求を送信する(S301)。
NTPサーバ10の制御部11は、時刻同期要求を受信し、時刻情報105と、同期判定情報106をNTPクライアント20に送信する(S302)。また、NTPサーバ10は、ログ情報107としてNTPクライアント20のIPアドレスと同期要求時刻を記録する。
As shown in FIG. 4, first, the
The
ここで、図5(a)、(b)、(c)に沿って、時刻情報105、同期判定情報106、ログ情報107について説明する。
Here, the
図5(a)に示すように、時刻情報105は、NTPサーバ10の内部時計の日付と時刻より成る。
As shown in FIG. 5A, the
図5(b)に示すように、同期判定情報106は、前回の同期時刻161、同期時のずれ162、同期状況163、前回のリブート時刻164、ハードウエア障害状況165、前回の手動時刻変更時刻166等からなる。
As shown in FIG. 5B, the
前回の同期時刻161(前回時刻同期を実施した時刻)は、NTPサーバ10が前回、時刻同期を実施(開始)した日付、日時である。NTPサーバ10は、さらに上位のサーバに対してNTPクライアントとして時刻同期を行う。前回の同期時刻161は、この時刻同期を実施した時刻である。
The previous synchronization time 161 (the time when the previous time synchronization was performed) is the date and time when the
同期時のずれ162(前回時刻同期の際の時刻のずれ)は、前回の時刻同期時の、それまでのNTPサーバ10自身の時刻情報105と、上位のサーバから受信した時刻情報のずれを示す。
The time difference 162 at the time of synchronization (time difference at the time of the previous time synchronization) indicates a time difference between the
同期状況163(前回時刻同期の状況)は、前回の時刻同期の実施状況を示す情報であり、時刻調整中であるか、時刻同期が完了しているか、を示す情報である。時刻同期は、ある期間にわたって行われる。例えば、1分のずれを1時間かけて徐々に修正するといったことが行われる。時刻調整中とは、この時刻同期が行われている期間にあることを示す。この期間を過ぎて、時刻同期が終了すれば、時刻同期が完了したことになる。 The synchronization status 163 (the status of the previous time synchronization) is information indicating the implementation status of the previous time synchronization, and is information indicating whether the time is being adjusted or whether the time synchronization is completed. Time synchronization is performed over a period of time. For example, the deviation of 1 minute is gradually corrected over 1 hour. “Time adjustment in progress” indicates that the time synchronization is in progress. If the time synchronization is over after this period, the time synchronization is complete.
前回のリブート時刻164は、NTPサーバ10が前回、リブートを行った時刻であり、制御部11は、リブート時に、その時刻を記憶部12に記憶しておく。
The previous reboot time 164 is the time when the
ハードウエア障害状況165は、NTPサーバ10のハードウエア障害が発生した時刻、およびハードウエア障害が復旧したか、を示す情報であり、制御部11は、例えばマザーボード交換時など、ハードウエア障害が発生した場合に、その時刻を記憶部12に記憶するとともに、ハードウェア障害の復旧時に、復旧したことを示す情報を記憶部12に記憶する。
The hardware failure status 165 is information indicating the time when the hardware failure of the
前回の手動時刻変更時刻166は、手動で時刻の変更を実施した時刻であり、制御部11は、手動の時刻変更が実施された時刻を記憶部12に記憶する。
The previous manual time change time 166 is a time at which the time is manually changed, and the
以上に説明したNTPサーバ10のリブート、ハードウエア障害、手動時刻変更は、NTPサーバ10に生じるイベントの例であり、NTPサーバ10の制御部11は、これらサーバの時刻が変化する可能性のあるイベントについて、その発生時刻等をイベント発生状況として記憶部12に記憶する。なお、本実施形態では、リブート、ハードウエア障害、手動時刻変更の発生状況を同期判定情報106として記憶するが、サーバの時刻が変化する可能性のあるイベントであれば、その他のイベントの発生状況を同期判定情報106として記憶することができる。
The reboot, hardware failure, and manual time change of the
図5(c)に示すように、ログ情報107は、NTPクライアント20のIPアドレス171、同期要求時刻172、時刻同期の有無173、同期無の場合の判定理由174、同期時刻175、同期時のずれ176を含む。
As shown in FIG. 5C, the
NTPクライアント20のIPアドレス171は、時刻同期を行うNTPクライアント20のIPアドレスである。
The
同期要求時刻172は、NTPクライアント20から時刻同期要求を受信した時刻である。
The synchronization request time 172 is the time when the time synchronization request is received from the
時刻同期の有無173は、NTPクライアント20が後述する処理において時刻同期処理を実施するか/実施しなかったかの情報である。
The presence /
同期無の場合の判定理由174は、NTPクライアント20が時刻同期処理を実施しなかった場合の理由を示す情報であり、NTPクライアント20が時刻同期処理を実施しなかった場合に、後述するS401〜S405のいずれかの判定理由が書き込まれる。
The
同期時刻175は、NTPクライアント20が時刻同期を実施(開始)した時刻である。NTPクライアント20が時刻同期を実施した場合に書き込まれる。
The
同期時のずれ176は、NTPクライアント20の時刻同期時の、それまでのNTPクライアント20自身の時刻情報207と、NTPサーバ10から受信した時刻情報105との差である。NTPクライアント20が時刻同期を実施した場合に書き込まれる。
The synchronization deviation 176 is a difference between the
図4の説明に戻る。NTPクライアント20の制御部11は、時刻情報105および同期判定情報106を受信し、サーバ側の同期判定情報106等を元に同期を実施するか否かの判定処理を実施する(S303)。
Returning to the description of FIG. The
図7は、判定処理(S303)の流れを示すフローチャートである。
判定処理として、NTPクライアント20の制御部11は、受信した同期判定情報106の前回の同期時刻161を参照して、NTPサーバ10で同期が行われているか否かを判定する(S401)。
NTPサーバ10で同期が行われていない場合(S401のNo)、NTPクライアント20の時刻同期は行わないと判定する(S407)。同期が行われていないNTPサーバ10の時刻情報105は、信頼性が低いためである。例えば、前回の同期時刻161が空欄であれば、NTPサーバ10で同期が行われていないと判定する。
FIG. 7 is a flowchart showing the flow of the determination process (S303).
As a determination process, the
When synchronization is not performed in the NTP server 10 (No in S401), it is determined that time synchronization of the
また、NTPクライアント20の制御部11は、同期状況163と同期時のずれ162を参照し、NTPサーバ10が時刻同期の調整中であり、かつ、同期時のずれ162が所定の時間T1(例えば、T1=4分)以上か否かを判定する(S402)。
NTPサーバ10が時刻同期の調整中であり、かつ、同期時のずれ162が所定の時間T1以上の場合(S402のYes)、NTPクライアント20の時刻同期は行わないと判定する(S407)。大きなずれのある時刻情報に同期している最中のNTPサーバ10の時刻情報105は、正確な時刻とのずれが大きい可能性があるためである。
Further, the
When the
さらに、NTPクライアント20の制御部11は、前回のリブート時刻164、ハードウエア障害状況165の障害発生時刻、前回の手動時刻変更時刻166、および、前回の同期時刻161を参照して、NTPサーバ10における所定のイベント(リブート、ハードウエア障害、手動時刻変更等)後にNTPサーバ10が時刻同期を実施しているか否かを判定する(S403)。すなわち、各イベントの時刻(前回のリブート時刻164、ハードウエア障害状況165の障害発生時刻、前回の手動時刻変更時刻166)と前回の同期時刻161を比較し、前回の同期時刻161がいずれかのイベントの時刻より以前である場合(S403のNo)、NTPクライアント20の時刻同期は行わないと判定する(S407)。これらのイベント後に時刻同期を行っていない場合、NTPサーバ10の時刻が正確な時刻とずれている可能性があるためである。
Further, the
図7の判定処理の流れでは、更に、後述するS404、S405において、NTPクライアント20の時刻情報207や同期判定情報208も用いた時刻同期実施の判定処理を行う。
In the determination process flow of FIG. 7, the time synchronization execution determination process using the
図6(a)、(b)に沿って、NTPクライアント20の時刻情報207、同期判定情報208について説明する。
The
図6(a)に示すように、時刻情報207は、時刻情報105と同様、NTPクライアント20の内部時計の日付と時刻より成る。
As shown in FIG. 6A, the
また、図6(b)に示すように、NTPクライアント20の同期判定情報208は、NTPサーバ10の同期判定情報106と同様に、前回の同期時刻281、同期時のずれ282、同期状況283、前回のリブート時刻284、ハードウエア障害状況285、前回の手動時刻変更時刻286等からなる。
Further, as shown in FIG. 6B, the
前回の同期時刻281、同期時のずれ282、同期状況283、前回のリブート時刻284、ハードウエア障害状況285、前回の手動時刻変更時刻286は、それぞれ、前述した前回の同期時刻161、同期時のずれ162、同期状況163、前回のリブート時刻164、ハードウエア障害状況165、前回の手動時刻変更時刻166と同様の情報である。
The
図7の説明に戻る。S404では、NTPクライアント20の制御部11が、クライアント側の同期判定情報208のハードウエア障害状況285を参照し、NTPクライアント20がハードウエア障害を起こしているか判定し、ハードウエア障害を起こしている場合には(S404のYes)、NTPクライアント20の時刻同期は行わないと判定する(S407)。例えば、ハードウエア障害状況285が、障害発生時刻に発生したハードウェア障害が復旧していることを示すものでなければ、ハードウエア障害を起こしていると判定する。
Returning to the description of FIG. In S404, the
また、NTPクライアント20の制御部11は、クライアント側の同期判定情報208の同期時のずれ282を参照して、NTPサーバ10の時刻情報105とNTPクライアント20の時刻情報207のずれが、同期時のずれ282より所定の時間T2大きいか否かを判定する(S405)。NTPサーバ10の時刻情報105とNTPクライアント20の時刻情報207のずれが、同期時のずれ282より所定の時間T2大きい場合(S405のYes)、NTPクライアント20の時刻同期は行わないと判定する(S407)。NTPクライアント20が前回時刻同期を行った際の同期時のずれ282に対し、新たに時刻同期を行う際のずれがある程度大きい場合、NTPサーバ10の時刻の進行に何らかの異常があった可能性があるためである。
Further, the
以上のS401〜S405の全てで、時刻同期を実施しないと判定されない場合に、NTPクライアント20の制御部11は、NTPクライアント20の時刻同期を行うと判定する(S406)。
When it is not determined that time synchronization is not performed in all of the above S401 to S405, the
図4の説明に戻る。以上の判定処理で時刻同期を行うと判定された場合(S304のYes)、NTPクライアント20の制御部11は、NTPサーバ10から受信した時刻情報105に基づき、時刻同期を実施(開始)し(S305)、S306の処理へ移る。一方、時刻同期を行わないと判定された場合(S304のNo)、時刻同期は行わず、S306の処理へ移行する。
Returning to the description of FIG. When it is determined that time synchronization is performed in the above determination process (Yes in S304), the
S306で、NTPクライアント20の制御部11は、今回行った処理について、同期情報209の記録を行い、当該同期情報209をNTPクライアント20のIPアドレスとともにNTPサーバ10に送信する(S306)。
In S306, the
図6(c)に沿って、NTPクライアント20の同期情報209について説明する。
図6(c)に示すように、同期情報209は、時刻同期の有無291、同期無の場合の判定理由292、同期時刻293、同期時のずれ294等より成る。
The
As shown in FIG. 6C, the
時刻同期の有無291、同期無の場合の判定理由292、同期時刻293、同期時のずれ294は、それぞれ、前述した時刻同期の有無173、同期無の場合の判定理由174、同期時刻175、同期時のずれ176と同様である。
Presence / absence of
図6(c)は、S401で時刻同期を行わないと判定された場合の同期情報209の例である。時刻同期の有無291について、「無」が記録され、同期無の場合の判定理由292として、S401の判定理由「NTPサーバの時刻同期未実施」が記録される。時刻同期が行われなかったので、同期時刻293、同期時のずれ294は空欄である。一方、時刻同期を行った場合には、時刻同期の有無291について、「有」が記録され、同期時刻293、同期時のずれ294として、それぞれNTPクライアント20が同期を実施(開始)した時刻と、NTPクライアント20の時刻同期時の、それまでのNTPクライアント20自身の時刻情報207と、NTPサーバ10から受信した時刻情報105との差が書き込まれる。
FIG. 6C is an example of the
なお、NTPクライアント20の制御部11は、S306において、同期判定情報208の、前回の同期時刻281、同期時のずれ282、同期状況283のデータも更新しておく。
In S306, the
図4の説明に戻る。NTPサーバ10は、NTPクライアント20のIPアドレスと同期情報209を受信し、IPアドレスの対応するログ情報107の時刻同期の有無173、同期無の場合の判定理由174、同期時刻175、同期時のずれ176に、同期情報209の時刻同期の有無291、同期無の場合の判定理由292、同期時刻293、同期時のずれ294を書き込んで記憶部12に記憶する(S308)。
ログ情報107により、NTPサーバ10は、NTPクライアント20の時刻同期状況を管理することが可能になる。適宜管理サーバ(不図示)にこのログ情報107を送信するなどして、システムの管理のため用いることもできる。
Returning to the description of FIG. The
The
以上説明したように、本発明の実施形態によれば、NTPクライアント20が、NTPサーバ10から、時刻同期を行うか否かを判定可能な同期判定情報106を時刻情報105とともに受け取る。NTPクライアント20は、この同期判定情報106を元に同期をするか否かを判定し、信頼に足りうる時刻情報105に基づく同期を実施することが可能になる。例えば、NTPサーバ10が前回時刻同期を実施した時刻や、前回時刻同期の際の時刻のずれ、前回時刻同期の状況などを用いて、NTPサーバ10が時刻同期を実施していない場合や、NTPサーバ10が時刻同期の調整中かつ時刻のずれが所定の時間以上の場合には時刻同期を行わないことで、信頼性の低い時刻情報105に基づき時刻同期を行う可能性が低くなる。
さらに、リブートや、ハードウエア障害、手動による時刻変更などのイベント後に時刻同期を行っていないNTPサーバ10からの時刻情報105に基づく時刻同期を排除することで、より信頼性の高い時刻情報105に基づく時刻同期が可能になる。
加えて、NTPクライアント20の前回時刻同期の際の時刻のずれを用いて同期するか否かの判定を行うこともでき、自身の時刻情報207とNTPサーバ10から受信した時刻情報105のずれをこれと比較し判定を行うことで、さらに信頼性の高い時刻同期を行うことが可能になる。
As described above, according to the embodiment of the present invention, the
Furthermore, by eliminating time synchronization based on the
In addition, it is possible to determine whether or not to synchronize using the time lag at the time of the previous time synchronization of the
なお、判定の方法は上記したものに限らない。例えば、複数のNTPサーバ10から受け取った時刻情報105を元に、時刻同期を実施するか否かの判定を行うこともできる。これを以下説明する。
図8は、このような時刻同期システム500の構成を示す図である。時刻同期システム500は、NTPクライアント20が、複数のNTPサーバ10−1、10−2、…とネットワーク30を介して接続された構成である。
The determination method is not limited to the above. For example, based on the
FIG. 8 is a diagram showing the configuration of such a time synchronization system 500. The time synchronization system 500 has a configuration in which the
NTPクライアント20は、複数のNTPサーバ10−1、10−2、…に前記のS301と同様に時刻同期要求を送信し、これに応じて受信した複数のNTPサーバ10−1、10−2、…の同期判定情報106等を元に、それぞれのNTPサーバ10の時刻情報105について、S303と同様の判定処理を実施し、同期を実施して問題ないかを判定する。
これに加えて、NTPクライアント20の制御部11は、同期を実施しないと判定されない(S304のYes)時刻情報105のうち、ある任意の2つの時刻情報105同士のずれが所定の時間T3以上か否かも判定する。そして、これが所定の時間T3以上の場合に、同期処理を行わないようにしておく。適正と判定される時刻情報105であっても、相互に大きく異なる時刻を示す場合には、その信頼性に疑問があるためである。このように、複数のNTPサーバ10による時刻情報105同士の比較も行うことで、信頼性の低い時刻情報105に基づき時刻同期を行う可能性はさらに低くなる。
The
In addition to this, the
なお、以上の同期処理実施の判定処理で使用する所定の時間T1〜T3は、予め所定値を定めて、NTPクライアント20の記憶部12に格納しておけばよい。
It should be noted that the predetermined times T1 to T3 used in the determination process for performing the synchronization process described above may be determined in advance and stored in the
以上、添付図面を参照しながら本発明の実施形態について説明したが、本発明はかかる例に限定されない。当業者であれば、特許請求の範囲に記載された技術的思想の範疇内において各種の変更例または修正例に想到し得ることは明らかであり、それらについても当然に本発明の技術的範囲に属するものと了解される。 As mentioned above, although embodiment of this invention was described referring an accompanying drawing, this invention is not limited to this example. It is obvious for those skilled in the art that various modifications or modifications can be conceived within the scope of the technical idea described in the claims, and these are naturally within the technical scope of the present invention. It is understood that it belongs.
1………時刻同期システム
10………NTPサーバ
20………NTPクライアント
105、207………時刻情報
106、208………同期判定情報
107………ログ情報
209………同期情報
1 .........
Claims (7)
前記サーバ端末に時刻同期要求を送信する送信手段と、
前記サーバ端末から、当該サーバ端末が前回時刻同期を実施した時刻、前回時刻同期の際の時刻のずれ、前回時刻同期の状況を含む同期判定情報と時刻情報を受信する受信手段と、
前記同期判定情報を元に、前記サーバ端末が時刻同期を実施していない場合、もしくは、前記サーバ端末が前回時刻同期の調整中かつ前回時刻同期の際の時刻のずれが所定の時間以上の場合、前記時刻情報について、前記クライアント端末の時刻同期を実施しないと判定する判定手段と、
前記時刻情報について時刻同期を実施しないと判定されない場合に、前記時刻情報に基づき、時刻同期を実施する時刻同期手段と、
を具備することを特徴とするクライアント端末。 A client terminal connected to a server terminal via a network,
Transmitting means for transmitting a time synchronization request to the server terminal;
Receiving means for receiving from the server terminal the time at which the server terminal performed the previous time synchronization, the time lag at the time of the previous time synchronization, the synchronization determination information including the status of the previous time synchronization, and the time information;
When the server terminal is not performing time synchronization based on the synchronization determination information, or when the server terminal is adjusting the previous time synchronization and the time lag during the previous time synchronization is a predetermined time or more Determining means for determining that the time synchronization of the client terminal is not performed for the time information;
If it is not determined that time synchronization is not performed for the time information, time synchronization means for performing time synchronization based on the time information;
A client terminal comprising:
前記判定手段は、前記同期判定情報を元に、さらに、所定のイベントの発生後に前記サーバ端末が時刻同期を行っていない場合、前記クライアント端末の時刻同期を実施しないと判定することを特徴とする請求項1記載のクライアント端末。 The synchronization determination information includes an occurrence status of a predetermined event in the server terminal,
The determination means further determines, based on the synchronization determination information, that the time synchronization of the client terminal is not performed when the server terminal does not perform time synchronization after occurrence of a predetermined event. The client terminal according to claim 1.
前記判定手段は、さらに、複数の前記サーバ端末から受信し、時刻同期を実施しないと判定されなかった時刻情報のいずれか2つに、所定の時間以上のずれがある場合に、前記クライアント端末の時刻同期を実施しないと判定することを特徴とする請求項1から請求項3のいずれかに記載のクライアント端末。 Connected to a plurality of the server terminals,
The determination unit is further configured to receive the client terminal from the plurality of server terminals when there is a deviation of a predetermined time or more in any two of the time information that has not been determined not to perform time synchronization. The client terminal according to any one of claims 1 to 3, wherein it is determined that time synchronization is not performed.
当該サーバ端末が前回時刻同期を実施した時刻、前回時刻同期の際の時刻のずれ、前回時刻同期の状況を含む同期判定情報を記憶する記憶手段と、
前記クライアント端末からの時刻同期要求を受けて、前記記憶手段により記憶されている前記同期判定情報と時刻情報を前記クライアント端末に送信する送信手段と、
を具備し、
前記同期判定情報は、前記クライアント端末で、前記サーバ端末が時刻同期を実施していない場合、もしくは、前記サーバ端末が前回時刻同期の調整中かつ前回時刻同期の際の時刻のずれが所定の時間以上の場合、前記時刻情報について、前記クライアント端末の時刻同期を実施しないと判定する際に用いられることを特徴とするサーバ端末。 A server terminal connected to a client terminal via a network,
Storage means for storing synchronization determination information including the time at which the server terminal performed the previous time synchronization, the time lag during the previous time synchronization, and the status of the previous time synchronization;
A transmission unit that receives a time synchronization request from the client terminal and transmits the synchronization determination information and time information stored in the storage unit to the client terminal;
Comprising
The synchronization determination information is a predetermined time when the server terminal is not performing time synchronization at the client terminal, or when the server terminal is adjusting the previous time synchronization and the time difference during the previous time synchronization is a predetermined time. In the above case, the server terminal is used when determining that the time synchronization of the client terminal is not performed for the time information.
前記サーバ端末は、
当該サーバ端末が前回時刻同期を実施した時刻、前回時刻同期の際の時刻のずれ、前回時刻同期の状況を含む同期判定情報を記憶する記憶手段を有し、
前記クライアント端末からの時刻同期要求を受けて、前記記憶手段で記憶されている前記同期判定情報と時刻情報を送信するステップを実行し、
前記クライアント端末は、
前記サーバに時刻同期要求を送信するステップと、
前記サーバ端末から前記同期判定情報と前記時刻情報を受信するステップと、
前記同期判定情報を元に、前記サーバ端末が時刻同期を実施していない場合、もしくは、前記サーバ端末が前回時刻同期の調整中かつ前回時刻同期の際の時刻のずれが所定の時間以上の場合、前記時刻情報について、前記クライアント端末の時刻同期を実施しないと判定するステップと、
前記時刻情報について時刻同期を実施しないと判定されない場合に、前記時刻情報に基づき、時刻同期を実施するステップと、
を実行することを特徴とする時刻同期方法。 A time synchronization method for performing time synchronization in a time synchronization system in which a server terminal and a client terminal are connected by a network,
The server terminal is
A storage means for storing synchronization determination information including the time at which the server terminal performed the previous time synchronization, the time lag during the previous time synchronization, and the status of the previous time synchronization;
Receiving the time synchronization request from the client terminal, and executing the step of transmitting the synchronization determination information and time information stored in the storage means;
The client terminal is
Sending a time synchronization request to the server;
Receiving the synchronization determination information and the time information from the server terminal;
When the server terminal is not performing time synchronization based on the synchronization determination information, or when the server terminal is adjusting the previous time synchronization and the time lag during the previous time synchronization is a predetermined time or more Determining that the time synchronization of the client terminal is not performed for the time information;
If it is not determined that time synchronization is not performed for the time information, performing time synchronization based on the time information;
The time synchronization method characterized by performing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011069322A JP2012202897A (en) | 2011-03-28 | 2011-03-28 | Client terminal, server terminal, time synchronization method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011069322A JP2012202897A (en) | 2011-03-28 | 2011-03-28 | Client terminal, server terminal, time synchronization method, and program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2012202897A true JP2012202897A (en) | 2012-10-22 |
Family
ID=47184051
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011069322A Withdrawn JP2012202897A (en) | 2011-03-28 | 2011-03-28 | Client terminal, server terminal, time synchronization method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2012202897A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2014199729A1 (en) | 2013-06-12 | 2014-12-18 | 富士電機株式会社 | Distribution device, distribution system, and distribution method |
CN109257133A (en) * | 2018-09-14 | 2019-01-22 | 武汉虹信通信技术有限责任公司 | A kind of the whole network clock synchronizing method and device applied to LTE rail transit network |
-
2011
- 2011-03-28 JP JP2011069322A patent/JP2012202897A/en not_active Withdrawn
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2014199729A1 (en) | 2013-06-12 | 2014-12-18 | 富士電機株式会社 | Distribution device, distribution system, and distribution method |
US9519306B2 (en) | 2013-06-12 | 2016-12-13 | Fuji Electric Co., Ltd. | Distribution device, distribution system, and distribution method |
CN109257133A (en) * | 2018-09-14 | 2019-01-22 | 武汉虹信通信技术有限责任公司 | A kind of the whole network clock synchronizing method and device applied to LTE rail transit network |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10162951B2 (en) | Non-intrusive background synchronization when authentication is required | |
US9798632B2 (en) | Providing boot data in a cluster network environment | |
US20190073276A1 (en) | System and method for datacenter recovery | |
US9311199B2 (en) | Replaying jobs at a secondary location of a service | |
US7062676B2 (en) | Method and system for installing program in multiple system | |
JP5120860B2 (en) | Method, system, and computer program for facilitating recovery within an agreement timing network | |
EP3766203B1 (en) | Autonomous secrets renewal and distribution | |
JP5042318B2 (en) | Method, system, and computer program for defining a tier 1 configuration in an agreement timing network | |
EP3624426B1 (en) | Binding crud-type protocols in distributed agreement protocols | |
US20060224723A1 (en) | Data updating system and method | |
US20100318610A1 (en) | Method and system for a weak membership tie-break | |
US11531604B2 (en) | Methods and systems for data resynchronization in a replication environment | |
US20090049329A1 (en) | Reducing likelihood of data loss during failovers in high-availability systems | |
WO2012111112A1 (en) | Information processing device, time setting method, and time setting program | |
CN106331081A (en) | Information synchronization method and device | |
JP2012202897A (en) | Client terminal, server terminal, time synchronization method, and program | |
US20120191645A1 (en) | Information processing apparatus and database system | |
CN115758447A (en) | Information security service processing and cluster generating method, electronic device and storage medium | |
EP3884648B1 (en) | Geo-replicated iot hub | |
US20080148023A1 (en) | Method and system for synchronous operation of an application by a purality of processing units | |
US20220327030A1 (en) | System and method for restoration using micro-backups | |
US20130246832A1 (en) | Information processing device, computer-readable recording medium having stored therein program for setting time of information processing device, monitor, and method for setting time of information processing device | |
JP6773533B2 (en) | Operating environment synchronization device, operating environment synchronization system, operating environment synchronization method, and operating environment synchronization program | |
TWI400600B (en) | Method for recovering system setting and computer system | |
JP3726043B2 (en) | Clock information synchronization method, duplexing device and synchronization program in duplexing device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Application deemed to be withdrawn because no request for examination was validly filed |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20140603 |