Communication device, method for processing communication device, and program

The communication device improves time synchronization accuracy by determining communication state and adjusting the clock based on differential times under good conditions, mitigating jitter in wireless PTP environments.

JP2025176406APending Publication Date: 2025-12-04CANON KK
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024082546
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2025-12-04

Smart Images

  • Figure 2025176406000001_ABST
    Figure 2025176406000001_ABST
Patent Text Reader

Abstract

To reduce a deterioration in time adjustment accuracy synchronized with a time distribution server.SOLUTION: A communication device has: first acquisition means that acquires transmission time of a clock of a time distribution server when the time distribution server transmits a reception packet, and reception time of a clock of the communication device when the communication device receives the reception packet; second acquisition means that acquires transmission time of the clock of the communication device when the communication device transmits a transmission packet, and reception time of the clock of the time distribution server when the time distribution server receives the transmission packet; first calculation means that calculates a first differential time between the reception time and the transmission time of the reception packet determined to have a good communication state; second calculation means that calculates a second differential time between the reception time and the transmission time of the transmission packet determined to have a good communication state; and adjustment means that adjusts the time of the clock of the communication device on the basis of the first differential time and the second differential time.SELECTED DRAWING: Figure 5
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present disclosure relates to a communication device, a processing method for a communication device, and a program. [Background technology]

[0002] As a method for adjusting the system time of a communication device via communication, the Precision Time Protocol (PTP) defined in IEEE1588-2008 (also known as IEEE1588 version 2) is often used.

[0003] PTP is a communications protocol for time adjustment via communication. By communicating between a client device and a time distribution server called a GMC (Grand Master Clock), PTP enables the client device's time to be synchronized with the time of the time distribution server with high accuracy.

[0004] PTP also requires timestamps for the transmission and reception timing of PTP packets. Therefore, it is usually desirable for client devices to have a communication interface with a PTP Hardware Clock (PHC) that can output timestamps for transmitted and received packets. The PTP processing of the client device then adjusts the time of the PHC on the communication interface, synchronizing the PHC time with the time of the time distribution server.

[0005] When time adjustment using PTP is performed via wireless communication, such as wireless LAN, the wireless environment and other wireless communication devices may cause packet loss due to radio wave reflection, attenuation, interference, etc., which may result in retransmission processing.

[0006] In addition, due to collision avoidance protocols such as CSMA / CA (Carrier Sense Multiple Access / Collision Avoidance), there is a possibility that a random long waiting period will occur after the timestamp is stamped.

[0007] These retransmission processes and long wait times result in jitter in wireless communications. Because PTP assumes that the communication delay between the time distribution server and the client device is constant in both directions, jitter in communications can degrade the accuracy of time synchronization between the client device and the time distribution server.

[0008] In an environment where jitter occurs, such as wireless communication, there is a method of predicting the occurrence of retransmission processes or long waiting processes that cause jitter, and not using PTP packets that are predicted to have undergone these processes.

[0009] Patent Document 1 discloses a method of measuring multiple communication delay times between a time distribution server and a client device and adjusting the time based on the smallest value among the measured values. [Prior art documents] [Patent documents]

[0010] [Patent Document 1] Japanese Patent Application Laid-Open No. 2016-225880 Summary of the Invention [Problem to be solved by the invention]

[0011] In the above-mentioned Patent Document 1, deterioration of time synchronization accuracy is suppressed by adjusting the time based on the minimum communication delay time that is less likely to cause retransmission processing or long waiting processing, which are factors that cause deterioration of time synchronization accuracy.

[0012] However, it is difficult to determine whether retransmission or long waiting times will occur based on the communication delay time alone. For example, if multiple measurements of communication delay times are all taken under poor wireless communication conditions, time synchronization accuracy may be degraded even if the time is adjusted based on the minimum communication delay time.

[0013] The present disclosure aims to reduce deterioration in the accuracy of adjusting the time synchronized with a time distribution server. [Means for solving the problem]

[0014] The communication device includes a receiving means for receiving a received packet from a time distribution server, a first obtaining means for obtaining the transmission time of the clock of the time distribution server when the time distribution server transmitted the received packet and the reception time of the clock of the communication device when the communication device received the received packet, a transmitting means for transmitting a transmission packet to the time distribution server, a second obtaining means for obtaining the transmission time of the clock of the communication device when the communication device transmitted the transmitted packet and the reception time of the clock of the time distribution server when the time distribution server received the transmitted packet, a communication state when the received packet was received, and a time information obtaining means for obtaining the time information of the clock of the time distribution server when the time distribution server received the transmitted packet. a first calculation means for calculating a first differential time between the reception time and transmission time of a received packet for which the determination means has determined that the communication state is good; a second calculation means for calculating a second differential time between the reception time and transmission time of a transmitted packet for which the determination means has determined that the communication state is good; a third calculation means for calculating a communication delay time based on the first differential time and the second differential time; and an adjustment means for adjusting the time of a clock of the communication device based on the reception time and transmission time of the received packet and the communication delay time, or the reception time and transmission time of the transmitted packet and the communication delay time. [Effects of the Invention]

[0015] According to the present disclosure, it is possible to reduce deterioration in the accuracy of adjusting the time synchronized with a time distribution server. [Brief explanation of the drawings]

[0016] [Figure 1] FIG. 2 illustrates an example of a hardware configuration of a communication device. [Figure 2] FIG. 1 illustrates an example of the configuration of a communication system. [Figure 3] FIG. 2 illustrates an example of a functional configuration of a communication device. [Figure 4]10 is a flowchart of a time synchronization process in the communication device. [Figure 5] 10 is a flowchart of a communication delay time update process of a communication device. [Figure 6] 10 is a flowchart of a time adjustment process of a communication device. [Figure 7] 10 is a flowchart of an event handler process of the communication device. [Figure 8] FIG. 10 is a sequence diagram showing transmission and reception of PTP packets. [Figure 9] 10 is a flowchart of a communication delay time update process of a communication device. DETAILED DESCRIPTION OF THE INVENTION

