JPH11212926A - System time correction method for unix system - Google Patents

System time correction method for unix system

Info

Publication number
JPH11212926A
JPH11212926A JP10014487A JP1448798A JPH11212926A JP H11212926 A JPH11212926 A JP H11212926A JP 10014487 A JP10014487 A JP 10014487A JP 1448798 A JP1448798 A JP 1448798A JP H11212926 A JPH11212926 A JP H11212926A
Authority
JP
Japan
Prior art keywords
time
correction
data
corrected
unix
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
JP10014487A
Other languages
Japanese (ja)
Inventor
Kazuhiko Sugiyama
和彦 杉山
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 Communication Systems Ltd
Original Assignee
NEC Communication Systems Ltd
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 Communication Systems Ltd filed Critical NEC Communication Systems Ltd
Priority to JP10014487A priority Critical patent/JPH11212926A/en
Publication of JPH11212926A publication Critical patent/JPH11212926A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)
  • Electric Clocks (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a correction method which can gradually and slowly change the system time without affecting the coincidence of times in a network consisting of plural UNIX systems nor the application program which work in these systems. SOLUTION: The correction time data received from a network maintenance terminal 1 and a time setting request 8 including the correction width data are received in a time management process 20, and the time of a server system 2 is gradually corrected by a degree equivalent to the correction width data. Then the system 2 periodically sends a time correction request 6 including both correction time and correction width data to the client systems 3 and 4. The systems 3 and 4 receives the request 6 in each time management process 30 respectively and gradually correct their own times by a degree equivalent to the correction width data.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、システム時刻補正
方法に関し、特にオンライントランザクション処理のア
プリケーションプログラム等が影響を受けないように穏
やかにシステムの時刻を補正するUNIXシステムにお
けるシステム時刻補正方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a system time correction method, and more particularly to a system time correction method for a UNIX system which gently corrects the system time so that application programs for online transaction processing are not affected.

【0002】[0002]

【従来の技術】従来、この種の一般的なUNIXシステ
ムにおけるシステム時刻補正方法は、UNIX関数ad
jtime(2)システムコールを利用してシステムの
時刻を補正するが、その補正幅はシステムによってまち
まちで、「システムクロックを進ませる場合、実時間1
秒間に11秒進ませる。遅らせる場合、実時間1秒間に
1/2秒だけシステムクロックを進ませる。」というよ
うな補正幅の大きいシステムもある。
2. Description of the Related Art Heretofore, a system time correction method in a general UNIX system of this kind has been known as a UNIX function ad.
The time of the system is corrected using the jtime (2) system call, and the correction range varies depending on the system.
Advance 11 seconds per second. In the case of delay, the system clock is advanced by 1 / second per one second of real time. Some systems have a large correction width.

【0003】また、この種の従来のシステム時刻補正方
法は、特開平5−108198に開示されているように
基準時刻を分配する設備を複数設置することにより、分
配中の設備が故障しても基準時刻を送出することで時刻
を補正し、その時刻補正機能を停止しないようにしてい
た。
[0003] Further, this type of conventional system time correction method is disclosed in Japanese Patent Application Laid-Open No. 5-108198, in which a plurality of facilities for distributing the reference time are installed, so that even if the equipment being distributed fails. The time is corrected by sending the reference time, so that the time correction function is not stopped.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、一般的
なUNIXシステムにおける時刻補正において、「実時
間1秒間に11秒進ませる」というような補正幅を持つ
システムの時刻補正中に、アプリケーションプログラム
で5秒間の中断処理を実行したとしても、実時間で見れ
ば1秒間となってしまい、アプリケーションプログラム
の正常な動作を保証することができなかった。
However, in the time correction in a general UNIX system, during the time correction of a system having a correction range such as "advance one second to 11 seconds per actual time", 5 Even if the interruption process for a second is executed, it will be one second in real time, and the normal operation of the application program cannot be guaranteed.

【0005】また、特開平5−108198におけるシ
ステム時刻補正方法においても、各装置が稼働中のアプ
リケーションを考慮せずに時刻データを受け取りそのま
ま自装置の標準時刻としているため、大幅な時刻補正が
生じた場合、各装置の時刻に関連する稼働中のアプリケ
ーションプログラムに影響をもたらしていた。
Also, in the system time correction method disclosed in Japanese Patent Application Laid-Open No. 5-108198, since each device receives the time data without considering the application in operation and uses it as the standard time of the device itself, a large time correction occurs. In such a case, the running application program related to the time of each device is affected.

【0006】本発明の目的は、上記課題を解決するため
に複数のUNIXシステムで構成されるネットワーク内
部での時刻の一致化と、サーバシステムまたはクライア
ントシステムでそれぞれ稼働するオンライントランザク
ション処理等のアプリケーションプログラムに対して影
響を及ぼさないように、少しずつ穏やかにシステム時刻
補正方法を提供することである。
[0006] An object of the present invention is to solve the above-mentioned problems by synchronizing the time inside a network constituted by a plurality of UNIX systems, and by executing an application program such as an online transaction process operating on a server system or a client system. To provide a system time correction method gradually and gently so as not to affect the system time.

【0007】[0007]

【課題を解決するための手段】本発明は、サーバシステ
ムと、複数のクライアントシステムとから構成されたネ
ットワークでのUNIXシステムにおけるシステム時刻
補正方法であって、前記クライアントシステムは、前記
サーバシステムからの補正時刻データと補正幅データと
を含む時刻補正要求を定期的に受け付け時刻を徐々に補
正することを特徴としている。
SUMMARY OF THE INVENTION The present invention relates to a system time correction method for a UNIX system in a network comprising a server system and a plurality of client systems, wherein the client system receives a request from the server system. A time correction request including the correction time data and the correction width data is periodically received, and the time is gradually corrected.

【0008】更に、前記サーバシステムからの前記時刻
補正要求に対して、前記クライアントシステムの現在時
刻と前記補正時刻データによる要求時刻との時刻差を計
算し、前記時刻差を前記要求補正幅データの値を用いて
少しずつ時刻補正することを特徴としている。
Further, in response to the time correction request from the server system, a time difference between the current time of the client system and a request time based on the corrected time data is calculated, and the time difference is calculated based on the request correction width data. The time is gradually corrected using the value.

【0009】また、本発明は、端末を接続したサーバシ
ステムと、複数のクライアントシステムとから構成され
たネットワークでのUNIXシステムにおけるシステム
時刻補正方法であって、前記サーバシステムは、前記端
末からの補正時刻データと補正幅データとを含む時刻設
定要求を受信した場合時刻を徐々に補正することを特徴
としている。
The present invention also relates to a system time correction method in a UNIX system in a network including a server system to which a terminal is connected and a plurality of client systems, wherein the server system corrects the time from the terminal. When a time setting request including time data and correction width data is received, the time is gradually corrected.

【0010】更に、前記時刻設定要求に対して、前記サ
ーバシステムの現在時刻と前記補正時刻データによる要
求時刻との時刻差を計算し、前記時刻差を前記要求補正
幅データの値を用いて少しずつ時刻補正することを特徴
としている。
Further, in response to the time setting request, a time difference between the current time of the server system and the requested time based on the corrected time data is calculated, and the time difference is calculated using the value of the requested correction width data. It is characterized in that the time is corrected step by step.

【0011】更に、前記サーバシステムは、補正時刻デ
ータと補正幅データとを含む時刻補正要求を前記クライ
アントシステムに定期的に送信することを特徴としてい
る。
Further, the server system periodically transmits a time correction request including correction time data and correction width data to the client system.

【0012】また、本発明は、サーバシステムと、複数
のクライアントシステムとから構成されたネットワーク
でのUNIXシステムにおけるシステム時刻補正方法で
あって、前記クライアントシステムは、前記サーバシス
テムからの補正時刻データおよび補正幅データを定期的
に受信する受信ステップと、自システムの現在時刻およ
び前記補正時刻データを基に相対時刻に変換する変換ス
テップと、前記相対時刻から前記補正幅データを減算す
る演算ステップと、前記演算ステップにおいて減算した
値が0を越えれば前記補正幅データ分だけ前記現在時刻
を補正し一定間隔毎に前記演算ステップを繰り返す繰り
返しステップと、前記演算ステップにおいて減算した値
が0以下であれば前記現在時刻の補正を終了する終了ス
テップとを含むことを特徴としている。
The present invention also relates to a system time correction method in a UNIX system in a network including a server system and a plurality of client systems, wherein the client system includes a correction time data and a correction time data from the server system. A receiving step of periodically receiving correction width data, a conversion step of converting the current time of the own system and the correction time data to a relative time, and an arithmetic step of subtracting the correction width data from the relative time, If the value subtracted in the calculation step exceeds 0, the current time is corrected by the correction width data and the calculation step is repeated at regular intervals. If the value subtracted in the calculation step is 0 or less, An end step of ending the correction of the current time. It is characterized in.

【0013】また、本発明は、端末を接続したサーバシ
ステムと、複数のクライアントシステムとから構成され
たネットワークでのUNIXシステムにおけるシステム
時刻補正方法であって、前記サーバシステムは、前記端
末からの補正時刻データおよび補正幅データを受信する
受信ステップと、前記補正時刻データが絶対時刻であれ
ば自システムの現在時刻および前記補正時刻データを基
に相対時刻に変換する変換ステップと、前記相対時刻か
ら前記補正幅データを減算する演算ステップと、前記演
算ステップにおいて減算した値が0を越えれば前記補正
幅データ分だけ前記現在時刻を補正し一定間隔毎に前記
演算ステップを繰り返す繰り返しステップと、前記演算
ステップにおいて減算した値が0以下であれば前記現在
時刻の補正を終了する終了ステップとを含むことを特徴
としている。
[0013] The present invention also relates to a system time correction method in a UNIX system in a network comprising a server system connected to a terminal and a plurality of client systems, wherein the server system corrects the time from the terminal. A receiving step of receiving time data and correction width data, a conversion step of converting the relative time based on the current time of the own system and the corrected time data if the corrected time data is an absolute time, An arithmetic step of subtracting the correction width data, a repeating step of correcting the current time by the correction width data if the value subtracted in the arithmetic step exceeds 0, and repeating the arithmetic step at regular intervals; and If the subtracted value is 0 or less, the correction of the current time is terminated. It is characterized in that it comprises a termination step that.

【0014】更に、前記サーバシステムは、前記補正時
刻データおよび前記補正幅データを定期的に前記クライ
アントシステムに定期的に送信する送信ステップを含む
ことを特徴としている。
Further, the server system is characterized by including a transmission step of periodically transmitting the correction time data and the correction width data to the client system.

【0015】[0015]

【発明の実施の形態】先ず、作用について以下に説明す
る。
DESCRIPTION OF THE PREFERRED EMBODIMENTS First, the operation will be described below.

【0016】複数のUNIXシステムで構成されるネッ
トワークシステムにおいて、サーバシステムの時刻を補
正するだけで、従属するクライアントシステム全ての時
刻を自動的に補正することが可能である。また、ネット
ワーク内部におけるクライアントシステムの増設/減設
作業においても、サーバシステム内にクライアントシス
テム登録テーブルを設けることによりそのクライアント
システム登録テーブルの内容を修正するだけで対応が可
能である。
In a network system composed of a plurality of UNIX systems, it is possible to automatically correct the time of all subordinate client systems only by correcting the time of the server system. In addition, when a client system is added / removed in the network, it is possible to cope with the problem only by modifying the contents of the client system registration table by providing the client system registration table in the server system.

【0017】サーバシステムまたはクライアントシステ
ム個々においては、少しずつシステム時計を補正してい
くためオンライントランザクション処理のアプリケーシ
ョンプログラムが影響を受けないように、穏やかにシス
テムの時刻を補正することが可能である。
In each of the server system and the client system, the system clock is corrected little by little, so that the system time can be gently corrected so that application programs for online transaction processing are not affected.

【0018】次に、本発明の実施の形態について、図面
を参照して説明する。
Next, embodiments of the present invention will be described with reference to the drawings.

【0019】図1を参照すると、本発明の実施の形態で
ある複数のUNIXシステムで構成されるネットワーク
システムは、ネットワーク管理者から時刻の設定要求を
受け付けるネットワーク保守端末1と、ネットワーク内
部での基準時刻となるサーバシステム2と、サーバシス
テム2に従属するクライアントシステム3,4と、サー
バシステム2とクライアントシステム3,4間を接続す
るLAN5とから構成される。
Referring to FIG. 1, a network system comprising a plurality of UNIX systems according to an embodiment of the present invention includes a network maintenance terminal 1 for receiving a time setting request from a network administrator, and a reference within the network. The server system 2 includes a server system 2 serving as a time, client systems 3 and 4 subordinate to the server system 2, and a LAN 5 connecting the server system 2 and the client systems 3 and 4.

【0020】サーバシステム2は、プログラム制御によ
りUNIXシステム時計を任意の補正幅で補正する機能
を含む時刻管理プロセス20と、クライアントシステム
登録テーブル7とを有する。クライアントシステム3と
4は、プログラム制御を行う時刻管理プロセス30をそ
れぞれ有する。
The server system 2 has a time management process 20 including a function of correcting a UNIX system clock by an arbitrary correction width under program control, and a client system registration table 7. Each of the client systems 3 and 4 has a time management process 30 for performing program control.

【0021】また、図1を参照すると、複数のUNIX
システムで構成されネットワークシステム内部での時刻
管理プロセス20,30と関連データの流れを示すもの
である。例えば、ネットワーク管理者が、ネットワーク
保守端末1を利用して時刻の設定要求を行うと、その設
定要求は時刻設定要求8としてサーバシステム2内部の
時刻管理プロセス20に到達し、サーバシステム2内部
の時刻管理プロセス20では、設定要求に従い自システ
ムの時刻を少しずつ補正する。更に、サーバシステム2
は、あらかじめ設定された一定周期起動により、サーバ
システムの現在時刻を取得し、時刻補正要求6を送出す
ることにより従属するクライアントシステムに対して時
刻補正を行う。クライアントシステムでも同様に、時刻
補正要求6に従い自システムの時刻を穏やかに少しずつ
補正する。
Referring also to FIG. 1, a plurality of UNIX
It shows the flow of time management processes 20 and 30 and related data within a network system which is constituted by a system. For example, when a network administrator makes a time setting request using the network maintenance terminal 1, the setting request reaches a time management process 20 inside the server system 2 as a time setting request 8, and In the time management process 20, the time of the own system is corrected little by little according to the setting request. Further, the server system 2
Obtains the current time of the server system at a predetermined period of time, and sends a time correction request 6 to perform time correction on the subordinate client systems. Similarly, the client system gently and gradually corrects the time of its own system according to the time correction request 6.

【0022】図2を参照すると、主に図1のサーバシス
テムの内部を詳細に示した構成図である。
FIG. 2 is a block diagram mainly showing the details of the inside of the server system of FIG.

【0023】サーバシステム2は、時刻管理プロセス2
0と、クライアントシステム登録テーブル7と、UNI
Xシステム時計26とから構成される。時刻管理プロセ
ス20は、時刻設定要求を解析する要求解析21と、シ
ステムの現時刻と要求時刻とを比較し指示された補正幅
で徐々にシステム時刻を補正する補正処理22と、シス
テムの現時刻を取得し従属するクライアントシステムに
時刻補正要求を周期的に行う同期処理23とから構成さ
れる。ネットワーク保守端末1から受け付けた時刻設定
要求8(この要求は「補正時刻データ」と「補正幅デー
タ」を含んでいる)により時刻管理プロセス20の要求
解析21を起動させ、データの正当性を確認する。正当
性が確認された「補正時刻データ」と「補正幅データ」
は、補正処理22に引き継がれ、「補正時刻データ」と
システムの現在時刻(UNIXシステム時計26)とを
比較し、「補正幅データ」の補正幅で少しずつUNIX
システム時計26の時刻補正処理を行う。
The server system 2 includes a time management process 2
0, client system registration table 7, and UNI
And an X system clock 26. The time management process 20 includes a request analysis 21 for analyzing a time setting request, a correction process 22 for comparing the current time of the system with the requested time and gradually correcting the system time with a specified correction width, and a current time of the system. And a synchronization process 23 for periodically obtaining a time correction request to the subordinate client system. In response to the time setting request 8 received from the network maintenance terminal 1 (this request includes “correction time data” and “correction width data”), the request analysis 21 of the time management process 20 is started, and the validity of the data is confirmed. I do. "Correction time data" and "Correction width data" whose validity has been confirmed
Is carried over to the correction processing 22, compares the “correction time data” with the current time of the system (UNIX system clock 26), and gradually changes the UNIX by the correction width of the “correction width data”.
The time correction of the system clock 26 is performed.

【0024】また、周期処理23では、自システムの時
刻補正処理とは別にシステムの現在時刻(UNIXシス
テム時計26)を取得し、クライアントシステム登録テ
ーブル7で管理される従属する各クライアントシステム
に対して、時刻補正を行うため時刻補正要求6を発行す
る。
In the periodic process 23, the current time (UNIX system clock 26) of the system is obtained separately from the time correction process of the own system, and the subordinate client systems managed by the client system registration table 7 are obtained. Issue a time correction request 6 for time correction.

【0025】図3を参照すると、主に図1のクライアン
トシステム3,または4の内部を詳細に示した構成図で
ある。
FIG. 3 is a block diagram mainly showing the inside of the client system 3 or 4 of FIG. 1 in detail.

【0026】クライアントシステム3,または4は、時
刻管理プロセス30とUNIXシステム時計36とから
構成される。
The client system 3 or 4 comprises a time management process 30 and a UNIX system clock 36.

【0027】時刻管理プロセス30は、サーバシステム
2からの時刻設定要求8を解析する要求解析31と、シ
ステムの現時刻と要求時刻とを比較し指示された補正幅
で徐々にシステム時刻を補正する補正処理32とから構
成される。サーバシステム2内部の周期処理23から受
け付けた時刻補正要求6(この要求は「時刻補正デー
タ」と「補正幅データ」とを含む)をサーバシステムと
同様に要求解析31でデータの正当性を確認する。正当
性が確認された「補正時刻データ」と「補正幅データ」
は、サーバシステムと同様に補正処理32に引き継が
れ、「補正時刻データ」とシステムの現在時刻(UNI
Xシステム時計36)とを比較し、「補正幅データ」の
補正幅で少しずつUNIXシステム時計36の時刻補正
処理を行う。
The time management process 30 compares a request analysis 31 for analyzing the time setting request 8 from the server system 2 with the current time of the system and the requested time, and gradually corrects the system time by a specified correction width. And a correction process 32. The validity of the time correction request 6 (this request includes “time correction data” and “correction width data”) received from the periodic processing 23 inside the server system 2 is confirmed by the request analysis 31 in the same manner as the server system. I do. "Correction time data" and "Correction width data" whose validity has been confirmed
Is carried over to the correction processing 32 as in the server system, and the “correction time data” and the current time of the system (UNI
The X system clock 36) is compared, and the time correction process of the UNIX system clock 36 is performed little by little with the correction width of the “correction width data”.

【0028】図2において、ネットワーク保守端末1か
ら受け付ける時刻設定要求8のデータは、「補正時刻デ
ータ」と「補正幅データ」である。なお、「補正時刻デ
ータ」は、3つの型を指定することが可能で、合わせた
い時刻を「年月日時分秒+マイクロ秒」で指定する絶対
時刻指定、合わせたい時刻を「UNIX通算秒+マイク
ロ秒」で指定するジュリアン時刻指定、現在時刻を基本
として合わせたい時刻を「±秒+マイクロ秒」で指定す
る相対時刻指定がそれぞれ可能である。「補正幅デー
タ」は、実時間1秒間当たり最小10ミリ秒の補正幅か
ら、UNIXシステムで許容する最大時刻補正幅までの
範囲で任意の値で指定することが可能である。
In FIG. 2, the data of the time setting request 8 received from the network maintenance terminal 1 are “correction time data” and “correction width data”. Note that three types of “correction time data” can be specified, and that the time to be set is specified by “year, month, day, hour, minute, second, and microsecond”, and the time to be set is set to “UNIX total seconds + It is possible to specify a Julian time specified by "microsecond" and a relative time specified by "± second + microsecond" to set a time to be set based on the current time. The "correction width data" can be specified by an arbitrary value within a range from a correction width of a minimum of 10 milliseconds per second of real time to a maximum time correction width permitted by the UNIX system.

【0029】例えば、図4の(a)を参照すると、実時
間1秒間当たり100ミリ秒の補正幅でシステム時計を
進めると仮定した場合、実時間1.0秒の時にシステム
時計は1.1秒、実時間5.0秒の時にシステム時計は
5.5秒、実時間10.0秒の時にシステム時計は1
1.0と補正され、実時間10秒にシステム時計を1秒
進めたことになる。また、図4の(b)を参照すると同
じ補正幅でシステム時計を遅らせると仮定した場合、実
時間1.0秒の時にシステム時計は0.9秒、実時間
5.0秒の時にシステム時計は4.5秒、実時間10.
0秒の時にシステム時計は9.0秒、実時間5.0秒の
時にシステム時計は4.5秒、実時間10.0秒の時に
システム時計は9.0秒と補正され、実時間10秒間に
システム時計を1秒遅らせたことになる。
For example, referring to FIG. 4A, assuming that the system clock is advanced by a correction width of 100 milliseconds per second of real time, when the real time is 1.0 second, the system clock becomes 1.1. Second, the system clock is 5.5 seconds when the real time is 5.0 seconds, and the system clock is 1 when the real time is 10.0 seconds.
This is corrected to 1.0, which means that the system clock is advanced by 1 second to the actual time of 10 seconds. Referring to FIG. 4B, assuming that the system clock is delayed by the same correction width, the system clock is 0.9 seconds when the real time is 1.0 second, and the system clock is 5.0 seconds when the real time is 5.0 seconds. Is 4.5 seconds, real time 10.
At 0 seconds, the system clock is corrected to 9.0 seconds, when the real time is 5.0 seconds, the system clock is corrected to 4.5 seconds, and when the real time is 10.0 seconds, the system clock is corrected to 9.0 seconds. That is, the system clock is delayed by one second per second.

【0030】次に、本発明の実施の形態の動作について
図2〜6を参照して説明する。
Next, the operation of the embodiment of the present invention will be described with reference to FIGS.

【0031】今、保守者がサーバシステム2の時刻を修
正するために、ネットワーク保守端末1から合わせたい
時刻である「補正時刻データ」と補正する時間幅である
「補正時刻幅データ」を入力したとする。すると、時刻
設定要求8(「補正時刻データ」と「補正幅データ」
付)がサーバシステム2に送出する。ネットワーク保守
端末1からの「補正時刻データ」と「補正幅データ」は
図2のサーバシステム2の時刻管理プロセス20の要求
解析21で受け付けられ、絶対時刻指定またはジュリア
ン時刻指定データを、相対時刻データに変換する(図5
のステップS1,S2,S3)。このときの相対時刻の
計算方法は、例えば絶対時刻であれば(現在時刻−絶対
時刻)の絶対値が相対時刻となる。だたし、現在時刻は
UNIXシステム時計26を読み出した値である。相対
時刻に変換する理由は、補正処理22のプログラムの内
部処理を一本化するためである。
Now, in order to correct the time of the server system 2, the maintainer inputs “corrected time data” as the time to be adjusted and “corrected time width data” as the time width to be corrected from the network maintenance terminal 1. And Then, the time setting request 8 (“correction time data” and “correction width data”
A) is sent to the server system 2. The “correction time data” and “correction width data” from the network maintenance terminal 1 are received by the request analysis 21 of the time management process 20 of the server system 2 in FIG. 2, and the absolute time specification or the Julian time specification data is converted to the relative time data. (Fig. 5
Steps S1, S2, S3). In the calculation method of the relative time at this time, if the absolute time is, for example, the absolute value of (current time−absolute time) is the relative time. However, the current time is a value obtained by reading the UNIX system clock 26. The reason for converting to the relative time is to unify the internal processing of the program of the correction processing 22.

【0032】補正処理22では、相対時刻データに変換
された「補正時刻データ」(以降、略して相対時刻と称
する)と「補正幅データ」(以降、略して補正幅と称す
る)をメモリに保存し(ステップS4,S5)、補正処
理を開始する。補正処理は、UNIXシステムコールで
あるUNIX関数adjtime(2)の引数に、指定
された「補正幅」を設定し(ステップS7)、本システ
ムコールを実行する。すなわち、このときの補正処理
は、時刻が進んでいる場合は減算処理を、時刻が遅れて
いる場合は加算処理を、それぞれ行う。その後、「相対
時刻」から「補正幅」を差し引いて(ステップS8)、
1秒間の処理中断を実行する(ステップS9)。本処理
の終了は、「相対時刻」と「補正幅」を比較し、値が0
以下であること(ステップS6)により判定する。すな
わち、比較値が0以下になるまで、例えば「補正幅」に
200ミリ秒を指定すれば、1秒間に200ミリ秒づつ
穏やかにUNIXシステム時計26を補正する。
In the correction process 22, the "correction time data" (hereinafter, simply referred to as "relative time") and the "correction width data" (hereinafter, simply referred to as "correction width") converted into relative time data are stored in the memory. Then (steps S4 and S5), the correction process is started. In the correction processing, the designated "correction width" is set as an argument of the UNIX function adjtime (2), which is a UNIX system call (step S7), and this system call is executed. That is, in the correction process at this time, a subtraction process is performed when the time is advanced, and an addition process is performed when the time is delayed. Thereafter, the “correction width” is subtracted from the “relative time” (step S8),
The process is suspended for one second (step S9). The end of this processing is to compare the “relative time” with the “correction width” and determine that the value is 0.
It is determined based on the following (step S6). That is, until the comparison value becomes 0 or less, for example, if 200 ms is designated as the “correction width”, the UNIX system clock 26 is gently corrected by 200 ms per second.

【0033】次に、あらかじめ、一定周期(例えば日単
位)に時刻を修正できるように「補正幅データ」が設定
されているとする。このとき補正時刻(例えば午前8:
00)に時刻補正要求6が毎日発行される。
Next, it is assumed that "correction width data" is set in advance so that the time can be corrected at a fixed period (for example, on a daily basis). At this time, the correction time (for example, 8:
00), a time correction request 6 is issued every day.

【0034】図1の時刻補正要求によるサーバシステム
2とクライアントシステム3,4間の時刻補正方法は、
あらかじめ指定される周期でサーバシステム2の周期処
理23が自システムの時刻(UNIXシステム時計2
6)を取得し、絶対時間指定の型である「年月日時分秒
+マイクロ秒」データとあらかじめ指定された標準の補
正幅データとを、データとして従属するクライアントシ
ステム3,4に時刻補正の要求を行うために時刻補正要
求6を発行する。従属するクライアントシステム3,4
とは、サーバシステム内部の「周期処理プログラム」が
管理するデータで、あらかじめクライアントシステム登
録テーブル7に登録しておく必要がある。サーバシステ
ム2からの時刻補正要求6は、サーバシステム2の処理
と同様、時刻管理プロセス30の要求解析31で受け付
け、補正処理32で少しずつUNIXシステム時計36
を補正する。このときの時刻管理プロセス30の補正処
理フローは図6となる。
The time correction method between the server system 2 and the client systems 3 and 4 based on the time correction request in FIG.
The periodic processing 23 of the server system 2 executes the time of its own system (UNIX system clock 2) at a predetermined cycle.
6) is obtained, and “year / month / day / hour / minute / second + microsecond” data, which is a type of absolute time specification, and standard correction width data specified in advance are transmitted to the subordinate client systems 3 and 4 as time correction data. A time correction request 6 is issued to make the request. Subordinate client systems 3, 4
“Data” is data managed by a “periodic processing program” in the server system and needs to be registered in the client system registration table 7 in advance. The time correction request 6 from the server system 2 is received by the request analysis 31 of the time management process 30, and the UNIX system clock 36 is gradually increased by the correction process 32, similarly to the processing of the server system 2.
Is corrected. FIG. 6 shows the correction processing flow of the time management process 30 at this time.

