Time synchronization system

A control device 2 includes a preset time determinator 22 for determining a preset time to be set to a first real-time clock of a terminal device 3 based on a second real-time clock. The terminal device 3 includes a latency time timer 34 for clocking a lapse of a latency time which is a period of time from the terminal device 3 acquiring the preset time until the preset time being set to the first real-time clock and is calculated in a clocking accuracy having the number of effective figures greater than that of the first real-time clock, and a time setter 32 for setting the preset time to the first real-time clock when the latency time is lapsed.

TECHNICAL FIELD

The present invention relates to a time synchronization system for synchronizing times between terminals.

BACKGROUND ART

Conventionally, in information process systems which synchronize time, there are some arts which add an acquired time information to a time required for transferring the time information to obtain a time information with fewer errors (e.g., see Patent Document 1).

Further, in conventional seismological observation systems, there are some arts which transmit a future time with respect to the current time from a master seismometer to a slave seismometer in advance, and calibrate the current time of the slave seismometer by the transmitted future time in response to a subsequent clock signal (e.g., see Patent Document 2).

REFERENCE DOCUMENTS OF CONVENTIONAL ART

Patent Documents

DISCLOSURE OF THE INVENTION

Problems to be Solved by the Invention

However, in the conventional information process systems described above, a case where a difference may exist in the synchronization between a Real Time Clock (RTC) which is a source of synchronization and a CPU or IOP which is a target of synchronization by a number of effective figures per clocking is not taken into consideration. Thus, for example, if the number of effective figures per clocking of RTC which is the source of synchronization is greater than the number of effective figures per clocking of CPU or IPO which is the target of synchronization, it is impossible to perform an accurate time synchronization because, for example, the time in low digits (milliseconds) is not always in agreement with each other.

Further, since communication processing for receiving a clock signal used for the time synchronization always occurs in the conventional seismological observation systems described above, this system cannot achieve power savings when performing battery-drive wireless communications.

Therefore, the subject to be solved by the present invention is to provide a time synchronization system which can accurately perform a time synchronization even when a difference in the number of effective figures per clocking exists between a source of synchronization and a target of synchronization, and can save power by eliminating wireless communications for receiving clock signals.

SUMMARY OF THE INVENTION

In order to solve the problem, a time synchronization system according to the present invention includes one or more terminal devices, each having a first real-time clock, and a control device having a second real-time clock of which the number of effective figures per clocking is greater then that of the first real-time clock. The control device includes a preset time determinator for determining a preset time to be set to the first real-time clock of the terminal device based on the second real-time clock. The terminal device includes: a latency time timer for clocking a lapse of a latency time, the latency time being a period of time from the terminal device acquiring the preset time until the preset time being set to the first real-time clock, and the latency time being calculated in a clocking accuracy having the number of effective figures greater than that of the first real-time clock; and a time setter for setting the preset time to the first real-time clock when the latency time is lapsed.

Effects of the Invention

According to the present disclosure, a time synchronization can accurately be performed even when a difference in the number of effective figures per clocking exists between a source of synchronization and a target of synchronization, and power can be saved by eliminating wireless communications for receiving clock signals.

MODE FOR CARRYING OUT THE INVENTION

Hereinafter, a desirable embodiment of terminal devices and a terminal controlling device which constitute a time synchronization system of the present invention is described with reference to the accompanying drawings. Note that in the following description, a case where the present invention is applied to terminal devices which measure an operating state of a steam trap (not illustrated) and a terminal controlling device (control device) which controls the terminal devices is illustrated and described. Further, dimensions of constituent members in each drawing are not intended to precisely represent dimensions of actual constituent members, scales of the respective constituent members, etc.

1. First Embodiment

1-1. Entire Configuration of Time Synchronization System

