Relay device and program

JP2023104245A5Active Publication Date: 2024-10-31MITSUBISHI ELECTRIC CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2022005119
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2022-01-17
Publication Date
2024-10-31
Estimated Expiration
2042-01-17

AI Technical Summary

Technical Problem

Devices receiving time synchronization signals from a time source cannot accurately determine if the received time is abnormal, leading to potential synchronization errors.

Method used

A relay device equipped with a communication unit, calculation unit, counter unit, and abnormality determination unit to analyze the interval and variance of received time jumps, using relationship information to detect abnormal times by comparing against preset thresholds.

Benefits of technology

Enables accurate detection of abnormal times, ensuring precise time synchronization by filtering out erroneous reception times and maintaining high precision in synchronization processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

To detect abnormal time.SOLUTION: A relay device 100 includes: a communication unit 110 which receives a frame including reception time; a calculation unit 140 which calculates a transition width using the reception time and management time managed in the relay device 100; a management unit 180; a counter unit 150; and an abnormality determination unit 160. The management unit 180 stores the management time and relation information which is information showing a plurality of transition widths corresponding to a plurality of counter values and in which a total value of the plurality of counter values is a preset threshold value or greater. The counter unit 150 increments the counter value corresponding to the calculated transition width. The calculation unit 140 uses the relation information to execute first calculation processing which calculates a difference between the calculated transition width and the transition width at the largest of the counter values or second calculation processing which includes calculation processing of variance obtained using the relation information, a moving average value of the variance, and percentage change of the moving average value. The abnormality determination unit 160 determines that the reception time is abnormal if the difference or the percentage change is the threshold vale or greater.SELECTED DRAWING: Figure 4
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This disclosure relates to a relay device. [Background technology]

[0002] Multiple devices communicate via a network. Time synchronization is performed between these multiple devices. gPTP (generalized Precision Time Protocol) is a known communication protocol for time synchronization. gPTP is also defined in IEEE 802.1AS-2020. A technique for detecting time synchronization anomalies has been proposed (see Patent Document 1). [Prior art documents] [Patent Documents]

[0003] [Patent Document 1] Japanese Patent Publication No. 2018-201110 [Overview of the project] [Problems that the invention aims to solve]

[0004] By the way, in time synchronization, synchronization is performed based on the time received from the time source (hereinafter referred to as the received time). However, the device that receives the received time does not know whether the received time is an abnormal time or not. Therefore, for example, if the received time is an abnormal time, it is problematic for the device to perform synchronization based on the received time. Thus, the device needs to detect abnormal times. However, the problem is how to detect abnormal times.

[0005] The purpose of this disclosure is to detect abnormal time zones. [Means for solving the problem]

[0006] A relay device according to one aspect of the present disclosure is provided. The relay device includes a communication unit that receives a frame containing a time transmitted by a time source, a calculation unit that calculates a jump width indicating the interval between the reception time and the management time using the reception time, which is the time contained in the frame, and the management time, which is a time managed by the relay device, a management unit, a counter unit, and an abnormality determination unit. The management unit stores the management time and relational information which is information indicating a plurality of jump widths corresponding to a plurality of counter values, and the sum of the plurality of counter values ​​is greater than or equal to a preset threshold. The counter unit increments a counter value corresponding to the jump width calculated using the reception time. The calculation unit performs a first calculation process using the relational information to calculate the difference between the jump width calculated using the reception time and the jump width with the largest counter value, or a second calculation process which includes a variance calculation process using the relational information, a moving average calculation process of the variance, and a calculation process of the rate of change of the moving average. The abnormality determination unit determines the reception time to be abnormal if the difference or the rate of change is greater than or equal to a preset threshold. [Effects of the Invention]

[0007] According to this disclosure, abnormal times can be detected. [Brief explanation of the drawing]

