TWI599863B - Time synchronization device, time synchronization system and time synchronization method - Google Patents

Time synchronization device, time synchronization system and time synchronization method Download PDF

Info

Publication number
TWI599863B
TWI599863B TW104123047A TW104123047A TWI599863B TW I599863 B TWI599863 B TW I599863B TW 104123047 A TW104123047 A TW 104123047A TW 104123047 A TW104123047 A TW 104123047A TW I599863 B TWI599863 B TW I599863B
Authority
TW
Taiwan
Prior art keywords
time
data
unit
master device
synchronization
Prior art date
Application number
TW104123047A
Other languages
Chinese (zh)
Other versions
TW201643569A (en
Inventor
Xiaonan Shi
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Publication of TW201643569A publication Critical patent/TW201643569A/en
Application granted granted Critical
Publication of TWI599863B publication Critical patent/TWI599863B/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/28Timers or timing mechanisms used in protocols

Description

時刻同步裝置、時刻同步系統以及時刻同步方法 Time synchronization device, time synchronization system, and time synchronization method

本發明為有關一種時刻同步裝置、時刻同步系統以及時刻同步方法者。 The present invention relates to a time synchronization device, a time synchronization system, and a time synchronization method.

在PA(Process‧Automation;處理自動化)領域中,藉由從封閉網路構成到開放網路構成之轉換、以及新資訊技術的適用等,推展實現廣區域的智慧通訊。作為具體例示,可以舉例如智慧電網。在多數裝置的計測與控制中,為了簡單化事件同步與資料相關,要求高精確度的時刻同步。 In the field of PA (Process‧Automation), we have promoted intelligent communication in a wide area by transforming from a closed network to an open network and the application of new information technologies. As a specific example, for example, a smart grid can be mentioned. In the measurement and control of most devices, in order to simplify event synchronization and data correlation, high-accuracy time synchronization is required.

在封閉網路構成中,利用獨自的時刻同步方式,使所謂數十台之比較少數的裝置時刻同步化。時刻同步精確度為微秒單位。為了提高時刻同步精確度,時刻同步方式主要是被安裝在硬體基底。 In the closed network configuration, a so-called dozens of relatively few devices are synchronized at a time by the unique time synchronization method. The time synchronization accuracy is in microsecond units. In order to improve the accuracy of time synchronization, the time synchronization method is mainly installed on a hardware substrate.

作為在開放網路構成可利用的時刻同步方式,IEEE(Institute‧of‧Electrical‧and‧Electronics‧Eengineers;電機電子工程師學會)發展出利用乙太網路(Ethernet;商標登錄)之時刻同步規格IEEE1588。在IEEE1588中,規定了藉由透過網路傳送/接收已記錄時刻的同步訊框,同步時刻的方法。IEEE1588的安裝分為硬體基底安裝與軟體基底安裝2種類。 As a time synchronization method that can be utilized in an open network, IEEE (Institute‧of‧Electrical‧and‧Electronics‧Eengineers; Institute of Electrical and Electronics Engineers) developed the time synchronization specification IEEE1588 using Ethernet (trademark registration) . In IEEE 1588, a method of synchronizing a time by transmitting/receiving a synchronization frame at a recorded time through a network is defined. The IEEE1588 is divided into two types: hardware base mounting and software base mounting.

在硬體基底安裝中,使用進行OSI(Open‧ Systems‧Interconnection;開放系統互連)參考模型的物理層處理之PHY的硬體時間戳記機能,記錄時刻(例如參照專利文獻1)。因此,時刻傳送側將PHY傳送同步訊框時的時間戳記作為傳送時刻予以記錄,傳送已記錄之傳送時刻。同樣,時刻接收側將PHY接收同步訊框時的時間戳記作為接收時刻予以記錄,將已記錄之接收時刻利用於應用程式。時刻同步精確度在理論上雖然是1奈米秒,但實際上最高為100奈米秒程度。 In a hardware base installation, use OSI (Open‧ Systems‧Interconnection; Open System Interconnection) The hard time stamp function of the physical layer processing PHY of the reference model, recording time (for example, refer to Patent Document 1). Therefore, the time transmission side records the time stamp when the PHY transmits the synchronization frame as the transmission time, and transmits the recorded transmission time. Similarly, the time receiving side records the time stamp when the PHY receives the synchronization frame as the reception time, and uses the recorded reception time for the application. The timing synchronization accuracy is theoretically 1 nanosecond, but in reality it is up to 100 nanoseconds.

在軟體基底安裝中,使用進行OSI參考模型的應用層處理之應用程式的軟體時間戳記機能,記錄時刻。因此,時刻傳送側將應用程式對下位處理指示同步訊框的傳送時的時間戳記作為傳送時刻予以記錄,傳送已記錄的傳送時刻。同樣,時刻接收側將應用程式在從下位處理被通知同步訊框的接收時之時間戳記作為接收時刻予以記錄,將已記錄之接收時刻利用於應用程式。時刻同步精確度在最差的情況下為惡化到100毫秒程度。又,軟體基底安裝的時刻同步精確度根據應用程式所動作的OS(Operating‧System;作業系統)、及通訊機能的階層構造而有大幅變動。 In the software base installation, the software time stamp function of the application layer processing of the OSI reference model is used to record the time. Therefore, the time transmission side records the time stamp when the application indicates the transmission of the synchronization frame by the lower processing as the transmission time, and transmits the recorded transmission time. Similarly, the time receiving side records the time stamp when the application is notified of the reception of the synchronization frame from the lower processing as the reception time, and uses the recorded reception time for the application. The time synchronization accuracy is deteriorated to the extent of 100 milliseconds in the worst case. Moreover, the timing synchronization accuracy of the software base mounting greatly varies depending on the OS (Operating‧System; operating system) in which the application operates and the hierarchical structure of the communication function.

【先前技術文獻】 [Previous Technical Literature] 【專利文獻】 [Patent Literature]

【專利文獻1】日本特開2012-256965號公報 [Patent Document 1] Japanese Patent Laid-Open Publication No. 2012-256965

在系統從封閉網路構成變更為開放網路構成時, 將該系統與其他系統連接。從資產交流的觀點看來,在系統內部之時刻同步中繼續利用既存的時刻同步方式,在與系統外部的時刻同步時認為可利用IEEE1588。但是,在該情況下,必須要有對應既存的時刻同步方式及IEEE1588兩方的終端。在重新導入IEEE1588的情況下,若是採用硬體基底安裝,可以得到高精確度的時刻同步,但是會耗費龐大成本。因此從成本節省的觀點看來,期許採用軟體基底安裝。 When the system is changed from a closed network to an open network, Connect the system to other systems. From the point of view of asset exchange, it is continued to utilize the existing time synchronization method in the time synchronization within the system, and it is considered that IEEE1588 can be utilized when synchronizing with the time outside the system. However, in this case, it is necessary to have a terminal corresponding to the existing time synchronization method and IEEE1588. In the case of re-importing IEEE1588, if it is mounted on a hard substrate, high-accuracy time synchronization can be obtained, but it is costly. Therefore, from the viewpoint of cost saving, it is expected to use a software substrate installation.

本發明以提升根據軟體基底安裝之時刻同步方式的時刻同步精確度為目的。 The invention aims to improve the time synchronization accuracy according to the time synchronization manner of the software substrate installation.

有關本發明之一形態之時刻同步裝置,包括:接收部,從具有主時鐘的主裝置接收第1資料;傳送部,在根據前述接收部接收前述第1資料後,將第2資料傳送到前述主裝置;記錄部,使用軟體時鐘之從屬時鐘,記錄前述接收部之前述第1資料接收時刻、及前述傳送部之前述第2資料傳送時刻;補正部,補正根據前述記錄部記錄的前述第1資料接收時刻、及前述第2資料傳送時刻;及同步部,至少從前述主裝置通知之前述主裝置的前述第1資料傳送時刻、根據前述補正部補正之前述第1資料接收時刻、根據前述補正部補正之前述第2資料傳送時刻、及前述主裝置通知之前述主裝置的前述第2資料接收時刻,計算出前述主裝置時鐘與前述從屬時鐘之時刻偏差的偏置。 A time synchronization device according to an aspect of the present invention includes: a receiving unit that receives first data from a master device having a master clock; and a transmitting unit that transmits the second data to the aforementioned information after receiving the first data according to the receiving unit a recording unit that records the first data reception time of the receiving unit and the second data transmission time of the transmission unit using a slave clock of the software clock, and a correction unit that corrects the first record recorded by the recording unit And a synchronization unit that corrects at least the first data transmission time of the master device notified by the master device, the first data reception time corrected by the correction unit, and the correction according to the correction The second data transmission time of the partial correction and the second data reception time of the master device notified by the master device calculate an offset of the time difference between the master device clock and the slave clock.

在本發明中,由於補正使用軟體時鐘記錄的時刻,可以提升根據軟體基底安裝之時刻同步方式的時刻同步精確度。 In the present invention, since the timing of recording using the software clock is corrected, the time synchronization accuracy according to the time synchronization manner of the software substrate mounting can be improved.

100‧‧‧時刻同步系統 100‧‧‧Time synchronization system

101‧‧‧第1時刻同步方式 101‧‧‧First Time Synchronization

102‧‧‧第2時刻同步方式 102‧‧‧Second Time Synchronization Mode

110‧‧‧GM(總主裝置) 110‧‧‧GM (main master)

120‧‧‧PLC(可程式邏輯控制器) 120‧‧‧PLC (programmable logic controller)

130‧‧‧現場裝置 130‧‧‧Field devices

200‧‧‧主裝置 200‧‧‧Main device

201‧‧‧主時鐘 201‧‧‧Master Clock

202‧‧‧PHY(Port‧Physical‧Layer;埠物理層) 202‧‧‧PHY (Port‧Physical‧Layer;埠Physical layer)

203‧‧‧MAC(媒體存取控制器) 203‧‧‧MAC (Media Access Controller)

204‧‧‧MAC驅動器 204‧‧‧MAC drive

205‧‧‧OS(作業系統) 205‧‧‧OS (Operating System)

206‧‧‧時刻同步應用程式 206‧‧‧Time synchronization application

207‧‧‧其他應用程式 207‧‧‧Other applications

208‧‧‧補正表 208‧‧‧Revised form

210‧‧‧傳送部 210‧‧‧Transportation Department

220‧‧‧接收部 220‧‧‧ Receiving Department

230‧‧‧記錄部 230‧‧ ‧Recording Department

240‧‧‧補正部 240‧‧‧Revision Department

300‧‧‧時刻同步裝置 300‧‧‧Time synchronization device

301‧‧‧從屬時鐘 301‧‧‧Subordinate clock

302‧‧‧PHY 302‧‧‧PHY

303‧‧‧MAC 303‧‧‧MAC

304‧‧‧MAC驅動器 304‧‧‧MAC drive

305‧‧‧OS 305‧‧‧OS

306‧‧‧時刻同步應用程式 306‧‧‧Time synchronization application

307‧‧‧其他應用程式 307‧‧‧Other applications

308‧‧‧補正表 308‧‧‧Revision Table

310‧‧‧接收部 310‧‧‧ Receiving Department

320‧‧‧傳送部 320‧‧‧Transportation Department

330‧‧‧記錄部 330‧‧‧Recording Department

340‧‧‧補正部 340‧‧‧Revision Department

350‧‧‧同步部 350‧‧‧Synchronization Department

400‧‧‧網路 400‧‧‧Network

401‧‧‧第1資料 401‧‧‧1st information

402‧‧‧第2資料 402‧‧‧2nd information

403‧‧‧第3資料 403‧‧‧3rd information

404‧‧‧第4資料 404‧‧‧4th information

405‧‧‧偏置 405‧‧‧Offset

901‧‧‧處理器 901‧‧‧ processor

902‧‧‧輔助記憶裝置 902‧‧‧Auxiliary memory device

903‧‧‧記憶體 903‧‧‧ memory

904‧‧‧通訊裝置 904‧‧‧Communication device

905‧‧‧輸入介面 905‧‧‧Input interface

906‧‧‧顯示器介面 906‧‧‧Display interface

907‧‧‧輸入裝置 907‧‧‧ Input device

908‧‧‧顯示器 908‧‧‧ display

910‧‧‧訊號線 910‧‧‧ signal line

911‧‧‧電線 911‧‧‧Wire

912‧‧‧電線 912‧‧‧Wire

921‧‧‧接收器 921‧‧‧ Receiver

922‧‧‧傳送器 922‧‧‧transmitter

圖1為顯示有關實施形態1之時刻同步系統的構成例之圖面。 Fig. 1 is a view showing a configuration example of a time synchronization system according to the first embodiment.

圖2為顯示有關實施形態1之主裝置與時刻同步裝置之構成的方塊圖。 Fig. 2 is a block diagram showing the configuration of a master device and a time synchronization device according to the first embodiment.

圖3為顯示有關實施形態1之時刻同步系統的動作之流程圖。 Fig. 3 is a flow chart showing the operation of the time synchronization system according to the first embodiment.

圖4為顯示有關實施形態1之時刻同步系統的動作之流程圖。 Fig. 4 is a flow chart showing the operation of the time synchronization system according to the first embodiment.

圖5為顯示有關實施形態1之時刻同步系統的動作之流程圖。 Fig. 5 is a flow chart showing the operation of the time synchronization system according to the first embodiment.

圖6為顯示有關實施形態1之主裝置與時刻同步裝置之安裝例的方塊圖。 Fig. 6 is a block diagram showing an example of mounting of a master device and a time synchronization device according to the first embodiment.

圖7為顯示有關實施形態1之主裝置與時刻同步裝置間之通訊手段的順序圖。 Fig. 7 is a sequence diagram showing communication means between the master device and the time synchronization device in the first embodiment.

圖8為顯示有關實施形態2之時刻同步系統的構成例之圖面。 Fig. 8 is a view showing a configuration example of a time synchronization system according to the second embodiment.

圖9為顯示有關實施形態3之時刻同步系統的構成例之圖面。 Fig. 9 is a view showing a configuration example of a time synchronization system according to the third embodiment.

圖10為顯示有關本發明之實施形態之時刻同步裝置的硬 體構成例之圖面。 Figure 10 is a view showing the timing of the time synchronization device according to the embodiment of the present invention. The figure of the body composition example.

以下,針對本發明之實施形態,使用圖面進行說明。又,各圖中相同或相當的部份附予相同的符號。在實施形態的說明中,針對相同或相當的部分,會適當省略或簡略該說明。 Hereinafter, embodiments of the present invention will be described using the drawings. In the drawings, the same or corresponding parts are attached to the same symbols. In the description of the embodiments, the description of the same or equivalent components will be omitted or simplified.

實施形態1. Embodiment 1.

在習知之根據軟體基底安裝之時刻同步方式中,會有前述之時刻同步精確度惡化的課題。該課題的主因為軟體時間戳記的波動、及安裝時刻同步的終端之內部處理延遲的非對稱性。在本實施形態中,藉由補正時刻的記錄值,可以除去或抑制此等主因的至少一部份。 In the conventional time synchronization method in which the software base is mounted, there is a problem that the aforementioned time synchronization accuracy is deteriorated. This problem is mainly due to the fluctuation of the software time stamp and the asymmetry of the internal processing delay of the terminal at the time of installation. In the present embodiment, at least a part of these main factors can be removed or suppressed by correcting the recorded value at the time.

本實施形態為利用軟體基底安裝,實現存在有多台裝置之分散系統中的時刻同步者。在有關本實施形態之根據軟體基底安裝之時刻同步方式中,利用IEEE1588的原理。該時刻同步方式可安裝在存在於分散系統中的任意終端。安裝在終端的OS為即時OS。時刻傳送側的終端為主裝置。時刻接收側的終端為從屬、實施時刻同步的終端。 In the present embodiment, it is possible to realize time synchronization in a distributed system in which a plurality of devices exist by mounting on a soft substrate. In the time synchronization method according to the present embodiment in which the software base is mounted, the principle of IEEE 1588 is utilized. This time synchronization method can be installed in any terminal existing in the distributed system. The OS installed on the terminal is an instant OS. The terminal on the transmission side is the master device. The terminal on the receiving side of time is a slave that is dependent and synchronized at the time of implementation.

以下,依序說明有關本實施形態之系統構成、有關本實施形態之系統動作、本實施形態之效果。 Hereinafter, the system configuration of the present embodiment, the system operation of the present embodiment, and the effects of the present embodiment will be described in order.

***構成的說明*** ***Composed description***

參照圖1,說明有關本實施形態系統之時刻同步系統100的構成例。 An example of the configuration of the time synchronization system 100 according to the system of the present embodiment will be described with reference to Fig. 1 .

時刻同步系統100為分散系統。時刻同步系統100 包括:1台GM110(Grand。Master;總主裝置)、及多台PLC120(Programmable‧Logic‧Controller;可程式邏輯控制器)、及多台現場裝置130。 The time synchronization system 100 is a distributed system. Time synchronization system 100 It includes: one GM110 (Grand. Master; main master), and a plurality of PLC120 (Programmable‧Logic‧ Controller; programmable logic controller), and a plurality of field devices 130.

在本例中,採用樹狀型的網路架構。GM110成為根部,至少有3台PLC120作為根部的下位節點與GM110連接。至少連接1台PLC120或是至少3台的現場裝置130作為更下位節點,構成子網路。 In this case, a tree-like network architecture is used. The GM 110 becomes the root, and at least three PLCs 120 are connected to the GM 110 as the lower node of the root. At least one PLC 120 or at least three field devices 130 are connected as lower-level nodes to form a sub-network.

GM110提供時刻基準。在GM110和與GM110連接之PLC120間的時刻同步中適用第1時刻同步方式101。第1時刻同步方式101為有關本實施形態之根據軟體基底安裝之時刻同步方式,是利用IEEE1588的原理者。針對根據第1時刻同步方式101的時刻同步順序將於之後詳述。 The GM110 provides a time base. The first time synchronization method 101 is applied to the time synchronization between the GM 110 and the PLC 120 connected to the GM 110. The first time synchronization method 101 is a time synchronization method according to the present embodiment and is based on the principle of IEEE1588. The sequence of time synchronization according to the first time synchronization method 101 will be described in detail later.

在各子網路內部的時刻同步中適用第2時刻同步方式102。第2時刻同步方式102為各子網路之獨自的時刻同步方式。針對根據第2時刻同步方式102的時刻同步順序由於可以適用任意的順序,省略說明。 The second time synchronization method 102 is applied to time synchronization in each subnet. The second time synchronization method 102 is an individual time synchronization method for each subnet. The order of the time synchronization according to the second time synchronization method 102 can be applied to any order, and the description thereof will be omitted.

與GM110連接之PLC120與各子網路的第2時刻同步方式102對應,同時也與第1時刻同步方式101對應。 The PLC 120 connected to the GM 110 corresponds to the second time synchronization method 102 of each subnet, and also corresponds to the first time synchronization method 101.

又,與GM110連接之PLC120的台數、及各子網路的構成可以進行適當變更。將PLC120置換成NC(Numerical‧Controller;數值控制器)等其他種類的機器亦可。 Further, the number of PLCs 120 connected to the GM 110 and the configuration of each subnet can be changed as appropriate. It is also possible to replace the PLC 120 with another type of machine such as NC (Numerical ‧ Controller; numerical controller).

參照圖2,說明有關本實施形態之主裝置200及時刻同步裝置300的構成。 The configuration of the main device 200 and the time synchronization device 300 according to the present embodiment will be described with reference to Fig. 2 .

主裝置200具有主時鐘201。主時鐘201並不是硬體時鐘,而是軟體時鐘。所謂硬體時鐘為搭載在硬體之時鐘。硬體時鐘被利用於硬體時間戳記機能。所謂軟體時鐘為利用軟體進行管理之時鐘。軟體時鐘被利用於軟體時間戳記機能。 The main device 200 has a main clock 201. The main clock 201 is not a hardware clock but a software clock. The so-called hardware clock is a clock that is mounted on a hardware. The hardware clock is used for hardware time stamping. The so-called software clock is a clock that is managed by software. The software clock is utilized for the software timestamp function.

主裝置200包括:傳送部210、接收部220、記錄部230、及補正部240。 The main apparatus 200 includes a transmission unit 210, a reception unit 220, a recording unit 230, and a correction unit 240.

圖1所示之GM110為第1時刻同步方式101中之時刻傳送側的終端,相當於主裝置200。 The GM 110 shown in FIG. 1 is a terminal on the transmission side in the first time synchronization method 101, and corresponds to the master device 200.

時刻同步裝置300具有從屬時鐘301。從屬時鐘301與主時鐘201相同,並不是硬體時鐘,而是軟體時鐘。 The time synchronization device 300 has a slave clock 301. The slave clock 301 is the same as the master clock 201 and is not a hardware clock but a software clock.

時刻同步裝置300包括:接收部310、傳送部320、記錄部330、補正部340、及同步部350。 The time synchronization device 300 includes a reception unit 310, a transmission unit 320, a recording unit 330, a correction unit 340, and a synchronization unit 350.

如圖1所示之與GM110連接之PLC120為第1時刻同步方式101中之時刻接收側的終端,相當於時刻同步裝置300。 The PLC 120 connected to the GM 110 as shown in FIG. 1 is a terminal on the receiving side at the time of the first time synchronization method 101, and corresponds to the time synchronization device 300.

主裝置200與時刻同步裝置300依照以下說明之第1時刻同步方式101的通訊順序,透過網路400互相傳送/接收資料。藉此,時刻同步裝置300可以使從屬時鐘301的時刻與主時鐘201的時刻一致。 The main device 200 and the time synchronization device 300 transmit and receive data to and from each other via the network 400 in accordance with the communication sequence of the first time synchronization method 101 described below. Thereby, the time synchronization device 300 can match the time of the slave clock 301 with the time of the master clock 201.

主裝置200的傳送部210將第1資料401傳送到時刻同步裝置300。 The transfer unit 210 of the host device 200 transmits the first material 401 to the time synchronization device 300.

時刻同步裝置300的接收部310從主裝置200接收第1資料401。 The receiving unit 310 of the time synchronization device 300 receives the first material 401 from the host device 200.

時刻同步裝置300的傳送部320在利用接收部310 接收第1資料401後,將第2資料402傳送到主裝置200。 The transmitting unit 320 of the time synchronization device 300 is using the receiving unit 310. After receiving the first material 401, the second material 402 is transmitted to the host device 200.

主裝置200的接收部220從時刻同步裝置300接收第2資料402。 The receiving unit 220 of the host device 200 receives the second material 402 from the time synchronization device 300.

主裝置200的記錄部230使用主時鐘201,記錄傳送部210之第1資料401傳送時刻及接收部220之第2資料402接收時刻。 The recording unit 230 of the main device 200 uses the main clock 201 to record the transmission time of the first data 401 of the transmission unit 210 and the reception time of the second data 402 of the reception unit 220.

主裝置200的補正部240補正根據記錄部230記錄之第1資料401傳送時刻及第2資料402接收時刻。 The correction unit 240 of the main device 200 corrects the transmission time of the first data 401 and the reception time of the second data 402 recorded by the recording unit 230.

主裝置200的傳送部210將至少用以通知根據補正部240補正之第1資料401傳送時刻之第3資料403、及至少用以通知根據補正部240補正之第2資料402接收時刻之第4資料404傳送到時刻同步裝置300。藉此,傳送部210對於時刻同步裝置300至少通知根據補正部240補正之第1資料401傳送時刻及第2資料402接收時刻。 The transmission unit 210 of the host device 200 notifies at least the third data 403 for transmitting the time of the first data 401 corrected by the correction unit 240, and at least the fourth time for receiving the second data 402 corrected by the correction unit 240. The data 404 is transmitted to the time synchronization device 300. Thereby, the transmission unit 210 notifies the time synchronization device 300 of at least the first data 401 transmission time and the second data 402 reception time corrected by the correction unit 240.

時刻同步裝置300的接收部310從主裝置200接收第3資料403及第4資料404。 The receiving unit 310 of the time synchronization device 300 receives the third data 403 and the fourth material 404 from the host device 200.

時刻同步裝置300的記錄部330使用從屬時鐘301,記錄接收部310之第1資料401接收時刻及傳送部320之第2資料402傳送時刻。 The recording unit 330 of the time synchronization device 300 uses the slave clock 301 to record the reception time of the first data 401 of the reception unit 310 and the transmission time of the second data 402 of the transmission unit 320.

時刻同步裝置300的補正部340補正根據記錄部330記錄之第1資料401接收時刻及第2資料402傳送時刻。 The correction unit 340 of the time synchronization device 300 corrects the reception time of the first data 401 and the transmission time of the second material 402 recorded by the recording unit 330.

時刻同步裝置300的同步部350至少從主裝置200通知的主裝置200之第1資料401傳送時刻、根據補正部340補正之第1資料401接收時刻、根據補正部340補正之第2資 料402傳送時刻、及主裝置200通知的主裝置200之第2資料402接收時刻,計算出偏置405。偏置405為主時鐘201與從屬時鐘301之時刻偏移。同步部350在計算偏置405時,參照根據接收部310接收的第3資料403與第4資料404。即,同步部350從根據接收部310接收的第3資料403,得到主裝置200之第1資料401傳送時刻。同步部350從根據接收部310接收的第4資料404,得到主裝置200之第2資料402接收時刻。 The synchronization unit 350 of the time synchronization device 300 transmits at least the time of transmission of the first data 401 of the host device 200 notified by the host device 200, the time of reception of the first data 401 corrected by the correction unit 340, and the second resource corrected by the correction unit 340. The time 402 and the time of reception of the second data 402 of the host device 200 notified by the host device 200 are calculated, and the offset 405 is calculated. The offset 405 is offset from the time of the master clock 201 and the slave clock 301. When calculating the offset 405, the synchronization unit 350 refers to the third data 403 and the fourth material 404 received by the receiving unit 310. In other words, the synchronization unit 350 obtains the transmission timing of the first material 401 of the host device 200 from the third data 403 received by the reception unit 310. The synchronization unit 350 obtains the second data 402 reception time of the host device 200 from the fourth data 404 received by the reception unit 310.

在本實施形態中,第3資料403不只是根據主裝置200的補正部240補正之第1資料401傳送時刻,也是用以通知根據主裝置200的記錄部230記錄之第1資料401傳送時刻之資料。第4資料404不只是根據補正部240補正之第2資料402接收時刻,也是用以通知根據記錄部230記錄之第2資料402接收時刻之資料。即,在本實施形態中,主裝置200的傳送部210對於時刻同步裝置300,進一步通知根據記錄部230記錄之第1資料401傳送時刻、及第2資料402接收時刻。為此,時刻同步裝置300的同步部350在計算偏置405時,將根據主裝置200的記錄部230記錄之第1資料401傳送時刻與根據主裝置200的補正部240補正之第1資料401傳送時刻兩者用來作為主裝置200通知的主裝置200之第1資料401傳送時刻。又,時刻同步裝置300的同步部350在計算偏置405時,將根據主裝置200的記錄部230記錄之第2資料402接收時刻與根據主裝置200的補正部240補正之第2資料402接收時刻兩者用來作為主裝置200通知的主裝置200之第2資料402接 收時刻。 In the present embodiment, the third data 403 is not only the transmission time of the first material 401 corrected by the correction unit 240 of the host device 200, but also for notifying the transmission time of the first data 401 recorded by the recording unit 230 of the host device 200. data. The fourth material 404 is not only the reception time of the second data 402 corrected by the correction unit 240, but also the data for notifying the reception time of the second data 402 recorded by the recording unit 230. In other words, in the present embodiment, the transmission unit 210 of the host device 200 further notifies the time synchronization device 300 of the transmission time of the first data 401 and the reception time of the second data 402 recorded by the recording unit 230. Therefore, when the offset unit 405 calculates the offset 405, the synchronization unit 350 of the time synchronization device 300 calculates the first data 401 transmission time recorded by the recording unit 230 of the main device 200 and the first data 401 corrected by the correction unit 240 of the main device 200. Both of the transfer times are used as the first data 401 transfer time of the host device 200 notified by the host device 200. Further, when the offset unit 405 calculates the offset 405, the synchronization unit 350 of the time synchronization device 300 receives the second data 402 reception time recorded by the recording unit 230 of the main device 200 and the second data 402 corrected by the correction unit 240 of the main device 200. At the time, both are used as the second data 402 of the main device 200 notified by the main device 200. Receive time.

在本實施形態中,同步部350在計算偏置405時,不只是根據補正部340補正之第1資料401接收時刻,也使用記錄部330記錄之第1資料401接收時刻。又,同步部350在計算偏置405時,不只是根據補正部340補正之第2資料402傳送時刻,也使用記錄部330記錄之第2資料402傳送時刻。 In the present embodiment, when the offset unit 405 calculates the offset 405, the synchronization unit 350 not only receives the time of receiving the first data 401 corrected by the correction unit 340, but also receives the time of the first data 401 recorded by the recording unit 330. Further, when the offset unit 405 calculates the offset 405, the synchronization unit 350 not only transmits the time of the second data 402 corrected by the correction unit 340, but also transmits the time of the second material 402 recorded by the recording unit 330.

換言之,在本實施形態中,同步部350從主裝置200記錄之第1資料401傳送時刻、主裝置200補正之第1資料401傳送時刻、根據記錄部330記錄之第1資料401接收時刻、根據補正部340補正之第1資料401接收時刻、根據記錄部330記錄之第2資料402傳送時刻、根據補正部340補正之第2資料402傳送時刻、主裝置200記錄之第2資料402傳送時刻、及主裝置200補正之第2資料402接收時刻,計算出偏置405。 In other words, in the present embodiment, the synchronization unit 350 transmits the time from the first data 401 recorded by the host device 200, the transmission time of the first data 401 corrected by the main device 200, and the reception time of the first data 401 recorded by the recording unit 330, based on The first data 401 reception time corrected by the correction unit 340, the second data 402 transmission time recorded by the recording unit 330, the second data 402 transmission time corrected by the correction unit 340, and the second data 402 transmission time recorded by the host device 200, And the time at which the second data 402 corrected by the main device 200 is received, the offset 405 is calculated.

具體而言,同步部350從主裝置200記錄之第1資料401傳送時刻與主裝置200補正之第1資料401傳送時刻的總合、和根據記錄部330記錄之第1資料401接收時刻與根據補正部340補正之第1資料401接收時刻的總合之差、及根據記錄部330記錄之第2資料402傳送時刻與根據補正部340補正之第2資料402傳送時刻的總合、和主裝置200記錄之第2資料402接收時刻與主裝置200補正之第2資料402接收時刻的總合之差,計算出偏置405。 Specifically, the synchronization unit 350 receives the total of the transmission time of the first data 401 recorded by the host device 200 and the transmission time of the first data 401 corrected by the host device 200, and the reception time and the basis of the first data 401 recorded by the recording unit 330. The total difference between the reception time of the first data 401 corrected by the correction unit 340, and the total of the transmission time of the second data 402 recorded by the recording unit 330 and the transmission time of the second data 402 corrected by the correction unit 340, and the master device The offset 405 is calculated by the difference between the reception time of the second data 402 recorded at 200 and the reception time of the second data 402 corrected by the host device 200.

又,第3資料403即使只是用以通知根據主裝置200的記錄部230記錄的第1資料401傳送時刻之資料亦可。 第4資料404即使只是用以通知根據記錄部230記錄的第2資料402接收時刻之資料亦可。因此,主裝置200不包括補正部240亦可。 Further, the third material 403 may be used to notify the data transmitted at the time of the first data 401 recorded by the recording unit 230 of the host device 200. The fourth material 404 may be used to notify the data of the time of receipt of the second data 402 recorded by the recording unit 230. Therefore, the main device 200 does not include the correction unit 240.

在主裝置200不包括補正部240、或是補正部240沒有補正根據記錄部230記錄之第1資料401傳送時刻之情況下,時刻同步裝置300的補正部340補正主裝置200通知之主裝置200的第1資料401傳送時刻亦可。在該情況下,時刻同步裝置300的同步部350在計算偏置405時,可以使用主裝置200通知之主裝置200的第1資料401傳送時刻,同時使用根據補正部340補正之第1資料401的傳送時刻。 When the main device 200 does not include the correction unit 240 or the correction unit 240 does not correct the transmission time of the first data 401 recorded by the recording unit 230, the correction unit 340 of the time synchronization device 300 corrects the main device 200 notified by the main device 200. The first data 401 can also be transmitted at the time. In this case, when the synchronization unit 350 of the time synchronization device 300 calculates the offset 405, the first data 401 of the main device 200 notified by the host device 200 can be used to transmit the time, and the first data 401 corrected by the correction unit 340 can be used. The moment of transmission.

在主裝置200不包括補正部240、或是補正部240沒有補正根據記錄部230記錄之第2資料402接收時刻之情況下,時刻同步裝置300的補正部340補正主裝置200通知之主裝置200的第2資料402接收時刻亦可。在該情況下,時刻同步裝置300的同步部350在計算偏置405時,可以使用主裝置200通知之主裝置200的第2資料402接收時刻,同時使用根據補正部340補正之第2資料402接收時刻。 When the main device 200 does not include the correction unit 240 or the correction unit 240 does not correct the reception time of the second data 402 recorded by the recording unit 230, the correction unit 340 of the time synchronization device 300 corrects the main device 200 notified by the main device 200. The second data 402 can also be received at the time. In this case, when the synchronization unit 350 of the time synchronization device 300 calculates the offset 405, the second data 402 that is corrected by the main device 200 can be used, and the second data 402 corrected by the correction unit 340 can be used. Receive time.

***動作說明*** *** Action Description ***

參照圖3、圖4及圖5,說明時刻同步系統100的動作。時刻同步系統100的動作相當於有關本實施形態之時刻同步方法。 The operation of the time synchronization system 100 will be described with reference to Figs. 3, 4 and 5. The operation of the time synchronization system 100 corresponds to the time synchronization method of the present embodiment.

圖3為顯示與第1資料401的傳送/接收相關之動作。在本實施形態中反覆進行第1資料401的傳送/接收。 FIG. 3 is a view showing an operation related to transmission/reception of the first material 401. In the present embodiment, transmission/reception of the first material 401 is repeated.

在步驟S11中,主裝置200的傳送部210將第1 資料401反覆傳送到時刻同步裝置300。 In step S11, the transmission unit 210 of the main device 200 will be the first The data 401 is repeatedly transmitted to the time synchronization device 300.

在步驟S12中,時刻同步裝置300的接收部310從主裝置200反覆接收第1資料401。 In step S12, the receiving unit 310 of the time synchronization device 300 repeatedly receives the first material 401 from the host device 200.

在步驟S13中,主裝置200的記錄部230在每次根據傳送部210傳送第1資料401時,使用主時鐘201記錄傳送部210之第1資料401傳送時刻。 In step S13, the recording unit 230 of the main apparatus 200 records the transmission time of the first material 401 of the transmission unit 210 using the main clock 201 each time the first data 401 is transmitted by the transmission unit 210.

在步驟S14中,主裝置200的補正部240在每次根據記錄部230記錄第1資料401的傳送時刻時產生亂數,並使用已產生的亂數,計算根據記錄部230記錄之第1資料401傳送時刻的補正值。 In step S14, the correction unit 240 of the main apparatus 200 generates a random number every time the recording unit 230 records the transmission time of the first material 401, and calculates the first data recorded by the recording unit 230 using the generated random number. 401 The correction value of the transmission time.

在步驟S15中,主裝置200的傳送部210將用以通知根據補正部240計算之第1資料401傳送時刻的補正值之資料作為第3資料403傳送到時刻同步裝置300。 In step S15, the transmission unit 210 of the host device 200 transmits the data for notifying the correction value of the transmission time of the first data 401 calculated by the correction unit 240 to the time synchronization device 300 as the third data 403.

在步驟S16中,時刻同步裝置300的接收部310從主裝置200反覆接收第3資料403。 In step S16, the receiving unit 310 of the time synchronization device 300 repeatedly receives the third material 403 from the host device 200.

在步驟S17中,時刻同步裝置300的記錄部330在每次根據接收部310接收第1資料401時,使用從屬時鐘301記錄接收部310之第1資料接收時刻。 In step S17, the recording unit 330 of the time synchronization device 300 records the first data reception time of the reception unit 310 using the slave clock 301 each time the first data 401 is received by the reception unit 310.

在步驟S18中,時刻同步裝置300的補正部340在每次根據記錄部330記錄第1資料401的接收時刻時產生亂數,使用已產生的亂數,計算根據記錄部330記錄之第1資料401接收時刻的補正值。 In step S18, the correction unit 340 of the time synchronization device 300 generates a random number each time the reception time of the first data 401 is recorded by the recording unit 330, and calculates the first data recorded by the recording unit 330 using the generated random number. 401 receives the correction value of the time.

如後述所示,時刻同步裝置300的同步部350在計算偏置405時,使用根據補正部340計算之第1資料401接 收時刻的補正值作為第1資料401的接收時刻。 As will be described later, the synchronization unit 350 of the time synchronization device 300 uses the first data 401 calculated by the correction unit 340 when calculating the offset 405. The correction value at the time of collection is used as the reception time of the first material 401.

圖4為顯示與第2資料402的傳送/接收相關之動作。在本實施形態中反覆進行第2資料402的傳送/接收。 FIG. 4 is a view showing an operation related to transmission/reception of the second material 402. In the present embodiment, transmission/reception of the second material 402 is repeated.

在步驟S21中,時刻同步裝置300的傳送部320在每次根據接收部310接收第1資料401時,將第2資料402傳送到主裝置200。 In step S21, the transmission unit 320 of the time synchronization device 300 transmits the second material 402 to the main device 200 every time the reception unit 310 receives the first material 401.

在步驟S22中,主裝置200的接收部220從時刻同步裝置300反覆接收第2資料402。 In step S22, the receiving unit 220 of the host device 200 repeatedly receives the second material 402 from the time synchronization device 300.

在步驟S23中,主裝置200的記錄部230在每次根據接收部220接收第2資料402時,使用主時鐘201記錄接收部220之第2資料402接收時刻。 In step S23, the recording unit 230 of the main device 200 records the reception time of the second material 402 of the receiving unit 220 using the main clock 201 each time the second data 402 is received by the receiving unit 220.

在步驟S24中,主裝置200的補正部240在每次根據記錄部230記錄第2資料402的接收時刻時產生亂數,使用已產生的亂數,計算根據記錄部230記錄之第2資料402接收時刻的補正值。 In step S24, the correction unit 240 of the main apparatus 200 generates a random number every time the recording unit 230 records the reception time of the second material 402, and calculates the second material 402 recorded by the recording unit 230 using the generated random number. The correction value at the time of reception.

在步驟S25中,主裝置200的傳送部210將用以通知根據補正部240計算之第2資料402接收時刻的補正值之資料作為第4資料404傳送到時刻同步裝置300。 In step S25, the transfer unit 210 of the host device 200 transmits the data for notifying the correction value of the second data 402 reception time calculated by the correction unit 240 to the time synchronization device 300 as the fourth data 404.

在步驟S26中,時刻同步裝置300的接收部310從主裝置200反覆接收第4資料404。 In step S26, the receiving unit 310 of the time synchronization device 300 repeatedly receives the fourth material 404 from the host device 200.

在步驟S27中,時刻同步裝置300的記錄部330在每次根據傳送部320傳送第2資料402時,使用從屬時鐘301,記錄傳送部320之第2資料402的傳送時刻。 In step S27, the recording unit 330 of the time synchronization device 300 uses the slave clock 301 to record the transmission time of the second material 402 of the transmission unit 320 each time the second data 402 is transmitted by the transmission unit 320.

在步驟S28中,時刻同步裝置300的補正部340 在每次根據記錄部330記錄第2資料402傳送時刻時產生亂數,使用已產生的亂數,計算根據記錄部330記錄之第2資料402傳送時刻的補正值。 In step S28, the correction unit 340 of the time synchronization device 300 Each time the recording unit 330 records the transmission time of the second material 402, a random number is generated, and the correction value according to the transmission timing of the second material 402 recorded by the recording unit 330 is calculated using the generated random number.

如後述所示,時刻同步裝置300的同步部350在計算偏置405時,使用根據補正部340計算之第2資料402傳送時刻的補正值作為第2資料402的傳送時刻。 As will be described later, the synchronization unit 350 of the time synchronization device 300 uses the correction value of the transmission time of the second data 402 calculated by the correction unit 340 as the transmission time of the second material 402 when calculating the offset 405.

在本實施形態中,如上述所示,反覆進行將1個個第1資料401、第2資料402、第3資料403及第4資料404依序傳送/接收之通訊順序。 In the present embodiment, as described above, the communication sequence in which one piece of the first material 401, the second material 402, the third material 403, and the fourth material 404 are sequentially transmitted/received is repeatedly performed.

圖5為顯示計算偏置405的動作。 FIG. 5 is a diagram showing the operation of calculating the offset 405.

在步驟S31中,時刻同步裝置300的同步部350在每次根據接收部310接收第1資料401時,計算偏置405。即,同步部350針對1次的通訊順序,計算1個偏置405。 In step S31, the synchronization unit 350 of the time synchronization device 300 calculates the offset 405 every time the first data 401 is received by the receiving unit 310. That is, the synchronization unit 350 calculates one offset 405 for one communication sequence.

在步驟S32中,時刻同步裝置300的同步部350儲存偏置405的多個計算值。即,同步部350儲存對應2次以上的通訊順序之2個以上的偏置405。 In step S32, the synchronization unit 350 of the time synchronization device 300 stores a plurality of calculated values of the offset 405. In other words, the synchronization unit 350 stores two or more offsets 405 corresponding to the communication order of two or more times.

在步驟S33中,時刻同步裝置300的同步部350進行已儲存之多個計算值的統計處理。同步部350因應該統計處理的結果,調整從屬時鐘301的時刻。具體而言,同步部350將已儲存之多個計算值的平均用來作為統計處理的結果,調整從屬時鐘301的時刻。藉此,使主時鐘201的時刻與從屬時鐘301的時刻同步。 In step S33, the synchronization unit 350 of the time synchronization device 300 performs statistical processing of the plurality of stored calculated values. The synchronization unit 350 adjusts the timing of the slave clock 301 as a result of the statistical processing. Specifically, the synchronization unit 350 uses the average of the stored plurality of calculated values as the result of the statistical processing, and adjusts the timing of the slave clock 301. Thereby, the timing of the master clock 201 is synchronized with the timing of the slave clock 301.

在本實施形態中,如前述所示,利用IEEE1588的原理。即,將第1資料401、第2資料402、第3資料403及 第4資料404作為同步訊框進行傳送/接收。具體而言,將第1資料401作為Sync(同步)訊息進行傳送/接收,第2資料402作為Follow-Up(追蹤)訊息進行傳送/接收,第3資料403作為Delay_Req(延遲請求)訊息進行傳送/接收,第4資料404作為Delay_Resp(延遲回應)訊息進行傳送/接收。 In the present embodiment, as described above, the principle of IEEE 1588 is utilized. That is, the first data 401, the second data 402, the third data 403, and The fourth data 404 is transmitted/received as a synchronization frame. Specifically, the first data 401 is transmitted/received as a Sync message, the second data 402 is transmitted/received as a Follow-Up message, and the third data 403 is transmitted as a Delay_Req message. /Receive, the 4th data 404 is transmitted/received as a Delay_Resp message.

若是假設主裝置200與時刻同步裝置300間之單向延遲為往返延遲的一半,將根據記錄部330記錄之第1資料401接收時刻與根據補正部340補正之第1資料401接收時刻的總合減去藉由第3資料403通知之主裝置200記錄之第1資料401傳送時刻與主裝置200補正之第1資料401傳送時刻的總合之值、和藉由第4資料404通知之主裝置200記錄之第2資料402接收時刻與主裝置200補正之第2資料402接收時刻的總合減去根據記錄部330記錄之第2資料402傳送時刻與根據補正部340補正之第2資料402傳送時刻的總合之值的總和,以4除之的值成為單向延遲。接著,將根據記錄部330記錄之第1資料401接收時刻與根據補正部340補正之第1資料401接收時刻的總和減去主裝置200記錄之第1資料401傳送時刻與主裝置200補正之第1資料401傳送時刻的總合以2除之的值、和主裝置200記錄之第2資料402接收時刻與主裝置200補正之第2資料402接收時刻的總合減去根據記錄部330記錄之第2資料402傳送時刻與根據補正部340補正之第2資料402傳送時刻的總合以2除之的值之任一方,減去單向延遲之值成為偏置405。 If it is assumed that the one-way delay between the master device 200 and the time synchronization device 300 is half of the round trip delay, the total time of the reception time of the first data 401 recorded by the recording unit 330 and the reception time of the first data 401 corrected by the correction unit 340 is determined. The sum of the transmission time of the first data 401 recorded by the main device 200 notified by the third data 403 and the transmission time of the first data 401 corrected by the main device 200, and the main device notified by the fourth data 404 are subtracted. The total of the reception time of the second data 402 of the 200 record and the reception time of the second data 402 corrected by the main device 200 is subtracted from the transmission time of the second data 402 recorded by the recording unit 330 and the second data 402 corrected by the correction unit 340. The sum of the total values of the moments, the value divided by 4 becomes a one-way delay. Then, the reception time of the first data 401 recorded by the recording unit 330 and the reception time of the first data 401 corrected by the correction unit 340 are subtracted from the transmission time of the first data 401 recorded by the host device 200 and the correction by the host device 200. The total value of the data 401 transmission time is divided by 2, and the total time of the reception time of the second data 402 recorded by the host device 200 and the second data 402 reception time corrected by the host device 200 is subtracted from the recording unit 330. The value of the second data 402 transmission time and the total of the transmission time of the second data 402 corrected by the correction unit 340 is divided by two, and the value obtained by subtracting the one-way delay becomes the offset 405.

即,在偏置405為T_offset、根據主裝置200的記 錄部230記錄之第1資料401傳送時刻為T_m1、T_m1的補正值為T_m1’、根據時刻同步裝置300的記錄部330記錄之第1資料401的接收時刻為T_s1、T_s1的補正值為T_s1’、根據時刻同步裝置300的記錄部330記錄之第2資料402的傳送時刻為T_s2、T_s2的補正值為T_s2’、主裝置200的記錄部230記錄之第2資料402接收時刻為T_m2、T_m2的補正值為T_m2’時T_offset=((T_s1+T_s1’)-(T_m1+T_m1’))/2-(((T_s1+T_s1’)-(T_m1+T_m1’))+((T_m2+T_m2’)-(T_s2+T_s2’)))/4=(((T_s1+T_s1’)-(T_m1+T_m1’)-((T_m2+T_m2’)-(T_s2+T_s2’)))/4,或是T_offset=((T_m2+T_m2’)-(T_s2+T_s2’))/2-(((T_s1+T_s1’)-(T_m1+T_m1’))+((T_m2+T_m2’)-(T_s2+T_s2’)))/4=(((T_s1+T_s1’)-(T_m1+T_m1’)-((T_m2+T_m2’)-(T_s2+T_s2’)))/4。在步驟S31中,可以使用這樣的計算式可以求出偏置405。 That is, the offset 405 is T_offset, according to the record of the host device 200. The transmission time of the first data 401 recorded by the recording unit 230 is T_m1, the correction value of T_m1 is T_m1', and the reception time of the first data 401 recorded by the recording unit 330 of the time synchronization device 300 is T_s1, and the correction value of T_s1 is T_s1'. The transmission time of the second data 402 recorded by the recording unit 330 of the time synchronization device 300 is T_s2, the correction value of T_s2 is T_s2', and the reception time of the second data 402 recorded by the recording unit 230 of the main device 200 is T_m2 and T_m2. When the correction value is T_m2', T_offset=((T_s1+T_s1')-(T_m1+T_m1'))/2-(((T_s1+T_s1')-(T_m1+T_m1'))+((T_m2+T_m2') -(T_s2+T_s2')))/4=(((T_s1+T_s1')-(T_m1+T_m1')-((T_m2+T_m2')-(T_s2+T_s2')))/4, or T_offset =((T_m2+T_m2')-(T_s2+T_s2'))/2-(((T_s1+T_s1')-(T_m1+T_m1'))+((T_m2+T_m2')-(T_s2+T_s2') )) /4 = (((T_s1 + T_s1') - (T_m1 + T_m1') - ((T_m2 + T_m2') - (T_s2 + T_s2'))) / 4. In step S31, such calculation can be used The equation can be used to find the offset 405.

又,將根據補正部340補正之第1資料401接收時刻減去藉由第3資料403通知之第1資料401傳送時刻之值、和藉由第4資料404通知之第2資料402接收時刻減去根據補正部340補正之第2資料402傳送時刻之值的總合以2除之的值視為單向延遲亦可。在該情況下,從根據補正部340補正之第1資料401接收時刻減去藉由第3資料403通知之第1資料401傳送時刻之值、與藉由第4資料404通知之第2資料402接收時刻減去根據補正部340補正之第2資料402傳送時刻之值的任一方減去單向延遲之值成為偏置405。 Further, the reception time of the first data 401 corrected by the correction unit 340 is subtracted from the value of the transmission time of the first data 401 notified by the third data 403, and the reception time of the second data 402 notified by the fourth data 404 is subtracted. The value obtained by dividing the total value of the transmission time of the second data 402 corrected by the correction unit 340 by 2 is regarded as a one-way delay. In this case, the value of the transmission time of the first data 401 notified by the third data 403 and the second data 402 notified by the fourth material 404 are subtracted from the reception time of the first data 401 corrected by the correction unit 340. The value obtained by subtracting the value of the one-way delay from the reception time minus the value of the transmission time of the second data 402 corrected by the correction unit 340 becomes the offset 405.

即,在步驟S31中,使用 T_offset=(T_s1’-T_m1’)-((T_s1’-T_m1’)+(T_m2’-T_s2’))/2=((T_s1’-T_m1’)-(T_m2’-T_s2’))/2、或是T_offset=(T_m2’-T_s2’)-((T_s1’-T_m1’)+(T_m2’-T_s2’))/2=-((T_s1’-T_m1’)-(T_m2’-T_s2’))/2之計算式求出偏置405亦可。 That is, in step S31, use T_offset=(T_s1'-T_m1')-((T_s1'-T_m1')+(T_m2'-T_s2'))/2=((T_s1'-T_m1')-(T_m2'-T_s2'))/2, Or T_offset=(T_m2'-T_s2')-((T_s1'-T_m1')+(T_m2'-T_s2'))/2=-((T_s1'-T_m1')-(T_m2'-T_s2')) The calculation formula of /2 can also find the offset 405.

參照圖6,說明主裝置200及時刻同步裝置300的安裝例。 An example of mounting the main device 200 and the time synchronization device 300 will be described with reference to Fig. 6 .

時刻同步裝置300的接收部310及傳送部320之機能被安裝在PHY302及MAC303(Media‧Access‧Control;媒體存取控制器)。PHY302及MAC303是內藏在時刻同步裝置300之硬體。具體而言,PHY302為進行OSI參考模型的物理層處理之晶片,MAC303為進行OSI參考模型的資料鏈結層處理之晶片。又,PHY302及MAC303統合在相同的晶片亦可。 The functions of the receiving unit 310 and the transmitting unit 320 of the time synchronization device 300 are installed in the PHY 302 and the MAC 303 (Media‧Access‧ Control; Media Access Controller). The PHY 302 and the MAC 303 are hardware built in the time synchronization device 300. Specifically, the PHY 302 is a wafer that performs physical layer processing of the OSI reference model, and the MAC 303 is a wafer that performs data link layer processing of the OSI reference model. Moreover, the PHY 302 and the MAC 303 may be integrated on the same chip.

同樣,主裝置200的傳送部210及接收部220之機能也是被安裝在PHY202及MAC203。PHY202為進行物理層處理之晶片,MAC203為進行資料鏈結層處理之晶片。 Similarly, the functions of the transmitting unit 210 and the receiving unit 220 of the master device 200 are also installed in the PHY 202 and the MAC 203. The PHY 202 is a chip that performs physical layer processing, and the MAC 203 is a wafer that performs data link layer processing.

時刻同步裝置300的記錄部330之機能被安裝在MAC驅動器304。MAC驅動器304為搭載在時刻同步裝置300之軟體。具體而言,MAC驅動器304為了控制及操作MAC303,藉由OS305予以利用之中間軟體。MAC驅動器304具有使用從屬時鐘301產生時間戳記之軟體時間戳記機能。 The function of the recording unit 330 of the time synchronization device 300 is installed in the MAC driver 304. The MAC driver 304 is a software mounted on the time synchronization device 300. Specifically, the MAC driver 304 uses the intermediate software utilized by the OS 305 in order to control and operate the MAC 303. The MAC driver 304 has a soft time stamp function that generates a time stamp using the slave clock 301.

同樣,主裝置200的記錄部230之機能也被安裝在MAC驅動器204。MAC驅動器204為了控制及操作MAC203,藉由OS205予以利用之中間軟體。MAC驅動器204具有使用主時鐘201產生時間戳記之軟體時間戳記機能。 Similarly, the function of the recording unit 230 of the main apparatus 200 is also installed in the MAC driver 204. The MAC driver 204 is an intermediate software that is utilized by the OS 205 in order to control and operate the MAC 203. The MAC driver 204 has a soft time stamp function that generates a time stamp using the master clock 201.

時刻同步裝置300的補正部340及同步部350之機能被安裝在時刻同步應用程式306。時刻同步應用程式306為搭載在時刻同步裝置300之軟體。具體而言,時刻同步應用程式306為與其他應用程式307一起在OS305上動作之應用程式。時刻同步應用程式306管理用以補正根據MAC驅動器304產生之時間戳記的波動之補正表308。 The functions of the correction unit 340 and the synchronization unit 350 of the time synchronization device 300 are installed in the time synchronization application 306. The time synchronization application 306 is a software installed in the time synchronization device 300. Specifically, the time synchronization application 306 is an application that operates on the OS 305 together with other applications 307. The time synchronization application 306 manages a correction table 308 for correcting fluctuations in time stamps generated by the MAC driver 304.

同樣,主裝置200的補正部240之機能被安裝在時刻同步應用程式206。時刻同步應用程式206為與其他應用程式207一起在OS205上動作之應用程式。時刻同步應用程式206管理補正根據MAC驅動器204產生之時間戳記的波動所用之補正表208。 Similarly, the function of the correcting unit 240 of the main device 200 is installed in the time synchronization application 206. The time synchronization application 206 is an application that operates on the OS 205 together with other applications 207. The time synchronization application 206 manages the correction table 208 used to correct the fluctuations in the time stamps generated by the MAC driver 204.

傳送時刻之主裝置200、及使時刻同步之時刻同步裝置300的OS對於時刻同步具有相同的階層構造。該階層構造為:對應OS205、305及時刻同步應用程式206、306之應用程式層;對應MCA驅動器204、304及MAC203、303之資料鏈結層;及對應PHY202、302之物理層的3層構造。如此一來,在有關本實施形態之時刻同步協定中,從應用程式層不透過OSI參考模型的傳送層及網路層,直接存取資料鏈結層。 The master device 200 that transmits the time and the OS of the time synchronization device 300 that synchronizes the time have the same hierarchical structure for the time synchronization. The hierarchy is configured as: an application layer corresponding to the OS 205, 305 and the time synchronization applications 206, 306; a data link layer corresponding to the MCA drivers 204, 304 and the MACs 203, 303; and a 3-layer structure corresponding to the physical layers of the PHYs 202, 302 . As described above, in the time synchronization protocol of the present embodiment, the data link layer is directly accessed from the application layer without the transmission layer and the network layer of the OSI reference model.

參照圖7,說明圖6所例示之主裝置200及時刻同步裝置300的動作。 The operation of the master device 200 and the time synchronization device 300 illustrated in Fig. 6 will be described with reference to Fig. 7 .

在主裝置200將Sync訊息作為同步訊框進行傳送之步驟S41中,時刻同步應用程式206產生Sync訊息的同步訊框。時刻同步應用程式206在該同步訊框中不儲存時刻。當OS205檢測到利用時刻同步應用程式206產生同步訊框時,啟 動優先中斷,將該同步訊框比其他訊框更先輸入到MAC驅動器204。MAC驅動器204藉由在輸入同步訊框的時點產生軟體時間戳記,記錄同步訊框的傳送時刻T_m1。之後,MAC驅動器204將同步訊框輸入到MAC203。MAC203從PHY202傳送同步訊框。MAC驅動器204將已記錄的傳送時刻T_m1反饋到時刻同步應用程式206。時刻同步應用程式206將從MAC驅動器204所反饋的傳送時刻T_m1儲存在補正表208之第1行空白列中的最前列。時刻同步應用程式206產生依據正規分布的亂數,將已產生的亂數儲存在補正表208第2行的同一列。時刻同步應用程式206藉由從儲存在補正表208第1行的傳送時刻T_m1減去儲存在補正表208第2行的亂數,補正傳送時刻T_m1的波動。時刻同步應用程式206將已補正的傳送時刻T_m1’儲存在補正表208第3行的同一列。又,傳送時刻T_m1藉由在傳送時刻T_m1加上亂數等其他方法取代從傳送時刻T_m1減去亂數進行補正亦可。又,將傳送時刻T_m1、亂數、已補正的傳送時刻T_m1’儲存在補正表208的哪一行哪一列可以適當變更。 In the step S41 in which the main device 200 transmits the Sync message as the synchronization frame, the time synchronization application 206 generates a synchronization frame of the Sync message. The time synchronization application 206 does not store the time in the synchronization frame. When the OS 205 detects that the synchronization frame is generated by the time synchronization application 206, The priority interrupt is interrupted, and the synchronization frame is input to the MAC driver 204 earlier than other frames. The MAC driver 204 records the transmission time T_m1 of the synchronization frame by generating a software time stamp at the time of inputting the synchronization frame. Thereafter, the MAC driver 204 inputs the sync frame to the MAC 203. The MAC 203 transmits a sync frame from the PHY 202. The MAC driver 204 feeds back the recorded transmission time T_m1 to the time synchronization application 206. The time synchronization application 206 stores the transfer time T_m1 fed back from the MAC driver 204 in the forefront of the first row blank column of the correction table 208. The time synchronization application 206 generates random numbers based on the normal distribution, and stores the generated random numbers in the same column of the second row of the correction table 208. The time synchronization application 206 corrects the fluctuation of the transmission time T_m1 by subtracting the random number stored in the second line of the correction table 208 from the transmission time T_m1 stored in the first line of the correction table 208. The time synchronization application 206 stores the corrected transmission time T_m1' in the same column of the third row of the correction table 208. Further, the transmission time T_m1 may be corrected by subtracting the random number from the transmission time T_m1 by another method such as adding a random number at the transmission time T_m1. Further, which row of the correction table 208 is stored in the transmission time T_m1, the random number, and the corrected transmission time T_m1' can be appropriately changed.

在時刻同步裝置300接收Sync訊息作為同步訊框之步驟S51中,PHY302從主裝置200接收同步訊框。PHY302將已接收的同步訊框輸入到MAC303。MAC驅動器304藉由在檢測到同步訊框輸入到MAC303的時點,產生軟體時間戳記,記錄同步訊框的接收時刻T_s1。之後,MAC驅動器304立即將已記錄的接收時刻T_s1輸入到時刻同步應用程式306。時刻同步應用程式306將從MAC驅動器304輸入的接收時刻T_s1 儲存在補正表308第1行之空白列中的最前列。時刻同步應用程式306產生依據正規分布的亂數,將已產生的亂數儲存在補正表308第2行的同一列。時刻同步應用程式306藉由從儲存在補正表308第1行的接收時刻T_s1減去儲存在補正表308第2行的亂數,補正接收時刻T_s1的波動。時刻同步應用程式306將已補正的接收時刻T_s1’儲存在補正表308第3行的同一列。又接收時刻T_s1藉由在接收時刻T_s1加上亂數等其他方法取代從接收時刻T_s1減去亂數進行補正亦可。又,將接收時刻T_s1、亂數、已補正的接收時刻T_s1’儲存在補正表308的哪一行哪一列可以適當變更。 In step S51 in which the time synchronization device 300 receives the Sync message as the synchronization frame, the PHY 302 receives the synchronization frame from the main device 200. The PHY 302 inputs the received sync frame to the MAC 303. The MAC driver 304 generates a software time stamp by detecting the timing at which the synchronization frame is input to the MAC 303, and records the reception timing T_s1 of the synchronization frame. Thereafter, the MAC driver 304 immediately inputs the recorded reception time T_s1 to the time synchronization application 306. The time synchronization application 306 will receive the reception time T_s1 from the MAC driver 304. Stored in the forefront of the blank column in the first row of the correction table 308. The time synchronization application 306 generates random numbers based on the normal distribution, and stores the generated random numbers in the same column of the second row of the correction table 308. The time synchronization application 306 corrects the fluctuation of the reception time T_s1 by subtracting the random number stored in the second line of the correction table 308 from the reception time T_s1 stored in the first line of the correction table 308. The time synchronization application 306 stores the corrected reception time T_s1' in the same column of the third row of the correction table 308. Further, the reception time T_s1 may be corrected by subtracting the random number from the reception time T_s1 by another method such as adding a random number at the reception time T_s1. Further, which row of the correction table 308 is stored in the correction time T_s1, the random number, and the corrected reception time T_s1' can be appropriately changed.

在主裝置200將Follow-Up訊息作為同步訊框進行傳送之步驟S42中,時刻同步應用程式206產生Follow-Up訊息的同步訊框。時刻同步應用程式206在該同步訊框儲存已儲存在補正表208第1行與第3行之補正前與已補正的傳送時刻T_m1,T_m1’組合中儲存在最後列之補正前與已補正的傳送時刻T_m1,T_m1’組合,即剛才的Sync訊息之補正前與已補正的傳送時刻T_m1,T_m1’。當OS205檢測利用時刻同步應用程式206產生同步訊框時,啟動優先中斷,將該同步訊框比其他訊框更先輸入到MAC驅動器204。MAC驅動器204在同步訊框輸入的時點產生軟體時間戳記。但是,MAC驅動器204檢測到同步訊框為Follow-Up訊息,只將已產生的時間戳記在緩衝器等保持一定時間,而不會反饋到時刻同步應用程式206。之後,MAC驅動器204將同步訊框輸入到MAC203。MAC203從PHY202傳送同步訊框。 In the step S42 in which the main device 200 transmits the Follow-Up message as the synchronization frame, the time synchronization application 206 generates a synchronization frame of the Follow-Up message. The time synchronization application 206 stores the corrections in the first row and the third row of the correction table 208 and the corrected transmission time T_m1, T_m1' in the synchronization frame storage before the correction of the last column and the corrected The transmission time T_m1, T_m1' is combined, that is, before the correction of the Sync message and the corrected transmission time T_m1, T_m1'. When the OS 205 detects that the synchronization frame is generated by the time synchronization application 206, the priority interrupt is activated, and the synchronization frame is input to the MAC driver 204 earlier than the other frames. The MAC driver 204 generates a software time stamp at the point of time when the sync frame is input. However, the MAC driver 204 detects that the sync frame is a Follow-Up message, and only stores the generated time stamp in the buffer or the like for a certain period of time without being fed back to the time synchronization application 206. Thereafter, the MAC driver 204 inputs the sync frame to the MAC 203. The MAC 203 transmits a sync frame from the PHY 202.

在時刻同步裝置300接收Follow-Up訊息作為同步訊框之步驟S52中,PHY302由主裝置200接收同步訊框。PHY302將已接收的同步訊框輸入到MAC303。MAC驅動器304在檢測到同步訊框輸入到MAC303的時點產生軟體時間戳記。但是,MAC驅動器304檢測到同步訊框為Follow-Up訊息,只將已產生的時間戳記在緩衝器等保持一定時間,而不會輸入到時刻同步應用程式306。之後,MAC驅動器304透過OS305將同步訊框輸入到時刻同步應用程式306。時刻同步應用程式306檢測到從MAC304輸入的同步訊框為Follow-Up訊息,擷取出儲存在同步訊框之補正前與已補正的傳送時刻T_m1,T_m1’。 In step S52 in which the time synchronization device 300 receives the Follow-Up message as the synchronization frame, the PHY 302 receives the synchronization frame from the main device 200. The PHY 302 inputs the received sync frame to the MAC 303. The MAC driver 304 generates a software time stamp when it detects that the sync frame is input to the MAC 303. However, the MAC driver 304 detects that the sync frame is a Follow-Up message, and only stores the generated time stamp in the buffer or the like for a certain period of time without inputting to the time synchronization application 306. Thereafter, the MAC driver 304 inputs the sync frame to the time synchronization application 306 via the OS 305. The time synchronization application 306 detects that the synchronization frame input from the MAC 304 is a Follow-Up message, and extracts the pre-correction transmission time T_m1, T_m1' stored before the correction of the synchronization frame.

在時刻同步裝置300將Delya_Req訊息作為同步訊框進行傳送之步驟S53中,時刻同步應用程式306產生Delya_Req訊息之同步訊框。時刻同步應用程式306在該同步訊框中不儲存時刻。當OS305檢測到藉由時刻同步應用程式306產生同步訊框時,啟動優先中斷,將該同步訊框比其他訊框更先輸入到MAC驅動器304。MAC驅動器304藉由在同步訊框輸入的時點產生軟體時間戳記,記錄同步訊框的傳送時刻T_s2。之後,MAC驅動器304將同步訊框輸入到MAC303。MAC303從PHY302傳送同步訊框。MAC驅動器304將已記錄的傳送時刻T_s2反饋到時刻同步應用程式306。時刻同步應用程式306將從MAC驅動器304反饋的傳送時刻T_s2儲存在補正表308第4行之空白列中的最前列。時刻同步應用程式306產生依據正規分布的亂數,將已產生的亂數儲存在補正表308 第5行的同一列。時刻同步應用程式306藉由從儲存在補正表308第4行的傳送時刻T_s2減去儲存在補正表308第5行的亂數,補正傳送時刻T_s2的波動。時刻同步應用程式306將已補正的傳送時刻T_s2’儲存在補正表308第6行的同一列。又,傳送時刻T_s2藉由在傳送時刻T_s2加上亂數等其他方法取代從傳送時刻T_s2減去亂數進行補正亦可。又,將傳送時刻T_s2、亂數、已補正的傳送時刻T_s2’儲存在補正表308的哪一行哪一列可以適當變更。 In step S53, in which the time synchronization device 300 transmits the Delya_Req message as the synchronization frame, the time synchronization application 306 generates a synchronization frame of the Delya_Req message. The time synchronization application 306 does not store the time in the synchronization frame. When the OS 305 detects that the synchronization frame is generated by the time synchronization application 306, the priority interrupt is activated, and the synchronization frame is input to the MAC driver 304 earlier than the other frames. The MAC driver 304 records the transmission time T_s2 of the synchronization frame by generating a software time stamp at the time of input of the synchronization frame. Thereafter, the MAC driver 304 inputs the sync frame to the MAC 303. The MAC 303 transmits a sync frame from the PHY 302. The MAC driver 304 feeds back the recorded transmission time T_s2 to the time synchronization application 306. The time synchronization application 306 stores the transfer time T_s2 fed back from the MAC driver 304 in the forefront of the blank column of the fourth row of the correction table 308. The time synchronization application 306 generates a random number according to the normal distribution, and stores the generated random number in the correction table 308. The same column on line 5. The time synchronization application 306 corrects the fluctuation of the transmission time T_s2 by subtracting the random number stored in the 5th line of the correction table 308 from the transmission time T_s2 stored in the 4th line of the correction table 308. The time synchronization application 306 stores the corrected transmission time T_s2' in the same column of the sixth row of the correction table 308. Further, the transmission time T_s2 may be corrected by subtracting the random number from the transmission time T_s2 by another method such as adding a random number at the transmission time T_s2. Further, which row of the correction table 308 is stored in the transmission time T_s2, the random number, and the corrected transmission time T_s2' can be appropriately changed.

在主裝置200接收Delya_Req訊息作為同步訊框之步驟S43中,PHY202從時刻同步裝置300接收同步訊框。PHY202將已接收的同步訊框輸入到MAC203。MAC驅動器204藉由在檢測到同步訊框輸入到MAC203的時點產生軟體時間戳記,記錄同步訊框的接收時刻T-m2。之後,MAC驅動器204將已記錄的接收時刻T-m2立即輸入到時刻同步應用程式206。時刻同步應用程式206將從MAC驅動器204輸入的接收時刻T-m2儲存在補正表208第4行之空白列中的最前列。時刻同步應用程式206產生依據正規分布的亂數,將已產生的亂數儲存在補正表208第5行之同一列。時刻同步應用程式206藉由從儲存在補正表208第4行的接收時刻T-m2減去儲存在補正表208第5行的亂數,補正接收時刻T-m2的波動。時刻同步應用程式206將已補正的接收時刻T-m2’儲存在補正表208第6行的同一列。又接收時刻T-m2藉由在接收時刻T-m2加上亂數等其他方法取代從接收時刻T-m2減去亂數進行補正亦可。又,將接收時刻T-m2、亂數、已補正的接收時刻T-m2’ 儲存在補正表208的哪一行哪一列可以適當變更。 In step S43 in which the main device 200 receives the Delya_Req message as the synchronization frame, the PHY 202 receives the synchronization frame from the time synchronization device 300. The PHY 202 inputs the received sync frame to the MAC 203. The MAC driver 204 records the reception time T-m2 of the synchronization frame by generating a software time stamp when detecting that the synchronization frame is input to the MAC 203. Thereafter, the MAC driver 204 immediately inputs the recorded reception time T-m2 to the time synchronization application 206. The time synchronization application 206 stores the reception time T-m2 input from the MAC driver 204 in the forefront of the blank column of the fourth row of the correction table 208. The time synchronization application 206 generates random numbers based on the normal distribution, and stores the generated random numbers in the same column of the fifth row of the correction table 208. The time synchronization application 206 corrects the fluctuation of the reception time T-m2 by subtracting the random number stored in the 5th line of the correction table 208 from the reception time T-m2 stored in the 4th line of the correction table 208. The time synchronization application 206 stores the corrected reception time T-m2' in the same column of the sixth row of the correction table 208. Further, the reception time T-m2 may be corrected by subtracting the random number from the reception time T-m2 by another method such as adding a random number at the reception time T-m2. Further, the reception time T-m2, the random number, and the corrected reception time T-m2' will be received. Which row of the correction table 208 is stored can be changed as appropriate.

在主裝置200將Delay_Resp訊息作為同步訊框進行傳送之步驟S44中,時刻同步應用程式206產生Delay_Resp訊息的同步訊框。時刻同步應用程式206在該同步訊框儲存已儲存在補正表208第4行與第6行之補正前與已補正的傳送時刻T_m2,T_m2’組合中儲存在最後列之補正前與已補正的傳送時刻T_m2,T_m2’組合,即剛才的Delya_Req訊息之補正前與已補正的傳送時刻T_m2,T_m2’。OS205當檢測到利用時刻同步應用程式206產生同步訊框時,啟動優先中斷,將該同步訊框比其他訊框更先輸入到MAC驅動器204。MAC驅動器204在同步訊框輸入的時點產生軟體時間戳記。但是,MAC驅動器204檢測到同步訊框為Delay_Resp訊息,只將已產生的時間戳記在緩衝器等保持一定時間,而不會反饋到時刻同步應用程式206。之後,MAC驅動器204將同步訊框輸入到MAC203。MAC203從PHY202傳送同步訊框。 In the step S44 in which the main device 200 transmits the Delay_Resp message as the synchronization frame, the time synchronization application 206 generates a synchronization frame of the Delay_Resp message. The time synchronization application 206 stores the corrections in the fourth row and the sixth row of the correction table 208 before the correction and the corrected transmission time T_m2, T_m2' are stored in the combination of the last column and the corrected The transmission time T_m2, T_m2' is combined, that is, before the correction of the Delya_Req message and the corrected transmission time T_m2, T_m2'. When detecting that the synchronization frame is generated by the time synchronization application 206, the OS 205 starts the priority interrupt, and inputs the synchronization frame to the MAC driver 204 earlier than the other frames. The MAC driver 204 generates a software time stamp at the point of time when the sync frame is input. However, the MAC driver 204 detects that the sync frame is a Delay_Resp message, and only stores the generated time stamp in the buffer or the like for a certain period of time without being fed back to the time synchronization application 206. Thereafter, the MAC driver 204 inputs the sync frame to the MAC 203. The MAC 203 transmits a sync frame from the PHY 202.

在時刻同步裝置300接收Delay_Resp訊息作為同步訊框之步驟S54中,PHY302從主裝置200接收同步訊框。PHY302將已接收的同步訊框輸入到MAC303。MAC驅動器304在檢測到同步訊框輸入到MAC303的時點產生軟體時間戳記。但是,MAC驅動器304檢測到同步訊框為Delay_Resp訊息,只將已產生的時間戳記在緩衝器等保持一定時間,而不會輸入到時刻同步應用程式306。之後,MAC驅動器304透過OS305將同步訊框輸入到時刻同步應用程式306。時刻同步應用程式306檢測到從MAC304輸入的同步訊框為Delay_Resp 訊息,擷取出儲存在同步訊框之補正前與已補正的傳送時刻T_m2,T_m2’。 In step S54 in which the time synchronization device 300 receives the Delay_Resp message as the synchronization frame, the PHY 302 receives the synchronization frame from the main device 200. The PHY 302 inputs the received sync frame to the MAC 303. The MAC driver 304 generates a software time stamp when it detects that the sync frame is input to the MAC 303. However, the MAC driver 304 detects that the sync frame is a Delay_Resp message, and only stores the generated time stamp in the buffer or the like for a certain period of time without being input to the time synchronization application 306. Thereafter, the MAC driver 304 inputs the sync frame to the time synchronization application 306 via the OS 305. The time synchronization application 306 detects that the synchronization frame input from the MAC 304 is Delay_Resp. The message is retrieved before the correction of the sync frame and the corrected transmission time T_m2, T_m2'.

在步驟S54之後,時刻同步應用程式306使用:藉由步驟S51儲存在補正表308第1行及第3行之補正前及已補正的傳送時刻T_s1,T_s1’;藉由步驟S52擷取出之補正前及已補正的傳送時刻T_m1,T_m1’;藉由步驟S53儲存在補正表308第4行及第6行之補正前及已補正的接收時刻T_s2,T_s2’;及藉由步驟S54擷取出之補正前及已補正的接收時刻T_m2,T_m2’,計算出偏置405。就計算式而言,如前述所示,雖然可以使用T_offset=(((T_s1+T_s1’)-(T_m1+T_m1’))-((T_m2+T_m2’)-(T_s2+T_s2’)))/4、或是T_offset=-(((T_s1+T_s1’)-(T_m1+T_m1’))-((T_m2+T_m2’)-(T_s2+T_s2’)))/4,但是使用其他計算式亦可。 After the step S54, the time synchronization application 306 uses: before the correction of the 1st line and the 3rd line of the correction table 308 and the corrected transmission time T_s1, T_s1' by the step S51; the correction by the step S52 The pre- and corrected transmission time T_m1, T_m1'; stored in the fourth and sixth lines of the correction table 308 before the correction and the corrected reception time T_s2, T_s2'; and the step S54 is taken out in step S53; The offset 405 is calculated before the correction and the corrected reception time T_m2, T_m2'. As far as the calculation formula is concerned, as described above, although T_offset = (((T_s1 + T_s1') - (T_m1 + T_m1')) - ((T_m2 + T_m2') - (T_s2 + T_s2'))) / 4, or T_offset=-(((T_s1+T_s1')-(T_m1+T_m1'))-((T_m2+T_m2')-(T_s2+T_s2')))/4, but other calculation formulas can also be used .

之後,反覆執行步驟S41到步驟S44的順序與步驟S51到步驟S54的順序。 Thereafter, the order of steps S41 to S44 and the order of step S51 to step S54 are repeatedly performed.

***效果說明*** *** Effect Description***

在本實施形態中,由於補正使用軟體時鐘記錄的時刻,可以提升根據軟體基底安裝之時刻同步方式的時刻同步精確度。 In the present embodiment, since the timing of recording using the software clock is corrected, the time synchronization accuracy according to the time synchronization method of the software base mounting can be improved.

實施形態2. Embodiment 2.

針對本實施形態,主要說明與實施形態1的差異。 The difference from the first embodiment will be mainly described with respect to the present embodiment.

參照圖8,說明有關本實施形態之時刻同步系統100的構成例。 An example of the configuration of the time synchronization system 100 according to the present embodiment will be described with reference to Fig. 8 .

在本例中,採用與圖1的例示相同之樹狀型網路 架構。 In this example, the same tree-like network as the one shown in Figure 1 is used. Architecture.

在實施形態1中,對於所有子網路內部的時刻同步都可以適用第2時刻同步方式102,但是在本實施形態中,對於一部份子網路內部的時刻同步適用第1時刻同步方式101。 In the first embodiment, the second time synchronization method 102 can be applied to time synchronization in all sub-networks. However, in the present embodiment, the first time synchronization mode 101 is applied to time synchronization in a part of the sub-networks. .

因此,與GM110連接之PLC120之中,一部份的PLC120也是第1時刻同步方式101中之時刻傳送側的終端,相當於主裝置200及時刻同步裝置300兩者。又,與該一部份PLC120連接之現場裝置130為第1時刻同步方式101中之時刻接收側的終端,相當於時刻同步裝置300。 Therefore, among the PLCs 120 connected to the GM 110, a part of the PLCs 120 is also the terminal on the transmission side in the first time synchronization method 101, and corresponds to both the master device 200 and the time synchronization device 300. Further, the field device 130 connected to the part of the PLC 120 is the terminal on the receiving side in the first time synchronization mode 101, and corresponds to the time synchronization device 300.

對於有關本實施形態之主裝置200及時刻同步裝置300的構成與動作,與實施形態1相同。 The configuration and operation of the master device 200 and the time synchronization device 300 according to the present embodiment are the same as those in the first embodiment.

實施形態3. Embodiment 3.

針對本實施形態,主要說明與實施形態1的差異。 The difference from the first embodiment will be mainly described with respect to the present embodiment.

參照圖9,說明有關本實施形態之時刻同步系統100的構成例。 An example of the configuration of the time synchronization system 100 according to the present embodiment will be described with reference to Fig. 9 .

在本例中,有部份採用線狀型的網路架構。在GM110串聯連接3台的PLC120。在此等3台的PLC120下位中,至少連接1台PLC120或是至少連接2台現場裝置130,構成樹狀型子網路。 In this case, some use a linear network architecture. Three PLCs 120 are connected in series in the GM110. Among the three lower PLC120s, at least one PLC120 or at least two field devices 130 are connected to form a tree-shaped subnetwork.

GM110和與GM110串聯連接之PLC120間的時刻同步為適合第1時刻同步方式101。與GM110串聯連接之PLC120之間的時刻同步也是適用第1時刻同步方式101。 The time synchronization between the GM 110 and the PLC 120 connected in series with the GM 110 is suitable for the first time synchronization method 101. The time synchronization between the PLCs 120 connected in series with the GM 110 is also applied to the first time synchronization method 101.

因此,在與GM110串聯連接之PLC120之中,中 間的2台PLC120也是第1時刻同步方式101中之時刻傳送側的終端,相當於主裝置200及時刻同步裝置300兩者。如此一來,本實施形態構成為將主機能分散在GM110與2台PLC120的形態。 Therefore, among the PLCs 120 connected in series with the GM110, The two PLCs 120 are also the terminals on the transmission side in the first time synchronization method 101, and correspond to both the master device 200 and the time synchronization device 300. In this way, the present embodiment is configured such that the host can be dispersed in the GM 110 and the two PLCs 120.

又,在與GM110串聯連接之PLC120之中,中間的2台PLC120不成為第1時刻同步方式101中之時刻傳送側的終端,而只是單純在GM110與其他PLC120間轉送同步訊框亦可。在該情況下,中間的2台PLC120只相當於時刻同步裝置300。如此一來,本實施形態可以將主機能變更為集中在GM110的形態。 Further, among the PLCs 120 connected in series with the GM 110, the two intermediate PLCs 120 do not become the terminals on the transmission side in the first time synchronization method 101, but may simply transfer the synchronization frame between the GM 110 and the other PLCs 120. In this case, the two intermediate PLCs 120 correspond to only the time synchronization device 300. In this way, in the present embodiment, the host can be changed to the form of the GM 110.

對於有關本實施形態之主裝置200與時刻同步裝置300的構成及動作,與實施形態1相同。 The configuration and operation of the master device 200 and the time synchronization device 300 according to the present embodiment are the same as those in the first embodiment.

以下,參照圖10,說明有關本發明之實施形態之時刻同步裝置300的硬體構成例。 Hereinafter, a hardware configuration example of the time synchronization device 300 according to the embodiment of the present invention will be described with reference to FIG.

時刻同步裝置300為電腦。時刻同步裝置300為包括:所謂處理器901、輔助記憶裝置902、記憶體903、通訊裝置904、輸入介面905、顯示器介面之硬體。處理器901透過訊號線910與其他硬體連接,控制此等其他硬體。輸入介面905與輸入裝置907連接。顯示器介面906與顯示器908連接。 The time synchronization device 300 is a computer. The time synchronization device 300 is a hardware including a processor 901, an auxiliary memory device 902, a memory 903, a communication device 904, an input interface 905, and a display interface. The processor 901 is connected to other hardware through the signal line 910 to control these other hardware. The input interface 905 is connected to the input device 907. Display interface 906 is coupled to display 908.

處理器901為進行處理的IC(Integrated‧Circuit;積體電路)。處理器901例如是CPU(Central‧Processing‧Unit;中央處理單元)、DSP(Digital‧Signal‧Processor;數位訊號處理器)、或是GPU(Graphics‧Processing‧Unit;圖形處理器)。 The processor 901 is an IC (Integrated‧Circuit) that performs processing. The processor 901 is, for example, a CPU (Central‧Processing‧Unit; central processing unit), a DSP (Digital‧Signal‧Processor; digital signal processor), or a GPU (Graphics‧Processing‧Unit; graphics processor).

輔助記憶裝置902為ROM(Read‧Only‧Memory; 唯讀記憶體)、快閃記憶體、或是HDD(Hard‧Disk‧Drive;硬碟驅動器)等記錄媒體。 The auxiliary memory device 902 is a ROM (Read‧Only‧Memory; Record-only memory, flash memory, or HDD (Hard‧Disk‧Drive; hard disk drive) and other recording media.

記憶體903例如是RAM(Random‧Access‧Memory;隨機存取記憶體)。 The memory 903 is, for example, a RAM (Random ‧ Access ‧ Memory)

通訊裝置904包含接收資料之接收器921及傳送資料之傳送器922。通訊裝置904例如是通訊晶片或NIC(Network‧Interface‧Card;網路介面卡)。 The communication device 904 includes a receiver 921 that receives data and a transmitter 922 that transmits data. The communication device 904 is, for example, a communication chip or an NIC (Network‧Interface‧Card; network interface card).

輸入介面905為與輸入裝置907的電線911連接之埠口。輸入介面905例如是USB(Universal‧Serial‧Bus;萬用串列匯流排)端子。 The input interface 905 is a port that is connected to the electric wire 911 of the input device 907. The input interface 905 is, for example, a USB (Universal‧Serial‧Bus) terminal.

顯示器介面906為與顯示器908的電線912連接之埠口。顯示器介面906例如是USB端子或HDMI(商標登錄)(High‧Definition‧Multimedia‧Interface;高清晰多媒體介面)端子。 Display interface 906 is a port that is connected to wire 912 of display 908. The display interface 906 is, for example, a USB terminal or an HDMI (trademark) (High‧Definition‧Multimedia‧Interface) terminal.

輸入裝置907例如是滑鼠、觸碰筆、鍵盤、或是觸碰面板。 The input device 907 is, for example, a mouse, a touch pen, a keyboard, or a touch panel.

顯示器908例如是LCD(Liquid‧Crystal‧Display;液晶顯示器)。 The display 908 is, for example, an LCD (Liquid‧Crystal® Display).

在輔助記憶裝置902中,記憶有實現接收部310、傳送部320、記錄部330、補正部340、同步部350之所謂「部」的機能之程式。該程式裝載在記憶體903,讀入到處理器901,並且利用處理器901予以執行。在輔助記憶裝置902中,也記憶有OS。OS的至少一部分被裝載在記憶體903,處理器901一邊執行OS,一邊執行實現「部」的機能之程式。 In the auxiliary storage device 902, a program for realizing the functions of the so-called "parts" of the receiving unit 310, the transmitting unit 320, the recording unit 330, the correcting unit 340, and the synchronizing unit 350 is stored. The program is loaded in the memory 903, read into the processor 901, and executed by the processor 901. In the auxiliary memory device 902, an OS is also memorized. At least a part of the OS is loaded in the memory 903, and the processor 901 executes a program for realizing the function of the "part" while executing the OS.

在圖10中,雖然顯示了1個處理器901,但是時刻同步裝置300包括多個處理器901亦可。再者,多個處理器901合作執行實現「部」的機能之程式亦可。 In FIG. 10, although one processor 901 is shown, the time synchronization device 300 may include a plurality of processors 901. Furthermore, the plurality of processors 901 cooperate to execute a program that realizes the function of the "part".

顯示「部」的處理結果之資訊、資料、訊號值、或變數值記憶在輔助記憶裝置902、記憶體903、或是處理器901內的電阻器或快取記憶體。 The information, data, signal value, or variable value indicating the processing result of the "part" is stored in the auxiliary memory device 902, the memory 903, or the resistor or cache memory in the processor 901.

利用「電路系統」提供「部」亦可。又,也可以將「部」取代為「電路」、「步驟」、「順序」或「處理」。「電路」及「電路系統」不只是包含處理器901,也包含邏輯IC、GA(Gate‧Array;閘陣列)、ASIC(Application‧Specific‧Integrated‧Circuit;特殊應用積體電路)、FPGA(Field-Programmable‧Gate‧Array;場式可程式閘陣列)之所謂其他種類的處理電路之概念。 It is also possible to provide "parts" using "circuitry". Alternatively, you can replace "part" with "circuit", "step", "order" or "processing". "Circuit" and "circuitry" include not only processor 901, but also logic IC, GA (Gate‧Array; gate array), ASIC (Application‧Specific‧Integrated‧Circuit), FPGA (Field) -Programmable‧Gate‧Array; the concept of so-called other types of processing circuits.

又,圖10所示之硬體構成也可以適用於有關本實施形態之主裝置200。 Further, the hardware configuration shown in Fig. 10 can also be applied to the main device 200 according to the present embodiment.

以上,雖然針對本發明的實施形態進行說明,但是將此等實施形態中,組合幾個予以實施亦可。或是,將此等實施形態中,部份性實施任1個或幾個亦可。例如,在此等實施形態的說明中以「部」作為說明者之中,只採用任一個亦可、採用幾個的任意組合亦可。又,本發明並不限於此等實施形態,因應必要可以進行各種變更。 Although the embodiments of the present invention have been described above, these embodiments may be combined and implemented. Alternatively, one or more of the embodiments may be implemented in part. For example, in the description of the embodiments, the "part" may be used as the instructor, and any combination of a few may be employed. Further, the present invention is not limited to the embodiments, and various modifications can be made as necessary.

100‧‧‧時刻同步系統 100‧‧‧Time synchronization system

101‧‧‧第1時刻同步方式 101‧‧‧First Time Synchronization

102‧‧‧第2時刻同步方式 102‧‧‧Second Time Synchronization Mode

110‧‧‧GM(總主裝置) 110‧‧‧GM (main master)

120‧‧‧PLC(可程式邏輯控制器) 120‧‧‧PLC (programmable logic controller)

130‧‧‧現場裝置 130‧‧‧Field devices

Claims (15)

一種時刻同步裝置,包括:接收部,從具有主時鐘之主裝置接收第1資料;傳送部,在根據前述接收部接收前述第1資料後,將第2資料傳送到前述主裝置;記錄部,使用軟體時鐘之從屬時鐘,記錄前述接收部的前述第1資料接收時刻及前述傳送部的前述第2資料傳送時刻;補正部,補正根據前述記錄部記錄的前述第1資料接收時刻及前述第2資料傳送時刻;及同步部,至少從前述主裝置通知之前述主裝置的前述第1資料傳送時刻、根據前述補正部補正的前述第1資料接收時刻、根據前述補正部補正的前述第2資料傳送時刻、及從前述主裝置通知之前述主裝置的前述第2資料接收時刻,計算出前述主時鐘與前述從屬時鐘之時刻偏差的偏置,其中,前述接收部從前述主裝置反覆接收前述第1資料,前述記錄部在每次根據前述接收部接收前述第1資料時,記錄前述接收部的前述第1資料接收時刻,前述補正部在每次根據前述記錄部記錄前述第1資料接收時刻時產生亂數,使用已產生的亂數,計算出根據前述記錄部記錄前述第1資料接收時刻之補正值,前述同步部在計算前述偏置時,將根據前述補正部計算的前述第1資料接收時刻之補正值用來作為前述第1資料接 收時刻。 A time synchronization device includes: a receiving unit that receives first data from a master device having a master clock; and a transmitting unit that transmits the second data to the master device after receiving the first data according to the receiving unit; and the recording unit The first data reception time of the receiving unit and the second data transmission time of the transmission unit are recorded by using a slave clock of the software clock, and the correction unit corrects the first data reception time and the second time recorded by the recording unit. And a synchronization unit that transmits at least the first data transmission time of the master device notified by the master device, the first data reception time corrected by the correction unit, and the second data transmission corrected by the correction unit And calculating an offset of a deviation between a time of the master clock and the slave clock from the second data receiving time of the master device notified by the master device, wherein the receiving unit repeatedly receives the first one from the master device The data recording unit records the receiving unit each time the receiving unit receives the first data. At the first data reception time, the correction unit generates a random number every time the first data reception time is recorded by the recording unit, and calculates the first data reception time by the recording unit using the generated random number. In the correction value, when the offset is calculated, the correction value of the first data reception time calculated by the correction unit is used as the first data connection. Receive time. 如申請專利範圍第1項之時刻同步裝置,其中,前述傳送部在每次根據前述接收部接收前述第1資料時,傳送前述第2資料到前述主裝置,前述記錄部在每次根據前述傳送部傳送前述第2資料時,記錄前述傳送部的前述第2資料傳送時刻,前述補正部在每次根據前述記錄部記錄前述第2資料傳送時刻時產生亂數,使用已產生的亂數,計算出根據前述記錄部記錄前述第2資料傳送時刻之補正值,前述同步部在計算前述偏置時,將根據前述補正部計算的前述第2資料傳送時刻之補正值用來作為前述第2資料傳送時刻。 The time synchronization device according to claim 1, wherein the transmitting unit transmits the second material to the main device every time the receiving unit receives the first data, and the recording unit transmits the data according to the transmission. When the second data is transmitted, the second data transfer time of the transfer unit is recorded, and the correction unit generates a random number every time the second data transfer time is recorded by the recording unit, and uses the generated random number to calculate The correction unit records the correction value of the second data transmission time, and the synchronization unit calculates the correction value of the second data transmission time calculated by the correction unit as the second data transmission when calculating the offset. time. 如申請專利範圍第1項之時刻同步裝置,其中,前述同步部在每次根據前述接收部接收前述第1資料時計算出前述偏置,儲存前述偏置的多個計算值,進行已儲存之多個計算值的統計處理,因應前述統計處理的結果,調整前述從屬時鐘的時刻。 The time synchronization device according to claim 1, wherein the synchronization unit calculates the offset every time the receiving unit receives the first data, and stores the plurality of calculated values of the offset, and stores the plurality of stored values. The statistical processing of the calculated values adjusts the timing of the aforementioned slave clock in response to the result of the foregoing statistical processing. 如申請專利範圍第3項之時刻同步裝置,其中,前述同步部將已儲存的多個計算值之平均用來作為前述統計處理的結果,調整前述從屬時鐘的時刻。 The time synchronization device of claim 3, wherein the synchronization unit uses an average of the plurality of stored calculation values as a result of the statistical processing to adjust a timing of the slave clock. 如申請專利範圍第1項之時刻同步裝置,其中,前述接收部從前述主裝置接收用以通知前述主裝置的前述第1資料傳送時刻之第3資料、及用以通知前述主裝置的前述第2資料接收時刻之第4資料, 前述同步部在計算前述偏置時,參照根據前述接收部接收的前述第3資料及前述第4資料。 The time synchronization device of claim 1, wherein the receiving unit receives, from the master device, third data for notifying the first data transmission time of the master device, and the third device for notifying the master device 2 The fourth data of the time of receipt of the data, The synchronization unit refers to the third data and the fourth data received by the receiving unit when calculating the offset. 如申請專利範圍第1項之時刻同步裝置,其中,前述同步部從前述主裝置記錄的前述第1資料傳送時刻、前述主裝置補正的前述第1資料傳送時刻、根據前述記錄部記錄的前述第1資料接收時刻、根據前述補正部補正的前述第1資料接收時刻、根據前述記錄部記錄的前述第2資料傳送時刻、根據前述補正部補正的前述第2資料傳送時刻、前述主裝置記錄的前述第2資料接收時刻、及前述主裝置補正的前述第2資料接收時刻,計算出前述偏置。 The time synchronization device according to the first aspect of the invention, wherein the synchronization unit reads the first data transmission time from the master device, the first data transmission time corrected by the master device, and the first record recorded by the recording unit. a data reception time, the first data reception time corrected by the correction unit, the second data transmission time recorded by the recording unit, the second data transmission time corrected by the correction unit, and the aforementioned recording by the master device. The offset is calculated by the second data reception time and the second data reception time corrected by the master device. 如申請專利範圍第6項之時刻同步裝置,其中,前述同步部從前述主裝置記錄的前述第1資料傳送時刻與前述主裝置補正的前述第1資料傳送時刻總合、和根據前述記錄部記錄的前述第1資料接收時刻與根據前述補正部補正的前述第1資料接收時刻總合之差;以及根據前述記錄部記錄的前述第2資料傳送時刻與根據前述補正部補正的前述第2資料傳送時刻總合、和前述主裝置記錄的前述第2資料接收時刻與前述主裝置補正的前述第2資料接收時刻總合之差,計算出前述偏置。 The time synchronization device of claim 6, wherein the synchronization unit is integrated with the first data transmission time recorded by the master device and the first data transmission time corrected by the master device, and recorded by the recording unit. a difference between the first data reception time and the first data reception time corrected by the correction unit; and the second data transmission time recorded by the recording unit and the second data transmission corrected by the correction unit The offset is calculated by summing the time and the difference between the second data reception time recorded by the master device and the second data reception time corrected by the master device. 一種時刻同步裝置,包括:接收部,從具有主時鐘之主裝置接收第1資料;傳送部,在根據前述接收部接收前述第1資料後,將第2資料傳送到前述主裝置;記錄部,使用軟體時鐘之從屬時鐘,記錄前述接收部的前 述第1資料接收時刻及前述傳送部的前述第2資料傳送時刻;補正部,補正根據前述記錄部記錄的前述第1資料接收時刻及前述第2資料傳送時刻;及同步部,至少從前述主裝置通知之前述主裝置的前述第1資料傳送時刻、根據前述補正部補正的前述第1資料接收時刻、根據前述補正部補正的前述第2資料傳送時刻、及從前述主裝置通知之前述主裝置的前述第2資料接收時刻,計算出前述主時鐘與前述從屬時鐘之時刻偏差的偏置,其中,前述同步部從前述主裝置記錄的前述第1資料傳送時刻、前述主裝置補正的前述第1資料傳送時刻、根據前述記錄部記錄的前述第1資料接收時刻、根據前述補正部補正的前述第1資料接收時刻、根據前述記錄部記錄的前述第2資料傳送時刻、根據前述補正部補正的前述第2資料傳送時刻、前述主裝置記錄的前述第2資料接收時刻、及前述主裝置補正的前述第2資料接收時刻,計算出前述偏置。 A time synchronization device includes: a receiving unit that receives first data from a master device having a master clock; and a transmitting unit that transmits the second data to the master device after receiving the first data according to the receiving unit; and the recording unit Recording the front of the receiving unit using the slave clock of the software clock The first data reception time and the second data transmission time of the transmission unit; the correction unit corrects the first data reception time and the second data transmission time recorded by the recording unit; and the synchronization unit, at least from the main The first data transmission time of the master device notified by the device, the first data reception time corrected by the correction unit, the second data transmission time corrected by the correction unit, and the master device notified from the master device At the second data reception time, an offset of the time difference between the master clock and the slave clock is calculated, wherein the synchronization unit reads the first data transmission time from the master device and the first device correction by the master device a data transmission time, the first data reception time recorded by the recording unit, the first data reception time corrected by the correction unit, the second data transmission time recorded by the recording unit, and the correction according to the correction unit The second data transmission time, the second data reception time and the foregoing recorded by the master device The second main information reception time correction means, calculate the offset. 如申請專利範圍第8項之時刻同步裝置,其中,前述同步部從前述主裝置記錄的前述第1資料傳送時刻與前述主裝置補正的前述第1資料傳送時刻總合、和根據前述記錄部記錄的前述第1資料接收時刻與根據前述補正部補正的前述第1資料接收時刻總合之差;以及根據前述記錄部記錄的前述第2資料傳送時刻與根據前述補正部補正的前述第2資料傳送時刻總合、和前述主裝置記錄的前述第2資料接 收時刻與前述主裝置補正的前述第2資料接收時刻總合之差,計算出前述偏置。 The time synchronization device of claim 8, wherein the synchronization unit is integrated with the first data transmission time recorded by the master device and the first data transmission time corrected by the master device, and recorded by the recording unit. a difference between the first data reception time and the first data reception time corrected by the correction unit; and the second data transmission time recorded by the recording unit and the second data transmission corrected by the correction unit The sum of the time, and the aforementioned second data recorded by the aforementioned master device The offset is calculated by the difference between the time of collection and the second data reception time corrected by the master device. 如申請專利範圍第8項之時刻同步裝置,其中,前述接收部從前述主裝置接收用以通知前述主裝置的前述第1資料傳送時刻之第3資料、及用以通知前述主裝置的前述第2資料接收時刻之第4資料,前述同步部在計算前述偏置時,參照根據前述接收部接收的前述第3資料及前述第4資料。 The time synchronization device of claim 8, wherein the receiving unit receives, from the master device, a third data for notifying the first data transmission time of the master device, and the third device for notifying the master device In the fourth data of the data reception time, the synchronization unit refers to the third data and the fourth data received by the receiving unit when calculating the offset. 一種時刻同步系統,包括:時刻同步裝置,如申請專利範圍第1至10項任一項所述者;及主裝置,使用軟體時鐘之主時鐘,記錄前述第1資料傳送時刻及前述第2資料接收時刻,補正已記錄的前述第1資料傳送時刻及前述第2資料接收時刻,至少將已補正的前述第1資料傳送時刻及前述第2資料接收時刻通知到前述時刻同步裝置。 A time synchronization system, comprising: a time synchronization device, as described in any one of claims 1 to 10; and a master device recording the first data transmission time and the second data using a master clock of a software clock At the reception time, the first data transmission time and the second data reception time that have been recorded are corrected, and at least the corrected first data transmission time and the second data reception time are notified to the time synchronization device. 如申請專利範圍第11項之時刻同步系統,其中,前述主裝置進一步將已記錄的前述第1資料傳送時刻及前述第2資料接收時刻通知到前述時刻同步裝置。 The time synchronization system of claim 11, wherein the master device further notifies the time synchronization device that the recorded first data transmission time and the second data reception time are recorded. 一種時刻同步系統,包括:接收部,從具有主時鐘之主裝置接收第1資料;傳送部,在根據前述接收部接收前述第1資料後,將第2資料傳送到前述主裝置;記錄部,使用軟體時鐘之從屬時鐘,記錄前述接收部的前 述第1資料接收時刻及前述傳送部的前述第2資料傳送時刻;補正部,補正根據前述記錄部記錄的前述第1資料接收時刻及前述第2資料傳送時刻;同步部,至少從前述主裝置通知之前述主裝置的前述第1資料傳送時刻、根據前述補正部補正的前述第1資料接收時刻、根據前述補正部補正的前述第2資料傳送時刻、及從前述主裝置通知之前述主裝置的前述第2資料接收時刻,計算出前述主時鐘與前述從屬時鐘之時刻偏差的偏置;以及主裝置,使用軟體時鐘之主時鐘,記錄前述第1資料傳送時刻及前述第2資料接收時刻,補正已記錄的前述第1資料傳送時刻及前述第2資料接收時刻,至少將已補正的前述第1資料傳送時刻及前述第2資料接收時刻通知到前述時刻同步裝置,其中,前述主裝置進一步將已記錄的前述第1資料傳送時刻及前述第2資料接收時刻通知到前述時刻同步裝置。 A time synchronization system includes: a receiving unit that receives first data from a master device having a master clock; and a transmitting unit that transmits the second data to the master device after receiving the first data according to the receiving unit; and the recording unit Recording the front of the receiving unit using the slave clock of the software clock The first data reception time and the second data transmission time of the transmission unit; the correction unit corrects the first data reception time and the second data transmission time recorded by the recording unit; and the synchronization unit at least from the main device Notifying the first data transmission time of the master device, the first data reception time corrected by the correction unit, the second data transmission time corrected by the correction unit, and the master device notified from the master device The second data receiving time calculates an offset of the time difference between the master clock and the slave clock; and the master device records the first data transmission time and the second data reception time using the main clock of the software clock, and corrects The recorded first data transmission time and the second data reception time are notified to the time synchronization device at least the corrected first data transmission time and the second data reception time, wherein the master device further The first data transmission time recorded and the second data reception time are notified to the same time Step device. 一種時刻同步方法,具有主時鐘的主裝置傳送第1資料,具有軟體時鐘之從屬時鐘的時刻同步裝置接收前述第1資料,前述時刻同步裝置在接收前述第1資料後,傳送第2資料,前述主裝置接收前述第2資料,前述主裝置通知前述第1資料傳送時刻及前述第2資料接收時刻, 前述時刻同步裝置使用前述從屬時鐘,記錄前述第1資料接收時刻及前述第2資料傳送時刻,補正已記錄的前述第1資料接收時刻及前述第2資料傳送時刻,至少從前述主裝置通知的前述第1資料傳送時刻、已補正的前述第1資料接收時刻、已補正的前述第2資料傳送時刻、及前述主裝置通知的前述第2資料接收時刻,計算出前述主時鐘與前述從屬時鐘的時刻偏差之偏置,從前述主裝置反覆接收前述第1資料,在每次接收前述第1資料時,記錄前述第1資料接收時刻,在每次記錄前述第1資料接收時刻時產生亂數,使用已產生的亂數,計算出記錄前述第1資料接收時刻之補正值,在計算前述偏置時,將計算的前述第1資料接收時刻之補正值用來作為前述第1資料接收時刻。 A time synchronization method, in which a master device having a master clock transmits first data, and a time synchronization device having a slave clock of a software clock receives the first data, and the time synchronization device transmits the second data after receiving the first data, The master device receives the second data, and the master device notifies the first data transmission time and the second data reception time. The time synchronization device records the first data reception time and the second data transmission time using the slave clock, and corrects the recorded first data reception time and the second data transmission time, and at least the aforementioned notification from the master device The first data transmission time, the corrected first data reception time, the corrected second data transmission time, and the second data reception time notified by the master device, the time of the master clock and the slave clock are calculated. The offset is offset, and the first data is repeatedly received from the master device, and the first data receiving time is recorded every time the first data is received, and a random number is generated every time the first data receiving time is recorded, and the number of random numbers is used. The generated random number is calculated as a correction value for recording the first data reception time, and when the offset is calculated, the calculated correction value of the first data reception time is used as the first data reception time. 一種時刻同步方法,具有主時鐘的主裝置傳送第1資料,具有軟體時鐘之從屬時鐘的時刻同步裝置接收前述第1資料,前述時刻同步裝置在接收前述第1資料後,傳送第2資料,前述主裝置接收前述第2資料,前述主裝置通知前述第1資料傳送時刻及前述第2資料接收時刻,前述時刻同步裝置使用前述從屬時鐘,記錄前述第1資料接收時刻及前述第2資料傳送時刻,補正已記錄的前述第1資料接收時刻及前述第2資料傳送時刻,至少從前述主裝置通知的前述第1資料傳送時刻、已補正的前述第1資料接收 時刻、已補正的前述第2資料傳送時刻、及前述主裝置通知的前述第2資料接收時刻,計算出前述主時鐘與前述從屬時鐘的時刻偏差之偏置,從前述主裝置記錄的前述第1資料傳送時刻、前述主裝置補正的前述第1資料傳送時刻、記錄的前述第1資料接收時刻、補正的前述第1資料接收時刻、記錄的前述第2資料傳送時刻、補正的前述第2資料傳送時刻、前述主裝置記錄的前述第2資料接收時刻、及前述主裝置補正的前述第2資料接收時刻,計算出前述偏置。 A time synchronization method, in which a master device having a master clock transmits first data, and a time synchronization device having a slave clock of a software clock receives the first data, and the time synchronization device transmits the second data after receiving the first data, The master device receives the second data, and the master device notifies the first data transmission time and the second data reception time, and the time synchronization device records the first data reception time and the second data transmission time using the slave clock. Correcting the recorded first data reception time and the second data transmission time, and receiving at least the first data transmission time notified from the master device and the corrected first data reception time At the time, the corrected second data transmission time, and the second data reception time notified by the master device, an offset of the time difference between the master clock and the slave clock is calculated, and the first record recorded from the master device The data transmission time, the first data transmission time corrected by the master device, the recorded first data reception time, the corrected first data reception time, the recorded second data transmission time, and the corrected second data transmission The offset is calculated at the time, the second data reception time recorded by the master device, and the second data reception time corrected by the master device.
TW104123047A 2015-06-08 2015-07-16 Time synchronization device, time synchronization system and time synchronization method TWI599863B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2015/066503 WO2016199196A1 (en) 2015-06-08 2015-06-08 Time synchronization device, time synchronization system, and time synchronization method

Publications (2)

Publication Number Publication Date
TW201643569A TW201643569A (en) 2016-12-16
TWI599863B true TWI599863B (en) 2017-09-21

Family

ID=57504772

Family Applications (1)

Application Number Title Priority Date Filing Date
TW104123047A TWI599863B (en) 2015-06-08 2015-07-16 Time synchronization device, time synchronization system and time synchronization method

Country Status (7)

Country Link
JP (1) JP6261822B2 (en)
KR (1) KR101847366B1 (en)
CN (1) CN107636627B (en)
DE (1) DE112015006604B4 (en)
SG (1) SG11201709362WA (en)
TW (1) TWI599863B (en)
WO (1) WO2016199196A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20190013077A (en) * 2017-07-31 2019-02-11 한국전기연구원 Clock synchronization error compensation system and method for compensating clock synchronization error between master and slave in EtherCAT networks
US11050501B2 (en) * 2018-06-14 2021-06-29 Microchip Technology Incorporated Performing PHY-level hardware timestamping and time synchronization in cost-sensitive environments
WO2020059137A1 (en) * 2018-09-21 2020-03-26 三菱電機株式会社 Communication device, communication system, communication method, and communication program
CN110244635A (en) * 2019-06-24 2019-09-17 中国航空无线电电子研究所 With the remote data concentrator for calculating forwarding time function

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8473638B2 (en) * 2008-05-02 2013-06-25 James Aweya Method and apparatus for time and frequency transfer in communication networks
JP5211987B2 (en) * 2008-09-26 2013-06-12 ブラザー工業株式会社 Terminal device and time adjustment method thereof
JP2013074527A (en) * 2011-09-28 2013-04-22 Fujitsu Ltd Transmission device, transmission system and communication control method
JP2013083450A (en) * 2011-10-06 2013-05-09 Sony Corp Time control device, time control method, and program
JP2013152095A (en) * 2012-01-24 2013-08-08 Sony Corp Time control device, time control method and program
CN102742190A (en) * 2012-02-01 2012-10-17 华为技术有限公司 Synchronization method, device, and system
KR101685856B1 (en) 2012-09-11 2016-12-12 미쓰비시덴키 가부시키가이샤 Correction parameter calculation device and system, correction parameter calculation method, and computer program
JP6158621B2 (en) * 2013-07-19 2017-07-05 京セラドキュメントソリューションズ株式会社 Image forming apparatus and image forming method
JP2015035158A (en) * 2013-08-09 2015-02-19 ルネサスエレクトロニクス株式会社 Data processing system

Also Published As

Publication number Publication date
TW201643569A (en) 2016-12-16
WO2016199196A1 (en) 2016-12-15
JPWO2016199196A1 (en) 2017-07-27
DE112015006604B4 (en) 2020-08-20
KR101847366B1 (en) 2018-04-09
JP6261822B2 (en) 2018-01-17
SG11201709362WA (en) 2017-12-28
DE112015006604T5 (en) 2018-02-22
KR20170125405A (en) 2017-11-14
CN107636627A (en) 2018-01-26
CN107636627B (en) 2020-12-29

Similar Documents

Publication Publication Date Title
CN101960770B (en) Clock synchronization system, node, clock synchronization method
TWI599863B (en) Time synchronization device, time synchronization system and time synchronization method
CN101977104B (en) IEEE1588 based accurate clock synchronization protocol system and synchronization method thereof
EP2515501B1 (en) Media clock negotiation
JP5548305B2 (en) Updating the accumulated packet residence time in packet-switched communication networks
CN103532652B (en) A kind of time synchronism apparatus and method
JP6192995B2 (en) COMMUNICATION DEVICE, COMMUNICATION SYSTEM, COMMUNICATION METHOD, AND COMPUTER PROGRAM
JP6523497B1 (en) Master controller and synchronous communication system using the same
WO2017063450A1 (en) Timestamp filtering method and apparatus
WO2020135857A1 (en) Time synchronization method, system and device, and storage medium
EP2448168A1 (en) Method and system for bearing time synchronization protocol in optical transport network
CN107579793A (en) The optimization method of time synchronized, device and equipment between a kind of communication network device
CN106160914B (en) A kind of IEEE1588 clock synchronizing methods based on disturbance-observer feedback control technology
CN102299788A (en) Method and device for controlling automatic transmission of IEEE1558 (Institute of Electrical and Electronic Engineers 1558) protocol message
CN101790230B (en) Precision time protocol node, time stamp operation method and time synchronization system
CN103067112A (en) Clock synchronization method and device and network equipment
CN103259641A (en) Transmission apparatus, transmission method, program, and communication system
CN107749788B (en) A kind of method, device and equipment improving clock synchronization accuracy
CN203596827U (en) Time synchronization system, switch, and embedded interface board
CN101686093A (en) Transmission network clock synchronizing method, equipment and system
CN101902291B (en) Method, equipment and system for precise time synchronization
EP3231110A1 (en) Method and devices for time transfer using end to end transparent clocks
CN103117845A (en) Modification method, device and system of transparent clock residence time
CN116800366A (en) Clock synchronization method, device and storage medium
US7694176B2 (en) Fault-tolerant computer and method of controlling same

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees