CN102447553A - Realizing device of accurate time synchronization protocol - Google Patents

Realizing device of accurate time synchronization protocol Download PDF

Info

Publication number
CN102447553A
CN102447553A CN2010105075523A CN201010507552A CN102447553A CN 102447553 A CN102447553 A CN 102447553A CN 2010105075523 A CN2010105075523 A CN 2010105075523A CN 201010507552 A CN201010507552 A CN 201010507552A CN 102447553 A CN102447553 A CN 102447553A
Authority
CN
China
Prior art keywords
ptp
clock
agreement
message
operating system
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN2010105075523A
Other languages
Chinese (zh)
Inventor
陈志列
熊威
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
EVOC Intelligent Technology Co Ltd
Original Assignee
EVOC Intelligent Technology Co Ltd
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 EVOC Intelligent Technology Co Ltd filed Critical EVOC Intelligent Technology Co Ltd
Priority to CN2010105075523A priority Critical patent/CN102447553A/en
Publication of CN102447553A publication Critical patent/CN102447553A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The invention is applicable in the technical field of network communication, and provides a realizing device of accurate time synchronization protocol, the device comprises a system initialization unit, initializing the realizing device of PTP (precision time protocol), preparing for running of PTP(precision time protocol); a human-computer interaction unit, providing one or more interactive interfaces, providing interact between users and the realizing device of the PTP(precision time protocol); a protocol engine unit, running PTP(precision time protocol); a hardware communication unit, stamping time for all PTP(precision time protocol) messages of engine unit organization of the protocol , transmitting the PTP(precision time protocol) messages with stamp between the master clock device and the vice clock device. The invention of realizing device of PTP(precision time protocol) runs the PTP(precision time protocol) in the network, realizing high-precision synchronization of the network clock, and solving all kinds of problems caused by error of clock synchronization or asynchronization in the current industrial control.

Description

A kind of implement device of exact time synchronization agreement
Technical field
The invention belongs to network communication field, relate in particular to a kind of implement device of exact time synchronization agreement.
Background technology
In present industrial control process, because the different or synchronous error between each clock has caused a series of problem to Industry Control greatly in the industrial control network.In order to solve the stationary problem of each clock in the network.Prior art provides multiple agreement that can the network enabled clock synchronization, as NTP (Network Time Protocol, NTP), SNTP (Simple Network Time Protocol, SNTP) etc.But it is not high that the common deficiency of the agreement of these network enabled clock synchronizations is clock synchronization accuracies, generally all is Millisecond, can not well satisfy modern industry control, like the application demand of power industry, track traffic etc.
In order to address the above problem; Engineers and technicians with fields such as the information technology of common interests, automatic control, artificial intelligence, thermometricallies propose to have set up the synchronous committee of network precision interval clock; This synchronous committee of network precision interval clock has worked out the precision interval clock synchronous protocol standard (IEEE1588 standard) of network measure and control system; The precision interval clock agreement of IEEE1588 (Precision Time Synchronization Protocol; PTP) can realize high-precision Ethernet time synchronized, obtain good network clocking synchronization accuracy, improve the timing coincident indicator of network significantly.
But the PTP agreement of IEEE1588 has only defined synchronous standard, and prior art does not provide the concrete implement device of PTP agreement, makes that this PTP agreement is difficult to obtain promote.
Summary of the invention
The embodiment of the invention provides a kind of implement device of exact time synchronization agreement, is intended to the implement device operation PTP agreement through this exact time synchronization agreement, to reach the problem of the high-precise synchronization of each clock in the network.
The embodiment of the invention is achieved in that a kind of implement device of exact time synchronization agreement, and said device comprises:
The system initialization unit is used for the implement device of exact time synchronization PTP agreement is carried out initialization;
Man-machine interaction unit is used to provide one or more interactive interfaces, carries out alternately for the implement device of user and PTP agreement;
The protocol engine unit; Be used to move the PTP agreement; According to the various PTP messages of PTP agreement organizations; And according to the PTP agreement in clock equipment with from mutual PTP message between the clockwork, stab and time of reception stabs and realizes clock equipment and from the clock synchronization between the clockwork according to the transmitting time of each PTP message;
The hardware communication unit is used for the various PTP messages of said protocol engine cellular organization are stamped timestamp, and the PTP message that will stamp timestamp transmits in clock equipment with between the clockwork.
In embodiments of the present invention; A kind of implement device of new PTP agreement is provided; Implement device through this PTP agreement moves the PTP agreement in network; Realizing the high-precise synchronization of each clock in the network, thereby solved on the present Industry Control because asynchronous between the clock or variety of issue that synchronous error causes greatly.
Description of drawings
Fig. 1 is the network structure that is suitable for the implement device of PTP agreement provided by the invention;
Fig. 2 is the structured flowchart of the implement device of the PTP agreement that provides of the embodiment of the invention;
Fig. 3 is the clock equipment that provides of the embodiment of the invention and from the schematic flow sheet of the PTP message interaction between clockwork;
Fig. 4 is the structural representation of the hardware communication unit that provides of the embodiment of the invention;
Fig. 5 is the detailed architecture figure of the implement device of the PTP agreement that provides of the embodiment of the invention;
Fig. 6 is the startup flow chart of the implement device of the PTP agreement that provides of the embodiment of the invention.
Embodiment
In order to make the object of the invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with accompanying drawing and embodiment.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
In embodiments of the present invention, a kind of implement device of new PTP agreement is provided,, has satisfied the high-precise synchronization demand of clock in the network in network, to realize the PTP agreement.
The invention provides a kind of implement device of exact time synchronization agreement, said device comprises:
The system initialization unit is used for the implement device of exact time synchronization PTP agreement is carried out initialization, for the operation of PTP agreement is prepared;
Man-machine interaction unit is used to provide one or more interactive interfaces, carries out alternately for the implement device of user and PTP agreement;
The protocol engine unit; Be used to move the PTP agreement; According to the various PTP messages of PTP agreement organizations; And according to the PTP agreement in clock equipment with from mutual PTP message between the clockwork, stab and time of reception stabs and realizes clock equipment and from the clock synchronization between the clockwork according to the transmitting time of each PTP message;
The hardware communication unit is used for the various PTP messages of said protocol engine cellular organization are stamped timestamp, and the PTP message that will stamp timestamp transmits in clock equipment with between the clockwork.
For technical scheme of the present invention is described, describe through specific embodiment below.
Fig. 1 shows the network configuration of the implement device that is suitable for PTP agreement provided by the invention, a plurality ofly is connected clock equipment and respectively from communicating through the PTP message between the clockwork with clock equipment from clockwork.In another embodiment of the present invention, a plurality ofly also can be connected with a plurality of clock equipment from clockwork.
Fig. 2 shows the structure of the implement device of the PTP agreement that the embodiment of the invention provides, and for the ease of explanation, only shows the part relevant with the embodiment of the invention.
The implement device of this PTP agreement can be used for communication equipment; Like computer equipment etc.; Can be to run on the unit that software unit, hardware cell or software and hardware in these equipment combine; Also can be used as independently, suspension member is integrated in these equipment or runs in the application system of these equipment, wherein:
The implement device of the 1 pair of PTP agreement in system initialization unit carries out initialization, thinks that the operation of PTP agreement is ready.In embodiments of the present invention, system initialization unit 1 is mainly used in timer, system journal unit, configuration module etc. is carried out initialization.Wherein initialization includes but not limited to resource allocation, creates timer, creates message queue and initialization system daily record etc.Logical operation when wherein timer is used to accomplish the PTP protocol interaction guarantees the normal operation of PTP agreement.Message queue is used to the api interface that the user provides an outside, makes the user to obtain the abnormal information that takes place in the PTP agreement operation process through this api interface.
The resource that wherein need distribute includes but not limited to internal memory, data structure, message queue etc., as be clock synchronization compliant with precision time protocol data structure storage allocation, for outside master clock (Foreign Master) storage allocation.
Wherein the clock synchronization compliant with precision time protocol data structure is used for the attribute of quantitative description present clock, and the member of each data set of defining in the standard is comprised event in the recording clock synchronizing process, the state of clock port and numerical value etc.
Foreign Master is used to store the sync message that outside clock equipment is sent.Wherein ForeignMaster is to the local clock node, and all sync messages from the outside master clock that clockwork receives all need be stored the internal memory that distributes for Foreign Master, are used for the BMC algorithm process.Man-machine interaction unit 2 provides one or more interactive interfaces, carries out alternately for the implement device of user and PTP agreement.The interactive interface that wherein provides include but not limited to parameter/configuration interface and the API that is used to test (Application Programming Interface, API).This man-machine interaction unit 2 comprises configuration module 21 and test module 22.
Wherein configuration module 21 provides parameter/configuration interface, receives the configuring request of user's input, and is configured according to the system parameters of this configuring request to the implement device of PTP agreement.
Wherein can the system configured parameter include but not limited to local clock parameter attribute and User Defined parameter two parts.Owing to need the system configured parameter in existing IEEE 1588-2008 standard, regulation to be arranged, repeat no more at this.
This configuration module 21 includes but not limited to file configuration mode, database configuration mode, WEB configuration mode etc. according to configuring request to the mode that the system parameters of the implement device of PTP agreement is configured.
Wherein the idiographic flow of file configuration mode is following: this configuration module 21 provides the file configuration interface for the user; The user is through this document configuration interface input configuration file; And this configuration file stores is provided with in the file system of system of implement device of PTP agreement to this; When needs pass through the implement device operation PTP agreement of PTP agreement; Then directly read the content in this configuration file, and with the numerical value assignment that disposes in this configuration file in the clock data structure to dependent variable, so that the implement device of PTP agreement uses.Illustrate as follows:
Suppose that configuration file is called cfgFile.txt, then the content in this configuration file cfgFile.txt is user configured system parameters.After powering on, system at first opens this configuration file cfgFile.txt; Then all characters among this configuration file cfgFile.txt are read in the internal memory; The integrality of resolving each parameter with and value corresponding; Give the variable of the correspondence in the clock data structure with the corresponding assignment of this numerical value difference, so that used by the implement device of PTP agreement.
If this configuration file cfgFile.txt does not exist, then the implement device of PTP agreement will use the numerical value of one group of acquiescence to come assignment to give the variable of the correspondence in the clock data structure, and the numerical value that will give tacit consent to is then write in the file, as follow-up configuration file.
Wherein store the system parameters of the implement device of user configured PTP agreement in the configuration file.Database configuration mode, WEB configuration mode and file configuration mode are similar, and difference only is to adopt the system parameters of the implement device of the user configured PTP agreement of database storage.Illustrate no longer one by one at this.
The api interface that test module 22 is provided for testing receives the test request of user's input, and the function of the PTP agreement of this test request appointment is tested.The process that this test module 22 is tested is following:
At first call a test program inlet, enter into a test interface, this test program comprises multiple functional test inlet, like timer test, system journal test, multicast test, message queue test and PTP information test etc.
Wait for user's input test option then, test finishes and is withdrawn into main interface wait input once more.
Protocol engine unit 3 operation PTP agreements; According to the various PTP messages of PTP agreement organizations; And according to the PTP agreement in clock equipment with from mutual PTP message between the clockwork, stab and time of reception stabs and realizes clock equipment and from the clock synchronization between the clockwork according to the transmitting time of each PTP message.
This protocol engine unit 3 comprises timer 31, PTP message processing module (MPM) 32, network communication module 33, synchronized algorithm module 34 and clock processing module 35.Wherein:
Timer 31 provides timing function for the operation of PTP agreement.This timer 31 includes but not limited to the timer of three types of sync interval timer, receive time-out timer and delay requesting interval timers etc.
Wherein the sync interval timer is used to control clock equipment to the blanking time of sending sync message from clockwork.After switching to the PTP_MASTER state when the clock synchronization compliant with precision time protocol port; Program will start the sync interval timer, and it is the time of appointment that the time interval regularly is set then, and be pre-configured blanking time regularly; Program checks through the mode of poll whether the time interval regularly arrives then; If arrived, so this timing is re-set as the time of appointment, and sends sync message and arrive from clock.
The receive time-out timer is used to control the blanking time that receives sync message from clockwork from clock equipment.After switching to the PTP_SLAVE state when the clock synchronization compliant with precision time protocol port status; Program will start the receive time-out timer; It is the time of appointment that the time interval regularly is set then, and be pre-configured blanking time regularly, and program checks through the mode of poll whether the time interval regularly arrives then; If to also not receiving the PTP sync message; So the clock synchronization compliant with precision time protocol port is switched to the PTP_MASTER state, otherwise in this time interval, received sync message, so this timing is re-set as the time of appointment.
Postponing the requesting interval timer was used to write down from the blanking time of clockwork to clock equipment transmission lag request message.As when receive a certain sync message from clock after, will start delay requesting interval timer, the time interval is set to the integral multiple of sync message gap periods then, and this integral multiple pre-sets.Inquire about this timing through the mode of poll then and whether arrive,, will be re-set as the integral multiple of sync message gap periods so the time interval, and can give clock equipment by the transmission lag request message if arrive.
In embodiments of the present invention, the timer that sync interval timer, receive time-out timer and delay requesting interval timer etc. are three types can adopt same timer to realize, also can adopt different timers to realize.
PTP message processing module (MPM) 32 is according to the PTP agreement organizations and encapsulate various PTP messages, sends the PTP message through network communication module 32, or receives the PTP message from network communication module 32, and obtains the transmitting time stamp and the time of reception stamp of each PTP message.
In embodiments of the present invention, PTP message processing module (MPM) 32 includes but not limited to sync message, follows message, postpones request message and delayed response message according to the PTP message of PTP agreement organizations.
Wherein sync message is periodically to be sent to the message from clockwork by clock equipment.In embodiments of the present invention, PTP message processing module (MPM) 32 tissues and encapsulation sync message in the clock equipment are through the sync message after the 33 transmission encapsulation of network communication module.When receiving the sync message that clock equipment sends, obtain the timestamp (all being called the sync message time of reception later on stabs) when receiving this sync message from the PTP message processing module (MPM) 32 of clockwork.
Following message also is periodically to be sent to the message from clockwork by clock equipment, and this is followed the transmitting time that has comprised sync message in the message and stabs (all being called the sync message transmitting time later on stabs).Follow message and sync message has the property of following, sync message sends the back scheduled time and can send and follow message.
Postponing request message is by the message that periodically is sent to clock equipment from clockwork.In embodiments of the present invention; Postpone request message from PTP message processing module (MPM) 32 tissues of clockwork; And at the message that will postpone to ask to be sent to clock equipment, the timestamp when obtaining the transmission lag request message (all be called later on and postpone message transmitting time stamp).
The delayed response message is clock equipment after receiving the delay request message that sends from clockwork to the message that sends from clockwork, comprised clock equipment in this delayed response message and received the timestamp that postpones request message (all be called later on postpone the message time of reception stab).
, when receiving the delayed response message that clock equipment sends, obtain the clock equipment that comprises in this delayed response message and receive the timestamp that postpones request message from the PTP message processing module (MPM) 32 of clockwork.
Synchronized algorithm module 34 is stabbed calculating from clock jitter and delay between clockwork and the clock equipment according to the transmitting time stamp and the time of reception of the various PTP messages that PTP message processing module (MPM) 32 is obtained.
In embodiments of the present invention, the sync message transmitting time obtained according to PTP message processing module (MPM) 32 of synchronized algorithm module 34 is stabbed, the sync message time of reception stabs, postpone the message transmitting time stabs and postpones the message time of reception and stab and calculate from clock jitter and delay between clockwork and the clock equipment.
See also Fig. 3, the clock equipment that provides for the embodiment of the invention and from the schematic flow sheet of the PTP message interaction between clockwork, details are as follows:
1, clock equipment constantly to sending sync message from clockwork, receives the sync message that clock equipment is sent from clockwork at t2 at t1 constantly.
2, clock equipment is after sending sync message; Behind Preset Time, send and include the message of following that the sync message transmitting time is stabbed t1; Receive after this follows message from clockwork, follow message and can obtain this and follow the sync message transmitting time that message comprises and stab t1 through resolving this.
3, from clockwork at t3 constantly to clock equipment transmission lag request message, clock equipment receives the delay request message that sends from clockwork constantly at t4.
4, clock equipment postpones the delayed response message that the message time of reception stabs t4 to sending from clockwork to comprise after receiving the delay request message that sends from clockwork.
According to clock equipment shown in Figure 3 with from the PTP message interaction flow process between clockwork, it is following to obtain synchronized algorithm:
Offset=(t2-t1)-one_way_delay;
one_way_delay=[(t2-t1)+(t4-t3)]/2;
According to above-mentioned two formula, can obtain Offset=[(t2-t1)-(t4-t3)]/2;
Wherein Offset is from the clock jitter between clockwork and the clock equipment, and one_way_delay is from the clock delay between clockwork and the clock equipment.T1 stabs for the sync message transmitting time, and t2 stabs for the sync message time of reception, and t3 stabs for postponing the message transmitting time, and t4 stabs for postponing the message time of reception.
In embodiments of the present invention; Because clock equipment can be periodically to sending sync message from clockwork and following message; Also can be from clockwork periodically to clock equipment transmission lag request message; In clock equipment with from will periodically carrying out synchronizing process shown in Figure 3 between the clockwork, synchronizing process is carried out repeatedly, finally will make consistent from clock, frequency and phase place between clockwork and the clock equipment.
Clock processing module 35 is adjusted from clock jitter, phase place and frequency between clockwork and the clock equipment from clock jitter between clockwork and the clock equipment and delay according to what synchronized algorithm module 34 calculated.Its detailed process is following:
After some clocks were linked into a sub-net, system can enter into a stable status very soon.One of them stable status is meant that clock synchronization compliant with precision time protocol can carry out the state of long PTP protocol interaction, like master clock M state (PTP_MASTER), from clock S state (PTP_SLAVE) or passive state (PTP_PASSIVE).Wherein passive state is appreciated that in PTP standard literary composition and is virtual off-state, under passive state, receives only the PTP message, and does not send any PTP message.
After receiving sync message at every turn and follow message from clock, can accomplish deviation and measure and calculate, from clock sent at every turn postpone request message with received should delays ask relevant delayed response message after, can accomplish time lag of first order and test calculating.
Can know that by Offset=(t2-t1)-one_way_delay Offset is only relevant with one_way_delay.In order to obtain comparatively accurate Offset, then need carry out proper process to one_way_delay, make the value of this one_way_delay more accurate.In embodiments of the present invention; The multiple algorithm that can adopt prior art to provide is handled one_way_delay; The following method that also can adopt the embodiment of the invention to provide is handled one_way_delay: in embodiments of the present invention, and in order to handle the shake that the network burst flow brings, through continuous calculating 3 times or one_way_delay more frequently; Be placed in the formation; The mode of filtering bigger unusual numerical value then and the numerical value that repeatedly calculates being averaged obtains one_way_delay, so just can reduce the one_way_delay numerical exception that the network burst flow causes, and then cause Offset unusual.
After having obtained more satisfactory Offset numerical value,, can calculate from phase difference between clock and the master clock and difference on the frequency according to this deviation ratio again through calculating from the deviation ratio between clock and the master clock.As can obtain according to the account form that this deviation ratio provides through the PHY chip from phase difference between clock and the master clock and difference on the frequency.
Obtained between clock and master clock the time clock correction, phase difference and three parameters of difference on the frequency deviate after, can this deviate be compensated to from clock.
Hardware communication unit (scheming not shown) is stamped timestamp to the various PTP messages of protocol engine unit 3 tissue, and the PTP message that will stamp timestamp transmits in clock equipment with between the clockwork.
In embodiments of the present invention; In clock equipment; After this hardware communication unit is stamped timestamp (being the sync message transmitting time stabs) to the sync message of protocol engine unit 3 tissues; Transfer to from clockwork, and protocol engine unit 3 organize include that the sync message transmitting time stabs follow message after, this is followed message transmissions to from clockwork; This hardware communication unit is when receiving from delay request message that clockwork sends simultaneously; Should postpone request message and transfer to protocol engine unit 3, and organize in protocol engine unit 3 and to include when postponing delayed response message that the request message time of reception stabs, with this delayed response message transmissions to from clockwork.
From clockwork; The sync message that this hardware communication unit sends the clock equipment that receives with follow message transmissions to the protocol engine unit 3 from clockwork; After the delay request message is organized in protocol engine unit 3; Should postpone request message and transfer to clock equipment, the delayed response message transmissions of simultaneously clock equipment that receives being sent is to the protocol engine unit 3 from clockwork.
See also Fig. 4, the structural representation of the hardware communication unit that provides for the embodiment of the invention.
This hardware communication unit comprises User Datagram Protocol (User Datagram Protocol; UDP) transport layer, network connection protocol (Internet Protocol; IP) transport layer, data link layer (Media Access Control, MAC) transport layer and physical layer (also claiming the PHY transport layer).In clock equipment, after the PTP message was organized in protocol engine unit 3, this PTP message transferred to from clockwork through UDP transport layer, IP transport layer, MAC transport layer and PHY transport layer successively.After PHY transport layer from clockwork receives the PTP message, transfer to protocol engine unit 3 through MAC transport layer, IP transport layer, UDP transport layer successively from clockwork.
In embodiments of the present invention, the hardware communication unit can be that the various PTP messages that protocol engine unit 3 is organized are stamped timestamp in MAC transport layer or PHY transport layer.Through being that the various PTP messages that protocol engine unit 3 is organized are stamped timestamp, can improve the clock synchronization accuracy in the network greatly in MAC transport layer or PHY transport layer.Preferably, be that the various PTP messages that protocol engine unit 3 is organized are stamped timestamp in the PHY transport layer, can improve the clock synchronization accuracy in the network to greatest extent.
In another embodiment of the present invention, the implement device of this PTP agreement also comprises operating system abstraction unit 5.This operating system abstraction unit 5 provides the standard interface of operating system, calls the assembly of respective operations system through the standard interface of this operating system, so that the implement device of PTP agreement and hardware layer carry out communication.Wherein the standard interface of the operating system that provides of operating system abstraction unit 5 includes but not limited to that file input/output interface (file I/O), format input/output interface (format IO), network interface, network input/output interface (network I/O), interrupt management, time management, time control, task management, management by synchronization, message management, memory management and system assert etc.
In embodiments of the present invention; The standard interface of the operating system that operating system abstraction unit 5 provides is made up of the basic module that constitutes different operating system; The assembly of the standard interface call operation system of the operating system that can be directly provides through operating system abstraction unit 5 of the implement device of PTP agreement is realized the communication with hardware layer like this.In embodiments of the present invention; Because the standard interface of the operating system that operating system abstraction unit 5 provides is made up of the basic module that constitutes different operating system; Thereby the implement device of the PTP agreement that the user need not the embodiment of the invention is provided carries out any modification, and the implement device of the PTP agreement that can the embodiment of the invention be provided is transplanted to several operation systems.
In another embodiment of the present invention; This operating system abstraction unit 5 only provides the standard interface of operating system; When the implement device of the PTP agreement that need the embodiment of the invention be provided is transplanted to the operating system of appointment; The user only needs to realize according to the assembly of the operating system of appointment the standard interface of the operating system that operating system abstraction unit 5 provides; The implement device of the PTP agreement that just can the embodiment of the invention be provided is transplanted to the operating system of this appointment, brings great convenience thereby transplant for interdepartmental system.
In another embodiment of the present invention, this device also comprises system journal unit 6.This system journal unit 6 is with implement device event in the process of operation PTP agreement of the form record PTP agreement of daily record.According to system journal unit 6 information recorded, can carry out accident analysis and maintenance by implement device easily and fast like this to the PTP agreement.
In order to further specify the implement device of the PTP agreement that the embodiment of the invention provides, see also Fig. 5, the detailed architecture of the implement device of the PTP agreement that provides for the embodiment of the invention, details are as follows:
In the implement device of PTP agreement shown in Figure 5, the external interface that the user calls this PTP agreement implement device starts and moves the PTP agreement.Wherein external interface comprises system initialization unit (scheming not shown), man-machine interaction unit (scheming not shown), protocol engine unit and system journal unit.Wherein man-machine interaction unit comprises configuration module and test module.
Wherein the protocol engine unit is the core of the implement device of PTP agreement; This protocol engine unit is observed the requirement of IEEE 1588 standards fully; It comprises the various protocols engine module, like timer, PTP message processing module (MPM), network communication module, synchronized algorithm module and clock processing module.Wherein the clock processing module also comprises time processing module and system's correlation module, wherein system's correlation module such as timestamp processing etc.
This device also comprises the operating system abstraction unit; This operating system abstraction unit provides the standard interface of operating system; The standard interface of these operating systems can be made up of the basic module that constitutes different operating system; Also can be when needed realize, so just can make the implement device of the PTP agreement that the embodiment of the invention provides be transplanted to operating system arbitrarily by the user.Used the socket visit of operating system like the network communication module, the clock processing module is called through the interface of the IO subsystem in the operating system, and the assembly that the realization of timer also is based in the operating system of appointment is realized.
The workflow of the implement device of the PTP agreement that the embodiment of the invention provides mainly comprises the synchronous flow process that starts flow process and PTP, and Fig. 6 shows the startup flow process of the implement device of PTP agreement, is summarized as follows:
In step S101, be the implement device distributing system resource of PTP agreement.
The resource that wherein needs distributed system resources to include but not limited to that needs distribute includes but not limited to internal memory, data structure, message queue etc., as be clock synchronization compliant with precision time protocol data structure storage allocation, be outside master clock (Foreign Master) storage allocation.
When being the implement device distributing system resource of PTP agreement, need be distribution system resources such as self-defining clock node data structure, system journal, timer, configuration parameter.
In step S102.Judge whether resource allocation is successful, if, execution in step S103, otherwise finish to start flow process.
In step S103, read the system configured parameter of the implement device of PTP agreement.
Wherein configuration parameter is meant that the user is the parameter of the implement device configuration of PTP agreement through configuration module.This configuration parameter can be with the stored in form of text in the host file system of operation PTP agreement, also can be with the stored in form of database in the Database Systems of the main frame of operation PTP agreement.This configuration parameter is used for the build-in attribute of the implement device of PTP agreement is changed.
In step S104, judge whether configuration parameter reads success, if, execution in step S106, otherwise, execution in step S105.
In step S105, the configuration parameter of load default, and with the acquiescence configuration parameter write file.
In step S106, timer and message queue are carried out initialization process according to configuration parameter.
Wherein timer is that the timing mechanism that the operating system through the bottom appointment provides is realized.
Message queue also is that the mechanism that the operating system through the bottom appointment provides realizes, is mainly used in event message is sent and receives, and user interface is provided.
In step S107, start the protocol engine task.
In embodiments of the present invention, the protocol engine task is that the mechanism that the operating system through the bottom appointment provides realizes, main effect is that the implement device of PTP agreement is carried out with a task, and operating system can be managed this task.
In step S108, judge whether the protocol engine task starts success, if, then finish the startup flow process of the implement device of PTP agreement, if deny, after then elder generation discharges distributed system resources, finish the startup flow process of the implement device of PTP agreement again.
Because the synchronous flow process of PTP is existing definition in IEEE 1588 standards, therefore, repeats no more at this.
The implement device of the PTP agreement that the embodiment of the invention provides goes for multiple network, like electrical network etc., to realize the high-precise synchronization of clock in the network.
One of ordinary skill in the art will appreciate that; Realize that all or part of step in the foregoing description method is to instruct relevant hardware to accomplish through program; Described program can be in being stored in a computer read/write memory medium; Described storage medium is like ROM/RAM, disk, CD etc.
The embodiment of the invention is through providing a kind of implement device of new PTP agreement; Implement device through this PTP agreement moves the PTP agreement in network; Realizing the high-precise synchronization of each clock in the network, thereby solved on the present Industry Control because asynchronous between the clock or variety of issue that synchronous error causes greatly.The implement device of the PTP agreement that the while embodiment of the invention provides can be transplanted in various operating systems easily and efficiently.
The above is merely preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of within spirit of the present invention and principle, being done, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (9)

1. the implement device of an exact time synchronization agreement is characterized in that, said device comprises:
The system initialization unit is used for the implement device of exact time synchronization PTP agreement is carried out initialization;
Man-machine interaction unit is used to provide one or more interactive interfaces, carries out alternately for the implement device of user and PTP agreement;
The protocol engine unit; Be used to move the PTP agreement; According to the various PTP messages of PTP agreement organizations; And according to the PTP agreement in clock equipment with from mutual PTP message between the clockwork, stab and time of reception stabs and realizes clock equipment and from the clock synchronization between the clockwork according to the transmitting time of each PTP message;
The hardware communication unit is used for the various PTP messages of said protocol engine cellular organization are stamped timestamp, and the PTP message that will stamp timestamp transmits in clock equipment with between the clockwork.
2. device as claimed in claim 1 is characterized in that, said protocol engine unit comprises:
Timer, the operation that is used to the PTP agreement provides timing function;
The PTP message processing module (MPM) is used for according to the PTP agreement organizations and encapsulates various PTP messages, sends the PTP message through the network communication module, or receives the PTP message from the network communication module, and the transmitting time of obtaining each PTP message is stabbed and the time of reception stamp;
Synchronized algorithm module, the transmitting time of the various PTP messages that are used for obtaining according to said PTP message processing module (MPM) are stabbed and time of reception stabs and calculates from clock jitter and delay between clockwork and the clock equipment;
The clock processing module is used for adjusting from clock jitter, phase place and frequency between clockwork and the clock equipment from clock jitter between clockwork and the clock equipment and delay according to what said synchronized algorithm module calculated.
3. device as claimed in claim 2; It is characterized in that; The type of timer comprises sync interval timer, receive time-out timer and postpones the requesting interval timer, adopts same timer or different timing device to realize said sync interval timer, receive time-out timer and delay requesting interval timer.
4. device as claimed in claim 1 is characterized in that, said hardware communication unit comprises UDP transport layer, IP transport layer, MAC transport layer and PHY transport layer.
5. device as claimed in claim 4 is characterized in that, the hardware communication unit is that the various PTP messages of said protocol engine cellular organization are stamped timestamp in said MAC transport layer or PHY transport layer.
6. device as claimed in claim 1 is characterized in that, said device also comprises:
The operating system abstraction unit is used to provide the standard interface of operating system, calls the assembly of respective operations system through the standard interface of operating system, so that the implement device of PTP agreement and hardware layer carry out communication.
7. device as claimed in claim 6; It is characterized in that; The standard interface of the operating system that said operating system abstraction unit provides is made up of the basic module that constitutes different operating system; Perhaps said operating system abstraction unit only provides the standard interface of operating system, in the time need the implement device of said PTP agreement being transplanted to the operating system of appointment, realizes the standard interface of the operating system that said operating system abstraction unit provides according to the assembly of the operating system of appointment.
8. device as claimed in claim 1 is characterized in that, said device also comprises:
The system journal unit is used for writing down the process event of the implement device of PTP agreement in operation PTP agreement with the form of daily record.
9. device as claimed in claim 1 is characterized in that, said man-machine interaction unit comprises:
Configuration module is used to provide parameter/configuration interface, receives the configuring request of user's input, and is configured according to the system parameters of this configuring request to the implement device of PTP agreement;
Test module, the API that is provided for testing receives the test request of user's input, and the function of the PTP agreement of this test request appointment is tested.
CN2010105075523A 2010-10-12 2010-10-12 Realizing device of accurate time synchronization protocol Pending CN102447553A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010105075523A CN102447553A (en) 2010-10-12 2010-10-12 Realizing device of accurate time synchronization protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010105075523A CN102447553A (en) 2010-10-12 2010-10-12 Realizing device of accurate time synchronization protocol

Publications (1)

Publication Number Publication Date
CN102447553A true CN102447553A (en) 2012-05-09

Family

ID=46009665

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010105075523A Pending CN102447553A (en) 2010-10-12 2010-10-12 Realizing device of accurate time synchronization protocol

Country Status (1)

Country Link
CN (1) CN102447553A (en)

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104253665A (en) * 2013-06-28 2014-12-31 上海贝尔股份有限公司 Synchronizing equipment and synchronizing system with same
CN105634715A (en) * 2014-10-31 2016-06-01 中国飞行试验研究院 Airborne network IEEE1588 protocol transparent clock port synchronization method
CN105634716A (en) * 2014-10-31 2016-06-01 中国飞行试验研究院 Airborne network IEEE1588 protocol slave clock port synchronization method
CN107925974A (en) * 2015-08-10 2018-04-17 高通股份有限公司 Part time synchronization function in fine time-ordered measurement agreement synchronizes
CN110572234A (en) * 2019-10-22 2019-12-13 深圳震有科技股份有限公司 Method for realizing clock synchronization based on serial port, intelligent terminal and storage medium
WO2019242321A1 (en) * 2018-06-19 2019-12-26 中兴通讯股份有限公司 Time synchronization method, device, network device and computer readable storage medium
CN110794919A (en) * 2019-10-22 2020-02-14 深圳震有科技股份有限公司 Method for realizing clock synchronization based on MDIO, intelligent terminal and storage medium
CN110912634A (en) * 2019-10-25 2020-03-24 深圳震有科技股份有限公司 Method for realizing clock synchronization based on SPI, storage medium and terminal equipment
CN111077941A (en) * 2019-11-06 2020-04-28 深圳震有科技股份有限公司 Clock synchronization setting method, equipment and storage medium
CN111107020A (en) * 2019-12-31 2020-05-05 盛科网络(苏州)有限公司 Method for time synchronization of multi-core Ethernet switching chip
CN111225122A (en) * 2020-01-19 2020-06-02 深圳英飞拓科技股份有限公司 Method for realizing time correcting mechanism in multi-camera video synchronization based on PTP (precision time protocol)
WO2020114436A1 (en) * 2018-12-04 2020-06-11 深圳市中兴微电子技术有限公司 Clock synchronization method, system, device and storage medium
CN112039719A (en) * 2020-07-20 2020-12-04 河北汉光重工有限责任公司 PTP clock synchronization precision testing method for linux system
CN112491490A (en) * 2020-11-27 2021-03-12 南京简岱自动化科技有限公司 Time synchronizer adaptable to different devices
CN114095109A (en) * 2021-11-17 2022-02-25 深圳市领创星通科技有限公司 Clock synchronization method, device, equipment and storage medium
CN114157380A (en) * 2021-12-02 2022-03-08 浪潮云信息技术股份公司 ZNBASE distributed database clock synchronization method and system
CN114285542A (en) * 2022-01-28 2022-04-05 高新兴物联科技有限公司 Network time correction method, equipment and computer readable storage medium
CN114614934A (en) * 2022-03-28 2022-06-10 智己汽车科技有限公司 Time synchronization triggering device and method
CN115642977A (en) * 2022-10-10 2023-01-24 广东越新微系统研究院 Hybrid optimization time synchronization system
CN115801176A (en) * 2023-01-19 2023-03-14 北京国科天迅科技有限公司 Cross-platform clock synchronization method, device and storage medium based on PTP (precision time protocol)
CN116208289A (en) * 2023-04-28 2023-06-02 北京邮电大学 Time synchronization method and device based on white box switch and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101039173A (en) * 2007-04-29 2007-09-19 山东大学 Apparatus and method for realizing synchronization between Ethernet chain-like network nodes
US20080181112A1 (en) * 2007-01-31 2008-07-31 Juergen Beck Methods and Apparatus for Controlling Latency Variation in a Packet Transfer Network
CN101330342A (en) * 2008-07-30 2008-12-24 中兴通讯股份有限公司 Method for implementing time synchronization protocol using port mirror and apparatus thereof
CN101388741A (en) * 2008-10-24 2009-03-18 中国科学院计算技术研究所 Highly precised time synchronization device, system and method for computer network
CN101547083A (en) * 2008-03-24 2009-09-30 杭州华三通信技术有限公司 Time synchronizer, time synchronization system and time synchronization method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080181112A1 (en) * 2007-01-31 2008-07-31 Juergen Beck Methods and Apparatus for Controlling Latency Variation in a Packet Transfer Network
CN101039173A (en) * 2007-04-29 2007-09-19 山东大学 Apparatus and method for realizing synchronization between Ethernet chain-like network nodes
CN101547083A (en) * 2008-03-24 2009-09-30 杭州华三通信技术有限公司 Time synchronizer, time synchronization system and time synchronization method
CN101330342A (en) * 2008-07-30 2008-12-24 中兴通讯股份有限公司 Method for implementing time synchronization protocol using port mirror and apparatus thereof
CN101388741A (en) * 2008-10-24 2009-03-18 中国科学院计算技术研究所 Highly precised time synchronization device, system and method for computer network

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
林涛 等: "《基于精密时间协议的时钟同步技术》", 《计算机应用》 *
王玉洁: "《数字化变电站中IEEE1588对时协议的实现》", 《中国优秀硕士学位论文全文数据库 电子期刊》 *

Cited By (30)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104253665B (en) * 2013-06-28 2017-06-13 上海贝尔股份有限公司 Synchronizer and the synchronization system comprising the equipment
CN104253665A (en) * 2013-06-28 2014-12-31 上海贝尔股份有限公司 Synchronizing equipment and synchronizing system with same
CN105634715A (en) * 2014-10-31 2016-06-01 中国飞行试验研究院 Airborne network IEEE1588 protocol transparent clock port synchronization method
CN105634716A (en) * 2014-10-31 2016-06-01 中国飞行试验研究院 Airborne network IEEE1588 protocol slave clock port synchronization method
CN107925974A (en) * 2015-08-10 2018-04-17 高通股份有限公司 Part time synchronization function in fine time-ordered measurement agreement synchronizes
CN107925974B (en) * 2015-08-10 2019-05-17 高通股份有限公司 Part time synchronization function in fine time-ordered measurement agreement synchronizes
WO2019242321A1 (en) * 2018-06-19 2019-12-26 中兴通讯股份有限公司 Time synchronization method, device, network device and computer readable storage medium
WO2020114436A1 (en) * 2018-12-04 2020-06-11 深圳市中兴微电子技术有限公司 Clock synchronization method, system, device and storage medium
US11664914B2 (en) 2018-12-04 2023-05-30 Sanechips Technology Co., Ltd. Clock synchronization method, system and device, and storage medium
CN110794919A (en) * 2019-10-22 2020-02-14 深圳震有科技股份有限公司 Method for realizing clock synchronization based on MDIO, intelligent terminal and storage medium
CN110572234A (en) * 2019-10-22 2019-12-13 深圳震有科技股份有限公司 Method for realizing clock synchronization based on serial port, intelligent terminal and storage medium
CN110912634A (en) * 2019-10-25 2020-03-24 深圳震有科技股份有限公司 Method for realizing clock synchronization based on SPI, storage medium and terminal equipment
CN111077941A (en) * 2019-11-06 2020-04-28 深圳震有科技股份有限公司 Clock synchronization setting method, equipment and storage medium
CN111077941B (en) * 2019-11-06 2024-04-02 深圳震有科技股份有限公司 Clock synchronization setting method, device and storage medium
CN111107020A (en) * 2019-12-31 2020-05-05 盛科网络(苏州)有限公司 Method for time synchronization of multi-core Ethernet switching chip
CN111107020B (en) * 2019-12-31 2022-01-11 苏州盛科通信股份有限公司 Method for time synchronization of multi-core Ethernet switching chip
CN111225122A (en) * 2020-01-19 2020-06-02 深圳英飞拓科技股份有限公司 Method for realizing time correcting mechanism in multi-camera video synchronization based on PTP (precision time protocol)
CN112039719A (en) * 2020-07-20 2020-12-04 河北汉光重工有限责任公司 PTP clock synchronization precision testing method for linux system
CN112491490A (en) * 2020-11-27 2021-03-12 南京简岱自动化科技有限公司 Time synchronizer adaptable to different devices
CN114095109A (en) * 2021-11-17 2022-02-25 深圳市领创星通科技有限公司 Clock synchronization method, device, equipment and storage medium
CN114157380A (en) * 2021-12-02 2022-03-08 浪潮云信息技术股份公司 ZNBASE distributed database clock synchronization method and system
CN114157380B (en) * 2021-12-02 2023-10-13 上海沄熹科技有限公司 ZNBASE distributed database clock synchronization method and system
CN114285542A (en) * 2022-01-28 2022-04-05 高新兴物联科技有限公司 Network time correction method, equipment and computer readable storage medium
CN114285542B (en) * 2022-01-28 2023-10-13 高新兴物联科技股份有限公司 Network time correction method, device and computer readable storage medium
CN114614934A (en) * 2022-03-28 2022-06-10 智己汽车科技有限公司 Time synchronization triggering device and method
CN114614934B (en) * 2022-03-28 2024-05-14 智己汽车科技有限公司 Time synchronization triggering device and method
CN115642977A (en) * 2022-10-10 2023-01-24 广东越新微系统研究院 Hybrid optimization time synchronization system
CN115801176A (en) * 2023-01-19 2023-03-14 北京国科天迅科技有限公司 Cross-platform clock synchronization method, device and storage medium based on PTP (precision time protocol)
CN116208289A (en) * 2023-04-28 2023-06-02 北京邮电大学 Time synchronization method and device based on white box switch and electronic equipment
CN116208289B (en) * 2023-04-28 2023-07-21 北京邮电大学 Time synchronization method and device based on white box switch and electronic equipment

Similar Documents

Publication Publication Date Title
CN102447553A (en) Realizing device of accurate time synchronization protocol
CN106992830B (en) A kind of clock synchronizing method in FC-AE-1553 networks
CN101547083B (en) Time synchronizer, time synchronization system and time synchronization method
CN100370864C (en) Network element time synchronizing method in mobile communication system
US9654555B2 (en) Method for synchronizing local clocks in a distributed computer system
CN104378193A (en) Time synchronization system and method, exchanger and embedded interface board
CN101615948A (en) A kind of method and system that realize time synchronized
EP3444789B1 (en) Timing synchronization method, sensor embedding terminal, and sensor network system
CN101977104A (en) IEEE1588 based accurate clock synchronization protocol system and synchronization method thereof
CN101330342B (en) Method for implementing time synchronization protocol using port mirror and apparatus thereof
Zeng et al. Time-slotted software-defined Industrial Ethernet for real-time Quality of Service in Industry 4.0
CN103188064A (en) Clock synchronization method and clock synchronization device
CN111740800B (en) Multi-precision clock synchronization method based on SDN framework 5G intelligent node
CN106899370A (en) A kind of clock chain circuit changing method, device and base station
CN101009546A (en) Time synchronization method for network segment utilizing different time synchronization protocol
CN101790230B (en) Precision time protocol node, time stamp operation method and time synchronization system
CN203596827U (en) Time synchronization system, switch, and embedded interface board
CN103812589A (en) Time synchronization method based on double ring bus
CN113411153A (en) Centralized control time synchronization method for time sensitive network
JP2017529728A (en) Time synchronization method, device and time synchronization server for network device
CN105978652A (en) Synchronous time comparing equipment of redundant Ethernet, system and method thereof
CN110808807B (en) Clock synchronization method of equipment in local area network
CN103580768B (en) A kind of method for synchronizing time and device
Mahmood et al. Clock synchronization for IEEE 802.11 based wired-wireless hybrid networks using PTP
KR100726476B1 (en) Time synchronization method for minimizing power consumption of hetero-species sensor nodes and network adopting same

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20120509

RJ01 Rejection of invention patent application after publication