【0035】サーバシステム2がクライアントシステム
3,4に定期的に時刻補正行うために、時刻補正要求6
(「補正時刻データ」と「補正幅データ」付)がクライ
アントシステム3,4に送出する。サーバシステム2か
らの「補正時刻データ」と「補正幅データ」は図3のク
ライアントシステムの時刻管理プロセス30の要求解析
31で受け付けられ、絶対時刻指定データを、相対時刻
データに変換する(図6のステップS22)。このとき
の相対時刻の計算方法は、サーバシステム2の処理と同
様に(現在時刻−絶対時刻)の絶対値が相対時刻とな
る。ただし、現在時刻はUNIXシステム時計36を読
み出した値である。
In order for the server system 2 to periodically correct the time to the client systems 3 and 4, a time correction request 6
(With "correction time data" and "correction width data") are sent to the client systems 3 and 4. “Correction time data” and “correction width data” from the server system 2 are received by the request analysis 31 of the time management process 30 of the client system in FIG. 3, and the absolute time designation data is converted into relative time data (FIG. 6). Step S22). In the calculation method of the relative time at this time, the absolute value of (current time−absolute time) becomes the relative time similarly to the processing of the server system 2. However, the current time is a value obtained by reading the UNIX system clock 36.

【0036】補正処理32では、相対時刻データに変換
された「補正時刻データ」(以降、略して相対時刻と称
する)と「補正幅データ」(以降、略して補正幅と称す
る)をメモリに保存し(ステップS24,S25)、補
正処理を開始する。補正処理は、UNIXシステムコー
ルであるUNIX関数adjtime(2)の引数に、
指定された「補正幅」を設定し(ステップS27)、本
システムコールを実行する。すなわち、このときの補正
処理は、時刻が進んでいる場合は減算処理を、時刻が遅
れている場合は加算処理を、それぞれ行う。その後、
「相対時刻」から「補正幅」を差し引いて(ステップS
28)、1秒間の処理中断を実行する(ステップS2
9)。本処理の終了は、「相対時刻」と「補正幅」を比
較し、値が0以下であること(ステップS26)により
判定する。すなわち、比較値が0以下になるまで、例え
ば「補正幅」に200ミリ秒を指定すれば、1秒間に2
00ミリ秒づつ穏やかにUNIXシステム時計を補正す
る。
In the correction process 32, the "correction time data" (hereinafter abbreviated as "relative time") and the "correction width data" (hereinafter abbreviated as "correction width") converted into relative time data are stored in the memory. (Steps S24 and S25), and the correction process is started. The correction process is performed by adding an argument of a UNIX function adjtime (2), which is a UNIX system call,
The designated "correction width" is set (step S27), and this system call is executed. That is, in the correction process at this time, a subtraction process is performed when the time is advanced, and an addition process is performed when the time is delayed. afterwards,
Subtract "correction width" from "relative time" (step S
28) Execute processing interruption for one second (step S2)
9). The end of this process is determined by comparing the “relative time” with the “correction width” and determining that the value is 0 or less (step S26). That is, until the comparison value becomes 0 or less, for example, if 200 ms is specified for the “correction width”, 2
Correct the UNIX system clock gently every 00 milliseconds.