[0008] [Figure 1] This is a diagram showing the communication system of Embodiment 1. [Figure 2] This figure shows an example of time synchronization based on gPTP according to Embodiment 1. [Figure 3] This figure shows the hardware of the relay device according to Embodiment 1. [Figure 4] This is a block diagram showing the functions of the relay device according to Embodiment 1. [Figure 5] This is a flowchart (part 1) showing an example of the processing performed by the relay device of Embodiment 1. [Figure 6] This is a flowchart (part 2) showing an example of the processing performed by the relay device of Embodiment 1. [Figure 7] It is a diagram showing an example of abnormality determination in Embodiment 1. [Figure 8] It is a diagram showing an example of the change in jump width in Embodiment 1. [Figure 9] It is a diagram showing an example of a graph of the change rate in Embodiment 1. [Figure 10] (A) to (D) are diagrams showing specific examples (the first one) of the processing executed by the relay device in Embodiment 1. [Figure 11] (A) to (C) are diagrams showing specific examples (the second one) of the processing executed by the relay device in Embodiment 1. [Figure 12] It is a diagram showing an example of the synchronization error in Embodiment 1. [Figure 13] It is a block diagram showing the functions of the relay device in Embodiment 2. [Figure 14] It is a flowchart showing an example of the processing executed by the relay device in Embodiment 2.

Mode for Carrying Out the Invention

[0009] Hereinafter, embodiments will be described with reference to the drawings. The following embodiments are merely examples, and various modifications are possible within the scope of the present disclosure.

[0010] Embodiment 1. FIG. 1 is a diagram showing the communication system of Embodiment 1. The communication system includes relay devices 100_1 to 100_4, a GM (Grand Master) 200, and terminal devices 300_1 to 300_4. For example, the relay devices 100_1 to 100_4 are L2SW (Layer 2 Switching Hub). The GM 200 is also referred to as a time source. Here, the collective name of the relay devices 100_1 to 100_4 is referred to as the relay device 100. The collective name of the terminal devices 300_1 to 300_4 is referred to as the terminal device 300.

[0011] Next, time synchronization based on gPTP will be described. FIG. 2 is a diagram showing an example of time synchronization based on gPTP in Embodiment 1. In FIG. 2, time synchronization performed between the relay device 100 and the GM 200 is mainly depicted. Time synchronization is similarly performed between the relay device 100 and the terminal device 300. Details of the time synchronization performed between the relay device 100 and the terminal device 300 are omitted.

[0012] As shown in FIG. 2, when the GM 200 receives a Pdelay_Req from the relay device 100, it transmits a Pdelay_Res including the reception time t G2 to the relay device 100. After the Pdelay_Res is transmitted, the GM 200 transmits a Pdelay_Res_Follow_Up including the transmission time t G3 to the relay device 100. Thereby, the relay device 100 can store the reception time t G2 and the transmission time t G3 . Further, the relay device 100 stores the time t L1 when the Pdelay_Req is transmitted and the time t' L4 when the Pdelay_Res is received.

[0013] The relay device 100 can calculate the clock ratio R GL using the symbols described in FIG. 2. For example, the relay device 100 can calculate the clock ratio R GL using Equation (1).

[0014]

Equation

[0015] The relay device 100 can calculate the propagation delay time D GL using the symbols described in FIG. 2. For example, the relay device 100 can calculate the propagation delay time D GL using Equation (2).

[0016]

Equation

[0017] The GM200 periodically sends Sync and Follow_Up messages to the relay device 100. The relay device 100 also has a dwell time S within the device. L The following can be calculated: In detail, the relay device 100 uses equation (3) to calculate the residence time S within the device. L This can be calculated. T in equation (3) LSNCTX T is the time when the relay device 100 sends Sync to the termination device 300. LSNCRX This is the time when the relay device 100 received the Sync signal. Note that S is the time the device resides within the device. L This is the time during which the Sync (i.e., frame) is temporarily stored.

[0018]

number

[0019] The relay device 100 transmits Sync at the transmission time T GM The propagation delay time D GL and residence time S within the device L The time is added. The relay device 100 synchronizes the time obtained by the addition with the time managed by the relay device 100. As a result, the time of the relay device 100 and the time of GM200 are synchronized. Time synchronization based on gPTP is performed in this manner. Furthermore, the relay device 100 performs synchronization using a method different from that of gPTP-based time synchronization. Details will be explained later.