FIG. 1is a view illustrating one example of an entire configuration of a time synchronization system1according to a first embodiment of the present invention. The time synchronization system1includes, for example, a terminal controlling device2, a plurality of terminal devices3, and a plurality of repeater devices4. For example, the terminal controlling device2, the terminal devices3, and the repeater devices4all have a wireless communication function, and can wirelessly communicate with each other. Note that inFIG. 1, for convenience of description, although the terminal controlling device2, the terminal devices3, and the repeater devices4are connected by solid lines, no connection line is necessary if they have the wireless communication function.

For example, the terminal device3starts up at a predetermined startup time, measures an operating state of a steam trap installed in a steam piping installation, and sends out the measurement data to the terminal controlling device2. Note that the startup of the terminal device3may be referred to as a “wake-up.”

Further, one or more terminal devices3form a group of terminal devices3. For example, as illustrated inFIG. 1, Group1is comprised of four terminal devices3, Group2is comprised of two terminal devices3, and

Group3is comprised of three terminal devices3.

The terminal controlling device2creates synchronous data for a time synchronization of each terminal device3and transmits the data to the respective terminal devices3, for example. Further, the terminal controlling device2receives the measurement data from the terminal devices3, for example.

The repeater device4operates as a repeater device which relays communication data between the terminal controlling device2and the terminal device3, for example.

When each terminal device3sends out the measurement data for every predetermined measuring period, it needs to perform a communication processing as efficiently as possible in order to reduce a power consumption. Thus, the terminal controlling device2and each terminal device3need to synchronize with each other in the current time which is a basis for determining the startup time. Therefore, in this embodiment, one example in which the time of each terminal device3is synchronized by transmitting the synchronous data for synchronizing the current time to each terminal device3from the terminal controlling device2is described.

1-2. Functional Block Diagram of Time Synchronization System

FIG. 2is a view illustrating one example of a functional block diagram of the time synchronization system1.

1-2-1. Functional Block Diagram of Terminal Controlling Device2

The terminal controlling device2includes a timer21which clocks time, a preset time determinator22which determines a time to be set to the terminal device3, a latency time calculator23which calculates a latency time when the terminal device3sets the preset time, a synchronous data transmitter24which transmits preset time data and latency time data to the terminal device3as the synchronous data, and a communication time calculator25which calculates a communication period of time between the terminal controlling device2and the terminal device3.

The timer21can continue clocking the current time, for example, even if the power of the terminal controlling device2is turned off. The timer21can clock time for example, in “milliseconds.”

The preset time determinator22can determine, for example, a future time of the current time as the time to be set to the terminal device3. For example, the preset time determinator22determines the preset time in “milliseconds” as “000 milliseconds.”

The latency time calculator23can determine the latency time which is a period of time from the terminal device3acquiring the preset time until setting the preset time, for example, based on a lapsed time of the time synchronization processing in the terminal controlling device2and the communication time between the terminal controlling device2and the terminal device3.

The synchronous data transmitter24can transmit as the synchronous data, for example, the preset time data which is indicative of the preset time and is determined by the preset time determinator22, and the latency time data which is indicative of the latency time and is calculated by the latency time calculator23.

The communication time calculator25can calculate the communication times, for example, when the terminal controlling device2, the terminal devices3, and the repeater devices4communicate, based on the number of hops etc. between the respective devices.

1-2-2. Functional Block Diagram of Terminal Device3

The terminal device3includes a timer31which clocks time, a time setter32which sets a time to the timer31using the preset time, a synchronous data receiver33which receives the preset time data and the latency time data as the synchronous data from the terminal controlling device2, and a latency time timer34which clocks the latency time based on the latency time data from the terminal controlling device2.

The timer31can continue clocking the current time, for example, even if the power of the terminal device3is turned off. The timer31can clock time, for example, in “seconds.” That is, the timer31of the terminal device3cannot clock time in “milliseconds,” unlike the timer21of the terminal controlling device2. Therefore, the number of effective figures per clocking of the timer21is greater than the number of effective figures per clocking of the timer31.