[0017] Hereinafter, embodiments will be described in detail with reference to the drawings. Note that the following embodiments do not limit the scope of the claims. Although multiple features are described in the embodiments, not all of these multiple features are necessarily required, and multiple features may be combined arbitrarily. Furthermore, in the drawings, the same reference numerals are used to designate the same or similar components, and redundant explanations will be omitted.

[0018] (First embodiment) 1 is a block diagram showing an example of a hardware configuration of a communication device 100 according to the first embodiment. The communication device 100 is a device having a communication function, and may be, for example, a camera, a printer, a smartphone, a tablet, a PC (personal computer), a projector, or the like.

[0019] The communication device 100 has a system bus 101, a CPU 102, a ROM 103, a RAM 104, a clock 105, a time synchronization device 106, and a wireless communication interface 107. The system bus 101 interconnects the CPU 102, the ROM 103, the RAM 104, the clock 105, the time synchronization device 106, and the wireless communication interface 107, and serves as a transfer path for various data between the connected devices.

[0020] The CPU 102 controls the communication device 100 by comprehensively controlling the hardware devices 103 to 107 via an OS or device drivers.

[0021] The ROM 103 stores the OS and control programs such as device drivers executed by the CPU 102 .

[0022] The RAM 104 functions as a main memory and work area for the CPU 102, and can temporarily store programs and data.

[0023] The clock 105 is a clock that indicates the system time within the communication device 100 .

[0024] The time synchronizer 106 synchronizes the time of the clock 105 with the external time distribution server 200 (FIG. 2). More specifically, the time synchronizer 106 is responsible for acquiring the sending and receiving times of PTP packets and adjusting the time of the clock 105. Here, PTP stands for Precision Time Protocol.

[0025] The wireless communication interface 107 transmits and receives PTP packets to and from an external time distribution server 200 (FIG. 2). In this embodiment, the wireless communication interface 107 does not include a clock, and the time of the clock 105 is adjusted by the time synchronizer 106. However, the wireless communication interface 107 may also include a clock.

[0026] Fig. 2 is a diagram showing an example of the configuration of a communication system 210. The communication system 210 includes the communication device 100 of Fig. 1 and a time distribution server 200. The communication device 100 and the time distribution server 200 are directly connected by wireless.

[0027] In this embodiment, the communication device 100 and the time distribution server 200 do not have to be directly connected, but may be connected via an access point or a base station. In this embodiment, the communication standard is assumed to be wireless LAN (Wi-Fi (registered trademark)), but mobile communications such as LTE (Long Term Evolution) and 5G may also be used. In addition, the time distribution server 200 may be the same device as the communication device 100, or three or more devices identical to the communication device 100 may be connected.

[0028] 3 is a block diagram showing an example of a functional configuration that operates by executing a program on CPU 102 of communication device 100. Communication device 100 includes a receiving unit 301, a transmitting unit 302, a time stamping unit 303, a communication status determining unit 304, a first calculating unit 305, a second calculating unit 306, a third calculating unit 307, a time adjusting unit 308, a communication delay time managing unit 309, and a communication environment change detecting unit 310.

[0029] The receiving unit 301 and the transmitting unit 302 control the transmission and reception of upper layer communication protocol packets including PTP. The receiving unit 301 and the transmitting unit 302 also control the wireless communication interface 107 to transmit and receive packets conforming to the wireless LAN standard to and from the time distribution server 200.

[0030] The time stamping unit 303 controls the clock 105 and the time synchronization device 106 to stamp the time when a PTP packet is received from the time distribution server 200 and the time when a PTP packet is transmitted to the time distribution server 200 .

[0031] The communication status determination unit 304 periodically acquires data on parameters indicating wireless quality, such as radio wave intensity, number of retransmissions, and noise ratio, from the wireless communication interface 107, and determines whether the communication status is good or not by comparing each of the parameters with a predetermined threshold. For example, the communication status determination unit 304 determines that the communication status is good if all parameters meet the criteria as compared with the threshold, and determines that the communication status is poor otherwise. Alternatively, each parameter may be weighted to make a comprehensive determination.

[0032] Furthermore, the communication status determination unit 304 determines the communication status for PTP packets received from the time distribution server 200 and PTP packets transmitted to the time distribution server 200. The communication status for transmitted and received PTP packets is determined from the communication status at the transmission and reception times of the PTP packets stamped by the time stamp unit 303.

[0033] The first calculation unit 305 calculates, using (Equation 1), a first differential time between the transmission time (T1) of the time distribution server 200 included in a received PTP packet (Sync message) for which the communication status determination unit 304 in Figure 8 has determined that the communication status is good, and the reception time (T2) of the PTP packet at the communication device 100. (Equation 1) First differential time = T2 - T1

[0034] In this embodiment, one-step PTP processing is assumed, but two-step processing is also possible. In the two-step processing, the time included in the Follow-Up message is used as the transmission time of the time distribution server 200. However, the communication state is determined based on the Sync message.

[0035] The second calculation unit 306 calculates a second differential time from a transmitted PTP packet (Delay-Request message) for which the communication status determination unit 304 in Fig. 8 has determined that the communication status is good, and a received PTP packet (Delay-Response message) corresponding to the PTP packet. More specifically, the second calculation unit 306 calculates the differential time between the transmission time (T3) of the Delay-Request message at the communication device 100 and the reception time (T4) of the Delay-Response message by the time distribution server 200, which is included in the Delay-Response message, using (Equation 2). (Equation 2) Second differential time = T4 - T3