[0020] Next, the hardware of the relay device 100 will be described. Figure 3 shows the hardware of the relay device according to Embodiment 1. The relay device 100 includes a processor 101, a volatile storage device 102, and a non-volatile storage device 103.

[0021] The processor 101 controls the entire relay device 100. For example, the processor 101 may be a CPU (Central Processing Unit), an FPGA (Field Programmable Gate Array), etc. The processor 101 may also be a multiprocessor. The relay device 100 may also have processing circuits.

[0022] The volatile memory device 102 is the main memory of the relay device 100. For example, the volatile memory device 102 is RAM (Random Access Memory). The non-volatile memory device 103 is the auxiliary memory of the relay device 100. For example, the non-volatile memory device 103 is an HDD (Hard Disk Drive) or an SSD (Solid State Drive).

[0023] Next, the functions of the relay device 100 will be explained. Figure 4 is a block diagram showing the functions of the relay device of Embodiment 1. The relay device 100 includes a communication unit 110_1 to 110_n (where n is a positive integer), an L2 protocol processing unit 120, a count determination unit 130, a calculation unit 140, a counter unit 150, an abnormality determination unit 160, a synchronization determination unit 170, and a management unit 180.

[0024] A portion of the management unit 180 may be implemented as a memory area reserved in the volatile memory device 102 or the non-volatile memory device 103.

[0025] Some or all of the communication units 110_1 to 110_n, the L2 protocol processing unit 120, the count determination unit 130, the calculation unit 140, the counter unit 150, the abnormality determination unit 160, the synchronization determination unit 170, and the management unit 180 may be implemented by processing circuits. Alternatively, some or all of the communication units 110_1 to 110_n, the L2 protocol processing unit 120, the count determination unit 130, the calculation unit 140, the counter unit 150, the abnormality determination unit 160, the synchronization determination unit 170, and the management unit 180 may be implemented as modules of a program executed by the processor 101.

[0026] Communication units 110_1 to 110_n transmit and receive frames. For example, frames include Pdelay_Req, Pdelay_Res, and Pdelay_Res_Follow_Up. In this way, communication units 110_1 to 110_n receive frames transmitted by GM200. Communication units 110_1 to 110_n also transmit frames to GM200. Here, communication units 110_1 to 110_n can be collectively referred to as communication unit 110.

[0027] If Pdelay_Res is received, the L2 protocol processing unit 120 obtains the reception time from Pdelay_Res. If Pdelay_Res_Follow_Up is received, the L2 protocol processing unit 120 obtains the transmission time from Pdelay_Res_Follow_Up.

[0028] When Pdelay_Req is sent, the L2 protocol processing unit 120 sends a Pdelay_Req transmission instruction to the communication units 110_1 to 110_n. As a result, the communication units 110_1 to 110_n transmit Pdelay_Req to the GM200.

[0029] The functions of the count determination unit 130, calculation unit 140, counter unit 150, abnormality determination unit 160, synchronization determination unit 170, and management unit 180 will be explained in detail later.

[0030] Next, the processes performed by the relay device 100 will be explained using a flowchart. Figure 5 is a flowchart (part 1) showing an example of the processing performed by the relay device of Embodiment 1. (Step S11) The count determination unit 130 receives the reception time included in Pdelay_Res and the transmission time included in Pdelay_Res_Follow_Up. (Step S12) The count determination unit 130 determines whether it has received Pdelay_Res and Pdelay_Res_Follow_Up for the first time. If it is the first time, the process proceeds to step S13. If it has received two or more times, the process proceeds to step S14.

[0031] (Step S13) The management unit 180 synchronizes the reception time included in Pdelay_Res with the management time, which is the time managed by the relay device 100. The management time is stored in the management unit 180. Then the process ends. (Step S14) The calculation unit 140 uses the reception time included in Pdelay_Res and the management time to calculate a gap width indicating the interval between the reception time and the management time. Alternatively, the gap width can be considered as a value indicating how much the management time is shifted from the reception time. Specifically, the calculation unit 140 calculates the gap width using equation (4).

[0032]

number

[0033] (Step S15) The counter unit 150 increments the counter value corresponding to the calculated jump distance. Here, the management unit 180 stores relational information. Relational information is information indicating multiple jump lengths corresponding to multiple counter values. For example, the relational information indicates the counter value corresponding to a jump length of "8ns", the counter value corresponding to a jump length of "0ns", the counter value corresponding to a jump length of "-8ns", and so on. The initial value of the counter value is 0. For example, if the calculated jump length is 8ns, the counter unit 150 adds 1 to the counter value corresponding to 8ns. In this way, the counter value corresponding to the calculated jump length is counted up.

[0034] (Step S16) The calculation unit 140 uses the relational information to calculate the difference between the calculated jump distance and the jump distance with the maximum counter value. Specifically, the calculation unit 140 uses the relational information to identify the jump distance with the maximum counter value from among multiple counter values. The calculation unit 140 calculates the difference between the calculated jump distance and the jump distance with the maximum counter value. For example, if the jump distance with the maximum counter value is 0 ns, the difference is calculated as shown in equation (5). Note that the difference is expressed as an absolute value.

[0035]

number

[0036] Here, the process performed in step S16 is also called the first calculation process.

[0037] (Step S17) The calculation unit 140 calculates the variance of the jump distance using the relevant information. Specifically, the calculation unit 140 calculates the variance of the jump distance using equation (6). 2 x is the variance. n is the total number of data points. i μ is the counter value. μ is the average value.

[0038]

number

[0039] In this way, the calculation unit 140 performs a variance calculation process using relational information. The calculation unit 140 calculates the moving average of the variance using equation (7). n This is the moving average calculated based on the nth variance. n ^2 is the variance of the jump distance counted up on the nth step. n+100 ^2 represents the variance of the jump increment counted up at the (n+100)th iteration.

[0040]

number

[0041] In this way, the calculation unit 140 performs the calculation of the moving average value of the variance. The calculation unit 140 calculates the rate of change of the moving average using equation (8).

[0042]

number

[0043] In this way, the calculation unit 140 performs the calculation of the rate of change of the moving average. Here, the process performed in step S17 is also called the second calculation process. The above describes the case in which the calculation unit 140 performs the first calculation process and the second calculation process. The calculation unit 140 may perform either the first calculation process or the second calculation process.

[0044] Figure 6 is a flowchart (part 2) showing an example of the processing performed by the relay device of Embodiment 1. (Step S21) The abnormality determination unit 160 determines whether the difference calculated in step S16 or the rate of change calculated in step S17 is greater than or equal to a preset threshold. If the difference or rate of change is greater than or equal to the threshold, the process proceeds to step S22. If the difference and rate of change are less than the threshold, the abnormality determination unit 160 determines that the reception time received in step S11 is normal. Then, the process proceeds to step S24.

[0045] (Step S22) The abnormality determination unit 160 determines whether the sum of the multiple counter values ​​indicated by the related information is equal to or greater than a preset threshold.

[0046] If the total value is greater than or equal to the threshold, it means that multiple Pdelay_Res were received before the Pdelay_Res containing the reception time received in step S11, that multiple jump intervals were calculated based on the multiple reception times included in the multiple Pdelay_Res, and that the counter values ​​corresponding to the multiple jump intervals were incremented. In short, it means that the flowcharts in Figures 5 and 6 have been performed multiple times before the Pdelay_Res containing the reception time received in step S11 was received.

[0047] If the sum is less than the threshold, the fluctuation in the rate of change is large. If the fluctuation in the rate of change is large, the abnormality determination will be incorrect. Therefore, step S22 is performed. Alternatively, the determination in step S22 may be expressed as follows: The abnormality determination unit 160 determines whether a sufficient amount of time has elapsed to detect the abnormality. If a sufficient amount of time has elapsed, it means that the sum is greater than or equal to the threshold. If a sufficient amount of time has not elapsed, it means that the sum is less than the threshold.

[0048] If the total value is equal to or greater than the threshold, the process proceeds to step S23. If the total value is less than the threshold, the abnormality determination unit 160 determines that the reception time received in step S11 is normal. Then, the process proceeds to step S24.

[0049] (Step S23) The abnormality determination unit 160 determines that the reception time received in step S11 is abnormal.

[0050] Here, we will explain how to determine an anomaly using a graph. Figure 7 shows an example of abnormality detection in Embodiment 1. The vertical axis in Figure 7 shows the counter value. The horizontal axis in Figure 7 shows the jump distance.

[0051] Figure 7 shows the jump length calculated in this case. That is, the jump length calculated in this case is the jump length calculated in step S14. Figure 7 also shows that the maximum jump length for the counter value is 0 ns. The difference is calculated using equation (5). If the difference is greater than or equal to the threshold, the abnormality determination unit 160 determines that the reception time, which is the basis for the jump length calculated in this case, is abnormal. In this way, the abnormality determination unit 160 determines that the reception time is abnormal in a case like Figure 7. Note that the threshold may be set to the time of the jump length that is considered abnormal. Alternatively, the threshold may be set to the probability of a jump length that is considered normal.

[0052] Next, we will illustrate a case where the maximum jump in the counter value gradually changes. Figure 8 shows an example of the change in jump distance in Embodiment 1. The vertical axis in Figure 8 shows the counter value. The horizontal axis in Figure 8 shows the jump distance.

[0053] Graph 401 shows that the maximum jump in the counter value is 0 ns. In other words, Graph 401 shows that the median value is 0 ns. Graph 402 shows a median of 100 ns. Graph 402 shows a state where the median is shifted by 100 ns. Note that the total number of counter values ​​in Graph 401 and Graph 402 are different. Graph 403 shows the median of Graph 402 shifted further to the right. Note that the total number of counter values ​​in Graph 402 and Graph 403 are different. Graph 404 shows graphs 401-403 represented in a single graph.

[0054] Thus, the median may gradually shift over time. In other words, the jump in reception time based on the reception time received by the relay device 100 may change over time. If graph 401 is a normal graph, reception times based on jumps far from the median of graph 401 can be considered abnormal reception times. Here, the rate of change is calculated to determine how far from the median of graph 401 a reception time is considered abnormal.

[0055] Next, we will illustrate the graph of the rate of change. Figure 9 shows an example of a graph of the rate of change in Embodiment 1. The left vertical axis in Figure 9 shows the moving average of the variance. The right vertical axis in Figure 9 shows the rate of change. The horizontal axis in Figure 9 shows time. If the rate of change is above a threshold, the abnormality detection unit 160 determines that the reception time, which is the basis for the jump width calculated this time, is abnormal.

[0056] As explained above, in step S22, if the sum of the counter values ​​is less than the threshold, the fluctuation in the rate of change is large. In other words, if sufficient time has not elapsed, the fluctuation in the rate of change is large. As shown in Figure 9, if sufficient time has not elapsed, the fluctuation in the rate of change is large. Therefore, if sufficient time has not elapsed, the rate of change may exceed the threshold. If the fluctuation in the rate of change is large, an abnormality is detected. That is, a misjudgment occurs. Therefore, step S22 is performed.

[0057] Returning to Figure 6, let's explain the flowchart. (Step S24) The synchronization determination unit 170 determines whether the counter value counted up in step S15 (i.e., the counter value corresponding to the jump amount calculated in step S14) is the largest among the multiple counter values ​​indicated by the relational information and whether it has been determined to be normal. If the conditions are met, the process proceeds to step S25. If the conditions are not met, the process proceeds to step S27.

[0058] The process will be explained in detail. The synchronization determination unit 170 uses relational information to identify the maximum value among multiple counter values. The synchronization determination unit 170 determines whether the jump length corresponding to the maximum counter value is the same as the jump length calculated in step S14. If the jump lengths are the same and normality is determined, the synchronization determination unit 170 determines that the conditions are met.