【0037】[0037]

【発明の効果】本発明の効果は、特別なハートウェアを
使用することなく、複数のUNIXシステムで構成され
るネットワークにおいて、ネットワーク管理者がサーバ
システムの時刻を補正するだけで、従属するクライアン
トシステム全ての時刻を自動的に補正することが可能で
あるということである。また、ネットワーク内部におけ
るクライアントシステム増設/減設作業においても、ネ
ットワーク管理者が、クライアントシステム登録テーブ
ルを修正するだけで対応が可能である。
The effect of the present invention is as follows. In a network constituted by a plurality of UNIX systems without using special heartware, a network administrator simply corrects the time of a server system, and a subordinate client system can be used. This means that all times can be automatically corrected. In addition, the network administrator can cope with the work of adding / removing the client system inside the network only by modifying the client system registration table.

【0038】更に、本ネットワークのオンライントラン
ザクション処理のアプリケーションプログラムが稼働す
る、サーバシステムまたはクライアントシステムここに
おいては、本プログラムが影響を受けない範囲の「補正
データ」を指定することにより、少しずつ穏やかにシス
テムの時刻を補正することが可能である。
Further, a server system or a client system on which an application program for online transaction processing of the present network operates. In this case, by designating "correction data" in a range that is not affected by the present program, it becomes gentler little by little. It is possible to correct the system time.