The time setter32can set the current time to the timer31, for example, by using the preset time data indicative of the preset time which is contained in the synchronous data received from the terminal controlling device2.

The synchronous data receiver33can receive as the synchronous data, for example, the preset time data indicative of the preset time which is determined by the preset time determinator22of the terminal controlling device2and the latency time data indicative of the latency time which is calculated by the latency time calculator23of the terminal controlling device2.

The latency time timer34can clock the latency time, for example, based on the latency time data contained in the synchronous data which is received by the synchronous data receiver33.

Note that the terminal device3is provided with a measuring part (not illustrated), and can measure, for example, a surface temperature and/or ultrasonic vibration of a steam trap5. Further, measurement data of the steam trap which is measured by the measuring part is wirelessly transmitted to the terminal controlling device2.

1-3. Example of Hardware Configuration of Time Synchronization System

1-3-1. Example of Hardware Configuration of Terminal Controlling Device2

FIG. 3is a view illustrating one example of a hardware configuration in which the terminal controlling device2is implemented using a CPU etc. The terminal controlling device2can be comprised of, for example, a laptop personal computer.

The terminal controlling device2includes a display unit40, a Real Time Clock (RTC)41, a CPU42, a Random Access Memory (RAM)43, a hard disk drive44, a keyboard/mouse45, and a wireless communication circuit46.

The display unit40can display an entry or entries from the keyboard/mouse45, measurement data, etc. The RTC41can present the current time by a clock function as data, for example, indicated in milliseconds (hh:mm:ss.000). The CPU42can execute a time synchronization program442stored in the hard disk drive44. The RAM43can provide the CPU42with an address space.

The hard disk drive44can store an operating system (OS)441, the time synchronization program442, hop count management data443, measurement data (not illustrated), etc. The keyboard/mouse45can accept input operation(s) for a control of the terminal device3from a user. The wireless communication circuit46can wirelessly communicate with the terminal devices3or the repeater devices4.

The timer21, which constitutes the terminal controlling device2illustrated inFIG. 2, is implemented by the RTC41. Further, the preset time determinator22, the latency time calculator23, the synchronous data transmitter24, and the communication time calculator25are implemented by running the time synchronization program442on the CPU42.

1-3-2. Example of Hardware Configuration of Terminal Device3

FIG. 4is a view illustrating one example of a hardware configuration in which the terminal device3is implemented by using the CPU etc. The terminal device3includes a Real Time Clock (RTC)51, a CPU52, a RAM53, a measuring sensor54, a wireless communication circuit55, and an Electrically Erasable and Programmable Read Only Memory (EEPROM)56, and a battery57.

The RTC51can provide the current time as data, for example, in seconds (hh:mm:ss) by a clock function, and can start up the terminal device3concerned at a time corresponding to the startup time data511which is set, by a timer function. The CPU52can execute a time preset program561stored in the EEPROM56. The RAM53can provide the CPU52with an address space, and can store preset time data531, latency time data532, etc.

The measuring sensor54can measure an operating state of a steam trap, for example, by a vibration sensor which uses a piezoelectric element and a temperature sensor which uses a thermocouple. The wireless communication circuit55can communicate with the terminal controlling device2or the repeater devices4. The EEPROM56can store the time preset program561. The battery57can supply power to each part of the terminal device3. The battery57corresponds to, for example, a dry battery or a secondary battery.

The timer31, which constitutes the terminal device3illustrated inFIG. 2, is implemented by the RTC51. Further, the time setter32, the synchronous data receiver33, and the latency time timer34are implemented by running the time preset program561on the CPU52.

1-4. Flowchart of Time Setting Processing

FIG. 5is a view illustrating one example of a flowchart of a time setting processing in the time synchronization system1.

For example, the CPU42of the terminal controlling device2can perform the time setting processing of this embodiment when performing processing for setting the startup time data511to the RTC51of the terminal device3. Note that in this embodiment, description about the processing for the setting the startup time data511is omitted.