[0059] (Step S25) The management unit 180 synchronizes the management time it manages with the reception time received in step S11. (Step S26) The control unit 180 shifts all counter values ​​by the amount calculated in step S14. Specifically, the control unit 180 adds or subtracts the amount calculated in step S14 from the multiple amounts indicated by the relational information. For example, if the amount calculated in step S14 is a negative value, the control unit 180 adds the amount calculated in step S14 to the multiple amounts indicated by the relational information. If the amount calculated in step S14 is a positive value, the control unit 180 subtracts the amount calculated in step S14 from the multiple amounts indicated by the relational information. As a result, all counter values ​​are shifted. After the parallel translation is complete, the process ends.

[0060] (Step S27) The management unit 180 synchronizes the management time using time synchronization based on gPTP.

[0061] Next, the processing performed by the relay device 100 will be explained using a specific example. Figures 10(A) to (D) show a specific example (part 1) of the processing performed by the relay device of Embodiment 1. The relay device 100 is assumed to have received the second Pdelay_Res.

[0062] The calculation unit 140 calculates a jump interval of "8ns" using the reception time included in Pdelay_Res (hereinafter referred to as the second reception time) and the management time managed by the management unit 180 (step S14). The counter unit 150 increments the counter value corresponding to the jump interval of "8ns" (step S15). Figure 10(A) shows the state after the counter value corresponding to the jump interval of "8ns" has been incremented.

[0063] The calculation unit 140 calculates the difference "0" between the jump length "8ns" and the jump length "8ns" at which the counter value is maximum (step S16). The abnormality determination unit 160 determines that the difference "0" is less than the threshold (No in step S21). The synchronization determination unit 170 determines that the counter value corresponding to the jump length "8ns" is maximum and that normality has been determined (Yes in step S24). The management unit 180 synchronizes the management time with the second reception time (step S25). The management unit 180 shifts all counter values ​​by the jump length "8ns" (step S26). Figure 10(B) shows the state after the shift has been performed.

[0064] The count determination unit 130 receives the reception time included in Pdelay_Res (hereinafter referred to as the third reception time) (step S11). The calculation unit 140 calculates the jump width "-8ns" using the third reception time and the management time (step S14). The counter unit 150 increments the counter value corresponding to the jump width "-8ns" (step S15). Figure 10(C) shows the state after the counter value corresponding to the jump width "-8ns" has been incremented.

[0065] The calculation unit 140 calculates the difference "0" between the jump length "-8ns" and the jump length "-8ns" where the counter value is at its maximum (step S16). Alternatively, the calculation unit 140 may calculate the difference between the jump length "-8ns" and the jump length "0ns" where the counter value is at its maximum. The abnormality determination unit 160 determines that the difference "0" is less than the threshold (No in step S21). The synchronization determination unit 170 determines that the counter value corresponding to the jump length "-8ns" is at its maximum and that normality has been determined (Yes in step S24). The management unit 180 synchronizes the management time with the third reception time (step S25). The management unit 180 shifts all counter values ​​by a jump length of "8ns" (step S26). Figure 10(D) shows the state after the shift has been performed.

[0066] Figures 11(A) to 11(C) show specific examples (part 2) of the processing performed by the relay device of Embodiment 1. The count determination unit 130 receives the reception time included in Pdelay_Res (hereinafter referred to as the 4th reception time) (step S11). The calculation unit 140 calculates the jump width "8ns" using the 4th reception time and the management time (step S14). The counter unit 150 increments the counter value corresponding to the jump width "8ns" (step S15). Figure 11(A) shows the state after the counter value corresponding to the jump width "8ns" has been incremented.

[0067] The calculation unit 140 calculates the difference "0" between the jump length "8ns" and the jump length "8ns" at which the counter value is maximum (step S16). The abnormality determination unit 160 determines that the difference "0" is less than the threshold (No in step S21). The synchronization determination unit 170 determines that the counter value corresponding to the jump length "8ns" is at its maximum and that normality has been determined (Yes in step S24). The management unit 180 synchronizes the management time with the fourth reception time (step S25). The management unit 180 shifts all counter values ​​by the jump length "8ns" (step S26). Figure 11(B) shows the state after the shift has been performed.