【図面の簡単な説明】[Brief description of the drawings]

【図1】複数のUNIXシステムで構成されるネットワ
ーク図である。
FIG. 1 is a network diagram composed of a plurality of UNIX systems.

【図2】サーバはシステムにおける本発明の構成図であ
る。
FIG. 2 is a configuration diagram of a server in a system according to the present invention.

【図3】クライアントシステムにおける本発明の構成図
である。
FIG. 3 is a configuration diagram of the present invention in a client system.

【図4】システム時刻補正処理のシステム時計と実時計
の関係図である。
FIG. 4 is a relationship diagram between a system clock and an actual clock in a system time correction process.

【図5】サーバシステムの時刻管理プロセスの補正処理
フロー図である。
FIG. 5 is a flowchart of a correction process of a time management process of the server system.

【図6】クライアントシステムの時刻管理プロセスの補
正処理フロー図である。
FIG. 6 is a flowchart of a correction process of a time management process of the client system.

【符号の説明】[Explanation of symbols]

1 ネットワーク保守端末 2 サーバシステム 3,4 クライアントシステム 5 LAN 6 時刻補正要求 7 クライアントシステム登録テーブル 8 時刻設定要求 21,31 要求解析 22,32 補正処理 23 周期処理 26,36 UNIXシステム時計 DESCRIPTION OF SYMBOLS 1 Network maintenance terminal 2 Server system 3, 4 Client system 5 LAN 6 Time correction request 7 Client system registration table 8 Time setting request 21, 31 Request analysis 22, 32 Correction processing 23 Periodic processing 26, 36 UNIX system clock

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】 サーバシステムと、複数のクライアント
システムとから構成されたネットワークでのUNIXシ
ステムにおけるシステム時刻補正方法であって、前記ク
ライアントシステムは、前記サーバシステムからの補正
時刻データと補正幅データとを含む時刻補正要求を定期
的に受け付け時刻を徐々に補正することを特徴とするU
NIXシステムにおけるシステム時刻補正方法。
1. A system time correction method in a UNIX system in a network including a server system and a plurality of client systems, wherein the client system includes a correction time data and a correction width data from the server system. U which periodically accepts a time correction request including
A system time correction method in a NIX system.
【請求項2】 前記サーバシステムからの前記時刻補正
要求に対して、前記クライアントシステムの現在時刻と
前記補正時刻データによる要求時刻との時刻差を計算
し、前記時刻差を前記補正幅データの値を用いて少しず
つ時刻補正することを特徴とする請求項1記載のUNI
Xシステムにおけるシステム時刻補正方法。
2. In response to the time correction request from the server system, a time difference between a current time of the client system and a requested time based on the corrected time data is calculated, and the time difference is calculated as a value of the correction width data. 2. The UNI according to claim 1, wherein the time is corrected little by little by using.
System time correction method in X system.
【請求項3】 端末を接続したサーバシステムと、複数
のクライアントシステムとから構成されたネットワーク
でのUNIXシステムにおけるシステム時刻補正方法で
あって、前記サーバシステムは、前記端末からの補正時
刻データと補正幅データとを含む時刻設定要求を受信し
た場合時刻を徐々に補正することを特徴とするUNIX
システムにおけるシステム時刻補正方法。
3. A system time correction method in a UNIX system in a network including a server system connected to a terminal and a plurality of client systems, wherein the server system corrects the correction time data from the terminal and the correction time data from the terminal. The time is gradually corrected when a time setting request including width data is received.
System time correction method in the system.
【請求項4】 前記時刻設定要求に対して、前記サーバ
システムの現在時刻と前記補正時刻データによる要求時
刻との時刻差を計算し、前記時刻差を前記補正幅データ
の値を用いて少しずつ時刻補正することを特徴とする請
求項3記載のUNIXシステムにおけるシステム時刻補
正方法。
4. In response to the time setting request, a time difference between a current time of the server system and a request time based on the corrected time data is calculated, and the time difference is gradually changed using the value of the correction width data. 4. The system time correction method in a UNIX system according to claim 3, wherein the time is corrected.
【請求項5】前記サーバシステムは、補正時刻データと
補正幅データとを含む時刻補正要求を前記クライアント
システムに定期的に送信することを特徴とする請求項1
または3記載のUNIXシステムにおけるシステム時刻
補正方法。
5. The server system according to claim 1, wherein the server system periodically transmits a time correction request including correction time data and correction width data to the client system.
Or the system time correction method in the UNIX system according to 3.
【請求項6】 サーバシステムと、複数のクライアント
システムとから構成されたネットワークでのUNIXシ
ステムにおけるシステム時刻補正方法であって、前記ク
ライアントシステムは、前記サーバシステムからの補正
時刻データと補正幅データとを含む時刻補正要求を定期
的に受信する受信ステップと、自システムの現在時刻お
よび前記補正時刻データを基に相対時刻に変換する変換
ステップと、前記相対時刻から前記補正幅データを減算
する演算ステップと、前記演算ステップにおいて減算し
た値が0を越えれば前記補正幅データ分だけ前記現在時
刻を補正し一定間隔毎に前記演算ステップを繰り返す繰
り返しステップと、前記演算ステップにおいて減算した
値が0以下であれば前記現在時刻の補正を終了する終了
ステップとを含むことを特徴とするUNIXシステムに
おけるシステム時刻補正方法。
6. A system time correction method in a UNIX system in a network including a server system and a plurality of client systems, wherein the client system includes a correction time data and a correction width data from the server system. A receiving step of periodically receiving a time correction request including: a conversion step of converting the current time of the own system and the corrected time data into a relative time; and an arithmetic step of subtracting the correction width data from the relative time. If the value subtracted in the calculation step exceeds 0, the current time is corrected by the correction width data and the calculation step is repeated at regular intervals; and the value subtracted in the calculation step is 0 or less. End step for ending the correction of the current time, if any. And a system time correction method in a UNIX system.
【請求項7】 端末を接続したサーバシステムと、複数
のクライアントシステムとから構成されたネットワーク
でのUNIXシステムにおけるシステム時刻補正方法で
あって、前記サーバシステムは、前記端末からの補正時
刻データおよび補正幅データを受信する受信ステップ
と、前記補正時刻データが絶対時刻であれば自システム
の現在時刻および前記補正時刻データを基に相対時刻に
変換する変換ステップと、前記相対時刻から前記補正幅
データを減算する演算ステップと、前記演算ステップに
おいて減算した値が0を越えれば前記補正幅データ分だ
け前記現在時刻を補正し一定間隔毎に前記演算ステップ
を繰り返す繰り返しステップと、前記演算ステップにお
いて減算した値が0以下であれば前記現在時刻の補正を
終了する終了ステップとを含むことを特徴とするUNI
Xシステムにおけるシステム時刻補正方法。
7. A system time correction method in a UNIX system in a network including a server system to which a terminal is connected and a plurality of client systems, wherein the server system corrects the correction time data and the correction time data from the terminal. A receiving step of receiving width data; a conversion step of converting the corrected time data into a relative time based on the current time of the own system and the corrected time data if the corrected time data is an absolute time; and An operation step of subtracting, if the value subtracted in the operation step exceeds 0, a repetition step of correcting the current time by the correction width data and repeating the operation step at regular intervals, and a value subtracted in the operation step Ending step of ending the correction of the current time if is less than or equal to 0 And UNI.
System time correction method in X system.
【請求項8】前記サーバシステムは、前記補正時刻デー
タおよび前記補正幅データを定期的に前記クライアント
システムに定期的に送信する送信ステップを含むことを
特徴とする請求項6または7記載のUNIXシステムに
おけるシステム時刻補正方法。
8. The UNIX system according to claim 6, wherein said server system includes a transmission step of periodically transmitting said correction time data and said correction width data to said client system. System time correction method.
JP10014487A 1998-01-27 1998-01-27 System time correction method for unix system Pending JPH11212926A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10014487A JPH11212926A (en) 1998-01-27 1998-01-27 System time correction method for unix system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10014487A JPH11212926A (en) 1998-01-27 1998-01-27 System time correction method for unix system

Publications (1)

Publication Number Publication Date
JPH11212926A true JPH11212926A (en) 1999-08-06

Family

ID=11862417

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10014487A Pending JPH11212926A (en) 1998-01-27 1998-01-27 System time correction method for unix system

Country Status (1)

Country Link
JP (1) JPH11212926A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005125082A1 (en) * 2004-06-22 2005-12-29 Matsushita Electric Industrial Co., Ltd. Communication system and communication apparatus
JP2006349364A (en) * 2005-06-13 2006-12-28 Toyota Infotechnology Center Co Ltd Time correction method
WO2014199729A1 (en) * 2013-06-12 2014-12-18 富士電機株式会社 Distribution device, distribution system, and distribution method
WO2024018787A1 (en) * 2022-07-20 2024-01-25 株式会社オートネットワーク技術研究所 Vehicle-mounted device, time synchronization method, and time synchronization program

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005125082A1 (en) * 2004-06-22 2005-12-29 Matsushita Electric Industrial Co., Ltd. Communication system and communication apparatus
US7954154B2 (en) 2004-06-22 2011-05-31 Panasonic Corporation Communication system and communication apparatus
JP2006349364A (en) * 2005-06-13 2006-12-28 Toyota Infotechnology Center Co Ltd Time correction method
WO2014199729A1 (en) * 2013-06-12 2014-12-18 富士電機株式会社 Distribution device, distribution system, and distribution method
CN104981742A (en) * 2013-06-12 2015-10-14 富士电机株式会社 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
JP6079879B2 (en) * 2013-06-12 2017-02-15 富士電機株式会社 Distribution apparatus, distribution system, and distribution method
CN104981742B (en) * 2013-06-12 2017-09-19 富士电机株式会社 Dispensing device, dissemination system and distribution method
WO2024018787A1 (en) * 2022-07-20 2024-01-25 株式会社オートネットワーク技術研究所 Vehicle-mounted device, time synchronization method, and time synchronization program