[0036] The third calculation unit 307 calculates the communication delay time from the first differential time and the second differential time using (Equation 3). (Equation 3) Communication delay time = (first differential time + second differential time) / 2

[0037] The time adjustment unit 308 adjusts the time of the clock 105 based on the transmission time T1, the reception time T2, and the communication delay time. First, the time adjustment unit 308 calculates the difference between the time of the time distribution server 200 and the time of the clock 105 as an offset using (Equation 4). (Equation 4) Offset = T2 - T1 - Communication Delay Time

[0038] Then, the time adjustment unit 308 calculates the adjusted time of the clock 105 from the calculated offset and the current time of the clock 105 using (Equation 5). (Formula 5) Adjusted time = current time - offset

[0039] Furthermore, the time adjustment unit 308 may use the transmission time T3 and the reception time T4 instead of the transmission time T1 and the reception time T2. The offset when the transmission time T3 and the reception time T4 are used is expressed by the following (Equation 6). (Equation 6) Offset = T3 - T4 + communication delay time

[0040] The communication delay time management unit 309 manages the communication delay time calculated by the third calculation unit 307. The time adjustment unit 308 adjusts the time using the communication delay time managed by the communication delay time management unit 309 unless a change in the communication environment is detected.

[0041] The communication environment change detection unit 310 detects a change in the communication environment by receiving an event such as a change in the wireless channel or a change in the connected access point from the wireless communication interface 107. Furthermore, when the communication environment change detection unit 310 detects a change in the communication environment, it instructs each functional unit to recalculate the communication delay time in the third calculation unit 307, adjust the time of the clock 105 in the time adjustment unit 308, and update the communication delay time managed by the communication delay time management unit 309.

[0042] In addition, the communication environment change detection unit 310 may compare the communication delay time calculated by the third calculation unit 307 with the communication delay time managed by the communication delay time management unit 309, and detect a change in the communication environment when the difference exceeds a predetermined threshold for a certain period of time or a certain number of times.

[0043] FIG. 4 is a flowchart showing a method for time synchronization processing with the time distribution server 200 in the communication device 100.

[0044] In step S400, the communication delay time management unit 309 performs a process of updating the communication delay time that it manages. Details of the communication delay time update process will be described later with reference to FIG.

[0045] In step S401, the time adjustment unit 308 performs a process of adjusting the time of the clock 105. Details of the time adjustment process will be described later with reference to FIG.

[0046] In step S402, the time adjustment unit 308 determines whether time synchronization with the time distribution server 200 has been completed. If time synchronization with the time distribution server 200 has not been completed, the process proceeds to step S403. If time synchronization with the time distribution server 200 has been completed, the process of the flowchart in FIG. 4 ends.

[0047] In step S403, the communication status determination unit 304 determines whether or not the receiving unit 301 has received a PTP packet (Sync message) from the time distribution server 200 in Fig. 8. If a PTP packet has been received, the process proceeds to step S404, and if a PTP packet has not been received, the process proceeds to step S402.

[0048] In step S404, the communication status determination unit 304 determines the communication status at the time corresponding to the received PTP packet. If the communication status at the time corresponding to the received PTP packet is good, the process proceeds to step S401, and if the communication status at the time corresponding to the received PTP packet is bad, the process proceeds to step S402.

[0049] Here, the time corresponding to the received PTP packet differs depending on the message of the received PTP packet. In the case of the Sync message 801 in Fig. 8, the determination is made at the time T2 when the Sync message 801 is received. In the case of the Delay-Response message 803, the determination is made at the time T3 when the corresponding Delay-Request message 802 is sent. In the case of the Follow-Up message, the determination is made at the time T2 when the corresponding Sync message 801 is received.

[0050] FIG. 5 is a flowchart showing the details of step S400 of the communication delay time update process in FIG.

[0051] In step S500, the communication delay time management unit 309 starts measuring the delay time and records the measurement start time.

[0052] In step S501, the time stamping unit 303 determines whether or not the Sync message 801 of the PTP packet has been received by the receiving unit 301. The receiving unit 301 receives the Sync message 801 of the PTP packet from the time distribution server 200. The Sync message 801 is an example of a received packet. If it has been received, the process proceeds to step S502; if it has not been received, the process proceeds to step S506.

[0053] In step S502, the time stamp unit 303 functions as an acquisition unit, and acquires the transmission time T1 of the Sync message 801 and the reception time T2 of the Sync message 801.

[0054] The transmission time T1 is the transmission time of the clock of the time distribution server 200 when the time distribution server 200 transmits the Sync message 801. The reception time T2 is the reception time of the clock 105 of the communication device 100 when the communication device 100 receives the Sync message 801.

[0055] Here, the Sync message 801 includes the transmission time T1 of the clock of the time distribution server 200 when the time distribution server 200 transmits the Sync message 801. The time stamping unit 303 acquires the transmission time T1 in the Sync message 801.

[0056] The receiving unit 301 may receive a Follow-Up message in the two-step case from the time distribution server 200. The Follow-Up message includes the transmission time T1 of the clock of the time distribution server 200 when the time distribution server 200 transmitted the Sync message 801. The time stamping unit 303 acquires the transmission time T1 in the Follow-Up message.

[0057] The transmission time T1 is obtained from the transmission time T1 of the time distribution server 200 contained in the received Sync message 801 or the Follow-Up message in the case of two steps.

[0058] The reception time T2 is obtained by acquiring the time stamped by the clock 105 at the moment when the Sync message 801 is received. The time stamping unit 303 controls the time synchronization device 106 to stamp and acquire the time by the clock 105.

[0059] In step S503, communication status determination unit 304 determines the communication status at reception time T2 when Sync message 801 is received. If the communication status is good and has improved, the process proceeds to step S504, and if the communication status is bad or has not improved, the process proceeds to step S505. Here, improved communication status can be rephrased as Sync message 801 being in the best communication status within the delay time measurement period.

[0060] For example, the communication state determination unit 304 determines the communication state by comparing at least one of the radio wave intensity, the number of retransmissions, and the noise ratio in wireless communication with a threshold value.

[0061] In step S504, the first calculation unit 305 calculates a first differential time (forward path time of communication) between the reception time T2 and the transmission time T1 using Equation 1. The forward path time is a time statically managed within the delay time measurement period, and is updated every time a Sync message in the best communication condition is received.

[0062] In step S505, the transmitting unit 302 transmits a Delay-Request message 802 of a PTP packet to the time distribution server 200. The Delay-Request message 802 is an example of a transmission packet. The time stamping unit 303 holds the transmission time of the Delay-Request message 802 as T3.

[0063] In step S506, the time stamping unit 303 determines whether or not the Delay-Response message 803 of the PTP packet has been received by the receiving unit 301. The receiving unit 301 receives the Delay-Response message 803 of the PTP packet from the time distribution server 200. If it has been received, the process proceeds to step S507; if it has not been received, the process proceeds to step S510.

[0064] In step S507, the time stamping unit 303 acquires the transmission time T3 of the Delay-Request message 802 and the reception time T4 of the Delay-Request message 802.

[0065] Here, the Delay-Response message 803 in step S506 includes the reception time T4 of the clock of the time distribution server 200 when the time distribution server 200 receives the Delay-Request message 802. The time stamping unit 303 obtains the reception time T4 from the Delay-Response message 803.

[0066] The transmission time T3 is the transmission time of the clock 105 of the communication device 100 when the communication device 100 transmits the Delay-Request message 802. The reception time T4 is the reception time of the clock of the time distribution server 200 when the time distribution server 200 receives the Delay-Request message 802.

[0067] The transmission time T3 is obtained from the transmission time of the Delay-Request message 802 held in step S505. The reception time T4 is obtained from the reception time T4 of the Delay-Response message 803 by the time distribution server 200.

[0068] In step S508, the communication status determination unit 304 determines the communication status at transmission time T3 when the Delay-Request message 802 is transmitted. If the communication status is good and has improved, the process proceeds to step S509, and if the communication status is bad or has not improved, the process proceeds to step S510.

[0069] Here, the improved communication state can be rephrased as the Delay-Request message 802 being in the best communication state within the delay time measurement period.

[0070] In step S509, the second calculation unit 306 calculates a second difference time (communication return time) between the reception time T4 and the transmission time T3 using Equation 2. The return time is a time statically managed within the delay time measurement period, and is updated every time a Delay-Request message is transmitted under the best communication conditions.

[0071] In step S510, the communication delay time management unit 309 determines whether a predetermined period of time has elapsed since the measurement start time recorded in step S500. If the predetermined period of time has elapsed, the process proceeds to step S510, and if the predetermined period of time has not elapsed, the process proceeds to step S501.

[0072] In step S511, the third calculation unit 307 determines whether both the forward path time in step S504 and the return path time in step S509 calculated under good communication conditions exist. If they exist, the process proceeds to step S512; if they do not exist, the process proceeds to step S500. If the process proceeds to step S500, the delay time measurement is restarted.

[0073] 8, receiving unit 301 receives Sync messages 801, 805, and 809 from time distribution server 200 multiple times within a certain period. Transmitting unit 302 transmits Delay-Request messages 802, 807, and 811 to time distribution server 200 multiple times within a certain period.

[0074] As a result, in step S504, the first calculation unit 305 calculates a first differential time (forward travel time) between the reception time T2 and transmission time T1 of the Sync message 809 that is determined by the communication status determination unit 304 to have the best communication status among the multiple Sync messages 801, 805, and 809.

[0075] In step S509, the second calculation unit 306 calculates a second differential time (return path time) between the reception time T4 and transmission time T3 of the Delay-Request message 802, which is determined by the communication status determination unit 304 to have the best communication status among the multiple Delay-Request messages 802, 807, and 811.

[0076] In step S512, the third calculation unit 307 calculates the communication delay time based on the first differential time (forward path time) in step S504 that was last updated within the delay time measurement period and the second differential time (return path time) in step S509, using Equation 3. The communication delay time calculated in step S512 is managed by the communication delay time management unit 309.

[0077] FIG. 6 is a flowchart showing the details of step S401 of the time adjustment process in FIG.

[0078] In step S600, the time adjustment unit 308 calculates the offset, which is the difference between the time of the time distribution server 200 and the time of the clock 105, using (Equation 4) from T1 and T2 acquired when the Sync message was received and the communication delay time managed by the communication delay time management unit 309. Here, T1 and T2 are those acquired when the Sync message was received and the communication status was determined to be good by the communication status determination unit 304.

[0079] Note that T3 and T4 may be used instead of T1 and T2. Here, T3 and T4 are obtained when a Delay-Response message corresponding to a Delay-Request message for which the communication status determination unit 304 has determined that the communication status is good is received. The time adjustment unit 308 calculates the offset, which is the difference between the time of the time distribution server 200 and the time of the clock 105, using Equation 6 from T3 and T4 obtained when the Delay-Response message is received and the communication delay time managed by the communication delay time management unit 309.

