CN109818826A - A kind of network path delay measurement method and its device and clock synchronization system - Google Patents

A kind of network path delay measurement method and its device and clock synchronization system Download PDF

Info

Publication number
CN109818826A
CN109818826A CN201910027368.XA CN201910027368A CN109818826A CN 109818826 A CN109818826 A CN 109818826A CN 201910027368 A CN201910027368 A CN 201910027368A CN 109818826 A CN109818826 A CN 109818826A
Authority
CN
China
Prior art keywords
state
timestamp
state machine
delay
time
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.)
Granted
Application number
CN201910027368.XA
Other languages
Chinese (zh)
Other versions
CN109818826B (en
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.)
Xi'an Electronic And Science University Engineering Technology Research Institute Co Ltd
Original Assignee
Xi'an Electronic And Science University Engineering Technology Research Institute 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 Xi'an Electronic And Science University Engineering Technology Research Institute Co Ltd filed Critical Xi'an Electronic And Science University Engineering Technology Research Institute Co Ltd
Priority to CN201910027368.XA priority Critical patent/CN109818826B/en
Publication of CN109818826A publication Critical patent/CN109818826A/en
Application granted granted Critical
Publication of CN109818826B publication Critical patent/CN109818826B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention relates to a kind of network path delay measurement method and its devices and clock synchronization system, including obtain trigger data;Obtain preset state machine information table;State machine is obtained from the preset state machine information table according to the trigger data, and feedback information is generated according to the state machine;Queuing processing is carried out to the feedback information in task queue, is lined up as a result, detected according to preset time to the queuing result, obtains testing result;State processing is carried out to the state machine according to the testing result, is stabbed with acquisition time, and path delay measurement data is calculated according to the timestamp.The present invention is dispatched by task timing queue all state machine states in delay measurements uniformly jumping interface, and task timer Timing Processing is enabled in timing business queue in office, to reduce the uncertainty that system calls delay, the execution efficiency of system is finally improved, the time precision of path delay measurement and time synchronization is improved.

Description