Similar Documents

Publication Publication Date Title
EP0135764B1 (en) Synchronization of clocks in a distributed computing network
US8880927B2 (en) Time synchronization method and system for multicore system
Dolev et al. Dynamic fault-tolerant clock synchronization
US6823456B1 (en) System and method for providing trusted services via trusted server agents
US20040223515A1 (en) Method and apparatus for the synchronization of a system time of a communications network with a clock reference
US20110090925A1 (en) Method for synchronization in networks
JPH10503282A (en) Controlled time scale generator for use as primary reference clock
CA2360009A1 (en) Methods, systems and computer program products for synchronizing clocks of nodes on a computer network
CN110061797A (en) Method for synchronizing time, device, storage medium and computer equipment
US20220029724A1 (en) A tsn enabled controller
US20040167990A1 (en) Methods and apparatus for network time synchronization
CN110492967A (en) A kind of method for synchronizing time, trunking and device
CN110442591B (en) Global clock system and method of alliance chain
US6370161B1 (en) Time synchronization of distributed computer telephony communication applications in a computer network
JPH11212926A (en) System time correction method for unix system
CN112422223B (en) TCP/IP-based time synchronization device, time synchronization method and time mark monitoring system
CN104993920B (en) A kind of lock in time method and SNTP clients based on SNTP
CN114003252A (en) Method, system, terminal and storage medium for automatically updating configuration file
de Azevedo et al. Fault-tolerant clock synchronization of large multicomputers via multistep interactive convergence
JP2002135284A (en) Line concentrator
JP2821091B2 (en) Remote monitoring control device and time synchronization device
GB2373400A (en) Real time clocks in communications networks
CN113114450B (en) Whole network clock feedback method and system
CN114765635B (en) Clock synchronization method, device, system, computer equipment and storage medium
CN116684026A (en) Cascade stepping type anti-jump clock synchronization method based on NTP protocol

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20001017