[0068] The count determination unit 130 receives the reception time included in Pdelay_Res (hereinafter referred to as the 5th reception time) (step S11). The calculation unit 140 calculates the jump width "-8ns" using the 5th reception time and the management time (step S14). The counter unit 150 increments the counter value corresponding to the jump width "-8ns" (step S15). Figure 11(C) shows the state after the counter value corresponding to the jump width "-8ns" has been incremented.

[0069] The calculation unit 140 calculates the difference of "8" between the jump length "-8ns" and the jump length "0ns" where the counter value is maximum (step S16). The abnormality determination unit 160 determines that the difference "8" is less than the threshold (No in step S21). The synchronization determination unit 170 determines that the counter value corresponding to the jump length "-8ns" is not the maximum (No in step S24). The management unit 180 synchronizes the management time using time synchronization based on gPTP (step S27).

[0070] According to Embodiment 1, the relay device 100 determines that the reception time is abnormal if the difference calculated in step S16 or the rate of change calculated in step S17 is greater than or equal to a threshold, and the sum of the multiple counter values ​​indicated by the related information is greater than or equal to a threshold. In this way, the relay device 100 can detect abnormal reception times.

[0071] Furthermore, if the counted counter value is at its maximum, the relay device 100 performs synchronization using the reception time. The reason why the relay device 100 performs this process will be explained.

[0072] Figure 12 shows an example of synchronization error in Embodiment 1. The vertical axis in Figure 12 represents probability. The horizontal axis in Figure 12 represents synchronization error.

[0073] When a communication system is functioning correctly, the probability distribution of synchronization errors is generally a normal distribution. The cause of synchronization errors is measurement error. For example, one type of measurement error is the time stamping error. A device with a time stamping error of 8 ns will have a positive error of up to 7.9999...ns. In addition, the propagation delay and frame residence time measured by the same device will result in negative errors. Considering the time stamping error, propagation delay, and frame residence time, the probability distribution of synchronization errors is considered to be a normal distribution.

[0074] The following explanation will use Figure 12. The difference between the reception time and the management time is the same as the synchronization error. In other words, the jump distance and the synchronization error are the same. If the counter value is treated similarly to a probability, the relationship between the jump distance and the counter value may follow a normal distribution, as shown in Figure 12. In order to derive this normal distribution, the sum of the multiple counter values ​​indicated by the relationship information must be greater than or equal to a threshold. When the relationship between the jump distance and the counter value follows a normal distribution, the communication system can be said to be functioning normally.

[0075] As shown in Figure 12, the probability corresponding to the smallest synchronization error (i.e., the synchronization error when 0 ns) is the highest. As shown in Figure 12, when the relationship between the jump length and the counter value follows a normal distribution, the jump length corresponding to the highest counter value can be considered to be the jump length when the synchronization error is smallest. This idea is utilized. When the counted-up counter value is the maximum among the counter values, the received reception time can be said to be the time with the smallest synchronization error. Therefore, when the counted-up counter value is the maximum, the relay device 100 performs synchronization using the received reception time. This allows the relay device 100 to perform highly accurate synchronization.

[0076] Embodiment 2. Next, Embodiment 2 will be described. Embodiment 2 will mainly describe the differences from Embodiment 1. In Embodiment 2, the explanation of matters common to Embodiment 1 will be omitted.

[0077] Figure 13 is a block diagram showing the functions of the relay device of Embodiment 2. The components in Figure 13 that are the same as those shown in Figure 4 are denoted by the same reference numerals as those shown in Figure 4. The relay device 100a has a synchronization determination unit 170a. The functions of the synchronization determination unit 170a will be described in detail later.

[0078] Next, the processes performed by the relay device 100a will be explained using a flowchart. Figure 14 is a flowchart showing an example of the processing performed by the relay device of Embodiment 2. The processing in Figure 14 differs from the processing in Figure 6 in that steps S23a and S24a are performed. Therefore, steps S23a and S24a will be explained in Figure 14. The explanation of the processing other than steps S23a and S24a will be omitted.

[0079] (Step S23a) The synchronization determination unit 170a determines whether the sum of multiple counter values ​​indicated by the relational information is equal to or greater than a preset threshold. If the sum is equal to or greater than the threshold, the process proceeds to step S24a. If the sum is less than the threshold, the process ends.

[0080] (Step S24a) The synchronization determination unit 170a determines whether the jump amount corresponding to the counter value counted up in step S15 is within a predetermined range centered on the jump amount of the maximum value among the multiple counter values ​​indicated by the relational information, and whether it is determined to be normal.

[0081] For example, if the maximum value among the multiple counter values ​​indicated by the relational information is 0ns, the synchronization determination unit 170a determines whether the jump corresponding to the counted-up counter value is within a range of ±10ns centered on 0ns and whether it is determined to be normal. If the conditions are met, the process proceeds to step S25. If the conditions are met, the process proceeds to step S27.

[0082] In Embodiment 1, synchronization was performed when the counted-up counter value was at its maximum; that is, step S25 was performed. In Embodiment 2, the conditions for synchronization are relaxed compared to Embodiment 1. However, a condition is still in place that the jump amount corresponding to the counted-up counter value is within the range centered on the jump amount of the maximum value. Therefore, even if synchronization is performed when this condition is met, the accuracy of the synchronization does not decrease significantly. Thus, the relay device 100a can perform highly accurate synchronization by performing the above processing.

[0083] The features of each embodiment described above can be combined with each other as appropriate. [Explanation of Symbols]

[0084] 100, 100_1~100_4, 100a Relay device, 101 Processor, 102 Volatile memory device, 103 Non-volatile memory device, 110_1~110_n Communication unit, 120 L2 protocol processing unit, 130 Count determination unit, 140 Calculation unit, 150 Counter unit, 160 Anomaly determination unit, 170, 170a Synchronization determination unit, 180 Management unit, 200 GM, 300, 300_1~300_4 Termination device, 401 Graph, 402 Graph, 403 Graph, 404 Graph.

Claims

1. A relay device for managing management time, comprising: A communication unit that receives a frame including a time transmitted from a time source; a calculation unit that calculates a jump width indicating an interval between the reception time and the management time using the reception time, which is the time included in the frame, and the management time; a management unit that stores relationship information indicating a plurality of jump widths corresponding to a plurality of counter values, the total value of the plurality of counter values ​​being equal to or greater than a preset threshold, and the management time; a counter unit that increments a counter value corresponding to the jump width calculated using the reception time; an abnormality determination unit that determines an abnormality in the reception time; having the calculation unit performs a first calculation process using the relationship information to calculate a difference between the jump width calculated using the reception time and the jump width with a maximum counter value, or a second calculation process including a calculation process of a variance using the relationship information, a calculation process of a moving average value of the variance, and a calculation process of a change rate of the moving average value; The abnormality determination unit determines that the reception time is abnormal when the difference or the rate of change is equal to or greater than a preset threshold value. Relay device.

2. the management unit synchronizes the management time with the reception time when the counter value corresponding to the jump width calculated using the reception time is maximum and is determined to be normal. The relay device according to claim 1 .

3. the management unit synchronizes the management time with the reception time when the jump width calculated using the reception time is included within a predetermined range centered on the jump width of the maximum value among the multiple counter values ​​indicated by the relationship information and when the management unit is determined to be normal. The relay device according to claim 1 .

4. When the management unit synchronizes the management times, the management unit adds or subtracts the jump width calculated using the reception times to or from the multiple jump widths indicated by the relationship information. The relay device according to claim 2 or 3.

5. A program that causes a processor to function as a relay device described in any one of claims 1 to 4.

6. A program that causes a processor to function as at least one of the communication unit, the calculation unit, the management unit, the counter unit and the abnormality determination unit of a relay device described in any one of claims 1 to 4.