A kind of network path delay measurement method and its device and clock synchronization system
Technical field
The invention belongs to electronics and the communications field, and in particular to a kind of network path delay measurement method and its device and when Between synchronization system.
Background technique
With the application of multimedia entertainment system and DAS (Driver Assistant System), the time-sensitives message data such as a large amount of audio-video It needs to transmit by Ethernet, more stringent requirements are proposed for this time synchronization to time sensitive network.
Time synchronization technique is by reducing clock jitter in the time calibration of each transmission node to a lesser range It is influenced with transmission delay bring, is to realize high resolution audio and video and real-time Data Transmission to improve the transmission quality of network Key technology.And the IEEE802.1AS time synchronization protocol that IEEE802.1 working group formulates, IEEE802.1AS are defined extensively The accurate clock synchronization protocol (generalized precision time protocol, abbreviation gPTP) of justice, it passes through net The each transmission node of network is time-synchronized to a common best master clock, to ensure that time-sensitive network message data pass Defeated low latency and time synchronization, it includes having time sensitive application interfaces, can easily give the time-sensitives such as audio, video Multi-media network application provide timestamp and timing etc. service.
However the agreement would ordinarily be encountered the serious problem of comparison in an implementation: path delay measurement is easy to be grasped Make system and call the uncertain influence of delay, generate biggish measurement error, thus the precision that influence time is synchronous.
Summary of the invention
In order to solve the above-mentioned problems in the prior art, the present invention provides a kind of network path delay measurement methods And its device and clock synchronization system.
The embodiment of the invention provides a kind of network path delay measurement methods, comprising:
Obtain trigger data;
Obtain preset state machine information table;
State machine is obtained from the preset state machine information table according to the trigger data, and raw according to the state machine At feedback information;
Queuing processing is carried out to the feedback information in task queue, is lined up as a result, according to preset time to institute It states queuing result to be detected, obtains testing result;
State processing is carried out to the state machine according to the testing result, is stabbed with acquisition time, and according to the time Stamp calculates path delay measurement data.
In one embodiment of the invention, the queuing result is detected according to the preset time, is examined Survey result, comprising:
It obtains current state and jumps mark;
It obtains NextState and jumps mark;
The state for detecting state machine described in the queuing result according to the preset time turns to jump as a result, if the state Turning to jump result is that current state jumps mark and is not updated to NextState and jumps mark, then continues to test the state of the state machine Turn to jump as a result, exporting institute if it is that current state jumps mark and is updated to NextState and jumps mark that the state, which turns to jump result, State testing result.
In one embodiment of the invention, state processing is carried out to the state machine according to the testing result, to obtain Timestamp is taken, including,
First state processing is carried out according to first state machine of the testing result to the state machine, when obtaining first Between stab;
The second state processing is carried out according to second state machine of the testing result to the state machine, when obtaining second Between stab.
In one embodiment of the invention, the is carried out to the first state machine of the state machine according to the testing result One state processing is stabbed at the first time with obtaining, including,
According to port enabler flags, requests to send initial state transmission delay request message data in time delay, then read first Sub-timestamp, more new state turns to jump mark to be that timestamp reads Success Flag after reading first sub-timestamp;
Success Flag is read according to the timestamp then to read in DELAY RESPONSE waiting state reception delay response message data The 4th sub-timestamp is taken, then parses second from the DELAY RESPONSE message data after reading four sub-timestamp Sub-timestamp parses second sub-timestamp and updates the state transition mark DELAY RESPONSE reception flag later;
According to the DELAY RESPONSE reception flag, the response of waiting state reception delay is followed to follow message number in DELAY RESPONSE According to then being followed from the DELAY RESPONSE and parse third sub-timestamp in message data, parsed after third sub-timestamp more The new state transition mark is that DELAY RESPONSE follows reception flag;
Reception flag is followed according to the DELAY RESPONSE, requests to wait timing in time delay requesting interval waiting state reception delay Information, then updating the state transition mark is that time delay request sends interval flag;
It is requested to send interval flag according to the time delay, sends the time delay request message number in time delay request waiting state According to, then first sub-timestamp is read, updates the state transition mark after reading first sub-timestamp, until described in Stamp meets preset threshold requirement at the first time;
It obtains stabbing at the first time according to first sub-timestamp and the 4th sub-timestamp.
In one embodiment of the invention, the is carried out to the second state machine of the state machine according to the testing result Two-state processing, to obtain the second timestamp, including,
According to the port enabler flags, the time delay request message data are received in time delay request initial latency state, then Updating the state transition mark is that time delay requests reception flag;
Reception flag is requested according to the time delay, the second sub-timestamp is read in DELAY RESPONSE timestamp waiting state, then will Second sub-timestamp is filled in the DELAY RESPONSE message data, when by sending described after second timestamp filling Prolong response message data, then read third sub-timestamp, reads the third sub-timestamp and update the state transition mark later Will is that timestamp reads Success Flag;
Success Flag is read according to the timestamp, the third sub-timestamp is filled in institute in time delay request waiting state It states DELAY RESPONSE and follows message data, then send the DELAY RESPONSE and follow message data, the DELAY RESPONSE follows message number According to the time delay request message data are received after sending, then the state transition mark is updated, until second timestamp Meet preset threshold requirement;
The second timestamp is obtained according to second sub-timestamp and the third sub-timestamp.
In one embodiment of the invention, path delay measurement data is calculated according to the timestamp, including,
According to first sub-timestamp, second sub-timestamp, the third sub-timestamp and the 4th period of the day from 11 p.m. to 1 a.m Between stamp calculate the path delay measurement data.
The embodiment of the invention provides a kind of network path delay measuring device, including trigger module, state-storage module, State acquisition module, task timing queue module, status processing module, wherein
The trigger module, for obtaining the trigger data;
The state-storage module, for storing the preset state machine information table;
The state acquisition module, described in being obtained from the preset state machine information table according to the trigger data State machine, and the feedback information is generated according to the state machine;
The task timing queue module is obtained for carrying out queuing processing to the feedback information in task queue It is described to be lined up as a result, detected according to the preset time to the queuing result, obtain the testing result;
The status processing module carries out state processing to the state machine according to the testing result, described in obtaining Timestamp, and the path delay measurement data is calculated according to the timestamp.
The embodiment of the invention provides a kind of network path delay time of measuring synchronization systems, including network as described above Path delay measuring device.
Compared with prior art, beneficial effects of the present invention:
1, the present invention is dispatched by task timing queue all state machine states in delay measurements uniformly jumping interface, And task timer Timing Processing is enabled in timing business queue in office, to reduce the uncertainty that system calls delay, most The execution efficiency for improving system eventually improves the time precision of path delay measurement and time synchronization.
2, path delay measurement method of the present invention, is used not only in end-to-end clock synchronization system, can also fit For the performance of time synchronization in entire network environment to can be improved in the complex environments such as multiple spot networking, application is more extensive.
Detailed description of the invention
Fig. 1 is a kind of flow diagram of network path delay measurement method provided in an embodiment of the present invention;
Fig. 2 is first state machine, the second state in a kind of network path delay measurement method provided in an embodiment of the present invention The structural schematic diagram of machine;
Fig. 3 is the state transition of first state machine in a kind of network path delay measurement method provided in an embodiment of the present invention Schematic diagram;
Fig. 4 is the shape of another first state machine in a kind of network path delay measurement method provided in an embodiment of the present invention State jumps schematic diagram;
Fig. 5 is the state transition of the second state machine in a kind of network path delay measurement method provided in an embodiment of the present invention Schematic diagram;
Fig. 6 is the shape of another second state machine in a kind of network path delay measurement method provided in an embodiment of the present invention State jumps schematic diagram;
Fig. 7 is that timestamp generates position signal in a kind of network path delay measurement method provided in an embodiment of the present invention Figure;
Fig. 8 is a kind of structural schematic diagram of network path delay measuring device provided in an embodiment of the present invention;
Fig. 9 is a kind of operational process signal of network path delay time of measuring synchronization system provided in an embodiment of the present invention Figure;
Figure 10 a~Figure 10 b is tri- kinds of path delay measurements of gPTP, penAVB and PTP-1.8 provided in an embodiment of the present invention Path delay measurement result contrast schematic diagram of the method under non-loaded and 256kps load.
Specific embodiment
Further detailed description is done to the present invention combined with specific embodiments below, but embodiments of the present invention are not limited to This.
Embodiment one
Referring to Figure 1, Fig. 2, Fig. 3, Fig. 4, Fig. 5, Fig. 6, Fig. 1 are a kind of network path delay provided in an embodiment of the present invention The flow diagram of measurement method;Fig. 2 is the first shape in a kind of network path delay measurement method provided in an embodiment of the present invention The structural schematic diagram of state machine, the second state machine;Fig. 3 is in a kind of network path delay measurement method provided in an embodiment of the present invention The state transition schematic diagram of first state machine;Fig. 4 is in a kind of network path delay measurement method provided in an embodiment of the present invention Another state transition schematic diagram of first state machine;Fig. 5 is a kind of network path delay measurement provided in an embodiment of the present invention The state transition schematic diagram of second state machine in method;Fig. 6 is a kind of network path delay measurement provided in an embodiment of the present invention The state transition schematic diagram of another second state machine in method.A kind of network path delay measurement provided in an embodiment of the present invention Method, the measurement method include:
Obtain trigger data;
Obtain preset state machine information table;
State machine is obtained from preset state machine information table according to trigger data, and feedback information is generated according to state machine;
Queuing processing is carried out to feedback information in task queue, is lined up as a result, being tied according to preset time to queuing Fruit is detected, and testing result is obtained;
State processing is carried out to state machine according to testing result, is stabbed with acquisition time, and path is calculated according to timestamp and is prolonged Slow measurement data.
Further, trigger data is obtained, is the state transition mark of state machine in acquisite approachs delay measurements.
Further, preset state machine information table is obtained, entire time synchronization system is store in preset state information table All state machines of system, no matter whether some state machine runs now or whether some state of the state machine executes, as long as Clock synchronization system starting operation, the information of all state machines can all be pre-deposited into preset state information table, and shape is preset State information table includes state machine types, the state of state machine.
Further, state machine is obtained from preset state machine information table according to trigger data, and is generated according to state machine Feedback information.
Specifically, after receiving trigger data, the touching whether there is according to trigger data acknowledgement state information table first Data corresponding states machine is sent out, if the corresponding state machine of trigger data is not present in preset state information table, registers the state Then machine marks the state machine of the registration into preset state information table again, and the state machine that these are marked generates instead Feedforward information;If corresponding with trigger data to these there are the corresponding state machine of trigger data in preset state information table State machine is marked, and the state machine that these are marked generates feedback information.Meanwhile all state machines for counting label exist Time required for each state processing selects state processing from the time required for these state processings and spends maximum duration Tmax is bundled in feedback information together.Wherein, feedback information includes the shape of the state machine types marked, the state machine of label State, time Tmax.
Further, queuing processing is carried out to feedback information in task queue, is lined up as a result, according to preset time It is detected to result is lined up, obtains testing result.
Specifically, task timing queue is received the state of the state machine in feedback information by state machine successive suitable Sequence carries out queue order, obtains being lined up result;
Meanwhile according to the time Tmax fed back in feedback information, preset time is set, it is fixed to open task according to preset time When device, task timer periodically detect task timing queue be lined up result in state machine state, and export detection knot Fruit.Wherein, the detection cycle of task timer is less than time Tmax.For example, all state processings in current task timing queue The longest state processing time be 5ms, i.e., at most need to wait 5ms to NextState from a certain state, then task timer Detection cycle be set as 1ms, every 1ms (or less time interval) go the state of detecting state machine whether turn to jump to it is next State, if not jumping to NextState, that continues to detect, if turning to have jumped to NextState, with regard to output test result.
Further, it is detected according to preset time to result is lined up, obtains testing result, comprising:
It obtains current state and jumps mark;
It obtains NextState and jumps mark;
The state turn jump for being lined up state machine in result is detected according to preset time as a result, if state turns to jump result to be current shape State, which jumps mark and is not updated to NextState, jumps mark, then the state for continuing to test state machine turns to jump as a result, if state turns to jump As a result it jumps mark for current state and is updated to NextState and jump mark, then output test result.
Further, state processing is carried out to state machine according to testing result, is stabbed with acquisition time, and according to timestamp meter Calculate path delay measurement data.
Wherein, state processing is carried out to state machine according to testing result, is stabbed with acquisition time, including,
First state processing is carried out to the first state machine MDPdelayReq of state machine according to testing result, to obtain the One timestamp;
The second state processing is carried out to the second state machine MDPdelayReq of state machine according to testing result, to obtain the Two timestamps.
Specifically, referring again to Fig. 2, path delay measurements data are mainly by first state machine in the present embodiment Two state machines realizations of MDPdelayReq and the second state machine MDPdelayResp, first state machine MDPdelayReq and second State machine MDPdelayResp is located at medium dependent layer (Media-dependent layer, abbreviation MD).First state machine Node where MDPdelayReq is used as promoter, the second place state machine MDPdelayResp node in response, the two phase Mutually triggering of the cooperation Jing Guo trigger data carries out the processing of first state machine in the state of first state machine MDPdelayReq, obtains It stabs at the first time, carries out message data reception in the state of the second state machine MDPdelayResp and carry out at the second state machine Reason obtains the second timestamp, by calculating first time stamp, the second timestamp, obtains path delay measurement data.
The present embodiment is the path delay of time measurement first state of the gPTP Protocol Design based on IEEE802.1AS protocol definition Machine MDPdelayReq and the second state machine MDPdelayResp, IEEE802.1AS agreement include that medium dependent layer MD, media are only Vertical layer (Media-independent layer, abbreviation MI), wherein medium dependent layer MD is responsible for the transmission of message data, media Independent stratum MI is responsible for clock synchronization system scheduling.Specifically, medium dependent layer MD realizes the message data with clock synchronization system Send and receive and the read-write of timestamp;Media independent layer MI is according to first state machine MDPdelayReq, the second state Machine MDPdelayResp realizes the scheduling of clock synchronization system and the processing of message data.First state machine MDPdelayReq It cooperates with the second state machine MDPdelayResp machine and completes path delay measurement.
Further, first state processing is carried out to the first state machine MDPdelayReq of state machine according to testing result, It is stabbed at the first time with obtaining, including,
According to port enabler flags, requests to send initial state transmission delay request message data in time delay, then read first Sub-timestamp t1, more new state turns to jump mark to be that timestamp reads Success Flag after reading the first sub-timestamp t1;
Success Flag is read according to timestamp, in DELAY RESPONSE waiting state reception delay response message data, then reads the Four sub-timestamp t4 then parse the second sub-timestamp after reading the 4th sub-timestamp t4 from DELAY RESPONSE message data T2 parses update state transition mark DELAY RESPONSE reception flag after the second sub-timestamp t2;
According to DELAY RESPONSE reception flag, the response of waiting state reception delay is followed to follow message data in DELAY RESPONSE, then It is followed from DELAY RESPONSE and parses third sub-timestamp t3 in message data, parse more new state after third sub-timestamp t3 Jumping mark is that DELAY RESPONSE follows reception flag;
Reception flag is followed according to DELAY RESPONSE, requests that timing is waited to believe in time delay requesting interval waiting state reception delay Breath, then updating state transition mark is that time delay request sends interval flag;
It is requested to send interval flag according to time delay, requests waiting state transmission delay request message data in time delay, then read First sub-timestamp t1 updates state transition mark after reading the first sub-timestamp t1, until stamp meets default threshold at the first time Value requires;
It obtains stabbing at the first time according to the first sub-timestamp t1 and the 4th sub-timestamp t4.
Referring again to Fig. 3, Fig. 4, it is seen then that in the present embodiment the state of first state machine MDPdelayReq include port not Energy state NOT_ENABLED, time delay request is set to send initial state INITIAL_SEND_PDELAY_REQ, DELAY RESPONSE waiting state WAITING_FOR_PDELAY_RESP, DELAY RESPONSE follow waiting state WAITING_FOR_PDELAY_RESP_Follow_Up, Time delay request sends interval waiting state WAITING_FOR_PDELAY_INTERVAL_TIMER, time delay request sends state SEND_ PDELAY_REQ, time-out is waited to reset state RESET, all states constitute first state machine MDPdelayReq.
Specifically, the state machine redirect procedure of first state machine MDPdelayReq and its corresponding states processing in Operation includes: that first state machine MDPdelayReq original state is that first state generator terminal mouth is not enabled on state NOT_ENABLED, when The port of node where clock synchronization system detects first state machine MDPdelayReq enables and first state machine Node where MDPdelayReq supports message data to receive and send, and first state machine MDPdelayReq state transition mark is more It is newly port enabler flags, first state machine MDPdelayReq receives state transition mark and is updated to port enabler flags, then First state machine MDPdelayReq is not enabled on state NOT_ENABLED by first state generator terminal mouth and jumps to time delay request transmission just Primary state INITIAL_SEND_PDELAY_REQ;
The transmission delay request message data in the case where time delay requests transmission initial state INITIAL_SEND_PDELAY_REQ The first sub-timestamp t1 is read after Pdelay_Req, transmission delay request message data Pdelay_Req, reads first period of the day from 11 p.m. to 1 a.m Between stab t1 after, first state machine MDPdelayReq state transition mark be updated to timestamp read Success Flag, first state machine MDPdelayReq requests transmission initial state INITIAL_SEND_PDELAY_REQ to jump to DELAY RESPONSE waiting state by time delay WAITING_FOR_PDELAY_RESP;
The second state machine MDPdelayResp hair is received at DELAY RESPONSE waiting state WAITING_FOR_PDELAY_RESP The DELAY RESPONSE message data Pdelay_Resp sent then reads after reception delay response message data Pdelay_Resp Four sub-timestamp t4 then parse the second sub-timestamp t2, first state machine from DELAY RESPONSE message data Pdelay_Resp MDPdelayReq state transition mark is updated to DELAY RESPONSE reception flag, and first state machine MDPdelayReq is by DELAY RESPONSE Waiting state WAITING_FOR_PDELAY_RESP jumps to DELAY RESPONSE and follows waiting state WAITING_FOR_PDELAY_RESP_ FOLLOW_UP;
Waiting state WAITING_FOR_PDELAY_RESP_FOLLOW_UP is followed to receive the second state machine in DELAY RESPONSE The DELAY RESPONSE that MDPdelayResp is sent follows message data Pdelay_Resp_Follow_Up, then follows from DELAY RESPONSE Third sub-timestamp t3 is parsed in message data Pdelay_Resp_Follow_Up, thus first state machine MDPdelayReq Obtain four timestamp informations for calculating path delay measurement data, first state machine MDPdelayReq state transition mark It is updated to DELAY RESPONSE and follows reception flag, first state machine MDPdelayReq follows waiting state WAITING_ by DELAY RESPONSE FOR_PDELAY_RESP_FOLLOW_UP jumps to time delay requesting interval waiting state WAITING_FOR_PDELAY_INTERVAL_ TIMER;
Time delay request report is waited in time delay spacing timer waiting state WAITING_FOR_PDELAY_INTERVAL_TIMER The timer information of literary data Pdelay_Req was employed at that time after asking the timer information of message data Pdelay_Req to reach, First state machine MDPdelayReq state transition mark is updated to time delay request and sends interval flag, first state machine MDPdelayReq is turned to jump to time delay by time delay spacing timer waiting state WAITING_FOR_PDELAY_INTERVAL_TIMER Request sends state SEND_PDELAY_REQ;
It requests to send state SEND_PDELAY_REQ, transmission delay request message data Pdelay_Req in time delay, start new One wheel path delay measurement, until stamp meets preset threshold requirement at the first time.Wherein, according to the first sub-timestamp t1 and the 4th Sub-timestamp t4 obtains stabbing at the first time.
Wherein, if first state machine MDPdelayReq is in DELAY RESPONSE waiting state WAITING_FOR_PDELAY_RESP DELAY RESPONSE message data Pdelay_Resp or DELAY RESPONSE is waited to follow waiting state WAITING_FOR_PDELAY_RESP_ FOLLOW_UP waits DELAY RESPONSE when following message data Pdelay_Resp_Follow_Up, occurs waiting time-out, then and first State machine MDPdelayReq state transition mark is updated to DELAY RESPONSE and timeout flag or DELAY RESPONSE is waited to follow waiting time-out Mark, first state machine MDPdelayReq by DELAY RESPONSE waiting state WAITING_FOR_PDELAY_RESP or DELAY RESPONSE with Turn to jump to waiting time-out reset state RESET with waiting state WAITING_FOR_PDELAY_RESP_FOLLOW_UP;Waiting time-out Reset state RESET, initialization path delay measurements parameter, then it is unconditional by wait time-out reset state RESET jump to when It employs to ask and sends state SEND_PDELAY_REQ, continuation transmission delay request message data Pdelay_Req starts next path and prolongs Measurement late.
State transition mark explanation in 1 first state machine MDPdelayReq of table
State transition mark Illustrate to describe
portEnabled Indicate port enabler flags
pdelayIntervalTimer Indicate that time delay request sends interval flag
rcvdPdelayResp Indicate DELAY RESPONSE reception flag
rcvdPdelayRespFollowUp Indicate that DELAY RESPONSE follows reception flag
rcvdMDTimestampReceive Indicate that timestamp reads Success Flag
pdelayRespTimeout Indicate that DELAY RESPONSE waits timeout flag
pdelayRespFollowUpTimeout Indicate that DELAY RESPONSE follows waiting timeout flag
In table 1, each state transition mark of first state machine MDPdelayReq controls first state machine Each state jumps in MDPdelayReq.The initial state of each state transition mark is 0.Fig. 3, Fig. 4 are please participated in again, are lifted Example explanation, follows waiting state when DELAY RESPONSE waiting state WAITING_FOR_PDELAY_RESP jumps to DELAY RESPONSE The condition of WAITING_FOR_PDELAY_RESP_FOLLOW_UP is in DELAY RESPONSE waiting state WAITING_FOR_PDELAY_ RESP state transition mark is updated to DELAY RESPONSE reception flag, otherwise DELAY RESPONSE waiting state WAITING_FOR_PDELAY_ The first state processing of RESP does not complete also, needs always that processing terminate in the state first state, just will be updated state transition Mark is DELAY RESPONSE reception flag, and first state machine MDPdelayReq is from DELAY RESPONSE waiting state WAITING_FOR_ PDELAY_RESP jumps to DELAY RESPONSE and follows waiting state WAITING_FOR_PDELAY_RESP_FOLLOW_UP, starts time delay Response follows the first state of waiting state WAITING_FOR_PDELAY_RESP_FOLLOW_UP to handle.Other states are with such It pushes away.
It can be seen from the above, the major function of the present embodiment first state machine MDPdelayReq are as follows:
(a) transmission delay request message data Pdelay_Req, and read for the first word time and stab t1, the first sub-timestamp t1 It is to be read after transmission delay request message data Pdelay_Req.
(b) reception delay response message data Pdelay_Resp, and read the 4th sub-timestamp t4, the 4th sub-timestamp T4 is reading after reception delay response message data Pdelay_Resp;The 4th sub-timestamp t4 is read later from DELAY RESPONSE The second sub-timestamp t2 is parsed in message data Pdelay_Resp.
(c) reception delay response follows message data Pdelay_Resp_Follow_Up, then follows message from DELAY RESPONSE Third sub-timestamp t3 is parsed in data Pdelay_Resp_Follow_Up.
(d) message data Pdelay_Resp_ is followed to time delay response message data Pdelay_Resp and DELAY RESPONSE The timeout treatment of Follow_Up.
Further, the second state machine MDPdelayResp of state machine is carried out at the second state according to testing result Reason, to obtain the second timestamp, including,
According to port enabler flags, initial latency state reception delay request message data are requested in time delay, then more new state Jumping mark is that time delay requests reception flag;
Reception flag is requested according to time delay, reads the second sub-timestamp t2 in DELAY RESPONSE timestamp waiting state, then by the Two timestamps are filled in DELAY RESPONSE message data, transmission delay response message data after the second sub-timestamp t2 is filled, Third sub-timestamp t3 is then read, update state transition mark reads after reading third sub-timestamp t3 for timestamp successfully marks Will;
Success Flag is read according to timestamp, third sub-timestamp t3 is filled in DELAY RESPONSE in time delay request waiting state Message data is followed, then reception delay after transmission delay response follows message data, DELAY RESPONSE that message data is followed to send Request message data then update state transition mark, until the second timestamp meets preset threshold requirement;
The second timestamp is obtained according to the second sub-timestamp t2 and third sub-timestamp t3.
Referring again to Fig. 5, Fig. 6, it is seen then that in the present embodiment the state of the second state machine MDPdelayResp include port not Energy state NOT_ENABLED, time delay request is set to wait initial state INITIAL_WAITING_FOR_PDELAY_REQ, time delay request etc. To state WAITING_FOR_PDELAY_REQ, DELAY RESPONSE timestamp waiting state SENT_PDELAY_RESP_WAITING_FOR_ TIMESTAMP, all states constitute the second state machine MDPdelayResp.
Specifically, the state machine redirect procedure of the second state machine MDPdelayResp and its corresponding states processing in Operation include: the second state machine MDPdelayResp original state be that the second state machine is not enabled on state NOT_ENABLED, when the The port of node where two-state machine MDPdelayResp meets that port is enabled and second state machine of node Node where MDPdelayResp supports message data to receive and send, the second state machine MDPdelayResp state transition mark Port enabler flags are updated to, the second state machine MDPdelayResp receives state transition mark and is updated to port enabler flags Afterwards, then the state of the second state machine MDPdelayResp is not enabled on state NOT_ENABLED by port and jumps to time delay request waiting Initial state INITIAL_WAITING_FOR_PDELAY_REQ;
In the case where time delay requests to wait initial state INITIAL_WAITING_FOR_PDELAY_REQ, by state transition RcvdPdelayReq mark is set to false, then waits first state machine MDPdelayReq transmission delay request message data Pdelay_Req was employed waiting initial state INITIAL_WAITING_FOR_PDELAY_REQ is asked to receive time delay request report at that time Literary data Pdelay_Req, the state transition mark of the second state machine MDPdelayResp are updated to time delay request reception flag, The state of second state machine MDPdelayResp is requested to wait initial state INITIAL_WAITING_FOR_PDELAY_ by time delay REQ jumps to DELAY RESPONSE timestamp waiting state SENT_PDELAY_RESP_WAITING_FOR_TIMESTAMP;
At DELAY RESPONSE timestamp waiting state SENT_PDELAY_RESP_WAITING_FOR_TIMESTAMP, read first The second sub-timestamp t2 is taken, is then filled into the second sub-timestamp t2 in DELAY RESPONSE message data Pdelay_Resp concurrently First state machine MDPdelayReq is given, reads third sub-timestamp after transmission delay response message data Pdelay_Resp T3, the state transition mark of the second state machine MDPdelayResp are updated to timestamp and read Success Flag, the second state machine The state of MDPdelayResp is by DELAY RESPONSE timestamp waiting state SENT_PDELAY_RESP_WAITING_FOR_ TIMESTAMP jumps to time delay request waiting state WAITING_FOR_PDELAY_REQ;
In the case where time delay requests waiting state WAITING_FOR_PDELAY_REQ, when third sub-timestamp t3 being filled into first Prolong response and follow in message data Pdelay_Resp_Follow_Up and be sent to first state machine MDPdelayReq, has sent After DELAY RESPONSE follows message data Pdelay_Resp_Follow_Up, continue waiting for receiving first state machine MDPdelayReq The time delay request message data Pdelay_Req of transmission, continues the second state processing process as above, until the second timestamp Meet preset threshold requirement.Wherein, the second timestamp is obtained according to the second sub-timestamp t2 and third sub-timestamp t3.
State transition mark explanation in 2 second state machine MDPdelayResp of table
State transition mark Illustrate to describe
portEnabled Indicate port enabler flags
rcvdPdelayReq Indicate that time delay requests reception flag
rcvdMDTimestampReceive Indicate that timestamp reads Success Flag
In table 2, each state transition mark of the second state machine MDPdelayResp controls the second state machine Each state jumps in MDPdelayResp, and each state transition mark initial value is 0.Referring again to Fig. 5, Fig. 6, illustrate It is bright, when time delay response time stamp waiting state SENT_PDELAY_RESP_WAITING_FOR_TIMESTAMP jumps to time delay request The condition of waiting state WAITING_FOR_PDELAY_REQ is to prolong response time stamp waiting state SENT_PDELAY_RESP_ State transition mark after WAITING_FOR_TIMESTAMP state processing is updated to timestamp and reads Success Flag, otherwise prolongs Response time stabs waiting state SENT_PDELAY_RESP_WAITING_FOR_TIMESTAMP also in the second shape for continuing the state State treatment process will be needed state transition mark to be updated to timestamp and read Success Flag, just meeting until the state processing terminates Time delay request waiting state WAITING_FOR_PDELAY_REQ is jumped to, and then carries out the second state processing of the state.It is other State and so on.
It can be seen from the above, the major function of the second state machine of the present embodiment MDPdelayResp are as follows:
(a) the time delay request message data Pdelay_Req that first state machine MDPdelayReq is sent is received, and reads the Two sub-timestamp t2, the second sub-timestamp t2 are that the second state machine MDPdelayResp is received to employ and sought message data It is read after Pdelay_Req.
(b) the second sub-timestamp t2 is filled in DELAY RESPONSE message data Pdelay_Resp, and is sent to the first shape State machine MDPdelayReq.
(c) third sub-timestamp t3 is read after transmission delay response message data Pdelay_Resp, by third sub-timestamp T3 is filled into DELAY RESPONSE and follows in message data Pdelay_Resp_Follow_Up, and DELAY RESPONSE is followed message data Pdelay_Resp_Follow_Up is sent to first state machine MDPdelayReq.
Referring again to Fig. 3, Fig. 4, Fig. 5, Fig. 6, it is seen that first state machine MDPdelayReq, the second state machine MDPdelayResp overall workflow are as follows: clock synchronization system initial start, first first state machine MDPdelayReq's Time delay request sends initial state INITIAL_SEND_PDELAY_REQ transmission delay request message data Pdelay_Req, then reads The first sub-timestamp t1 is taken, update state transition mark is that timestamp reads Success Flag after reading the first sub-timestamp t1, The state of first state machine MDPdelayReq requests transmission initial state INITIAL_SEND_PDELAY_REQ to jump to by time delay DELAY RESPONSE waiting state WAITING_FOR_PDELAY_RESP;Second state machine MDPdelayResp is initial etc. in time delay request Time delay request message data Pdelay_Req is received to state INITIAL_WAITING_FOR_PDELAY_REQ, then the second state Machine MDPdelayResp state transition mark is updated to time delay request reception flag, the state of the second state machine MDPdelayResp DELAY RESPONSE timestamp waiting state is jumped to by time delay request initial latency state INITIAL_WAITING_FOR_PDELAY_REQ SENT_PDELAY_RESP_WAITING_FOR_TIMESTAMP;In DELAY RESPONSE timestamp waiting state SENT_PDELAY_ RESP_WAITING_FOR_TIMESTAMP, reads the second sub-timestamp t2 first, reads the after the second sub-timestamp t2 Two sub-timestamp t2 are filled into DELAY RESPONSE message data Pdelay_Resp, then transmission delay response message data Pdelay_ Third sub-timestamp t3 is read after Resp, transmission delay response message data Pdelay_Resp, then the second state machine MDPdelayResp state transition mark is updated to timestamp and reads Success Flag, the state of the second state machine MDPdelayResp It is jumped by DELAY RESPONSE timestamp waiting state SENT_PDELAY_RESP_WAITING_FOR_TIMESTAMP as time delay request etc. To state WAITING_FOR_PDELAY_REQ;Waiting state WAITING_FOR_PDELAY_REQ is requested in time delay, first by third Sub-timestamp t3 is filled into DELAY RESPONSE and follows in message data Pdelay_Resp_Follow_Up, then transmission delay response with With message data Pdelay_Resp_Follow_Up;The DELAY RESPONSE waiting state WAITING_ of first state machine MDPdelayReq FOR_PDELAY_RESP receives DELAY RESPONSE message data Pdelay_Resp, then reads the 4th sub-timestamp t4, reads the The second sub-timestamp t2, first state are parsed after four sub-timestamp t4 from DELAY RESPONSE message data Pdelay_Resp Machine MDPdelayReq state transition mark is updated to DELAY RESPONSE reception flag, the state of first state machine MDPdelayReq by DELAY RESPONSE waiting state WAITING_FOR_PDELAY_RESP jumps to DELAY RESPONSE and follows waiting state WAITING_FOR_ PDELAY_RESP_FOLLOW_UP;Waiting state WAITING_FOR_PDELAY_RESP_FOLLOW_UP is followed to connect in DELAY RESPONSE It receives DELAY RESPONSE and follows message data Pdelay_Resp_Follow_Up, then follow message data Pdelay_ from DELAY RESPONSE The 4th sub-timestamp t4 is parsed in Resp_Follow_Up, is so far obtained in node where first state machine MDPdelayReq Four time stamp datas that path delay of time measurement data needs are calculated, then in node where first state machine MDPdelayReq The calculating of path delay measurement data is carried out, and path delay measurement data is saved in where first state machine MDPdelayReq Node.First state machine MDPdelayReq later, the second state machine MDPdelayResp course of work are requested periodically by time delay Information starting, after receiving time delay request timer information, transmission delay request data message Pdelay_Req starts a new round To acquisite approachs delay measurements data flow, until at the first time stamp, the second timestamp meet preset threshold requirement.
Further, the first sub-timestamp, the second sub-timestamp, third sub-timestamp, the 4th sub-timestamp are in gPTP The physical layer of agreement is read.
Specifically, Fig. 7 is referred to, when Fig. 7 is in a kind of network path delay measurement method provided in an embodiment of the present invention Between stamp generate position view, it is seen then that in gPTP agreement data message generate timestamp position, can be in client layer, MAC layer And physical layer.Timestamp is not to be directly bundled in message data after generating, but send or receive to message data Allocating time stamp interface is read later.Wherein, in the present embodiment, timestamp refers specifically to the first sub-timestamp t1, second period of the day from 11 p.m. to 1 a.m Between stab t2, third sub-timestamp t3, the 4th sub-timestamp t4, the first sub-timestamp t1, the second sub-timestamp t2, third sub- time T3, the 4th sub-timestamp t4 is stabbed to read in gPTP protocol physical layers.
Timestamp illustrates the time of message data entrance or time departure synchronization system, and gPTP agreement is by timestamp and reports Literary data actually enter or the difference between the time of time departure synchronization system is as timestamp accuracy measures standard.With The timestamp accuracy that three kinds of family layer, MAC layer and physical layer timestamps generate position is different: since linux system is non real-time Operating system causes clock synchronization system delay can not so will receive the influence that other processes occupy processor in client layer It determines, timestamp accuracy is lower;Timestamp is generated in MAC layer by trawl performance, avoids the interference of consumer process, time Stab accuracy be higher than client layer timestamp, but in the mac layer the processing time of timestamp be difficult to determine, timestamp accuracy is still It will receive influence;The highest timestamp generating mode of accuracy is that first character section reaches physical layer when message data receives The timestamp of Shi Shengcheng generates timestamp when the last byte leaves physical layer when message data is sent, and this mode is complete The interference of clock synchronization system delay is avoided entirely.But this generation timestamp mode, need the precision-fit of hardware.This reality It applies in example, timestamp is realized in physical layer.
Further, path delay measurement data is calculated according to timestamp.
Specifically, the present embodiment is according to the first sub-timestamp, the second sub-timestamp, third sub-timestamp and the 4th sub- time Stamp calculates path delay measurement data.Simultaneously storing path delay measurements data are calculated in first state machine MDPdelayReq.
In the present embodiment, each path delay measurement data calculating is expressed as:
Wherein, D indicates path delay measurement data, and t1 indicates the first sub-timestamp, and t2 indicates the second sub-timestamp, t3 table Show third sub-timestamp, t4 indicates the 4th sub-timestamp.
Specifically, first state machine MDPdelayReq and the second state machine MDPdelayResp pass through at first state Reason and the second state processing obtain the first sub-timestamp t1, the second sub-timestamp t2, third sub-timestamp t3, the 4th sub- time T4 is stabbed, finally in first state machine MDPdelayReq to the first sub-timestamp t1 of acquisition, the second sub-timestamp t2, third Timestamp t3, the 4th sub-timestamp t4 calculate to acquisite approachs delay measurements data D by formula (1).
Further, according to each path delay measurement data, the average value conduct of k path delay measurement data is sought Final path delay measurement data, final path delay measurement data calculating are expressed as:
Wherein, k indicates number, Davg,kIndicate the average value of k path delay measurement data, Davg,k-1Indicate the path k-1 The average value of delay measurements data.
Preferably, k value range is 10~20.
Specifically, node where first state machine MDPdelayReq and the second place state machine MDPdelayResp node Between initiate path delay measurement.Since message data may be by network congestion or fluctuation in the delay of clock synchronization system Influence, primary path delay measurement result can accurately not measure out first state machine in a period of time Node where MDPdelayReq and the second state machine MDPdelayResp path delay measurement data among the nodes.Cause This path delay measurement data generally requires repeatedly to carry out, and clock synchronization system will be stored in first state machine MDPdelayReq K path delay measurement data of place node is averaged the path delay measurement data final as clock synchronization system. In the present embodiment, stamp, the acquisition of the second timestamp meet preset threshold requirement at the first time, are exactly that the present embodiment obtains k path Delay measurements data obtain k stamp, the second timestamp at the first time, when by the first time stamp obtained every time and second Between stamp calculate each path delay of time measurement data, average k path delay measurement data of acquisition as last Path delay measurement data.Wherein, message data includes time delay request message data Pdelay_Req, DELAY RESPONSE message data Pdelay_Resp, DELAY RESPONSE follow message data Pdelay_Resp_Follow_Up.
Further, task timer has traversed the state and second of first state machine MDPdelayReq in feedback information After the state of state machine MDPdelayResp, periodically the state jumped in feedback information in task queue is purged.
Specifically, preset state machine information table is marked according to trigger data in clock synchronization system in timed task queue All state machines of middle needs, by the state machine types for the state machine being marked, the Design of State task timing team of state machine Column scheduling, and preset time is arranged according to time Tmax, task timer is opened according to preset time, task timer determines basis State machine state in the scheduling of task timing queue, periodically goes detection to reach the state machine state of the execution time, and make Corresponding state processing.When task timer has traversed the state and of the first state machine MDPdelayReq in feedback information After the state of two-state machine MDPdelayResp, periodically the state jumped in the feedback information in task queue is carried out clear It removes, reserves enough spaces for state machine state queuing next time.Again according to trigger data from preset state information table mark Remember state machine, confirmation enters state machine types, state machine state, time Tmax in task timing queue next time, after progress Continuous flow processing.
Wherein, the effect of task timing queue is exactly that first state machine has been determined in formula (1), formula (2) On the basis of the path delay time that each state is called in MDPdelayReq and the second state machine MDPdelayResp, pass through State machine types in preset state information table, state machine state, time Tmax are written in task timing queue, and uses and appoints Poll detecting state machine state is gone in business timer timing, can reduce the uncertainty that message data sends interval in this way, is improved The precision of path delay measurement and time synchronization.
The present embodiment proposes a kind of path delay measurement method, is dispatched using task timing queue, by first state machine The state of MDPdelayReq and the state of the second state machine MDPdelayResp unify state transition interface, in task timing team Task timer timing is enabled in column, so that it is determined that first state machine MDPdelayReq and the second state machine The time of each state processing in MDPdelayResp reduces the uncertainty that clock synchronization system calls delay, finally mentions The high execution efficiency of clock synchronization system and the time precision for improving delay measurements and time synchronization.
Fig. 8 is referred to, Fig. 8 is a kind of structural representation of network path delay measuring device provided in an embodiment of the present invention Figure.In the present embodiment, path delay measuring device specifically includes trigger module, state-storage module, state acquisition module, task Timing queue module, status processing module, wherein
Trigger module, for obtaining trigger data.
Specifically, trigger module obtains trigger data, and the present embodiment trigger data is mainly state transition mark.
State-storage module, for storing preset state machine information table.
Specifically, the preset state machine information table of state-storage module storage, is the needs according to clock synchronization system, in advance First the state machine being related to is stored in preset state information table, facilitates subsequent path delay measurements to use, it is possible to reduce path The time of state machine information table and the expense of memory are generated during delay measurements.
State acquisition module, for obtaining state machine from preset state machine information table according to trigger data, and according to shape State machine generates feedback information.
Specifically, it in state acquisition module, is marked in preset state machine information table according to trigger data and calculates path The state machine that delay data needs, and by shape in the state machine types of the state machine, state machine state and all state processings State handles long-time Tmax and generates feedback information, avoids stateful to institute in preset state machine information table in follow-up process processing The processing of machine.
Task timing queue module, for carrying out queuing processing to feedback information in task queue, be lined up as a result, It is detected according to preset time to result is lined up, obtains testing result.
Specifically, task timing queue module obtains first is that the state machine state in feedback information is carried out queuing processing It is lined up result;Second is that preset time is arranged according to time Tmax in feedback information, task timer is started according to preset time, Timing detects the queuing result of task timing queue, output test result.
The present embodiment is scheduled using state of the task timing queue to state machine, is determined and is counteracted portion of time The delay that synchronization system is called, while avoiding directly to send and receive in message data and carrying out path delay data in thread The uncertainty that clock synchronization system calls path delay measurement greatly reduces in processing.
Status processing module is carried out state processing to state machine according to testing result, is stabbed with acquisition time, and according to the time Stamp calculates path delay measurement data.
Specifically, in status processing module, according to the testing result of above-mentioned task timer, to the state of the state machine into Row state processing obtains the present embodiment from each state processing of state machine and calculates path constantly by the testing result of timer The timestamp information that delay measurements data need, passes through the timestamp information and calculates the path delay measurement data.
The present embodiment state processing is that corresponding state processing operation under the state is carried out according to state transition mark, is completed The state is immediately exited from after the state processing operation of one state, currently performed state and next time is prompted to need at the same time The state jumped.It is such to design each state only just execution when satisfaction jumps condition so that state machine, it is not required to Will always automatic regular polling detect the state jump condition, save a large amount of clock synchronization system time overhead.Meanwhile it is unified State machine entry design, clock synchronization system task timing queue is greatly facilitated to the calling of all kinds of state machines, in conjunction with appointing The task timer of business timing queue operates separately the reception of message data and the processing of transmission, message data, eliminates report Literary data processing, message data receive and are sent in temporal interact.
Fig. 9 is referred to, Fig. 9 is a kind of clock synchronization system fortune of network path delay measurement provided in an embodiment of the present invention Row flow diagram.The present embodiment design be based on IEEE802.1AS agreement, when clock synchronization system starting after, first into Then row parameter initialization determines whether the equipment being connected supports IEEE802.1AS to assist by receiving and sending message data View, the EP (end of program) if not supporting run best master clock algorithm (Best Master Clock if supporting Algorithm, abbreviation BMCA), best master clock, i.e., super main (GrandMaster, abbreviation are determined according to the result that BMCA is run GM it) whether there is, then continue to run BMCA selection best master clock if it does not exist.If BMCA selects best master clock, when Between synchronization system continue the path delay measurement method for executing the present embodiment downwards, and path delay measurement data is stored in the Node location where one state machine;The time synchronization process of clock synchronization system measures laggard in path delay in the present embodiment Row, by GM sending time sync message data, it is same that node where node, the second state machine where first state machine receives the time After walking message data, timing offset value is calculated according to time synchronization message data and path delay measurement data;Time synchronization System calls clock source interface according to timing offset value, calibrates the time in local clock source, i.e. prover time synchronization system time. Due to delay certainly exist, without by path delay measurement just progress time synchronization will cause very big clock Deviation.Wherein, when the path delay measurement of node where node, the second state machine where first state machine is without success, first Node, the second state machine institute are among the nodes without time synchronization where state machine.
Wherein, the BMCA of clock synchronization system, path delay measurement and time synchronization are that circulation carries out always, There is no the sequencings for providing three for IEEE802.1AS agreement, but BMCA does not select the situation of super master according to the actual situation Under can not carry out time synchronization, individually carried out without time synchronization path delay measurement be also it is meaningless.Therefore, The clock synchronization system of the present embodiment design runs BMCA first, when entire IEEE802.1AS agreement has determined best master clock And then carry out path delay measurement and time synchronization.In the present embodiment, path delay measurement period depends on Pdelay_Req The sending cycle of message data.
Using the clock synchronization system that the present embodiment designs, can be directly applied to need quick by network latency Feel in the fields such as the scene, such as audio video transmission, car networking DAS (Driver Assistant System), Unmanned Systems of data, Ke Yixian The accuracy of Enhanced time synchronization system real-time Data Transmission is write, system performance is improved.
For example, vehicle needs are accurately positioned in real time by communication network and transmit data, largely in Unmanned Systems Real time data will be transmitted by Ethernet.Shake and data transmission route due to clock existing between web-transporting device Diameter delay, has seriously affected the transmission quality of real time data, therefore with the increase in demand of data transfer bandwidth and real-time, right More stringent requirements are proposed for clock synchronization system between web-transporting device.
Path delay measurement method provided in this embodiment, by the time calibration of each transmission node to a lesser range Interior, reducing clock jitter and transmission delay bring influences, to improve the transmission quality of network, realizes the real time data of network Transmission.
In order to illustrate the advantage of the path delay measurement method of the present embodiment, the present embodiment compared the path gPTP of the present invention The path OpenAVB (Open Audio Video Bridging, abbreviation OpenAVB) in delay measuring method and open source projects Delay measuring method, PTP-1.8 path delay measurement method, three kinds of path delay measurement methods are respectively under heterogeneous networks load 200 path delay measurement data acquisitions have been carried out, and have been averaged to this 200 path delay measurement dataWith standard Poor σ, specific data refer to table 3.
Path delay measurement data average value and standard deviation (ns) under 3 three kinds of path delay measurement methods of table
By the data in table 3 it can be found that compared to open source projects OpenAVB path delay measurement method and PTP- 1.8 path delay measurement methods, the gPTP path delay measurement method that the present embodiment is designed and Implemented, path delay measurement result The most close with theoretical value, the fluctuation of path delay measurement data is smaller.Wherein, occur in theoretical value "-" indicate that official does not have There is given theoretical value under this condition.
0a~Figure 10 b referring to Figure 1, Figure 10 a~Figure 10 b are gPTP, penAVB and PTP- provided in an embodiment of the present invention Path delay measurement result contrast schematic diagram of 1.8 3 kinds of path delay measurement methods under non-loaded and 256kps load.Figure 10a is non-loaded lower path delay measurement result contrast schematic diagram, and Figure 10 b is that the lower path delay measurement of 256kps load is tied Fruit contrast schematic diagram.As it can be seen that PTP-1.8 path delay measured value with theoretical value differs larger under immunization with gD DNA vaccine, and path Delay measurements result has biggish fluctuation, this is because PTP-1.8 be four layer protocols based on UDP and client layer generate when Between stab, the path delay that timestamp generates is difficult to determine, causes that path delay measured value and theoretical value gap are big and fluctuation is big; GPTP path delay measured value and penAVB path delay measured value are close with theoretical value but still have certain gap, and the present embodiment is set The gPTP path delay measurement method of meter, the fluctuation compared to OpenAVB path delay measured value is smaller, the reason is that the road gPTP Diameter delay measuring method has used the scheduling of task timing queue, determines and counteracts prolonging for portion of time synchronization system calling Late, thus the road gPTP latency measurement and theoretical value it is closest and fluctuation it is smaller.
Referring again to Figure 10 b, with the increase of load, OpenAVB path delay measured value and PTP-1.8 path delay are surveyed Magnitude fluctuation is more obvious, and reason is exactly both OpenAVB and PTP-1.8 all without task timing queue dispatch deal stream Journey, but the processing of progress path delay data in thread is directly sended and received in message data, the increase of load exacerbates Clock synchronization system calls the uncertainty of path delay measurement.
GPTP path delay measurement method provided in this embodiment, is used not only for end-to-end clock synchronization system In, also can suitable for the complex environments such as multiple spot networking, to improve the performance of time synchronization in entire network environment, Application scenarios are more extensive.
The above content is a further detailed description of the present invention in conjunction with specific preferred embodiments, and it cannot be said that Specific implementation of the invention is only limited to these instructions.For those of ordinary skill in the art to which the present invention belongs, exist Under the premise of not departing from present inventive concept, a number of simple deductions or replacements can also be made, all shall be regarded as belonging to of the invention Protection scope.