[0080] In step S601, the time adjustment unit 308 calculates the adjusted time from the current time of the clock 105 and the offset calculated in step S600 using (Equation 5), and adjusts the time of the clock 105 with the adjusted time.

[0081] 7 is a flowchart showing the event handler processing in the communication environment change detection unit 310 of the communication device 100. The event handler processing is a process, task, or thread that runs in parallel with the time synchronization processing shown in FIG.

[0082] In step S700, communication environment change detection unit 310 determines whether or not an event has been received from wireless communication interface 107. If an event has been received, the process proceeds to step S701, and if not, the process proceeds to step S702.

[0083] In step S701, communication environment change detection unit 310 detects a change in the communication environment. If a change in the communication environment is detected, the process proceeds to step S400, and if no change in the communication environment is detected, the process proceeds to step S702.

[0084] For example, the communication environment change detection unit 310 determines the type of the received event. If the type of event is a wireless channel change, a connected access point change, or a connected base station change, a change in the communication environment is detected, and the process proceeds to a communication delay time update process in step S400. If the type of event is not a wireless channel change, an access point change, or a base station change, a change in the communication environment is not detected, and the process proceeds to step S702.

[0085] In addition, the communication environment change detection unit 310 may be configured to detect a change in the communication environment when the time or number of times that the difference between the communication delay time calculated by the third calculation unit 307 and the previous communication delay time exceeds a threshold continues for a certain period of time or a certain number of times.

[0086] In step S400, the process of step S400 in Fig. 5 is performed, and then the process proceeds to step S702.

[0087] In step S702, the communication environment change detection unit 310 determines whether time synchronization with the time distribution server 200 has been completed. If time synchronization with the time distribution server 200 has not been completed, the process proceeds to step S700. If time synchronization with the time distribution server 200 has been completed, the process of the flowchart in FIG. 7 ends.

[0088] FIG. 8 is a sequence diagram showing an example of transmission and reception of PTP packets between the communication device 100 and the time distribution server 200, and shows a specific example of the functions and processing flows described in FIGS.

[0089] Time 800 is the time when the time synchronization process of the clock 105 in the communication device 100 starts, and is assumed to be 50 seconds. The time on the clock of the time distribution server 200 at that timing is assumed to be 30 seconds, indicating that the clock 105 is 20 seconds ahead of the time on the clock of the time distribution server 200.

[0090] Messages 801 to 812 indicate various messages of the PTP packet. Time 813 is the time when the time of the clock 105 in the communication device 100 is adjusted, and shows how the time is adjusted from 100s to 80s.

[0091] Table 814 shows the message type, event that occurred in the message, and communication status determination for messages 801 to 812. The messages that are subject to determination by communication status determination unit 304 are Sync messages and Delay-Request messages, and Delay-Response messages are not subject to determination.

[0092] First, a description will be given of Sync messages 801, 804, 805, and 809. The time distribution server 200 transmits Sync messages 801, 804, 805, and 809 to the communication device 100.

[0093] Sync message 801 is transmitted by time distribution server 200 after a long waiting time due to a collision avoidance protocol for wireless communication. Sync messages 804 and 805 have been retransmitted due to packet loss. Sync message 809 has not experienced any occurrence.

[0094] The occurrence of a long waiting time due to the collision avoidance protocol indicates the presence of other carriers, i.e., congestion of the transmission path. Therefore, the Sync message 801 is determined by the communication state determination unit 304 to be in a poor communication state due to a high noise ratio.

[0095] The Sync messages 804 and 805 are determined to be in a poor communication state by the communication state determining unit 304 due to the occurrence of packet loss, that is, due to insufficient radio wave strength or a high noise ratio.

[0096] The Sync message 809 indicates that no event has occurred in the wireless section, and the communication state determining unit 304 determines that the communication state is good.

[0097] Next, a description will be given of the Delay-Request messages 802, 806, 807, 810, and 811. Upon receiving the Sync message, the communication device 100 transmits the Delay-Request messages 802, 806, 807, 810, and 811 to the time distribution server 200.

[0098] No event occurs in the Delay-Request message 802. Retransmissions due to packet loss occur in the Delay-Request messages 806 to 807 and 810 to 811.

[0099] The Delay-Request message 802 indicates that no event has occurred in the wireless section, and the communication status determination unit 304 determines that the communication status is good.

[0100] Due to packet loss and retransmissions, the Delay-Request messages 806 to 807 and 810 to 811 are determined to be in a poor communication state by the communication state determining unit 304 based on the number of retransmissions.

[0101] As a result, the first calculation unit 305 calculates the outbound time as T2-T1=92s-70s=22s from the Sync message 809 (T1: 70s, T2: 92s) (S504 in FIG. 5, (Equation 1)).

[0102] Further, the second calculation unit 306 calculates the return time as T4-T3=42s-60s=-18s from the Delay-Request message 802 (T3: 60s, T4: 42s) (S509 in FIG. 5, (Equation 2)).

[0103] From this, the communication delay time calculated by the third calculation unit 307 is (22s+(-18s) / 2=2s (S512 in FIG. 5, (Equation 3)).

[0104] Furthermore, at time 100s on the clock 105 in the communication device 100, the time adjustment unit 308 calculates offset = T2 - T1 - communication delay time = 92s - 70s - 2s = 20s from T1, T2 and the communication delay time (S600 in Figure 6, (Equation 4)).

[0105] Furthermore, the time adjustment unit 308 calculates the adjusted time=current time-offset=100s-20s=80s from the current time and offset (S601 in FIG. 6, (Equation 5)).

[0106] In the first embodiment described above, the communication delay time is calculated using the Sync message 809 and Delay-Request message 802 for which the communication state is determined to be good, and the time is adjusted based on the calculated communication delay time. This allows the communication device 100 to suppress deterioration in the accuracy of time synchronization with the time distribution server 200 due to time adjustment using the Sync message or Delay-Request message for which the communication state is poor.

[0107] (Second embodiment) In the first embodiment, in the communication delay time update process (S400), the delay time is measured for a predetermined period of time, and the communication delay time is calculated from the Sync message 809 and Delay-Request message 802 with the best communication conditions within the period.

[0108] In the second embodiment, an example is shown in which a communication delay time is calculated when a Sync message and a successive Delay-Request message satisfy a predetermined communication state. The second embodiment differs from the first embodiment only in the communication delay time update process (S400), and therefore, a description of the rest will be omitted.

[0109] FIG. 9 is a flowchart showing the details of the communication delay time update process in step S400 in FIG.

[0110] In step S900, the time stamping unit 303 determines whether or not the Sync message of the PTP packet has been received by the receiving unit 301. The receiving unit 301 receives the Sync message from the time distribution server 200. If the Sync message has been received, the process proceeds to step S901; if the Sync message has not been received, the process proceeds to step S900.

[0111] In step S901, the time stamping unit 303 obtains the sending time T1 of the Sync message 801 and the receiving time T2 of the Sync message 801. The sending time T1 is obtained from the sending time of the time distribution server 200 included in the received Sync message or the Follow-Up message in the case of two steps.

[0112] The reception time T2 is obtained by acquiring the time stamped at the moment when the Sync message is received by the clock 105. The time stamping unit 303 controls the time synchronizer 106 to stamp and acquire the time by the clock 105.

[0113] In step S902, the communication state determination unit 304 determines the communication state at the reception time T2 when the Sync message is received. If the communication state is good, the process proceeds to step S903, and if the communication state is bad, the process proceeds to step S900.

[0114] In step S903, the first calculation unit 305 calculates a first difference time (forward travel time of communication) between the reception time T2 and the transmission time T1 using (Equation 1).

[0115] In step S904, the transmitting unit 302 transmits a Delay-Request message in a PTP packet and holds the transmission time T3 of the Delay-Request message.

[0116] In step S905, the time stamping unit 303 determines whether or not a Delay-Response message for the PTP packet has been received by the receiving unit 301. The receiving unit 301 receives the Delay-Response message for the PTP packet. If it has been received, the process proceeds to step S906; if it has not been received, the process proceeds to step S905.

[0117] In step S906, the time stamping unit 303 obtains the transmission time T3 of the Delay-Request message and the reception time T4 of the Delay-Request message. The transmission time T3 is obtained from the transmission time of the Delay-Request message stored in step S904. The reception time T4 is obtained from the reception time by the time distribution server 200 included in the Delay-Response message.

[0118] In step S907, the communication state determination unit 304 branches depending on the determination result of the communication state at the transmission time T3 of the Delay-Request message. If the communication state is good, the process proceeds to step S908, and if the communication state is bad, the process proceeds to step S900.

[0119] As a result, in step S906, the second calculation unit 306 calculates a second differential time between the reception time T4 and transmission time T3 of the Delay-Request message determined to be in a good communication state by the communication state determination unit 304 when the communication state of the Delay-Request message following the Sync message determined to be in a good communication state by the communication state determination unit 304 is determined to be in a good communication state.

[0120] In step S908, the second calculation unit 306 calculates a second difference time (backward path time of communication) between the reception time T4 and the transmission time T3 using (Equation 2).

[0121] In step S909, the third calculation unit 307 calculates the communication delay time from the outbound path time in step S903 and the return path time in step S908 using Equation 3. The communication delay time calculated in step S909 is managed by the communication delay time management unit 309.

[0122] In the second embodiment described above, the communication delay time is calculated based on the timing when a Sync message indicating a good communication state and a subsequent Delay-Request message appear. Therefore, it is possible to perform time adjustment processing without waiting for a certain period of time, as in the first embodiment. Furthermore, the communication delay time is calculated based on the Sync message and the subsequent Delay-Request message. Therefore, even if there is a time advance error due to a difference in frequency between the clock of the time distribution server 200 and the clock 105 of the communication device 100, the effect of this error can be suppressed.

[0123] As described above, according to the first and second embodiments, when the communication device 100 synchronizes with the time distribution server 200 via time synchronization protocol communication, it is possible to avoid degradation of time synchronization accuracy by using the communication delay time measured under good wireless communication conditions.

[0124] (Other embodiments) The present disclosure can also be realized by a process in which a program that realizes one or more functions of the above-described embodiments is supplied to a system or device via a network or a storage medium, and one or more processors in the computer of the system or device read and execute the program. The present disclosure can also be realized by a circuit (e.g., ASIC) that realizes one or more functions.

[0125] It should be noted that the above-described embodiments merely illustrate specific examples of implementing the present disclosure, and the technical scope of the present disclosure should not be construed as being limited by these embodiments. In other words, the present disclosure can be implemented in various forms without departing from its technical concept or main features.

[0126] The disclosure of this embodiment includes the following configuration, method, and program. (Configuration 1) A communication device, receiving means for receiving a reception packet from a time distribution server; a first acquisition means for acquiring a transmission time of a clock of the time distribution server when the time distribution server transmits the received packet and a reception time of a clock of the communication device when the communication device receives the received packet; a transmitting means for transmitting a transmission packet to the time distribution server; a second acquiring means for acquiring a transmission time of a clock of the communication device when the communication device transmits the transmission packet and a reception time of a clock of the time distribution server when the time distribution server receives the transmission packet; a determination means for determining a communication state when the received packet is received and a communication state when the transmitted packet is transmitted; a first calculation means for calculating a first differential time between a reception time and a transmission time of a received packet determined by the determination means to be in a good communication state; a second calculation means for calculating a second differential time between the reception time and the transmission time of a transmission packet determined by the determination means to be in a good communication state; a third calculation means for calculating a communication delay time based on the first differential time and the second differential time; an adjustment means for adjusting the time of a clock of the communication device based on the reception time and transmission time of the received packet and the communication delay time, or based on the reception time and transmission time of the transmitted packet and the communication delay time; A communication device comprising: (Configuration 2) the receiving means receives a reception packet from the time distribution server a plurality of times, 2. The communication device according to configuration 1, wherein the transmitting means transmits a transmission packet to the time distribution server a plurality of times. (Configuration 3) the receiving means receives reception packets from the time distribution server a plurality of times within a certain period of time, 3. The communication device according to claim 2, wherein the transmitting means transmits a transmission packet to the time distribution server a plurality of times during the given period. (Configuration 4) the first calculation means calculates a first differential time between the reception time and transmission time of a received packet determined by the determination means to have the best communication state among the plurality of received packets; The communication device according to configuration 2 or 3, wherein the second calculation means calculates a second differential time between the reception time and the transmission time of a transmission packet that is determined by the determination means to have the best communication state among the plurality of transmission packets. (Configuration 5) the transmitting means, upon receiving the reception packet, transmits the transmission packet; The communication device according to configuration 1, wherein the second calculation means calculates a second differential time between the reception time and transmission time of a transmission packet determined by the determination means to be in a good communication state when the communication state of a transmission packet subsequent to the reception packet determined by the determination means to be in a good communication state is determined to be good. (Configuration 6) 6. The communication device according to any one of configurations 1 to 5, wherein the received packet and the transmitted packet are PTP packets. (Configuration 7) the received packet is a Sync message, 7. The communication device according to configuration 6, wherein the transmission packet is a Delay-Request message. (Configuration 8) the Sync message includes a transmission time of the clock of the time distribution server at the time when the time distribution server transmitted the Sync message; 8. The communication device according to claim 7, wherein the first acquisition means acquires the transmission time of the clock of the time distribution server when the time distribution server transmits the Sync message. (Configuration 9) the receiving means receives a Follow-Up message from the time distribution server, the Follow-Up message includes the transmission time of the clock of the time distribution server at the time when the time distribution server transmitted the Sync message; 8. The communication device according to claim 7, wherein the first acquisition means acquires the transmission time of the clock of the time distribution server when the time distribution server transmits the Sync message. (Configuration 10) the receiving means receives a Delay-Response message from the time distribution server, the Delay-Response message includes the reception time of the clock of the time distribution server when the time distribution server received the Delay-Request message, The communication device according to any one of configurations 7 to 9, wherein the second acquisition means acquires the reception time of the clock of the time distribution server when the time distribution server receives the Delay-Request message. (Configuration 11) 11. The communication device according to any one of configurations 1 to 10, wherein the determining means determines the communication state by comparing at least one of radio wave intensity, number of retransmissions, and noise ratio in wireless communication with a threshold value. (Configuration 12) further comprising a detection means for detecting a change in the communication environment; 12. The communication device according to any one of configurations 1 to 11, wherein, when the detection means detects a change in the communication environment, the receiving means receives the received packet, the first acquisition means acquires the transmission time of the clock of the time distribution server and the reception time of the clock of the communication device, the transmitting means transmits the transmitted packet, the second acquisition means acquires the transmission time of the clock of the communication device and the reception time of the clock of the time distribution server, the determination means determines the communication state, the first calculation means calculates the first differential time, the second calculation means calculates the second differential time, and the third calculation means calculates the communication delay time. (Configuration 13) The communication device according to configuration 12, wherein the detection means detects a change in the communication environment when there is a change in the wireless channel, a change in the connected access point, or a change in the connected base station. (Configuration 14) The communication device according to configuration 12, wherein the detection means detects a change in the communication environment when the difference between the communication delay time calculated by the third calculation means and the previous communication delay time exceeds a threshold value for a certain period of time or a certain number of times. (Method 1) A processing method for a communication device, comprising: a receiving step of receiving a reception packet from a time distribution server; a first acquisition step of acquiring a transmission time of the clock of the time distribution server when the time distribution server transmits the received packet and a reception time of the clock of the communication device when the communication device receives the received packet; a transmitting step of transmitting a transmission packet to the time distribution server; a second acquisition step of acquiring a transmission time of the clock of the communication device when the communication device transmits the transmission packet and a reception time of the clock of the time distribution server when the time distribution server receives the transmission packet; a determining step of determining a communication state when the received packet was received and a communication state when the transmitted packet was transmitted; a first calculation step of calculating a first differential time between a reception time and a transmission time of a received packet determined to be in a good communication state by the determination step; a second calculation step of calculating a second differential time between the reception time and the transmission time of a transmission packet determined to be in a good communication state in the determination step; a third calculation step of calculating a communication delay time based on the first differential time and the second differential time; an adjusting step of adjusting the time of a clock of the communication device based on the reception time and transmission time of the received packet and the communication delay time, or the reception time and transmission time of the transmitted packet and the communication delay time; A processing method for a communication device, comprising: (Program 1) A program for causing a computer to function as the communication device according to any one of the first to fourteenth aspects. [Explanation of symbols]

[0127] 301 receiving unit, 302 transmitting unit, 303 time stamping unit, 304 communication status determining unit, 305 first calculating unit, 306 second calculating unit, 307 third calculating unit, 308 time adjusting unit, 309 communication delay time managing unit, 310 communication environment change detecting unit

Claims

1. A communication device, receiving means for receiving a reception packet from a time distribution server; a first acquisition means for acquiring a transmission time of a clock of the time distribution server when the time distribution server transmits the received packet and a reception time of a clock of the communication device when the communication device receives the received packet; a transmitting means for transmitting a transmission packet to the time distribution server; a second acquiring means for acquiring a transmission time of a clock of the communication device when the communication device transmits the transmission packet and a reception time of a clock of the time distribution server when the time distribution server receives the transmission packet; a determination means for determining a communication state when the received packet is received and a communication state when the transmitted packet is transmitted; a first calculation means for calculating a first differential time between a reception time and a transmission time of a received packet determined by the determination means to be in a good communication state; a second calculation means for calculating a second differential time between the reception time and the transmission time of a transmission packet determined by the determination means to be in a good communication state; a third calculation means for calculating a communication delay time based on the first differential time and the second differential time; an adjustment means for adjusting the time of a clock of the communication device based on the reception time and transmission time of the received packet and the communication delay time, or the reception time and transmission time of the transmitted packet and the communication delay time; A communication device comprising:

2. the receiving means receives a reception packet from the time distribution server a plurality of times, 2. The communication device according to claim 1, wherein the transmitting means transmits a transmission packet to the time distribution server a plurality of times.

3. the receiving means receives reception packets from the time distribution server a plurality of times within a certain period of time, 3. The communication device according to claim 2, wherein the transmitting means transmits a transmission packet to the time distribution server a plurality of times during the fixed period.

4. the first calculation means calculates a first differential time between the reception time and transmission time of a received packet determined by the determination means to have the best communication state among the plurality of received packets; The communication device according to claim 2, characterized in that the second calculation means calculates a second differential time between the reception time and the transmission time of a transmission packet that is determined by the determination means to have the best communication state among the multiple transmission packets.

5. the transmitting means, upon receiving the reception packet, transmits the transmission packet; The communication device according to claim 1, characterized in that the second calculation means calculates a second differential time between the reception time and transmission time of a transmission packet determined by the determination means to be in a good communication state when the communication state of a transmission packet following a reception packet determined by the determination means to be in a good communication state is determined to be good.

6. 2. The communication device according to claim 1, wherein the received packet and the transmitted packet are PTP packets.

7. the received packet is a Sync message, 7. The communication device according to claim 6, wherein the transmission packet is a Delay-Request message.

8. the Sync message includes a transmission time of the clock of the time distribution server at the time when the time distribution server transmitted the Sync message; 8. The communication device according to claim 7, wherein the first acquisition means acquires the transmission time of the clock of the time distribution server when the time distribution server transmits the Sync message.

9. The receiving means receives a Follow-Up message from the time distribution server, the Follow-Up message includes the transmission time of the clock of the time distribution server at the time when the time distribution server transmitted the Sync message; 8. The communication device according to claim 7, wherein the first acquisition means acquires the transmission time of the clock of the time distribution server when the time distribution server transmits the Sync message.

10. the receiving means receives a Delay-Response message from the time distribution server, the Delay-Response message includes a reception time of the clock of the time distribution server when the time distribution server receives the Delay-Request message; 8. The communication device according to claim 7, wherein the second acquisition means acquires the reception time of the clock of the time distribution server when the time distribution server receives the Delay-Request message.

11. 2. The communication device according to claim 1, wherein the determining means determines the communication state by comparing at least one of radio wave intensity, number of retransmissions, and noise ratio in wireless communication with a threshold value.

12. further comprising a detection means for detecting a change in the communication environment; The communication device described in claim 1, characterized in that when the detection means detects a change in the communication environment, the receiving means receives the received packet, the first acquisition means acquires the transmission time of the clock of the time distribution server and the reception time of the clock of the communication device, the transmitting means transmits the transmitted packet, the second acquisition means acquires the transmission time of the clock of the communication device and the reception time of the clock of the time distribution server, the determination means determines the communication state, the first calculation means calculates the first differential time, the second calculation means calculates the second differential time, and the third calculation means calculates the communication delay time.

13. 13. The communication device according to claim 12, wherein the detection means detects a change in the communication environment when there is a change in the wireless channel, a change in the connected access point, or a change in the connected base station.

14. The communication device described in claim 12, characterized in that the detection means detects a change in the communication environment when the difference between the communication delay time calculated by the third calculation means and the previous communication delay time exceeds a threshold value for a certain period of time or a certain number of times.

15. A processing method for a communication device, comprising: a receiving step of receiving a reception packet from a time distribution server; a first acquisition step of acquiring a transmission time of the clock of the time distribution server when the time distribution server transmits the received packet and a reception time of the clock of the communication device when the communication device receives the received packet; a transmitting step of transmitting a transmission packet to the time distribution server; a second acquisition step of acquiring a transmission time of the clock of the communication device when the communication device transmits the transmission packet and a reception time of the clock of the time distribution server when the time distribution server receives the transmission packet; a determining step of determining a communication state when the received packet was received and a communication state when the transmitted packet was transmitted; a first calculation step of calculating a first differential time between a reception time and a transmission time of a received packet determined to be in a good communication state by the determination step; a second calculation step of calculating a second differential time between the reception time and the transmission time of a transmission packet determined to be in a good communication state in the determination step; a third calculation step of calculating a communication delay time based on the first differential time and the second differential time; an adjusting step of adjusting the time of a clock of the communication device based on the reception time and transmission time of the received packet and the communication delay time, or based on the reception time and transmission time of the transmitted packet and the communication delay time; A processing method for a communication device, comprising:

16. A program for causing a computer to function as the communication device according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Time synchronization device, time synchronization method, and time synchronization program

    JP2016225880A