Communication device, time correction method, and time correction program
The communication device addresses timing signal jumps by adjusting device time based on reception time differences, using large and small corrections to synchronize accurately and prevent jumps, enhancing time synchronization in timing-sensitive networks.
Patent Information
- Application Number
- JP2022068445
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2022-04-18
- Publication Date
- 2025-10-20
- Estimated Expiration
- 2042-04-18
AI Technical Summary
Existing communication devices synchronize their time based on received information, leading to potential timing signal jumps, especially when time information is significantly off, which can cause communication or device operation issues in timing-sensitive devices.
A communication device with a time synchronization unit that determines whether to synchronize or correct the device time based on the difference between the device time and reception time, making corrections to prevent time jumps by adjusting the device time to approach the reception time within a threshold, using both large and small corrections based on timing signal periods.
The solution allows for quick synchronization of time while suppressing timing signal jumps, ensuring accurate time synchronization without exceeding a preset threshold, even with significant time discrepancies.
Smart Images

Figure 0007756593000001 
Figure 0007756593000002 
Figure 0007756593000003
Abstract
Description
[Technical Field]
[0001] The present disclosure relates to a communication device, a time correction method, and a time correction program. [Background technology]
[0002] gPTP is a communications protocol for synchronizing time between devices over a network. gPTP is specified in IEEE802.1AS-2020. gPTP is an abbreviation for generalized Precision Time Protocol. gPTP exchanges control frames between adjacent devices to measure propagation delays in tree structures or between devices, frame residence times within devices, and distribute other time information, thereby achieving time synchronization with sub-microsecond accuracy between devices.
[0003] Patent Document 1 discloses a method for detecting and correcting a significant time jump caused by path switching in a BC device with two or more input paths. BC is an abbreviation for Boundary Clock. The BC device is a network device that relays communication frames. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] Japanese Patent Application Publication No. 2019-158538 Summary of the Invention [Problem to be solved by the invention]
[0005] Devices that operate according to a protocol usually synchronize their time by relying on the time information received from the previous device. Therefore, even if the received time information is significantly off, the device will synchronize to that time. Furthermore, devices connected to a network include timing-sensitive devices such as wireless devices and factory automation equipment. If such devices communicate or control using periodic timing signals generated based on synchronized time, time jumps can cause timing signal jumps, which can cause problems with communication or device operation.
[0006] Patent Document 1 describes a method for correcting time jumps within a predetermined time, but there is a problem in that it is not possible to suppress jumps in timing signals.
[0007] The present disclosure aims to quickly synchronize the time while suppressing timing signal jumps. [Means for solving the problem]
[0008] A communication device according to the present disclosure includes: A communication device that synchronizes a device time, which is a time that the device time is stored in, with the time of another communication device connected via a network, The device is provided with a time synchronization unit that determines whether to synchronize the device time with the reception time or to correct the device time based on the difference between the device time and the reception time of the time message transmitted from the other communication device, and if it is determined that the device time should be corrected, corrects the device time to approach the reception time so that no time jump occurs in the transmission timing of the timing signal that is transmitted periodically based on the device time. [Effects of the Invention]
[0009] In a communication device according to the present disclosure, if there is a difference in the received time that is equal to or greater than a set threshold, the time is corrected instead of being updated based on the received time. Thus, the communication device according to the present disclosure can quickly synchronize the time while suppressing timing signal differences. [Brief explanation of the drawings]
[0010] [Figure 1] FIG. 3 is a basic sequence diagram of time synchronization in the communication device according to the first embodiment. [Figure 2] FIG. 10 is a diagram illustrating an example in which the device time is slower than the normal time. [Figure 3] FIG. 10 is a diagram illustrating an image of a jump occurring in a timing signal when a time jump occurs. [Figure 4] FIG. 2 is a diagram showing an example of the functional configuration of a communication device according to the first embodiment. [Figure 5] FIG. 2 is a diagram showing an example of a hardware configuration of a communication device according to the first embodiment. [Figure 6] 4 is a flowchart showing the operation of the communication device according to the first embodiment. [Figure 7] FIG. 2 is a diagram showing an image of large correction in the time correction method according to the first embodiment. [Figure 8] FIG. 10 is a diagram showing an image of small corrections made by the time correction method according to the first embodiment. [Figure 9] In the communication device according to the first embodiment, the time jumps into the future and is corrected to be closer to the current time. [Figure 10] In the communication device according to the first embodiment, the time jumps into the future, and the time is corrected to a time further away from the current time. [Figure 11] In the communication device according to the first embodiment, the time jumps to the past and is corrected to be closer to the current time. [Figure 12] In the communication device according to the first embodiment, the time jumps to the past, and correction is made to the side farther away from the current time. DETAILED DESCRIPTION OF THE INVENTION
[0011] The present embodiment will be described below with reference to the drawings. In each drawing, the same or corresponding parts are assigned the same reference numerals. In the description of the embodiment, the description of the same or corresponding parts will be omitted or simplified as appropriate. The arrows in the drawings mainly indicate the flow of data or the flow of processing.
[0012] Embodiment 1 FIG. 1 is a basic sequence diagram of time synchronization in a communication system 500 including a communication device 10 according to this embodiment. Using FIG. 1, gPTP in a communication system 500 according to this embodiment will be described.
[0013] A communication device 10 according to this embodiment is connected to other communication devices 10 via a network. Each of the GM, BC, and end node is an example of a communication device 10. Figure 1 shows the flow of BC synchronizing with GM. BC is an abbreviation for Boundary Clock, and is a network device that relays communication frames. GM is an abbreviation for Grand Master, and is a device that has a highly accurate clock and distributes time. The GM is the time source for a time synchronization system.
[0014] There are six types of control frames used in gPTP: ·Announce: Although not shown in Figure 1, this notifies information such as the priority information of the communication device itself or the number of hops from the GM. Pdelay_Req: This frame notifies the start of propagation delay measurement. L1 ) is recorded by the communication device. Pdelay_Resp: A frame that is automatically returned by a communication device that receives a Pdelay_Req. The time at which the Pdelay_Req is received (t in Figure 1) G2 The communication device that receives this message (the sender of Pdelay_Req) records the time when this message was received (t in Figure 1). L4 ). Pdelay_Resp_FollowUp: Always sent immediately after Pdelay_Resp, and the exact time of Pdelay_Resp (t in Figure 1) G3 ) to notify. ·Sync: A frame that delivers time information. · Follow_Up: Always sent immediately after a Sync frame, and delivers the correct time in conjunction with the Sync frame.
[0015] Time synchronization is achieved through the exchange of the six types of control frames described above in the following three-step process. (1) Determining the time distribution route Each communication device sends an Announce message to its neighboring communication devices (hereafter referred to as neighboring devices), and based on that information, an algorithm called BMCA is used to determine the priority of each communication device and the time distribution route. BMCA is an abbreviation for Best Master Clock Algorithm. (2) Delay measurement between adjacent devices The delay between adjacent devices is calculated based on the timestamp information collected through the exchange of Pdelay_Req / Pdelay_Resp / Pdelay_Resp_FollowUp. In Figure 1, the BC measures the delay with the GM, but in reality, each communication device always does this. (3) Distribution of time information The GM determined by the BMCA sends a Sync / Follow_Up containing the time information of its own communication device. Each communication device on the time distribution path below the GM updates its own communication device's time with the value of the received time information plus the delay obtained by delay measurement, and distributes that time to subsequent communication devices.
[0016] In this way, after the time distribution route is determined, each communication device relays the Sync / Follow_Up frame while adding a delay to the time information from the GM, which enables time synchronization among all gPTP-compatible BCs and gPTP-compatible end nodes within the network.
[0017] Communication devices that operate according to the above protocol typically synchronize their time by relying on the time information received from the preceding device. Therefore, even if the received time information is significantly out of sync, they will synchronize to that time. In this case, if a timing-sensitive device communicates or controls using a periodic timing signal generated based on the synchronized time, timing signal skips may occur, potentially causing communication or device operation problems. Even when a system is operating normally, slight time jumps due to timestamp stamping errors are unavoidable. For example, in a device operating at 125 MHz, the timestamp granularity is 8 ns, so there is an error of ±8 ns each time a timestamp is acquired. However, networks are usually designed with slight time jumps and other errors in mind, so this does not cause any problems.
[0018] However, there are other factors that can cause the time to jump, and the following two factors in particular can cause the time to jump significantly. (a) When the GNSS synchronization status of the GM recovers after being degraded for a long time. GNSS is an abbreviation for Global Navigation Satellite System. A representative example of GNSS is GPS. GPS is an abbreviation for Global Positioning System. (b) When recovering from a long period of isolation from the network due to factors such as a broken communication cable
[0019] In the case of (a) above, the GM normally synchronizes with GNSS with high precision and distributes that time information to the network. However, if synchronization with GNSS is interrupted for an extended period due to the antenna installation environment or weather, the GM will operate independently using the clock of its own communication device. Because clocks have deviations, the longer the independent time, the greater the divergence between the GM time and the GNSS time. This means that if the GM regains synchronization after operating independently for a long period of time, the time may jump significantly. Regarding (b) above, similar to (a), if a BC loses network connection with the previous stage and runs independently for a long time, a time difference due to clock deviation will accumulate between the previous stage and the BC. As a result, when the connection is restored, the time of the tree below that BC may jump significantly.
[0020] FIG. 2 is a diagram showing an image of a case where the time of the own communication device is later than the normal time to be referenced. FIG. 3 is a diagram showing an image of a jump occurring in a timing signal when a time jump occurs.
[0021] ***Configuration Description*** FIG. 4 is a diagram illustrating an example of a functional configuration of the communication device 10 according to the present embodiment. The communication device 10 includes a communication interface unit 11, a communication interface unit 12, an L2 protocol unit 13, and a time synchronization unit 14. The time synchronization unit 14 includes a PTP parameter calculation unit 141, a jump width calculation unit 142, a correction calculation unit 143, a time management unit 144, and a timing signal generation unit 145. The communication interface unit may be one or three or more.
[0022] The communication interface units 11 and 12 are interfaces for transmitting and receiving communication frames to and from adjacent devices. The frames received by the communication interface units 11 and 12 are analyzed by the L2 protocol unit 13. The L2 protocol unit 13 has a function of analyzing information on the data link layer of Layer 2 of the OSI reference model. OSI is an abbreviation for Open Systems Interconnection. The L2 protocol unit 13 analyzes Ethernet (registered trademark) frames and passes information on gPTP control frames required for time synchronization to the time synchronization unit 14. The information on the gPTP control frames includes various parameter information, a reception timestamp acquired by the communication interface units 11 and 12 or the L2 protocol unit 13, and a transmission timestamp.
[0023] The time synchronization unit 14 calculates the time at which the communication device 10 will synchronize based on the information received from the L2 protocol unit 13, and generates a timing signal based on that time. The PTP parameter calculation unit 141 calculates the time using gPTP. The time management unit 144 holds the time of its own communication device and advances the time of its own communication device while correcting the time based on the clock ratio with GM obtained by calculation. In addition, the time held by the time management unit 144 can be passed to the L2 protocol unit 13, stored in a gPTP control frame, and transmitted from the communication interface units 11 and 12 to adjacent devices.
[0024] The jump width calculation unit 142 calculates the time jump width based on the time calculated by the PTP parameter calculation unit 141 and the time held by the time management unit 144. In the following, the time calculated by the PTP parameter calculation unit 141 is referred to as the reception time, and the time held by the time management unit 144 is referred to as the device time.
[0025] Based on the result of the jump width calculation unit 142, the correction calculation unit 143 determines whether to synchronize the device time with the reception time or to perform a correction on the device time. The timing signal generation unit 145 generates a timing signal based on the time information, i.e., the device time, of the time management unit 144. The timing signal output of this timing signal generation unit 145 is connected to a location (module) outside or inside the communication device 10 that requires a timing signal.
[0026] FIG. 5 is a diagram illustrating an example of a hardware configuration of the communication device 10 according to the present embodiment. The communication device 10 is a computer. The communication device 10 can be realized by a processor 101, a memory 102, and data transfer hardware 104. The processor 101, the memory 102, and the data transfer hardware 104 are connected via a bus 103.
[0027] The processor 101 is a CPU, a system LSI, or the like. CPU is an abbreviation for Central Processing Unit. CPU is also called a central processing unit, processing unit, arithmetic unit, processor, microprocessor, microcomputer, or DSP. DSP is an abbreviation for Digital Signal Processor. Furthermore, LSI is an abbreviation for Large Scale Integration. The memory 102 is a non-volatile or volatile semiconductor memory such as RAM, ROM, flash memory, EPROM, or EEPROM. Alternatively, the memory 102 is a magnetic disk, flexible disk, optical disk, compact disk, minidisk, or DVD. RAM is an abbreviation for Random Access Memory. ROM is an abbreviation for Read Only Memory. EPROM is an abbreviation for Erasable Programmable Read Only Memory. EEPROM is an abbreviation for Electrically Erasable Programmable Read-Only Memory. DVD is an abbreviation for Digital Versatile Disc.
[0028] The communication interface units 11 and 12 are realized by data transfer hardware 104 . The L2 protocol unit 13 and the time synchronization unit 14 are realized by hardware, software, firmware, or a combination thereof.
[0029] The software and firmware are written as programs and stored in memory 102 . The L2 protocol unit 13 and the time synchronization unit 14 may be realized by software or firmware. The L2 protocol unit 13 and the time synchronization unit 14 are realized by the processor 101 reading from the memory 102 and executing programs for operating as the L2 protocol unit 13 and the time synchronization unit 14, respectively. That is, the communication device 10 includes the memory 102 for storing programs that, when the functions are executed by the processor 101, result in the execution of steps for implementing the operations of the L2 protocol unit 13 and the time synchronization unit 14. Furthermore, these programs cause a computer to execute the various processes performed by the L2 protocol unit 13 and the time synchronization unit 14.
[0030] The program according to this embodiment is also referred to as a time correction program. Data, information, signal values, and variable values used, processed, or output by the time correction program are stored in memory, or in a register or cache memory within the processor.
[0031] The "part" of each part of the L2 protocol unit 13 and the time synchronization unit 14 may be interpreted as a "circuit," "step," "procedure," "process," or "circuitry." The time correction program causes a computer to execute various processes of each part of the L2 protocol unit 13 and the time synchronization unit 14. The "processing" of various processes of each part of the L2 protocol unit 13 and the time synchronization unit 14 may be interpreted as a "program," "program product," "computer-readable storage medium storing a program," or "computer-readable recording medium recording a program." Furthermore, the time correction method is a method performed by the communication device 10 executing the time correction program. The time correction program may be provided by being stored on a computer-readable recording medium, or may be provided as a program product.
[0032] The L2 protocol unit 13 and the time synchronization unit 14 may be realized by dedicated hardware. The dedicated hardware may be a single circuit, a composite circuit, a programmed processor, a parallel programmed processor, an ASIC, an FPGA, or a combination thereof. ASIC is an abbreviation for Application Specific Integrated Circuit. FPGA is an abbreviation for Field Programmable Gate Array. One of the L2 protocol unit 13 and the time synchronization unit 14 may be realized by dedicated hardware, and the other may be realized by the processor 101 and memory 102.
[0033] Each of the processor and the dedicated hardware electronic circuit is also called processing circuitry. That is, the functions of the communication device 10 are realized by the processing circuitry.
[0034] ***Explanation of Operation*** Next, a description will be given of the time correction process, which corresponds to the operation of communication device 10 according to this embodiment. The operation procedure of communication device 10 corresponds to a time correction method. Furthermore, the program that realizes the operation of communication device 10 corresponds to a time correction program.
[0035] The communication device 10 according to the present embodiment synchronizes the device time, which is the time it holds, with the time of other communication devices connected via a network.
[0036] FIG. 6 is a flowchart showing the time correction process of the communication device 10 according to the present embodiment. For simplicity, the calculations in the flowchart are written using the following parameters and functions.
[0037] <Parameters used> T:Current time T': Reception time Δ: Time jump width (T'-T) σ: Timing signal jump tolerance (threshold) I: Delivery cycle of PTP time message (Sync). Extracted from the Sync message header. P: Timing signal period TNext: Output time of the next timing signal
[0038] <Functions used> Function Q(a,b): A function that returns the quotient of a÷b (Quotient) Function sgn(x): Sign function. =-1(x<0), =0(x=0), =1(x>0)
[0039] The outline of the processing from step S101 to step S104 is as follows. The time synchronization unit 14 of the communication device 10 determines whether to synchronize the device time with the reception time or correct the device time based on the difference Δ between the device time and the reception time of a time message transmitted from another communication device. If it is determined that the device time should be corrected, the time synchronization unit 14 corrects the device time so that it approaches the reception time so that no time jump occurs in the transmission timing of the timing signal that is periodically transmitted based on the device time. The time synchronization unit 14 determines that the device time should be corrected if the difference between the device time and the reception time exceeds a preset threshold. Specifically, the process is as follows: Steps S101 to S104.
[0040] In step S101, the PTP parameter calculation unit 141 of the communication device 10 determines whether or not it has received the time from another communication device for the first time. If it has received the time for the first time, proceed to step S102. If it has not received the time for the first time, proceed to step S103.
[0041] In step S102, the time management unit 144 of the communication device 10 synchronizes the device time with the reception time calculated by the PTP parameter calculation unit 141.
[0042] In step S103 (if the time is received for the second or subsequent time), the jump calculation unit 142 of the communication device 10 calculates the time jump Δ by subtracting the device time T from the reception time T'. The time may jump to the past. If the time jumps to the past, the time jump will be a negative number.
[0043] In step S104, the jump calculation unit 142 determines whether the absolute value of the jump exceeds a preset threshold value. If the threshold value is not exceeded, the process proceeds to step S102. If the threshold value is exceeded, the process proceeds to step S105. That is, if the difference (absolute value of the jump width) exceeds a preset threshold σ, the device time is corrected. If the difference (absolute value of the jump width) is equal to or less than the threshold σ, the device time is synchronized with the reception time.
[0044] In step S105, the correction calculation unit 143 of the communication device 10 notifies the exceedance of the threshold. For example, the correction calculation unit 143 notifies another function block that uses the device time of the exceedance of the threshold. The other function block that uses the device time can determine that there is a discrepancy in the device time when there is an excess notification, but that there is no discrepancy in the device time when there is no excess notification. This allows the other function block that uses the device time to detect an abnormality.
[0045] The outline of the processing from step S106 to step S108 is as follows. When it is determined that the device time should be corrected, the time synchronization unit 14 performs a first correction on the device time in units of multiples of the period of the timing signal, as a correction to prevent time jumps from occurring in the transmission timing. If the difference between the device time and the reception time exceeds the threshold value σ after the first correction, the time synchronization unit 14 performs a second correction using a correction amount calculated to reduce the difference between the device time and the reception time. The time synchronization unit 14 repeats the second correction until the difference between the device time and the reception time becomes equal to or less than the threshold value σ.
[0046] For example, the time synchronization unit 14 determines the closest multiple of the reception time among the times that are multiples of the period of the timing signal from the device time. Next, the time synchronization unit 14 determines whether the closest multiple is the smaller or larger multiple of two times that sandwich the reception time. Then, the time synchronization unit 14 performs at least one of a first correction and a second correction on the device time depending on the determination result. Specifically, the process is as follows: Steps S106 to S108.
[0047] In step S106, the correction calculation unit 143 determines whether the absolute value of the jump is closer to the smaller multiple between the timing signal period and the timing signal period. Specifically, if the timing signal period is 10 seconds and the absolute value of the time jump is 27 seconds, this value is larger than 25 seconds, which is intermediate between 20 seconds (double) and 30 seconds (triple), and therefore it is determined that 30 seconds is the closer value. If the result of the determination is that it is closer to the smaller multiple, the process proceeds to step S107. If the result of the determination is that it is closer to the larger multiple, the process proceeds to step S108.
[0048] The correction calculation unit 143 calculates the amount of correction from the received Δ and parameter information, and passes it along with a correction instruction to the time management unit 144 and timing signal generation unit 145. The correction instruction is realized, for example, by setting a flag. The correction calculation unit 143 calculates a series of correction amounts such as sgn(Δ), P, Q(|Δ|, P), and σI / P to be used in the calculations in the next step S107 or step S108.
[0049] If there is no correction instruction, the time management unit 144 counts up the time using the clock of the device itself to advance the device time. On the other hand, if there is a correction instruction, the time management unit 144 corrects the device time T using the correction amount. The timing signal generator 145 also holds the next timing signal output time (TNext) and constantly references and compares it with the device time (T). If these two times match, it outputs a timing signal and updates the timing signal output time (TNext) (by adding P), and if a correction instruction is given, it updates TNext based on the amount of correction. Specifically, it is as follows:
[0050] In step S107, if a correction instruction is given, the time management unit 144 performs the following calculation. The period (P) of the timing signal is multiplied by the calculated multiple (the result of function Q), and then a correction term (σI / P) is added, which is calculated by multiplying the threshold (σ) by the Sync period (I) and dividing the result by the timing period (P). The total is multiplied by the sign of the jump width (sgn(Δ)), and the result is added to the current device time (T), which becomes the new device time (T).
[0051] Furthermore, if a correction instruction is received, the timing signal generating unit 145 performs the following calculation. The next timing signal output time (TNext) is calculated by multiplying the timing signal period (P) by the calculated multiple (the result of function Q), multiplying this by the sign of the jump width (sgn(Δ)), and adding the result to the next timing signal output time (TNext).
[0052] In step S108, if a correction instruction is given, the time management unit 144 performs the following calculation. The period of the timing signal is multiplied by the calculated multiple (the result of the function Q) plus 1, and the same correction term (σI / P) as in step S107 is subtracted therefrom. The total is multiplied by the sign of the jump width (sgn(Δ)), and the result is added to the current device time (T), which becomes the new device time (T).
[0053] Furthermore, if a correction instruction is received, the timing signal generating unit 145 performs the following calculation. The next timing signal output time (TNext) is multiplied by the timing signal period (P) plus 1 (the result of function Q), and then multiplied by the sign of the jump width (sgn(Δ)). This is the output time of the next timing signal (TNext).
[0054] Next, an image of the time correction method according to this embodiment will be explained using FIGS.
[0055] FIG. 7 is a diagram showing an image of a large correction (first correction) in the time correction method according to this embodiment. FIG. 8 is a diagram showing an image of a small correction (second correction) in the time correction method according to this embodiment.
[0056] In Figure 7, the time until the output of the next timing signal at the time a time jump occurs is designated as a. In the time correction method according to this embodiment, correction is performed so as not to disrupt this relationship. To this end, in step S106, the magnitude relationship between the time jump width and a multiple of the timing signal period is compared.
[0057] In the case of Figure 7, the time jump Δ is closer to 3P than 2P + (1 / 2)P. Therefore, 3P is added to the current device time. In this way, if the time jump exceeds the timing signal period P, a "large correction" is made by a multiple of the timing signal period P. After the "large correction" is made, the difference between the received time and the current device time is smaller than the timing signal period P.
[0058] Figure 7 is an explanatory diagram of a time correction method for a "large correction" when a time jump occurs as shown in Figure 10. Figure 7 shows an image of a time jump into the future, with the correction being made farther away from the current time. For example, if the time is (t1) and a time (t2) that is significantly ahead is received, the time is updated to (t4) instead of (t2) by the correction in the upper part of step S108. In this embodiment, the objective is to "prevent timing signal jumps." To achieve this, the device time is updated to (t4), a time when the time until the next timing signal output (a in FIG. 7) is equal and close to the actual reception time (t2). When this first large jump occurs, correction is made using two correction terms: a large correction term (P×Q(a,b)) and a small correction term (σI / P). Because the small correction term is smaller than the large correction term, "3P" is written in FIG. 7, but the correct time at (t4) is actually "3P-σI / P."
[0059] Even after the correction for the first large time jump shown in Figure 7, a correction calculation is performed each time the time is received. However, because the positional relationship between the reception time and the device time is close to (t2) and (t4), the calculation result of "Q(a,b)" during the large correction is always 0, and the time difference is P / 2 or less. Therefore, after a large correction is performed once, the calculation block of step S107 shown in Figure 6 is entered every time the time is received, and only "small corrections" are repeated. In this way, since the "large correction" component (P×Q(a,b)) of the equation in the upper processing of step S107 (or the upper processing of step S108) is 0, only the correction by the small correction term (σI / P) that follows it is applied. This value is the time jump threshold divided by the timing signal period and multiplied by the Sync period, and is the maximum amount of correction that can be made in one Sync reception.
[0060] Figure 8 shows how these small corrections are repeated, starting from the point enclosed by the dotted line in part B of Figure 7 and showing the subsequent behavior. First, as a result of the "large correction," the time is updated from (t1) to (t4) in Figure 7. Figure 8 shows the time after this update. In Figure 8, the next time the time is received, it will be the "corrected current time" (t4), and in that state the "received time" (t2) will be received. To be precise, these are times slightly ahead of (t4) and (t2), respectively, and are the times when Sync was received. At this point, since (t4) has been subjected to a "large correction," the absolute value (|Δ|) of the time difference between (t4) and (t2) is less than P / 2, and the calculation proceeds to step S107. For this reason, whether it is step S107 or step S108, once a "large correction" has been received, the calculation always proceeds to step S107 and a "small correction" is applied.
[0061] 6 does not include steps S106 and S108, and step S107 alone is effective in suppressing timing jumps. However, by having the option of step S107 or step S108 in "large correction," in addition to suppressing timing jumps, it has the effect of speeding up the catching-up of the current time with the reception time.
[0062] 9 to 12 are diagrams showing an image of the time correction method according to this embodiment. 9 to 12 show an image of time correction when a large time jump occurs that is greater than the timing signal period.
[0063] Figure 9 shows an image of the time jumping into the future and being corrected closer to the present time. In FIG. 9, the correction is as follows: (1) The device time is corrected closer to the current time by the large correction (first correction). (2) Small corrections (second corrections) are made to gradually bring the device time closer to the received time. (3) Synchronize when the difference between the received time and the device time is less than the threshold.
[0064] Figure 10 shows an image of the time jumping into the future and correcting it to a position farther away from the current time. In FIG. 10, the correction is as follows: (1) The device time is corrected to the far side from the current time by the large correction (first correction). (2) Small corrections (second corrections) are made to gradually bring the device time closer to the received time. (3) Synchronize when the difference between the received time and the device time is less than the threshold.
[0065] Figure 11 shows an image of the time jumping back in time and then being corrected closer to the current time. In FIG. 11, the correction is as follows: (1) The device time is corrected closer to the current time by the large correction (first correction). (2) Small corrections (second corrections) are made to gradually bring the device time closer to the received time. (3) Synchronize when the difference between the received time and the device time is less than the threshold.
[0066] FIG. 12 shows an image of time jumping back in time and correcting it to a time further away from the current time. In FIG. 12, the correction is as follows. (1) The device time is corrected to the far side from the current time by the large correction (first correction). (2) Small corrections (second corrections) are made to gradually bring the device time closer to the received time. (3) Synchronize when the difference between the received time and the device time is less than the threshold.
[0067] The time correction process according to this embodiment can be rephrased as follows. A communication device synchronizes its own time (device time) with the time (reception time) of another communication device connected via a network. The communication device includes a communication interface unit, an L2 protocol processing unit, and a time synchronization unit. The communication device also has a function to generate a periodic timing signal based on the synchronized device time. The time synchronization unit determines whether to synchronize with the reception time or to correct it based on the difference between the device time it holds and the received time. If it is determined that correction is to be made, the communication device corrects its own device time so that it approaches the reception time within a range in which the timing signal does not exceed a preset threshold. Specifically, the time synchronization unit continues to correct the device time while the difference exceeds the threshold, and synchronizes with the reception time only when the difference becomes equal to or less than the threshold.
[0068] In addition, when a time message is received, the time synchronization unit corrects the device time without skipping a timing signal by first making a large-granularity correction in units of multiples of the timing signal period to address the difference (time jump) between the received time and the device time. If the time difference after this correction still exceeds the threshold, the time synchronization unit then performs fine-grained correction using a correction amount calculated based on the difference, various setting parameters such as the timing signal period and the allowable jump threshold, and the PTP parameters extracted from the PTP frame. This provides the function of quickly synchronizing the device time even with large time jumps without causing jumps in the timing signal that exceed the threshold.
[0069] ***Explanation of the effect of this embodiment*** As described above, in the communication device according to this embodiment, if there is a time jump exceeding a set threshold when receiving the time, the timing signal jump is suppressed by making a correction. In a communication device according to this embodiment, when time information (Sync, Follow_Up) is received, the device compares the received time with the device's current time to determine whether it exceeds a preset threshold. If it does not, the device updates the time according to normal gPTP. If the threshold is exceeded and there is a gap of more than the timing signal period, the device updates the time to the time closest to the received time and without changing the time until the next timing signal output by adding a constant multiple of the timing signal period to the current time and the timing signal generation time. If the threshold is exceeded but the gap is less than the timing signal period, the device adds the maximum correction amount that can be updated in one time update, calculated from the threshold and the timing signal period.
[0070] In this way, the communication device according to this embodiment uses both a "large correction" based on a multiple of the timing signal period and a "small correction" for each Sync reception. This makes it possible to quickly synchronize the time when there is a large jump in the reception time without the timing signal jumping by more than the set threshold. Therefore, according to the communication device of this embodiment, when a device that is connected to a time synchronization network and generates a timing signal based on synchronized time receives a time that is significantly different from the current time, time synchronization can be performed quickly without causing a large jump in the timing signal. Furthermore, the communication device according to this embodiment can be applied to wireless base stations, mobile wireless base stations, factory automation, IP broadcasting, smart grids, and other applications indicated by the Time-Sensitive Networking (TSN) Task Group.
[0071] In the above-described first embodiment, each unit of the communication device has been described as an independent functional block. However, the configuration of the communication device does not have to be the same as that of the above-described embodiment. The functional blocks of the communication device may have any configuration as long as they can realize the functions described in the above-described embodiment. Furthermore, the communication device may not be a single device, but may be a system made up of multiple devices. Furthermore, it is possible to combine multiple parts of the first embodiment. Alternatively, it is possible to implement only one part of this embodiment. In addition, it is possible to implement this embodiment in any combination, either as a whole or in part. That is, in the first embodiment, the embodiments can be freely combined, or any of the components in each embodiment can be modified, or any of the components in each embodiment can be omitted.
[0072] The above-described embodiments are essentially preferred examples and are not intended to limit the scope of the present disclosure, the scope of application of the present disclosure, or the scope of use of the present disclosure. The above-described embodiments can be modified in various ways as needed. For example, the procedures described using flow charts or sequence diagrams may be modified as appropriate. [Explanation of symbols]
[0073] 10 communication device, 11, 12 communication interface unit, 13 L2 protocol unit, 14 time synchronization unit, 141 PTP parameter calculation unit, 142 jump width calculation unit, 143 correction calculation unit, 144 time management unit, 145 timing signal generation unit, 101 processor, 102 memory, 103 bus, 104 data transfer hardware.
Claims
1. A communication device that synchronizes a device time, which is a time that the device time is stored in, with the time of another communication device connected via a network, A communication device having a time synchronization unit that determines whether to synchronize the device time with the reception time or to correct the device time based on the difference between the device time and the reception time of a time message sent from the other communication device, and if it is determined that the device time should be corrected, corrects the device time to bring it closer to the reception time so that no time jump occurs in the transmission timing of a timing signal that is transmitted periodically based on the device time.
2. The time synchronization unit The communication device according to claim 1 , wherein the device time is determined to be corrected when a difference between the device time and the reception time exceeds a preset threshold value.
3. The time synchronization unit The communication device described in claim 2, wherein when it is determined that a correction should be made to the device time, a first correction is made to the device time in units of a multiple of the period of the timing signal, as a correction to prevent a time jump from occurring in the transmission timing.
4. The time synchronization unit 4. The communication device according to claim 3, wherein, if after the first correction, the difference between the device time and the reception time exceeds the threshold, a second correction is performed using a correction amount calculated so as to reduce the difference between the device time and the reception time, and the second correction is repeated until the difference between the device time and the reception time becomes equal to or less than the threshold.
5. A time correction method used in a communication device that synchronizes a device time, which is a time that the device time is stored in, with the time of another communication device connected via a network, comprising: A time correction method in which a computer determines whether to synchronize the device time with the reception time or correct the device time based on the difference between the device time and the reception time of a time message sent from the other communication device, and if it is determined that the device time should be corrected, corrects the device time to approach the reception time so that no time jump occurs in the transmission timing of a timing signal that is transmitted periodically based on the device time.
6. A time correction program used in a communication device that synchronizes a device time, which is a time that the device time is stored in, with the time of another communication device connected via a network, comprising: A time correction program that causes a computer to execute a time synchronization process that determines whether to synchronize the device time with the reception time or to correct the device time based on the difference between the device time and the reception time of a time message sent from the other communication device, and if it is determined that the device time should be corrected, corrects the device time to approach the reception time so that no time jump occurs in the transmission timing of a timing signal that is periodically transmitted based on the device time.
Citation Information
Patent Citations
Time synchronization apparatus and time synchronization method
JP2019158538A
Time distribution device, synchronization system, and program
JP2020077929A
Road-vehicle communication device
JP2020167603A
JPP6707209B