Claims (8)

1. a kind of network path delay measurement method characterized by comprising
Obtain trigger data;
Obtain preset state machine information table;
State machine is obtained from the preset state machine information table according to the trigger data, and is generated instead according to the state machine Feedforward information;
Queuing processing is carried out to the feedback information in task queue, is lined up as a result, according to preset time to the row Team's result is detected, and testing result is obtained;
State processing is carried out to the state machine according to the testing result, is stabbed with acquisition time, and according to the timestamp meter Calculate path delay measurement data.
2. measurement method according to claim 1, which is characterized in that according to the preset time to the queuing result into Row detection, obtains testing result, comprising:
It obtains current state and jumps mark;
It obtains NextState and jumps mark;
Turn to jump according to the state that the preset time detects state machine described in the queuing result as a result, if the state turns to jump As a result it jumps mark for current state and is not updated to NextState and jump mark, then the state for continuing to test the state machine turns jump As a result, exporting the inspection if it is that current state jumps mark and is updated to NextState and jumps mark that the state, which turns to jump result, Survey result.
3. measurement method according to claim 2, which is characterized in that carried out according to the testing result to the state machine State processing is stabbed with acquisition time, including,
First state processing is carried out according to first state machine of the testing result to the state machine, to obtain at the first time Stamp;
The second state processing is carried out according to second state machine of the testing result to the state machine, to obtain for the second time Stamp.
4. measurement method according to claim 3, which is characterized in that according to the testing result to the of the state machine One state machine carries out first state processing, is stabbed at the first time with obtaining, including,
According to port enabler flags, requests to send initial state transmission delay request message data in time delay, then read first period of the day from 11 p.m. to 1 a.m Between stab, more new state turns to jump mark to be that timestamp reads Success Flag after reading first sub-timestamp;
Success Flag is read according to the timestamp, in DELAY RESPONSE waiting state reception delay response message data, then reads the Four sub-timestamps then parse second period of the day from 11 p.m. to 1 a.m from the DELAY RESPONSE message data after reading four sub-timestamp Between stab, parse and update the state transition mark DELAY RESPONSE reception flag after second sub-timestamp;
According to the DELAY RESPONSE reception flag, the response of waiting state reception delay is followed to follow message data in DELAY RESPONSE, then It is followed from the DELAY RESPONSE and parses third sub-timestamp in message data, parsed described in the update later of third sub-timestamp State transition mark is that DELAY RESPONSE follows reception flag;
Reception flag is followed according to the DELAY RESPONSE, requests that timing is waited to believe in time delay requesting interval waiting state reception delay Breath, then updating the state transition mark is that time delay request sends interval flag;
It is requested to send interval flag according to the time delay, requests to send the state transmission time delay request message data in time delay, then First sub-timestamp is read, updates the state transition mark after reading first sub-timestamp, until described first Timestamp meets preset threshold requirement;
It obtains stabbing at the first time according to first sub-timestamp and the 4th sub-timestamp.
5. measurement method according to claim 4, which is characterized in that according to the testing result to the of the state machine Two-state machine carries out the second state processing, to obtain the second timestamp, including,
According to the port enabler flags, the time delay request message data are received in time delay request initial latency state, then are updated The state transition mark is that time delay requests reception flag;
It requests reception flag according to the time delay, reads the second sub-timestamp in DELAY RESPONSE timestamp waiting state, then it will be described Second sub-timestamp is filled in the DELAY RESPONSE message data, rings the time delay is sent after second timestamp filling Message data is answered, then reads third sub-timestamp, is read and is updated the state transition mark after the third sub-timestamp and be Timestamp reads Success Flag;
Success Flag is read according to the timestamp, when the third sub-timestamp is filled in described by time delay request waiting state Prolong response and follow message data, then sends the DELAY RESPONSE and follow message data, the DELAY RESPONSE follows message data to send out The time delay request message data are received after sending, then update the state transition mark, until second timestamp meets Preset threshold requirement;
The second timestamp is obtained according to second sub-timestamp and the third sub-timestamp.
6. measurement method according to claim 5, which is characterized in that calculate path delay measurement number according to the timestamp According to, including,
According to first sub-timestamp, second sub-timestamp, the third sub-timestamp and the 4th sub-timestamp Calculate the path delay measurement data.
7. a kind of network path delay measuring device, which is characterized in that obtained including trigger module, state-storage module, state Module, task timing queue module, status processing module, wherein
The trigger module, for obtaining the trigger data;
The state-storage module, for storing the preset state machine information table;
The state acquisition module, for obtaining the state from the preset state machine information table according to the trigger data Machine, and the feedback information is generated according to the state machine;
The task timing queue module obtains described for carrying out queuing processing to the feedback information in task queue It is lined up as a result, detected according to the preset time to the queuing result, obtains the testing result;
The status processing module carries out state processing to the state machine according to the testing result, to obtain the time Stamp, and the path delay measurement data is calculated according to the timestamp.
8. a kind of network path delay time of measuring synchronization system, other are characterized in that, including network as claimed in claim 7 Path delay measuring device.
CN201910027368.XA 2019-01-11 2019-01-11 Network path delay measuring method and device and time synchronization system Active CN109818826B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910027368.XA CN109818826B (en) 2019-01-11 2019-01-11 Network path delay measuring method and device and time synchronization system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910027368.XA CN109818826B (en) 2019-01-11 2019-01-11 Network path delay measuring method and device and time synchronization system