InFIG. 5, the CPU42of the terminal controlling device2selects one of the groups of the terminal device3(step S101). For example, the groups are selected in an order which allows efficient operations of the terminal devices and the repeater devices. In this embodiment, the groups are selected in an order of Group1, Group2, and Group3illustrated inFIG. 1.

The CPU42determines the preset time to be set to the RTC51of the terminal device3(step S102). For example, the CPU42can determine a “1 second” future time of the current time as the preset time. Specifically, the CPU42determines, for example, “00 hour, 00 minute, 01 second, 000 millisecond” which is a “1 second, 000 millisecond” future time of the current time (initial time) “00 hour, 00 minute, 00 second, 000 millisecond” as the preset time.

The CPU42starts a count after resetting the timer used for measuring the processing time to zero (step S103). Here, the term “processing time” as used herein refers to a time required for calculating the communication time after selecting the terminal device as will be described later, for example. In this embodiment, all the processing times for the respective terminal devices are described as “60 milliseconds.”

Note that a time required for calculating the latency time described later may be estimated and included into the processing time. Further, a time required for transmitting the synchronous data described later may be estimated and included into the processing time.

The CPU42selects the terminal device to which the synchronous data is transmitted (step S104). For example, the CPU42selects a terminal device3abelonging to Group1ofFIG. 1.

The CPU42calculates the communication time of the selected terminal device (step S105). For example, the CPU42extracts the number of hops “5” of the terminal device3afrom a record601of the hop count management data443illustrated inFIG. 6, and calculates as the communication time “100 milliseconds” by multiplying the number of hops “5” by the communication time “20 milliseconds” per hop.

Note that, in a case of the terminal device3b, the CPU42extracts the number of hops “4” of the terminal device3bfrom a record602of the hop count management data443illustrated inFIG. 6, and calculates as the communication time “80 milliseconds” by multiplying the number of hops “4” by the communication time “20 milliseconds” per hop. Further, in a case of terminal devices3c-3e, the CPU42extracts the number of hops “3” of the terminal devices3c-3efrom the respective records603-605of the hop count management data443illustrated inFIG. 6, and calculates as the communication time “60 milliseconds” by multiplying the number of hops “3” by the communication time “20 milliseconds” per hop, respectively.

Next, the CPU42calculates the latency time of the selected terminal device (step S106). For example, the CPU42can calculate the latency time by adding the processing time which the timer reset to zero at step S103described above is currently counting to the communication time and the processing time which are calculated at step S105described above. Note that if the time required for calculating the latency time and the time required for transmitting the synchronous data described later are included in the processing time, such times are contained in the calculated latency time.

FIG. 7is a view schematically illustrating one example in a case of calculating the latency times of the terminal devices3. When the processing time of the terminal device3ais “60 milliseconds,” the latency time is calculated as “840 milliseconds” by subtracting the processing time “60 milliseconds” and the communication time “100 milliseconds” from 1 second (1000 milliseconds). In this case, for example, the processing time “60 milliseconds” and the communication time “100 milliseconds” correspond to a “time required for acquiring the preset time by the terminal device.”

The CPU42generates the synchronous data by combining the data indicative of the preset time with the data indicative of the latency time, and transmits the generated synchronous data to the terminal device3. For example, the synchronous data is generated by combining data “00 hour, 00 minute, 01 second” indicative of the preset time with data “840 milliseconds” indicative of the latency time, and the generated data is then transmitted. Note that the digits in milliseconds (000 milliseconds) are omitted from the data indicative of the preset time because the effective digits of the RTC51of the terminal device3are only up to seconds.

When the synchronous data is received from the terminal controlling device2(step S110), the CPU52of the terminal device3reads the data indicative of the latency time among the received synchronous data, and then counts the latency time (step S111). For example, the CPU52of the terminal device3acounts the latency time until the count reaches “840 milliseconds.”

If it is determined that the count reaches the latency time (YES processing at step S112), the CPU52sets the data indicative of the preset time among the received synchronous data to the preset time data511of the RTC51(step S113). Specifically, the CPU52sets “00 hour, 00 minute, 01 second” to the RTC51.

On the other hand, the CPU42of the terminal controlling device2determines whether there is an unprocessed terminal device3(step S108), and if there is an unprocessed terminal device3, the CPU42returns to step S104described above, and repeats the processing (YES determination at step S108).

As illustrated inFIG. 7, the CPU52of the terminal device3bsets “00 hour, 00 minute, 01 second” which is the data indicative of the preset time to the RTC51after the latency time is counted until the count reaches “700 milliseconds.”

Further, for example, the CPU52of the terminal device3csets “00 hour, 00 minute, 01 second” which is the data indicative of the preset time to the RTC51after the latency time is counted until the count reaches “580 milliseconds.” Further, for example, the CPU52of the terminal device3dsets “00 hour, 00 minute, 01 second” which is the data indicative of the preset time to the RTC51after the latency time is counted until the count reaches “460 milliseconds.” Further, for example, the CPU52of the terminal device3esets “00 hour, 00 minute, 01 second” which is the data indicative of the preset time to the RTC51after the latency time is counted until the count reaches “340 milliseconds.”

Next, if there is no unprocessed terminal device3(NO determination at step S108), the CPU42of the terminal controlling device2then determines whether there is an unprocessed group (step S109), and if there is an unprocessed group, the CPU42returns to step S101described above, and repeats the processing (YES determination at step S109).

For example, when the time synchronization processing is completed for the terminal devices3a-3ebelonging to Group1illustrated inFIG. 1, the CPU42performs the time synchronization processing for the terminal devices3fand3gbelonging to Group2. Further, when the time synchronization processing is completed for the terminal devices3fand3gbelonging to Group2, the time synchronization processing is performed for the terminal devices3h-3jbelonging to Group3.

Thus, the terminal controlling device2transmits the preset time data indicative of the future time and the latency time data which are different for different terminal devices, and each terminal device3then sets the preset time indicative of the received preset time data to the RTC at the timing of reaching the latency time indicative of the received latency time data. Therefore, even if there is a difference in the number of effective figures per clocking of the RTC between the terminal controlling device2which is the source of synchronization and each terminal device3which is the target of synchronization, the time of each terminal device3can certainly be synchronized. Further, since the synchronous timings are in agreement with each other based on the latency times, wireless communications for receiving clock signals can be eliminated, thereby saving power.

2. Other Embodiments

In the embodiment described above, although all the processing times of the respective terminal devices are “60 milliseconds,” a time required for calculating the latency times may be included in the processing time. Further, a time required for transmitting the synchronous data may also be estimated and included in the processing time.

In the embodiment described above, although an example in which the “1 second” future time of the current time is determined as the preset time is described, other future times may be determined as the preset time. For example, the preset time may be determined according to the number of terminal devices3within a group. Specifically, a time interval between the current time and the preset time can be lengthened as more terminal devices3are provided.

In the embodiment described above, although an example in which the communication time when the terminal device3communicates with the repeater device4is calculated based on the number of hops between the respective devices etc. is described, the communication time may be a predetermined time. For example, all the communication times within a group may be “50 milliseconds.” Thus, it becomes possible to omit a processing for calculating the communication times, thereby accelerating the processing.

Note that, if all the processing times and communication times within a group are a fixed time, respectively, a difference in timings of acquiring the preset time between two terminal devices becomes in agreement with a difference in the latency times between the two terminal devices. Specifically, if a total time of the processing time and the communication time is “100 milliseconds,” a difference in the timings of acquiring the preset time between the terminal devices3aand3bis “100 milliseconds,” and a difference in the latency times between the terminal devices3aand3bis “100 milliseconds.”

Two or more of some or all of the configurations which are described in the embodiments described above may also be combined.

DESCRIPTION OF REFERENCE NUMERALS