Client device, method for controlling the client device, and program
The client device stabilizes its clock time by assessing reception intervals for synchronization messages, reducing packet fluctuations and enhancing synchronization accuracy in wireless communication environments.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- CANON KK
- Filing Date
- 2024-11-07
- Publication Date
- 2026-05-19
AI Technical Summary
Wireless communication in time synchronization protocols like PTP is prone to jitter and communication delays, leading to inaccuracies in time synchronization between devices.
A client device adjusts its clock time based on the stability of reception intervals for synchronization messages received from a server device, determining whether the intervals are within a threshold or standard deviation, and sends a delay request only when the intervals are stable, thereby reducing the number of communication packets and fluctuations.
This method enhances the accuracy of time synchronization by minimizing the impact of communication jitter and delays, improving synchronization precision in wireless environments.
Smart Images

Figure 2026082280000001_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a client device, a control method for the client device, and a program.
Background Art
[0002] In recent years, technologies for operating multiple devices in synchronization as a system have been used in various fields. As an example, there is a technology called volumetric video that generates an image (moving image or still image) of a 3D model using synchronized captured images of multiple imaging devices (for example, digital cameras, digital video cameras, etc.) and creates a 3D image that can be viewed from an arbitrary viewpoint. When applying such a technology, in order to synchronize the imaging timings of each of the multiple imaging devices, the imaging devices may perform time synchronization through communication via a network. As a technology for performing time synchronization between multiple devices through communication via a network, PTP version 2 (Precision Time Protocol Version 2) defined in the IEEE1588-2008 standard is known. PTP is a communication protocol (also referred to as a time synchronization protocol) for time adjustment through communication. PTP enables the time of a client device to be continuously synchronized with high accuracy to the time of a server device by performing communication between a time distribution server device called GMC (Grand Master Clock) and the client device.
[0003] When time synchronization via PTP is performed over a wireless LAN, it may be affected by collision avoidance mechanisms for communication data, such as CSMA / CA (Carrier Sense Multiple Access / Collision Avoidance). In such situations, after the transmission timestamp of the necessary packets is stamped in PTP, a random delay in transmission may occur. Furthermore, due to the influence of the wireless environment and other wireless communication devices, PTP packets may be lost due to radio wave reflection, attenuation, interference, etc., and PTP packets may be retransmitted. These PTP packet transmission delay and retransmission processes can generate jitter in PTP communication delays. PTP assumes that the communication delay time between the time distribution server and the client device is constant in both directions. Therefore, jitter in wireless communication delays can be a factor in degrading the accuracy of time synchronization between the client device and the time distribution server. In light of this situation, a method has been proposed to control the time synchronization process so that PTP packets that are considered to have experienced significant communication delays are not used in environments where communication delay jitter may occur. Patent Document 1 discloses a method in which multiple communication delay times are measured between a time distribution server and a client device, and the time is adjusted based on the minimum value among them. [Prior art documents] [Patent Documents]
[0004] [Patent Document 1] Japanese Patent Publication No. 2014-165582 [Overview of the project] [Problems that the invention aims to solve]
[0005] As mentioned above, wireless communication tends to be prone to jitter, a communication delay, due to retransmission and transmission waiting processes. Therefore, when time synchronization using PTP is performed via wireless communication such as Wi-Fi, a deterioration in time synchronization accuracy may occur.
[0006] In view of the above problems, the present invention aims to prevent the deterioration of the accuracy of time adjustment by a time synchronization protocol. [Means for solving the problem]
[0007] The client device according to the present invention comprises communication means for communicating with a server device that is the source of time synchronization using a time synchronization protocol, and time synchronization processing means for adjusting the time of the device's clock to synchronize with the time of the server device's clock based on the results of the communication by the communication means, wherein the time synchronization processing means calculates the reception interval for receiving synchronization messages of the time synchronization protocol communication transmitted by the server device at regular time intervals, determines whether the reception interval of the synchronization messages is stable or not, and adjusts the time of the device's clock according to the result of the determination. [Effects of the Invention]
[0008] According to the present invention, it is possible to prevent deterioration in the accuracy of time adjustment by time synchronization protocols. [Brief explanation of the drawing]
[0009] [Figure 1] This diagram shows an example of a schematic system configuration for a synchronized imaging system. [Figure 2] This diagram shows an example of the hardware configuration of a communication device. [Figure 3] This sequence diagram shows an example of a PTP communication sequence. [Figure 4] This figure shows an example of reception history data. [Figure 5] This flowchart shows an example of processing performed by a client device. [Figure 6] This flowchart shows an example of processing performed by a client device. [Figure 7] This diagram shows an example of the reception interval for reception history data. [Figure 8]This diagram shows an example of the reception interval for reception history data. [Figure 9] This sequence diagram shows an example of a PTP communication sequence. [Figure 10] This flowchart shows an example of the processing performed by a time distribution server device. [Figure 11] This flowchart shows an example of processing performed by a client device. [Modes for carrying out the invention]
[0010] Preferred embodiments of this disclosure will be described in detail below with reference to the attached drawings. In this specification and the drawings, components having substantially the same functional configuration are denoted by the same reference numerals, and redundant descriptions will be omitted.
[0011] <First Embodiment> (System configuration for performing time synchronization) A first embodiment of this disclosure will be described below. First, with reference to Figure 1, an example of a schematic system configuration of a synchronous imaging system to which the communication device according to this embodiment is applied will be described. Each of the communication devices 100 to 103 is a communication device equipped with an imaging function (in other words, an imaging device equipped with a communication function). That is, in the synchronous imaging system shown in Figure 1, still images and moving images of a subject (hereinafter collectively referred to as images) are captured (hereinafter also referred to as synchronous imaging) by synchronizing four imaging devices (communication devices 100 to 103 equipped with imaging functions).
[0012] In synchronous imaging, in order to synchronize the imaging timings of a plurality of imaging devices with high precision, it is necessary to synchronize the system times of each imaging device (communication device) with high precision. In the example shown in FIG. 1, for the sake of convenience, among four communication devices, the communication device 100 operates as a time distribution server that is the source of time synchronization, and the communication devices 101, 102, and 103 operate as clients that synchronize with the time of the communication device 100. Hereinafter, the communication device 100 that is the source of time synchronization will also be referred to as the time distribution server device 100. Also, the communication devices 101, 102, and 103 that synchronize with the time of the time distribution server device 100 will also be referred to as client devices 101, 102, and 103.
[0013] In this embodiment, the time distribution server device 100 operates as a wireless LAN access point, and each of the client devices 101, 102, and 103 makes a wireless connection to the time distribution server device 100. Also, each of the client devices 101, 102, and 103 performs time synchronization with the time distribution server device 100 by PTP communication. The time distribution server device 100 has functions as a GMC (Grand Master Clock) and a BC (Boundary Clock) that play the role of the source of PTP time synchronization.
[0014] (Hardware Configuration of Communication Device) Referring to FIG. 2, an example of the hardware configuration of a communication device having an imaging function in this embodiment will be described. The communication device 200 shown in FIG. 2 is a device that can be applied as each of the time distribution server device 100 and the client devices 101, 102, and 103 shown in FIG. 1. In the example shown in FIG. 2, a CPU (Central Processing Unit) 202, a RAM (Random Access Memory) 203, and a ROM (Read Only Memory) 204 are connected to a system bus 201. The CPU 202 controls the operation of the entire communication device 200 by expanding and executing the programs stored in the ROM 204. The RAM 203 is used as a temporary storage area that is expanded when system programs and application programs are executed. The ROM 204 is a storage area for storing various programs and data such as system programs and application programs, and can be realized by a non-volatile recording medium.
[0015] Also, a clock 205 and a time synchronization processing unit 206 are connected to the system bus 201. The clock 205 is a clock that measures the system time within the communication device 100. The clock 205 has a function of generating and outputting pulse signals with frequencies such as 1 Hz, 25 Hz, and 29.97 Hz based on the time. The time synchronization processing unit 206 executes processes related to the control of the clock 205, such as PTP communication processing and time adjustment. Note that the clock 205 may be realized as a configuration included inside the wireless communication interface 207, or may be realized as a software clock executed by the CPU 202. The time synchronization processing unit 206 has the functions of the PTP GMC and BC as a time distribution server and the function of a client that performs time synchronization. The time synchronization processing unit 206 can be implemented as a microprocessor different from the CPU 202 and the software executed thereon.
[0016] The wireless communication interface 207 includes a wireless communication controller implemented by an IC or the like, and an antenna for transmitting and receiving wireless communication signals. The wireless communication interface 207 is connected to the system bus 201 and controlled by software executed on the CPU 202. The communication device 200 uses the wireless communication interface 207 to establish a wireless communication link with other communication devices and transmit and receive packets. In this embodiment, for convenience, various explanations will be given focusing on the case where wireless LAN (Wi-Fi®) is applied as the wireless communication, but this does not limit the types of wireless communication that can be applied. As a specific example, wireless communication conforming to other wireless communication standards such as private LTE (Long Term Evolution) and local 5G may be applied.
[0017] The camera unit 208 includes an image sensor that converts the subject image (optical image of the subject) into an electrical signal to generate image data, a lens group that forms an image of the subject on the image sensor, an image processing unit that performs image processing on the image data, and a storage media unit that stores the image data. The camera unit 208 receives a pulse signal output by the clock 205 mentioned above and generates an imaging timing with a frame rate such as 59.94 fps or 50 fps. In other words, the communication device 200 can perform imaging synchronized with other communication devices by generating an imaging timing from the time when synchronization with other communication devices is achieved.
[0018] (PTP communication sequence) Next, the time synchronization communication sequence will be explained. Figure 3 shows an example of a PTP communication sequence between the time distribution server device 100 and the client device 101. Note that the example shown in Figure 3 shows only the minimum communication necessary for time synchronization of the client device.
[0019] The time distribution server device 100 continuously transmits synchronization message (SYNC) packets at regular time intervals. The client device 101 then receives the synchronization messages from the time distribution server. In the example shown in Figure 3, the packets denoted by reference numerals 301, 303, and 305 represent synchronization messages. Furthermore, when a synchronization message is sent, the time distribution server device 100 obtains a transmission timestamp at the time indicated by its own clock 205 and sends a follow-up message (Follow_Up) packet that stores the transmission timestamp. In the example shown in Figure 3, the packets denoted by reference numerals 302, 304, and 306 represent follow-up messages. The client device 101 obtains the transmission time of the synchronization message by receiving the follow-up message. Furthermore, when the client device 101 receives the synchronization message, it obtains a reception timestamp at the time indicated by the clock 205 within its own device. When client device 101 receives a synchronization message, it obtains the reception interval since the previous synchronization message. The reception interval is obtained as the time difference of the reception timestamps. Client device 101 stores the obtained reception interval as reception history data for synchronization messages.
[0020] Figure 4 is a table showing an example of the information held as reception history data 400 in the client device 101. Each entry in the reception history includes the Sync reception time 401 of the synchronization message and the Sync reception interval 402, which is the reception interval since the previous received message. Each entry in the reception history also includes the Sync transmission time 403, which is the transmission time of the synchronization message obtained from the follow-up message, and the SequenceID 404, which is the identifier assigned to the synchronization message. Reference numeral 405 indicates one entry which is a set of these parameters. Each entry in the reception history data is retained up to a predetermined maximum number. In the example shown in Figure 4, it is shown that up to 16 entries can be retained. When a new synchronization message is received, an entry is added to the reception history data. If the number of entries exceeds the predetermined number that can be retained, the history data (entry) of the oldest synchronization message is discarded before the new history data (entry) is added. As described above, the client device 101 retains historical data (entries) of the most recent predetermined number of received messages.
[0021] Furthermore, the client device 101 determines whether the interval between synchronization messages is stable based on the reception history data of the synchronization messages. If the client device 101 determines that the interval between synchronization messages is stable, it sends a delay request message (Delay_Req). In the example shown in Figure 3, the packet denoted by 307 indicates a delay request message. When sending a delay request message, the client device 101 obtains and stores a transmission timestamp at the time indicated by its own clock 205.
[0022] When the time distribution server device 100 receives a reception request message from the client device 101, it obtains a reception timestamp at the time indicated by the clock 205 within its own device. The time distribution server device 100 then stores the reception timestamp in a delayed response message (Delay_Resp) and sends it to the client device 101. In the example shown in Figure 3, the packet denoted by reference numeral 308 represents the delayed response message.
[0023] When client device 101 receives a delayed response message, it calculates the time difference ΔT between its own clock and the clock of time distribution server device 100. In calculating this time difference ΔT, the transmission time T1 and reception time T2 of the latest synchronization message at the time the delay request message is sent, and the transmission time T3 and reception time T4 of the delay request message are used. In the example shown in Figure 3, reference numerals 309, 310, 311, and 312 indicate the times T1, T2, T3, and T4 in which the time difference ΔT is used, respectively. The time difference ΔT between the clock of client device 101 and the clock of time distribution server device 100 is calculated by the formula shown below as (Equation 1).
[0024] ΔT = ((T2 - T1) - (T4 - T3)) / 2 …(Formula 1)
[0025] Then, the client device 101 corrects the time of its internal clock 205 based on the time difference ΔT described above.
[0026] The above describes the PTP communication sequence between the time distribution server device 100 and the client device 101 for the client device 101 to synchronize its time with the time distribution server device 100. Note that other client devices (for example, client devices 102 and 103 shown in Figure 1) will also execute the same communication sequence as the time distribution server device 100. Furthermore, the time distribution server device 100 may not only periodically send synchronization messages, but may also periodically multicast packets for other purposes, independently of the communication sequence shown in Figure 3. An example of such a packet is an announcement message packet used by the time distribution server device 100 to inform other communication devices of its presence on the network and information about the accuracy of its clock.
[0027] (Processing flow of client device 101) Next, an example of the processing of the time synchronization processing unit 206 of the client device 101 will be described with reference to Figures 5 and 6. Figures 5 and 6 are flowcharts showing an example of the processing of the client device 101, with particular focus on the PTP communication processing. The time synchronization processing unit 206 repeatedly executes a series of processes from the start indicated by the code S501 to the end indicated by the code S509. The contents of this series of processes will be described in detail below.
[0028] In S502, the time synchronization processing unit 206 receives synchronization messages periodically transmitted from the time distribution server device 100. The time synchronization processing unit 206 obtains a timestamp T2[n] of the reception time of the synchronization message. Herein, n is a variable used to individually identify each synchronization message transmitted periodically at predetermined time intervals, and can take the value of a positive integer. As a specific example, the reception time T2[n] represents the reception time T2 of the nth transmitted synchronization message. In S503, the time synchronization processing unit 206 receives a follow-up message from the time distribution server device 100. From the follow-up message, the time synchronization processing unit 206 obtains the timestamp T1[n] of the transmission time of the synchronization message received in S502. In S504, the time synchronization processing unit 206 performs processing of the received history of synchronization messages.
[0029] Now, with reference to Figure 6, we will explain the details of the S504 process shown in Figure 5. In S601, the time synchronization processing unit 206 calculates the reception interval Rint[n], which is the time from the time of reception of the previous synchronization message to the time of reception of the current synchronization message received in S502. In S602, the time synchronization processing unit 206 determines whether the absolute value of the difference between the reception interval Rint[n-1] of the previous synchronization message and the reception interval Rint[n] of the current synchronization message is less than or equal to a predetermined threshold ΔRint. In other words, the time synchronization processing unit 206 determines whether the reception interval Rint[n] of the current synchronization message is within a predetermined range of variation from the reception interval Rint[n-1] of the previous synchronization message. If the time synchronization processing unit 206 determines in S602 that the absolute value of the difference between the two reception intervals (i.e., reception intervals Rint[n-1] and Rint[n]) is less than or equal to the threshold ΔRint, it proceeds to S604. On the other hand, if the time synchronization processing unit 206 determines in S602 that the absolute value of the difference between the two reception intervals exceeds the threshold ΔRint, it proceeds to S603. The value of the threshold ΔRint may be, for example, one-thousandth of the period of the synchronization message transmitted by the time distribution server device 100 at regular intervals. In S603, the time synchronization processing unit 206 discards all received history data for synchronization messages and clears the reception history.
[0030] In S604, the time synchronization processing unit 206 adds a history entry related to the reception of the current synchronization message to the reception history data. The added entry includes parameters T2[n], Rint[n], T1[n], and SeqId[n], which is the SequenceID of the synchronization message, as shown by the label 405 in Figure 4. In S605, the time synchronization processing unit 206 determines whether the number of history entries held in the received history data is a predetermined number. In the example shown in Figure 4, the predetermined number is 16. If the time synchronization processing unit 206 determines in S605 that the number of history entries held in the received history data is a predetermined number, it proceeds to S505 as shown in Figure 5. On the other hand, if the time synchronization processing unit 206 determines in S605 that the number of history entries held in the received history data is not a predetermined number, it proceeds to S509 shown in Figure 5, and terminates the series of processes shown in Figures 5 and 6.
[0031] Now, let's refer to Figure 5 again. In S505, the time synchronization processing unit 206 performs a determination process to determine whether or not the delay request message can be sent. Details of this determination process will be described separately. If the time synchronization processing unit 206 determines that the delay request message can be sent as a result of this determination process, it proceeds to S506; otherwise, it proceeds to S509 and terminates the series of processes shown in Figure 5.
[0032] In S506, the time synchronization processing unit 206 sends a delay request message to the time distribution server device 100, obtains a transmission timestamp at the time of transmission using the device's clock 205, and obtains the transmission time T3 of the delay request message. In S507, the time synchronization processing unit 206 receives a delayed response message from the time distribution server device 100 and obtains the reception time T4 of the delay request message stored in the delayed response message. In S508, the time synchronization processing unit 206 uses the times T1[n], T2[n], T3, and T4 to determine the time difference (offset) between the clock of the client device 101 and the clock of the time distribution server device 100. Based on this time difference, the time synchronization processing unit 206 performs time adjustment on the clock 205 of the client device 101.
[0033] (Determining whether to send a delay request message) As an example of how to determine whether or not to send a delay request message in the S505 process shown in Figure 5, two methods will be explained. The first method determines whether a delay request message can be sent based on whether the reception intervals of all synchronization messages in the reception history data are within a predetermined threshold. In this method, if all reception intervals are within the predetermined threshold, it is determined that the delay request message can be sent. On the other hand, if there are any reception intervals that exceed the threshold, it is determined that the delay request message cannot be sent. Figure 7 shows an example of a reception interval for reception history data, with the reception interval represented by a bar graph. The vertical axis of the graph in Figure 7 represents the length of the reception interval Rint. The horizontal axis corresponds to each entry in the reception history data 400 exemplified in Figure 4. In other words, each graph in Figure 7 represents the length of the reception interval. The dotted line denoted by 701 in Figure 7 indicates the threshold line for the reception interval. In the example shown in Figure 7, Rint[n-1] exceeds the threshold, as indicated by 702, and in this case, the delay request message is determined to be unsendable.
[0034] The second method determines whether a delay request message can be sent based on whether the reception interval of the latest synchronization message falls within the standard deviation of the reception intervals of all reception history data. Specifically, the mean and standard deviation of the reception intervals of the reception history data are calculated, and it is determined whether the reception interval of the latest history falls within the range of mean ± standard deviation. If the reception interval of the latest received message falls within the standard deviation, it is determined that the delay supply message can be sent. On the other hand, if the reception interval of the latest received message does not fall within the standard deviation, it is determined that the delay request message cannot be sent. Figure 8(A) shows an example of a reception interval for reception history data, with the reception interval represented by a bar graph. The vertical axis of the graph in Figure 8(A) represents the length of the reception interval Rint. The horizontal axis corresponds to each entry in the reception history data 400 exemplified in Figure 4. The dotted line labeled 801 in Figure 8(A) represents the average value of all reception intervals. Figure 8(B) is a scatter plot showing the results of standardizing the reception intervals shown as a bar graph in Figure 8(A) (the reception interval values being transformed so that the mean is 0 and the variance is 1). The vertical axis of the scatter plot in Figure 8(B) represents the standardized reception intervals. The horizontal axis corresponds to the horizontal axis of the graph shown in Figure 8(A). In the scatter plot in Figure 8(B), data points plotted within the range of -1 to +1 for the standardized reception intervals correspond to reception intervals that fall within the standard deviation. The symbol 803 in Figure 8(A) indicates the value of the reception interval for the latest synchronization message. The standardized value of the reception interval indicated by symbol 803 is shown as the dotted number 804 in Figure 8(B). In other words, in the example shown in Figure 8, since the reception interval for the latest synchronization message is included in the standard deviation, it is determined that the delay request message can be sent.
[0035] Although two methods for determining whether or not to send a delay request message in S505 have been described as examples, the determination may also be made by combining these two methods.
[0036] As described above, in this embodiment, the client device 101 determines whether or not to send a delay request message based on the history data of the reception interval of synchronization messages sent from the time distribution server device 100. This determination determines whether or not the reception interval of synchronization messages is stable. Furthermore, if the reception interval of synchronization messages is stable, it means that the jitter of the communication delay of wireless communication from the time distribution server device 100 to the client device 101 is small. In other words, the above determination makes it possible to obtain a suitable timing for sending a delay request message to adjust the clock 205. Moreover, this time synchronization method based on this determination can reduce the number of PTP communication packets compared to the case in which time synchronization is performed by periodically sending delay request messages at random intervals.Therefore, it can be expected to reduce the effect of fluctuations in the communication delay of PTP packets in environments where communication delays are likely to occur, such as wireless communication.
[0037] <Second Embodiment> A second embodiment of this disclosure is described below. In this embodiment, the system configuration of the system that performs time synchronization is substantially the same as in the first embodiment. Furthermore, the hardware configurations of the time distribution server device 100 and the client devices 101 to 103 can also be substantially the same as in the first embodiment. The features of this embodiment will be described below, showing the parts that are the same as and the parts that differ from the first embodiment described above.
[0038] (PTP communication sequence) First, with reference to Figure 9, the PTP communication sequence for time synchronization between the time distribution server device 100 and the client device 101 will be described. Note that the example shown in Figure 9 shows the minimum communication necessary for time synchronization of the client device. Similar to the first embodiment, the time distribution server device 100 sends synchronization message (SYNC) packets at regular time intervals, as indicated by the reference numerals 901 to 904. The time distribution server device 100 obtains the transmission timestamp of the packet and obtains the transmission time of the synchronization message. However, in this embodiment, unlike the first embodiment described above, the time distribution server device 100 does not send a follow-up message each time a synchronization message is sent. Instead, after sending the synchronization message, the time distribution server device 100 stores the above transmission time associated with the SequenceID value of the synchronization message.
[0039] On the other hand, similar to the first embodiment, the client device 101 obtains the reception time each time it receives a synchronization message and obtains the time interval from the reception time of the previous synchronization message as the synchronization message reception interval. The client device 101 also maintains reception history data that includes the reception time of the synchronization message, the reception interval from the previous message, and the SequenceID parameter. However, in this embodiment, unlike the first embodiment described above, there is no reception of follow-up messages that arrive following the synchronization message, so the reception history data does not include the transmission time of the synchronization message. Also, similar to the first embodiment, the client device 101 updates the reception history data upon receiving a synchronization message, and if a predetermined number of history entries are maintained, it determines whether or not to send a delay request message. If the client device 101 determines that it is possible to send the message, it sends a delay request message to the time distribution server device 100.
[0040] The reference numeral 905 in Figure 9 indicates a delay request message (Delay_Req) that the client device 101 sends to the time distribution server device 100. In this embodiment, the SequenceID stored in this delay request message 905 is set to the same ID value as the SequenceID of the latest synchronization message received by the client device 101 (synchronization message 904 in the example shown in Figure 9). In addition, when the client device 101 sends the delay request message 905, it obtains the transmission time T3 as indicated by the reference numeral 910.
[0041] As indicated by the descriptive numeral 911, when the time distribution server device 100 receives the delay request message 905, it obtains the reception time T4. The time distribution server device 100 then selects and obtains the transmission time T1 (indicated by the descriptive numeral 908) of the synchronization message with the same SequenceID stored in the delay request message from among the transmission times of the synchronization messages it has stored. Then, as indicated by the descriptive numeral 906, the time distribution server device 100 stores the above transmission time T1 in a follow-up message (Follow_Up) and sends it to the client device 101. The time distribution server device 100 also stores the reception time T4 (indicated by the descriptive numeral 911) of the delay request message 905 in a delay response message (Delay_Resp) as indicated by the descriptive numeral 907 and sends it to the client device 101. When client device 101 receives follow-up message 906 and delayed response message 907, it obtains the transmission time T1 and reception time T4 stored in each message. Client device 101 also obtains the reception time T2 (indicated by reference numeral 909 in the example shown in Figure 9) of the most recent synchronization message sent when the delay request message was sent, from the reception history data. In this way, client device 101 obtains the transmission time T1 (908), reception time T2 (909), transmission time T3 (910), and reception time T4 (911). Then, client device 101 applies these obtained times to the aforementioned (Equation 1) to calculate the time difference (offset) ΔT between the clock of the time distribution server device 100 and its own clock, and adjusts the time on its own clock according to this time difference ΔT.
[0042] (Processing flow of the time distribution server device 100) Next, referring to Figure 10, an example of the processing of the time distribution server device 100 will be explained, focusing on the processing in PTP communication described above with reference to Figure 9. The time synchronization processing unit 206 of the time distribution server device 100 repeatedly executes a series of processes from the start indicated by the code S1001 to the end indicated by the code S1010.
[0043] In S1002, the time synchronization processing unit 206 determines whether or not it is the timing to send a synchronization message that is sent periodically at regular intervals. If the time synchronization processing unit 206 determines in S1002 that it is time to send a synchronization message, it proceeds to S1003. On the other hand, if the time synchronization processing unit 206 determines in S1002 that it is not the time to send a synchronization message, it proceeds to S1005. In S1003, the time synchronization processing unit 206 sends a synchronization message to the client device 101 and obtains the transmission time T1. In S1004, the time synchronization processing unit 206 associates the transmission time T1 with the SequenceID of the synchronization message sent in S1003 and stores it. The number of transmission times stored should be the same as a predetermined number of reception history data held by the client device 101.
[0044] In S1005, the time synchronization processing unit 206 determines whether or not it has received a delay request message from the client device 101. If the time synchronization processing unit 206 determines in S1005 that it has not received a delay request message, it proceeds to S1010 and terminates the series of processes shown in Figure 10. On the other hand, if the time synchronization processing unit 206 determines in S1005 that it has received a delay request message, it proceeds to S1006. In S1006, the time synchronization processing unit 206 obtains the reception time T4 of the delay request message from the packet's reception timestamp.
[0045] In S1007, the time synchronization processing unit 206 determines whether it has stored the SequenceID of the received delay request message and the transmission time of the synchronization message associated with the same SequenceID. If the time synchronization processing unit 206 determines in S1007 that it has stored the corresponding transmission time, it proceeds to S1008. On the other hand, if the time synchronization processing unit 206 determines in S1007 that it does not have the corresponding transmission time stored, it proceeds to S1009. In S1008, the time synchronization processing unit 206 uses the SequenceID and transmission time identified in S1007 to create a Follow_Up message and send it to the client device 101. In S1009, the time synchronization processing unit 206 sends a delayed response message containing the reception time T4 in response to the delay request message received from the client device 101. Then, in S1010, the time synchronization processing unit 206 completes the series of processes shown in Figure 10.
[0046] (Processing flow of client device 101) Next, referring to Figure 11, an example of the processing of the client device 101 will be explained, focusing on the processing in PTP communication described above with reference to Figure 9. The time synchronization processing unit 206 repeatedly executes a series of processes from the start indicated by the code S1101 to the end indicated by the code S1109. The contents of this series of processes will be explained below, focusing on the parts that differ from the first embodiment described above.
[0047] The processes in S1102, S1103, and S1104 correspond to the processes in S502, S504, and S505 in the example shown in Figure 5. When the time synchronization processing unit 206 sends a delay request message in S1105, it sets the value of the SequenceID of the last received synchronization message to the delay request message. This SequenceID is retrieved and used from the history entry of the latest synchronization message held in the reception history data. Furthermore, in the series of processes described with reference to Figure 5 in the first embodiment, the time synchronization processing unit 206 received a synchronization message in S502 and then a follow-up message in S503. In contrast, in this embodiment, the time synchronization processing unit 206 sends a delay request message in S1105 and then receives a follow-up message in S1106. The time synchronization processing unit 206 can obtain the transmission time T1 of the synchronization message of the SequenceID used in S1105 from the follow-up message received in S1106. The process in S1107 corresponds to the process in S507 in the example shown in Figure 5. In S1108, the time synchronization processing unit 206 uses the transmission time T1, reception time T2, transmission time T3, and reception time T4 to calculate the time difference (offset) ΔT between the clock within its own device and the clock of the time distribution server device 100. In this case, the transmission time T1 is the transmission time obtained from the follow-up message received in S1106, that is, the transmission time of the synchronization message of SequenceID used in S1105. Also, the transmission time T3 is the transmission time of the delay request message sent in S1105.
[0048] As explained above, in this embodiment, the time distribution server device 100 does not send a follow-up message each time a synchronization message is sent. Instead, the time distribution server device 100 sends a follow-up message notifying the transmission time of the synchronization message with SequenceID specified in the delay request message from the client device 101. By applying this control, it is possible to reduce the number of communication packets in PTP communication. In other words, in this embodiment, as in the first embodiment described above, it is possible to reduce fluctuations in the communication delay of PTP packets and further improve the effect of reducing fluctuations.
[0049] <Other Embodiments> The present invention can also be realized by supplying a program that implements one or more of the functions of the above-described embodiments to a system or device via a network or storage medium, and by having one or more processors in the computer of that system or device read and execute the program. It can also be realized by a circuit (e.g., an ASIC) that implements one or more functions.
[0050] Furthermore, the disclosure of this embodiment includes the following configurations, methods, and programs. (Configuration 1) A client device comprising: communication means for communicating with a server device that is the source of time synchronization using a time synchronization protocol; and time synchronization processing means for adjusting the time of the device's clock to synchronize with the time of the server device's clock based on the result of the communication by the communication means, wherein the time synchronization processing means calculates the reception interval for receiving synchronization messages of the time synchronization protocol communication transmitted by the server device at regular time intervals, determines whether the reception interval of the synchronization messages is stable or not, and adjusts the time of the device's clock according to the result of the determination. (Configuration 2) The client device according to Configuration 1, wherein the time synchronization processing means stores the reception interval of the synchronization message as historical data and determines whether or not the reception interval of the synchronization message is stable based on the historical data. (Configuration 3) The client device according to Configuration 2, wherein the time synchronization processing means stores the reception interval of the latest synchronization message as history data when the absolute value of the difference between the reception interval of the latest synchronization message and the reception interval of the previous synchronization message is less than or equal to a threshold. (Configuration 4) The client device according to Configuration 2 or 3, wherein the time synchronization processing means determines that the reception interval of the synchronization message is stable when all reception intervals stored as history data are within a predetermined threshold. (Configuration 5) The client device according to Configuration 2 or 3, wherein the time synchronization processing means determines that the reception interval of the synchronization message is stable when the reception interval of the latest synchronization message is included in the standard deviation of all reception intervals stored as historical data. (Configuration 6) The client device according to any one of Configurations 1 to 4, wherein the communication means sends a delay request message to the server device when the time synchronization processing means determines that the interval for receiving the synchronization message is stable, and receives a delay response message from the server device as a response to the delay request message. (Configuration 7) The client device according to Configuration 6, characterized in that the communication means receives a follow-up message sent from the server device after sending the delay request message containing the identifier of the latest synchronization message to the server device, to notify the transmission time of the synchronization message indicated by the identifier, and the time synchronization processing means calculates the time difference between the time of the server device's clock and the time of the device's clock in order to adjust the time of the device's clock based on the transmission time stored in the follow-up message. (Configuration 8) The client device according to Configuration 6, characterized in that the communication means receives a follow-up message sent from the server device after the transmission of the synchronization message to notify the transmission time of the synchronization message, and the time synchronization processing means calculates the time difference between the time of the server device's clock and the time of the device's clock in order to adjust the time of the device's clock based on the transmission time stored in the follow-up message. (Method 1) A method for controlling a client device, comprising: a communication step of communicating with a server device that is a source of time synchronization using a time synchronization protocol; and a time synchronization processing step of adjusting the time of the device's clock to synchronize with the time of the server device's clock based on the result of the communication in the communication step, wherein the time synchronization processing step calculates the reception interval for receiving synchronization messages of the time synchronization protocol communication transmitted by the server device at regular time intervals, determines whether the reception interval for the synchronization messages is stable or not, and adjusts the time of the device's clock according to the result of the determination, the method for controlling a client device. (Program 1) A program for causing a computer to function as a client device, comprising: communication means for communicating with a server device that is the source of time synchronization using a time synchronization protocol; and time synchronization processing means for adjusting the time of the device's clock to synchronize with the time of the server device's clock based on the results of the communication by the communication means, wherein the time synchronization processing means calculates the reception interval for receiving synchronization messages of the time synchronization protocol communication transmitted by the server device at regular time intervals, determines whether the reception interval for the synchronization messages is stable or not, and adjusts the time of the device's clock according to the result of the determination. [Explanation of Symbols]
[0051] 100 Time-based distribution server device 101 Client device 206 Time Synchronization Processing Unit 207 Wireless Communication Interface
Claims
1. A communication means that communicates with the server device that is the source of the time synchronization using a time synchronization protocol, A time synchronization processing means that adjusts the time of the device's clock to synchronize with the time of the server device's clock based on the result of the communication by the communication means, It has, The time synchronization processing means calculates the reception interval for receiving synchronization messages of the time synchronization protocol communication transmitted by the server device at regular time intervals, determines whether the reception interval for the synchronization messages is stable, and adjusts the time of its own clock according to the result of the determination. A client device characterized by the following features.
2. The client device according to claim 1, characterized in that the time synchronization processing means stores the reception interval of the synchronization message as historical data and determines whether or not the reception interval of the synchronization message is stable based on the historical data.
3. The client device according to claim 2, characterized in that the time synchronization processing means stores the reception interval of the latest synchronization message as history data when the absolute value of the difference between the reception interval of the latest synchronization message and the reception interval of the previous synchronization message is less than or equal to a threshold.
4. The client device according to claim 2, characterized in that the time synchronization processing means determines that the reception interval of the synchronization message is stable when all reception intervals stored as history data are within a predetermined threshold.
5. The client device according to claim 2, characterized in that the time synchronization processing means determines that the reception interval of the synchronization message is stable when the reception interval of the latest synchronization message is included in the standard deviation of all reception intervals stored as historical data.
6. The client device according to claim 1, characterized in that the communication means sends a delay request message to the server device when the time synchronization processing means determines that the interval for receiving the synchronization message is stable, and receives a delay response message from the server device as a response to the delay request message.
7. The communication means receives a follow-up message sent from the server device after it has sent the delay request message containing the identifier of the latest synchronization message to the server device, to notify the transmission time of the synchronization message indicated by the identifier. The time synchronization processing means calculates the time difference between the time on the server device's clock and the time on the device's clock, based on the transmission time stored in the follow-up message, in order to adjust the time on the device's clock. The client device according to claim 6, characterized in that...
8. The communication means receives a follow-up message sent from the server device after the transmission of the synchronization message, which notifies the transmission time of the synchronization message. The time synchronization processing means calculates the time difference between the time on the server device's clock and the time on the device's clock, based on the transmission time stored in the follow-up message, in order to adjust the time on the device's clock. The client device according to claim 6, characterized in that...
9. A method for controlling a client device, A communication step in which communication is performed with the server device that is the source of time synchronization using a time synchronization protocol, A time synchronization processing step which adjusts the time of the device's own clock to synchronize with the time of the server device's clock based on the result of the communication in the communication step, Includes, The time synchronization processing step calculates the reception interval for receiving synchronization messages of the time synchronization protocol communication transmitted by the server device at regular time intervals, determines whether the reception interval for the synchronization messages is stable, and adjusts the time of the device's clock according to the result of the determination. A method for controlling a client device, characterized by the following features.
10. Computers, A communication means that communicates with the server device that is the source of the time synchronization using a time synchronization protocol, A time synchronization processing means that adjusts the time of the device's clock to synchronize with the time of the server device's clock based on the result of the communication by the communication means, It has, The time synchronization processing means calculates the reception interval for receiving synchronization messages of the time synchronization protocol communication transmitted by the server device at regular time intervals, determines whether the reception interval for the synchronization messages is stable, and adjusts the time of its own clock according to the result of the determination. A program for causing a client device to function in a particular way.