Publications (2)

Publication Number Publication Date
CN109818826A true CN109818826A (en) 2019-05-28
CN109818826B CN109818826B (en) 2021-02-09

Family

ID=66603361

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910027368.XA Active CN109818826B (en) 2019-01-11 2019-01-11 Network path delay measuring method and device and time synchronization system

Country Status (1)

Country Link
CN (1) CN109818826B (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110661878A (en) * 2019-10-06 2020-01-07 上海淡竹体育科技有限公司 Method and device for synchronizing test instruction and data in sports test system
CN112019291A (en) * 2020-08-31 2020-12-01 合肥富煌君达高科信息技术有限公司 Network equipment timing method
CN112148214A (en) * 2020-09-04 2020-12-29 苏州浪潮智能科技有限公司 Node information processing method, equipment and medium in double-control environment
CN112182452A (en) * 2020-09-27 2021-01-05 中国平安财产保险股份有限公司 Page component rendering processing method, device, equipment and computer readable medium
CN112532472A (en) * 2020-11-09 2021-03-19 广东电网有限责任公司广州供电局 Method for testing uploading delay of phasor measurement unit
CN112838904A (en) * 2021-01-08 2021-05-25 中国电子技术标准化研究院 TSN network delay jitter measuring device and method
CN113259045A (en) * 2021-07-14 2021-08-13 四川腾盾科技有限公司 Remote control real-time transmission processing method for large unmanned aerial vehicle
CN113300874A (en) * 2021-02-09 2021-08-24 阿里巴巴集团控股有限公司 Network performance detection system and method
CN113328910A (en) * 2021-05-26 2021-08-31 中国电子科技集团公司第五十四研究所 Link state monitoring method facing spanning tree protocol
CN113810243A (en) * 2020-06-17 2021-12-17 上海汽车集团股份有限公司 Delay testing method and device
CN115150339A (en) * 2021-03-31 2022-10-04 瑞昱半导体股份有限公司 Delay adjustment method and data stream processing device
CN117992126A (en) * 2024-04-07 2024-05-07 西安羚控电子科技有限公司 Processor cooperative work method and system based on software lockstep

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103763055A (en) * 2013-10-18 2014-04-30 杭州联汇数字科技有限公司 Method for precise time synchronization
CN108683472A (en) * 2018-05-09 2018-10-19 西安电子科技大学昆山创新研究院 A kind of clock synchronizing method based on Time delay measurement

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103763055A (en) * 2013-10-18 2014-04-30 杭州联汇数字科技有限公司 Method for precise time synchronization
CN108683472A (en) * 2018-05-09 2018-10-19 西安电子科技大学昆山创新研究院 A kind of clock synchronizing method based on Time delay measurement

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
宋仕坤: "基于以太网MAC IP核的IEEE1588协议的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110661878B (en) * 2019-10-06 2023-08-18 上海淡竹体育科技有限公司 Method and device for synchronously testing instructions and data in sports test system
CN110661878A (en) * 2019-10-06 2020-01-07 上海淡竹体育科技有限公司 Method and device for synchronizing test instruction and data in sports test system
CN113810243B (en) * 2020-06-17 2022-08-12 上海汽车集团股份有限公司 Delay testing method and device
CN113810243A (en) * 2020-06-17 2021-12-17 上海汽车集团股份有限公司 Delay testing method and device
CN112019291A (en) * 2020-08-31 2020-12-01 合肥富煌君达高科信息技术有限公司 Network equipment timing method
CN112148214A (en) * 2020-09-04 2020-12-29 苏州浪潮智能科技有限公司 Node information processing method, equipment and medium in double-control environment
CN112182452A (en) * 2020-09-27 2021-01-05 中国平安财产保险股份有限公司 Page component rendering processing method, device, equipment and computer readable medium
CN112532472A (en) * 2020-11-09 2021-03-19 广东电网有限责任公司广州供电局 Method for testing uploading delay of phasor measurement unit
CN112532472B (en) * 2020-11-09 2022-11-04 广东电网有限责任公司广州供电局 Method for testing uploading delay of phasor measurement unit
CN112838904B (en) * 2021-01-08 2023-09-08 中国电子技术标准化研究院 TSN network delay jitter measuring device and method
CN112838904A (en) * 2021-01-08 2021-05-25 中国电子技术标准化研究院 TSN network delay jitter measuring device and method
CN113300874A (en) * 2021-02-09 2021-08-24 阿里巴巴集团控股有限公司 Network performance detection system and method
CN113300874B (en) * 2021-02-09 2024-04-19 阿里巴巴集团控股有限公司 Network performance detection system and method
CN115150339A (en) * 2021-03-31 2022-10-04 瑞昱半导体股份有限公司 Delay adjustment method and data stream processing device
CN113328910A (en) * 2021-05-26 2021-08-31 中国电子科技集团公司第五十四研究所 Link state monitoring method facing spanning tree protocol
CN113259045B (en) * 2021-07-14 2021-09-28 四川腾盾科技有限公司 Remote control real-time transmission processing method for large unmanned aerial vehicle
CN113259045A (en) * 2021-07-14 2021-08-13 四川腾盾科技有限公司 Remote control real-time transmission processing method for large unmanned aerial vehicle
CN117992126A (en) * 2024-04-07 2024-05-07 西安羚控电子科技有限公司 Processor cooperative work method and system based on software lockstep

Also Published As

Publication number Publication date
CN109818826B (en) 2021-02-09

Similar Documents

Publication Publication Date Title
CN109818826A (en) A kind of network path delay measurement method and its device and clock synchronization system
US10158444B1 (en) Event-driven precision time transfer
US20110252158A1 (en) Ethernet-based data transmission method, ethernet nodes and control system
CN100581164C (en) Accurate time synchronization method and system facing measurement and control
US9742645B2 (en) Method and apparatus for measuring performance of multi-service in tunnel
EP2242236B1 (en) Method for measuring frame loss, system for measuring frame loss, and device for measuring frame loss
US20030142696A1 (en) Method for ensuring access to a transmission medium
CN103929293B (en) Asymmetrically-delayed time synchronization method and system
WO2018006686A1 (en) Method, apparatus and device for optimizing time synchronization between communication network devices
US10009924B2 (en) Method and device for optimizing access to a medium in a communication network
US11700072B2 (en) Timing synchronization over cable networks
US8130752B2 (en) Real-time network measurement
US8149880B1 (en) Media streaming synchronization
CA2676117A1 (en) Server time protocol messages and methods
GB2461966A (en) Frame loss measurement system which communicates frame count information using OAM frames and corrects counters according to frame transmission order
KR20080073228A (en) Clock synchronization aid device for communication station(s) of a wireless network, and associated clock synchronization device
KR20100039710A (en) Terminal time of date synchronization method and apparatus in convergence network
US8165011B2 (en) Real-time network measurement
US11716162B2 (en) Method and system for controlling network timing precision of a seismic collector, and terminal device
JP5675703B2 (en) Communication device, control device, and program
CN108183762B (en) The method for synchronizing time of RapidIO network system and RapidIO network system
WO2021164248A1 (en) Method and apparatus for reporting in-situ flow information telemetry (ifit) detection information
CN106791908B (en) A kind of live video stream storage method for supporting cloud platform to use double buffering
US20230308926A1 (en) Method and apparatus for obtaining and sending physical layer measurement data
CN102983959B (en) Method for realizing one-step mode and two-step mode for PTP (precision time synchronization protocol) in a plurality of MAC

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant