CN107360060A - A kind of time-delay measuring method and device - Google Patents
A kind of time-delay measuring method and device Download PDFInfo
- Publication number
- CN107360060A CN107360060A CN201710666460.1A CN201710666460A CN107360060A CN 107360060 A CN107360060 A CN 107360060A CN 201710666460 A CN201710666460 A CN 201710666460A CN 107360060 A CN107360060 A CN 107360060A
- Authority
- CN
- China
- Prior art keywords
- slave unit
- time
- virtual time
- virtual
- main equipment
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 55
- 238000005259 measurement Methods 0.000 claims abstract description 214
- 230000004044 response Effects 0.000 claims abstract description 169
- 230000001360 synchronised effect Effects 0.000 claims abstract description 56
- 230000005540 biological transmission Effects 0.000 claims description 31
- 238000005070 sampling Methods 0.000 claims description 28
- 238000001914 filtration Methods 0.000 claims description 19
- 230000004048 modification Effects 0.000 claims description 7
- 238000012986 modification Methods 0.000 claims description 7
- 239000011800 void material Substances 0.000 claims description 6
- 238000004891 communication Methods 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 14
- 238000012545 processing Methods 0.000 description 10
- 238000004590 computer program Methods 0.000 description 7
- 230000008859 change Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 238000012360 testing method Methods 0.000 description 3
- 238000003491 array Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0852—Delays
Landscapes
- Engineering & Computer Science (AREA)
- Environmental & Geological Engineering (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present invention relates to network communication field, more particularly to a kind of time-delay measuring method and device, to solve the problems, such as that the measuring method of measurement time delay at present has significant limitations.At least one virtual time is stored in main equipment of the embodiment of the present invention, and periodically updates each virtual time;Main equipment sends measured message to slave unit, and first time point is determined according to virtual time corresponding to slave unit when sending measured message;The measurement response message that slave unit returns is received, the 4th time point was determined according to virtual time corresponding to slave unit when receiving measurement response message;Virtual time and the offset of the actual time of the slave unit according to corresponding to first time point, the second time point, the 3rd time point and the 4th time point determine the slave unit, if offset determines that virtual time is synchronous with actual time corresponding to slave unit no more than first threshold;And determine the One Way Delay between main equipment and slave unit.
Description
Technical field
The present invention relates to network communication technology field, more particularly to a kind of time-delay measuring method and device.
Background technology
Service-level agreement (Service-Level Agreement, SLA) is to be based on connectivity fault management
A kind of detection of network performance in real time for the application scenarios that (Connectivity Fault Management, CFM) is defined and system
Meter technology, by periodically send the protocol massages of setting detect with monitoring network communications situation, to be given birth to according to testing result
Into report.SLA KPI Key Performance Indicator (Key Performance Indicators, KPI) mainly has time delay, packet loss etc.,
Corresponding SLA time delay/jitter test (Delay Measurements, DM), packet loss test (Loss Measurements,
LM) etc..
In some deployment scenarios, main equipment and slave unit can initiate SLA measurements, such as measure time delay.Two layers of net
A kind of agreement of conventional measurement time delay is DMM (Delay measurement message, latency measurement message)/DMR in network
(Delay measurement reply, latency measurement response message) agreement.Time delay between measurement main equipment and slave unit
When, a kind of common mode is to measure the One Way Delay between main equipment and slave unit, for example, main equipment is to the unidirectional of slave unit
The One Way Delay of time delay and slave unit to main equipment.But before the One Way Delay between measurement main equipment and slave unit, need
Want between main equipment and slave unit by PTP (Precision Time Synchronization Protocol) 1588 agreements
Enter row clock synchronization.The method of measurement One Way Delay as shown in Figure 1, wherein A is main equipment, and B is slave unit, and is by leading
The one-way delay measurement that device A is initiated;At the time of wherein T1 is that main device A sends DMM messages, T2 is that slave unit B receives DMM
At the time of message, at the time of T3 is that slave unit B sends DMR messages, at the time of T4 is that main device A receives DMR messages;Then from master
Device A to slave unit B One Way Delay is T2-T1, is T4-T3 from slave unit B to main equipment A One Way Delay.
Because one-way delay measurement can measure the time delay of two independent, directions respectively, become increasingly to weigh in actual use
Will.And under normal circumstances, main equipment needs to initiate the one-way delay measurement to multiple slave units.By using such as Fig. 1 institutes
, it is necessary to require that each slave unit is synchronous with main equipment holding clock, that requires each during the method measurement One Way Delay shown
Slave unit can support PTP1588 agreements, and safeguard a clock synchronous with main equipment;But main equipment is often one
The high-performance headend newly to network, and slave unit is probably some does not support the old or inexpensive of PTP1588 agreements
Remote equipment, it is impossible to meet to keep the requirement synchronous with main equipment clock.With main equipment clock can not be kept same in slave unit
During step, it is impossible to using the One Way Delay between current method measurement main equipment and slave unit.Therefore, time delay is measured at present
Measuring method has significant limitations.
The content of the invention
The present invention provides a kind of time-delay measuring method and device, to solve time-delay measuring method present in prior art
The problem of with significant limitations.
Based on above mentioned problem, the embodiment of the present invention provides a kind of time-delay measuring method, and at least one use is stored in main equipment
In the virtual time synchronized with slave unit, and the virtual time corresponds with the slave unit for needing to measure;The master
The each virtual time of renewal of device periodically, this method include:
Main equipment sends measured message to slave unit, and empty according to corresponding to slave unit when sending the measured message
Pseudotime determines to represent the first time point for sending the measured message moment;
The main equipment receives the measurement response message that the slave unit returns, and is reported according to the measurement response is received
Virtual time corresponding to the slave unit determines to represent the 4th time point for receiving the measurement response message moment when literary;Its
Described in measure in response message comprising representing that the slave unit receives the second time point and the table at the measured message moment
Show that the slave unit sends the 3rd time point at the measurement response message moment;
The main equipment is according to the first time point, second time point, the 3rd time point and the described 4th
Time point determines virtual time corresponding to the slave unit and the offset of the actual time of the slave unit, if the offset
No more than first threshold, it is determined that virtual time corresponding to the slave unit is synchronous with the actual time of the slave unit;And will
One Way Delay of the difference of second time point and the first time point as the main equipment to the slave unit, and
Using One Way Delay of the difference at the 4th time point and the 3rd time point as the slave unit to the main equipment.
Due to storing virtual time corresponding at least one slave unit for needing to measure in the main equipment of the embodiment of the present invention,
Virtual time corresponding to each slave unit and actual time are subjected to false synchronization;For any one slave unit, main equipment to
When the slave unit carries out message interaction, main equipment is that the virtual time according to corresponding to the slave unit determines to send and receive message
Time point;And when calculating main equipment and the One Way Delay of the slave unit, main equipment sends measured message to the slave unit, and
And the virtual time according to corresponding to sending the message moment slave unit determines first time point, is receiving measurement response message
Afterwards, and the virtual time according to corresponding to slave unit when receiving measurement response message determined for the 4th time point;And the second time
Point and the 3rd time point are what slave unit determined according to itself actual time;Main equipment returns according to first time point, the slave unit
The second time point and the 3rd time point returned, and the 4th time point, by virtual time corresponding to the slave unit with it is true when
Between carry out false synchronization;After synchronization it is determined that One Way Delay between main equipment and slave unit.Due to the survey of the embodiment of the present invention
The method for measuring One Way Delay does not need slave unit to keep synchronous with the clock of main equipment, measurement One Way Delay of the embodiment of the present invention
Method simply borrows measured message, because the slave unit in network at least needs to support certain standard or privately owned measurement
Agreement, then the slave unit in network can support measured message to respond, therefore and not need slave unit to support
PTP1588 agreements.So as to which the method for measurement One Way Delay of the embodiment of the present invention is applied to arbitrary slave unit, no matter slave unit is
No support PTP1588 agreements, it is not necessary to the hardware or software of slave unit are upgraded or changed, and nor affects on master and sets
The standby actual time, so as to which the method for measurement One Way Delay of the embodiment of the present invention has wide applicability.
Optionally, this method also includes:
If the offset is more than the first threshold, the main equipment is corresponding to the slave unit according to the offset
Virtual time modify, and return to the main equipment to slave unit send measured message the step of.
Before One Way Delay of the embodiment of the present invention between measurement main equipment and slave unit, it will be stored in main equipment
Slave unit corresponding to virtual time it is synchronous with the actual time of the slave unit, so as to accurately measure main equipment with this from setting
One Way Delay between standby.
Optionally, the main equipment is according to the first time point, second time point, the 3rd time point and institute
The offset that the 4th time point determined the actual time of virtual time corresponding to the slave unit and the slave unit is stated, including:
The main equipment determines first difference at second time point and the first time point, and determines described the
Four time points and second difference at the 3rd time point;
The main equipment by the difference of first difference and second difference, and parameter preset business be used as it is described from
Virtual time corresponding to equipment and the offset of the actual time of the slave unit.
The inclined of the actual time of virtual time and slave unit corresponding to slave unit is calculated because the embodiment of the present invention gives
The method of shifting amount, it is easy to main equipment determining the true of virtual time corresponding to slave unit and slave unit according to the offset determined
One Way Delay after real time synchronized between measurement and slave unit.
Optionally, if the main equipment stores virtual time corresponding to multiple slave units, the main equipment will be the multiple
Virtual time corresponding to slave unit forms virtual time array according to the numeric order of each slave unit.
Due to the embodiment of the present invention by corresponding to multiple slave units virtual time form virtual time array mode carry out
Storage, reduces the occupancy to resource;And when each virtual time in virtual time array is updated, it can adopt
Virtual time in virtual time array is updated with a resource is unified, so as to reduce disappearing for storage and computing resource
Consumption, more economically realizes the storage and renewal to multiple virtual times.
Optionally, the main equipment periodically updates each virtual time, including:
The main equipment is at interval of the update cycle, when will be virtual corresponding to each slave unit in the virtual time array
Between be updated simultaneously.
Optionally, main equipment virtual time according to corresponding to slave unit when sending the measured message determines table
Show the first time point for sending the measured message moment, including:
When the main equipment will send that virtual time is as described first corresponding to the slave unit during measured message
Between point;
Main equipment virtual time according to corresponding to slave unit when receiving the measurement response message determines table
Show the 4th time point for receiving the measurement response message moment, including:
Described in virtual time corresponding to the slave unit is used as when the main equipment will receive the measurement response message
4th time point.
Optionally, the main equipment periodically updates each virtual time, including:
Within a update cycle, the main equipment according to each slave unit numeric order, at interval of fixed duration more
Virtual time corresponding to a slave unit in the new virtual time array;When wherein described fixed a length of update cycle with
The business of the virtual time number included in the virtual time array.
Because main equipment of the embodiment of the present invention stores virtual time corresponding to multiple slave units, in the slave unit quantity of storage
When very big, main equipment is difficult to update virtual time corresponding to substantial amounts of slave unit within a clock cycle.The embodiment of the present invention
Poll updates virtual time corresponding to each slave unit within a update cycle, so that main equipment is corresponding to a large amount of slave units
Virtual time renewal be easier realize.
Optionally, main equipment virtual time according to corresponding to slave unit when sending the measured message determines table
Show the first time point for sending the measured message moment, including:
The main equipment according to corresponding to the current or last virtual time once updated slave unit sequence number, need receive institute
The sequence number of the slave unit of measured message and the fixed duration are stated, it is determined that the slave unit is corresponding when sending the measured message
Virtual time deviation;
The main equipment will send virtual time corresponding to the slave unit and the deviation sum during measured message
As the first time point.
Optionally, main equipment slave unit sequence number, need according to corresponding to the current or last virtual time once updated
Receive the sequence number of the slave unit of the measured message and the fixed duration, it is determined that described in when sending the measured message from
The deviation of virtual time corresponding to equipment, including:
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is not less than, to be needed to receive the survey
The sequence number of the slave unit of message is measured, then the main equipment is by slave unit corresponding to the current or last virtual time once updated
Sequence number receives the difference of the sequence number of the slave unit of the measured message with needing, and the product of the fixed duration is used as transmission institute
State the deviation of virtual time corresponding to slave unit during measured message;
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is less than, to be needed to receive the measurement
The sequence number of the slave unit of message, then the main equipment determine slave unit corresponding to the current or last virtual time once updated
The number and value of sequence number and slave unit in the imaginary time array;And by described and value and need to receive the measured message
The difference of the sequence number of slave unit, and the product of the fixed duration are used as when sending the measured message corresponding to the slave unit
The deviation of virtual time.
Because the embodiment of the present invention is it is determined that during first time point, according to the current or last virtual time pair once updated
The slave unit sequence number answered, need to receive the sequence number of the slave unit of the measured message and fixed duration, to sending measured message
When virtual time corresponding to the slave unit be modified, using the revised time as first time point;Calculated so as to improve
Virtual time corresponding to slave unit and the accuracy of true time offset amount.
Optionally, when the main equipment root is virtual according to corresponding to slave unit when receiving the measurement response message
Between determine represent receive it is described measurement the response message moment the 4th time point, including:
The main equipment slave unit sequence number, transmission survey according to corresponding to the current or last virtual time once updated
The sequence number of the slave unit of response message and the fixed duration are measured, it is determined that from setting described in when receiving the measurement response message
The deviation of standby corresponding virtual time;
The main equipment will receive it is described measurement response message when virtual time corresponding to the slave unit with it is described partially
Poor sum is as the 4th time point.
Optionally, main equipment slave unit sequence number, hair according to corresponding to the current or last virtual time once updated
The sequence number of the slave unit of the measurement response message and the fixed duration are sent, it is determined that when receiving the measurement response message
The deviation of virtual time corresponding to the slave unit, including:
If the sequence number of slave unit corresponding to the current or last virtual time once updated is rung not less than the measurement is sent
The sequence number of the slave unit of message is answered, then the main equipment is by slave unit corresponding to the current or last virtual time once updated
The difference of the sequence number of slave unit of the sequence number with sending the measurement response message, and the product conduct of the fixed duration receive
The deviation of virtual time corresponding to the slave unit during measurement response message;
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is less than, sends the measurement response
The sequence number of the slave unit of message, then the main equipment determine slave unit corresponding to the current or last virtual time once updated
The number and value of sequence number and slave unit in the imaginary time array;And by described and value with sending the measurement response message
The difference of the sequence number of slave unit, and the product of the fixed duration are used as slave unit when receiving the measurement response message
The deviation of corresponding virtual time.
Because the embodiment of the present invention is it is determined that during four time points, according to the current or last virtual time pair once updated
Slave unit sequence number, the sequence number of the slave unit of the transmission measurement response message and the fixed duration answered, ring to receiving measurement
Virtual time corresponding to the slave unit is modified when answering message, using the revised time as the 4th time point;So as to improve
Calculate virtual time corresponding to slave unit and the accuracy of true time offset amount.
On the other hand, the embodiment of the present invention also provides a kind of latency measurement device, described device include virtual time module,
Packet sending and receiving module, time stamp sampling module, synchronous calculating filtration module, index computing module;Wherein described virtual time module
At least one virtual time for being synchronized with slave unit of middle storage, and the slave unit that the virtual time measures with needs
Correspond;The virtual time module is used to periodically update each virtual time;
The packet sending and receiving module sends measured message to slave unit;The time stamp sampling module is used for according to transmission
Virtual time corresponding to the slave unit determines to represent the first time point for sending the measured message moment during measured message;
The packet sending and receiving module is additionally operable to receive the measurement response message that the slave unit returns;The time stamp samples mould
Block is additionally operable to determine that expression receives institute according to virtual time corresponding to slave unit when receiving the measurement response message
State the 4th time point at measurement response message moment;Received in wherein described measurement response message comprising the expression slave unit
When second time point at the measured message moment and the expression slave unit send the 3rd of the measurement response message moment
Between point;
It is described it is synchronous calculate filtration module be used for according to the first time point, second time point, it is described 3rd when
Between point and the 4th time point determine virtual time corresponding to the slave unit and the slave unit actual time skew
Amount, if the offset is not more than first threshold, it is determined that virtual time corresponding to the slave unit is true with the slave unit
Real time synchronized;The index computing module is used for the difference of second time point and the first time point as described in
Main equipment to the slave unit One Way Delay, and using the difference at the 4th time point and the 3rd time point as institute
Slave unit is stated to the One Way Delay of the main equipment.
Optionally, the synchronous filtration module that calculates is additionally operable to:
If the offset is more than the first threshold, according to the offset to virtual time corresponding to the slave unit
Modify, and return to the step of main equipment is to slave unit transmission measured message.
Optionally, the synchronous filtration module that calculates is specifically used for:
Determine first difference at second time point and the first time point, and determine the 4th time point and
Second difference at the 3rd time point;The business of first difference and the difference of second difference, and parameter preset is made
For virtual time corresponding to the slave unit and the offset of the actual time of the slave unit.
Optionally, if the virtual time module stores virtual time corresponding to multiple slave units, synchronous calculate is filtered
Ripple module is additionally operable to:
Virtual time corresponding to the multiple slave unit is formed into virtual time battle array according to the numeric order of each slave unit
Row.
Optionally, the synchronous calculating filtration module, is specifically used for:
At interval of the update cycle, by virtual time corresponding to each slave unit in the virtual time array simultaneously
It is updated.
Optionally, the time stamp sampling module, is specifically used for:
Virtual time corresponding to the slave unit will be sent during the measured message as the first time point;
The time stamp sampling module, is specifically used for:
Virtual time corresponding to the slave unit is as the 4th time point when will receive the measurement response message.
Optionally, the synchronous calculating filtration module, is specifically used for:
It is described virtual at interval of fixed duration renewal according to the numeric order of each slave unit within a update cycle
Virtual time corresponding to a slave unit in time array;When wherein described fixed a length of update cycle with it is described virtual when
Between the business of virtual time number that includes in array.
Optionally, the time stamp sampling module, is specifically used for:
According to slave unit sequence number corresponding to the current or last virtual time once updated, need to receive the measured message
Slave unit sequence number and the fixed duration, it is determined that virtual time corresponding to slave unit when sending the measured message
Deviation;Virtual time corresponding to the slave unit and the deviation sum will be sent during the measured message as described first
Time point.
Optionally, the time stamp sampling module, is specifically used for:
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is not less than, to be needed to receive the survey
The sequence number of the slave unit of message is measured, then by the sequence number and needs of slave unit corresponding to the current or last virtual time once updated
The difference of the sequence number of the slave unit of the measured message is received, and the product of the fixed duration is used as the transmission measured message
The deviation of virtual time corresponding to Shi Suoshu slave units;
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is less than, to be needed to receive the measurement
The sequence number of the slave unit of message, it is determined that the sequence number of slave unit corresponding to the current or last virtual time once updated with it is described
The number and value of slave unit in imaginary time array;And by described and value and need to receive the sequence of the slave unit of the measured message
Number difference, and the fixed duration product as send the measured message when virtual time corresponding to the slave unit
Deviation.
Optionally, the time stamp sampling module, is specifically used for:
According to slave unit sequence number, the transmission measurement response message corresponding to the current or last virtual time once updated
Slave unit sequence number and the fixed duration, it is determined that empty corresponding to the slave unit when receiving the measurement response message
The deviation of pseudotime;Virtual time corresponding to the slave unit and the deviation sum when will receive the measurement response message
As the 4th time point.
Optionally, the time stamp sampling module, is specifically used for:
If the sequence number of slave unit corresponding to the current or last virtual time once updated is rung not less than the measurement is sent
The sequence number of the slave unit of message is answered, then by the sequence number of slave unit and transmission corresponding to the current or last virtual time once updated
The difference of the sequence number of the slave unit of the measurement response message, and the product of the fixed duration are rung as the measurement is received
The deviation of virtual time corresponding to slave unit when answering message;
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is less than, sends the measurement response
The sequence number of the slave unit of message, it is determined that the sequence number of slave unit corresponding to the current or last virtual time once updated with it is described
The number and value of slave unit in imaginary time array;And by it is described and value with send it is described measurement response message slave unit sequence
Number difference, and the fixed duration product as virtual corresponding to slave unit when receiving the measurement response message
The deviation of time.
Brief description of the drawings
Fig. 1 is the method schematic diagram that One Way Delay is measured in background technology;
Fig. 2 is the structural representation of latency measurement system of the embodiment of the present invention;
Fig. 3 is the schematic diagram that virtual time corresponding to slave unit is stored in main equipment of the embodiment of the present invention;
Fig. 4 is RTC of embodiment of the present invention schematic diagram;
Fig. 5 is the schematic diagram of the first virtual time array of the embodiment of the present invention;
Fig. 6 is the method schematic diagram that the embodiment of the present invention is updated processing to the virtual time in virtual time array
One;
Fig. 7 A are the schematic diagram of second of virtual time array of the embodiment of the present invention;
Fig. 7 B are the schematic diagram of the third virtual time array of the embodiment of the present invention;
Fig. 8 is the method schematic diagram that the embodiment of the present invention is updated processing to the virtual time in virtual time array
Two;
Fig. 9 is the overall flow figure that virtual time corresponding to slave unit of the embodiment of the present invention synchronizes with actual time;
Figure 10 is the overall flow figure of time-delay measuring method of the embodiment of the present invention;
Figure 11 is the structural representation of the first latency measurement device of the embodiment of the present invention;
Figure 12 is the structural representation of second of latency measurement device of the embodiment of the present invention;
Figure 13 is the flow chart of time-delay measuring method of the embodiment of the present invention.
Embodiment
At least one virtual time for being synchronized with slave unit is stored in main equipment of the embodiment of the present invention, and it is described
Virtual time corresponds with the slave unit for needing to measure;Main equipment periodically updates each virtual time;Main equipment to from
Equipment sends measured message, and the virtual time according to corresponding to slave unit when sending the measured message determines to represent to send
The first time point at the measured message moment;The main equipment receives the measurement response message that the slave unit returns, and root
Determine that expression receives the measurement response according to virtual time corresponding to slave unit when receiving the measurement response message
4th time point at message moment;In wherein described measurement response message the measurement report is received comprising the expression slave unit
Second time point at literary moment and the 3rd time point for representing the slave unit transmission measurement response message moment;The master
Equipment is according to determining the first time point, second time point, the 3rd time point and the 4th time point
Virtual time corresponding to slave unit and the offset of the actual time of the slave unit, if the offset is not more than the first threshold
Value, it is determined that virtual time corresponding to the slave unit is synchronous with the actual time of the slave unit;And by second time
Point and the One Way Delay of the difference of the first time point as the main equipment to the slave unit, and during by the described 4th
Between point and the One Way Delay of the difference at the 3rd time point as the slave unit to the main equipment.
Due to storing virtual time corresponding at least one slave unit for needing to measure in the main equipment of the embodiment of the present invention,
Virtual time corresponding to each slave unit and actual time are subjected to false synchronization;For any one slave unit, main equipment to
When the slave unit carries out message interaction, main equipment is that the virtual time according to corresponding to the slave unit determines to send and receive message
Time point;And when calculating main equipment and the One Way Delay of the slave unit, main equipment sends measured message to the slave unit, and
And the virtual time according to corresponding to sending the message moment slave unit determines first time point, is receiving measurement response message
Afterwards, and the virtual time according to corresponding to slave unit when receiving measurement response message determined for the 4th time point;And the second time
Point and the 3rd time point are what slave unit determined according to itself actual time;Main equipment returns according to first time point, the slave unit
The second time point and the 3rd time point returned, and the 4th time point, by virtual time corresponding to the slave unit with it is true when
Between carry out false synchronization;After synchronization it is determined that One Way Delay between main equipment and slave unit.Due to the survey of the embodiment of the present invention
The method for measuring One Way Delay does not need slave unit to keep synchronous with the clock of main equipment, measurement One Way Delay of the embodiment of the present invention
Method simply borrows measured message, because the slave unit in network at least needs to support certain standard or privately owned measurement
Agreement, then the slave unit in network can support measured message to respond, therefore and not need slave unit to support
PTP1588 agreements.So as to which the method for measurement One Way Delay of the embodiment of the present invention is applied to arbitrary slave unit, no matter slave unit is
No support PTP1588 agreements, it is not necessary to the hardware or software of slave unit are upgraded or changed, and nor affects on master and sets
The standby actual time, so as to which the method for measurement One Way Delay of the embodiment of the present invention has wide applicability.
In order that the object, technical solutions and advantages of the present invention are clearer, the present invention is made below in conjunction with accompanying drawing into
One step it is described in detail, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole implementation
Example.Based on the embodiment in the present invention, what those of ordinary skill in the art were obtained under the premise of creative work is not made
All other embodiment, belongs to the scope of protection of the invention.
As shown in Fig. 2 a kind of latency measurement system of the embodiment of the present invention, including main equipment 10 and at least one slave unit
20。
Wherein, virtual time corresponding to slave unit 20 is stored in main equipment 10, and periodically updates each slave unit 20
Corresponding virtual time, and virtual time corresponding to slave unit 20 is virtual corresponding to the slave unit 20 before renewal after renewal
Time and update cycle sum.
Main equipment 10, for sending measured message to slave unit, and according to slave unit when sending the measured message
Corresponding virtual time determines to represent the first time point for sending the measured message moment;Receive the survey that the slave unit returns
Response message is measured, and the virtual time according to corresponding to slave unit when receiving the measurement response message determines to represent to receive
To the 4th time point at the measurement response message moment;
Slave unit 20, for after measured message is received, the addition expression slave unit to receive in measured message
Second time point at the measured message moment, and added after needing return measurement response message in response message is measured
Represent that the slave unit sends the 3rd time point at the measurement response message moment, and be sent to main equipment;
Main equipment 10, it is additionally operable to according to the first time point, second time point, the 3rd time point and described
4th time point determined virtual time corresponding to the slave unit and the offset of the actual time of the slave unit, if described inclined
Shifting amount is not more than first threshold, it is determined that virtual time corresponding to the slave unit is synchronous with the actual time of the slave unit;
And using One Way Delay of the difference of second time point and the first time point as the main equipment to the slave unit,
And using the difference at the 4th time point and the 3rd time point as the slave unit to the main equipment it is unidirectional when
Prolong.
Wherein, the first threshold be according to empirical value, or the first threshold be the embodiment of the present invention in it is set in advance
Numerical value.
With reference to the embodiment of the present invention, optionally, the first threshold was 10 nanoseconds.
In embodiments of the present invention, main equipment can be used for measuring the One Way Delay with least one slave unit.Main equipment
In be stored with virtual time corresponding at least one slave unit;Virtual time corresponding to the slave unit wherein stored in main equipment
Mode is similar to the virtual RTC (Real Time Clock, real-time clock) for storing at least one slave unit in the host.But
It is that the virtual RTC of slave unit has no effect on the true RTC of main equipment.
For example, as shown in figure 3, the virtual RTC of N number of slave unit is stored in main equipment A.Wherein, RTC real represent that master sets
Standby A true RTC;RTC virtual represent the virtual RTC of each slave unit, for example RTC virtual-1 are slave unit B-1
Virtual time, the void that virtual time ... the RTC virtual-N that RTC virtual-2 are slave unit B-2 are slave unit B-N
Pseudotime.
Virtual time corresponding to each slave unit has a physical resource in the host, for slave unit is corresponding
Virtual time and actual time of slave unit synchronize, during so as to for measuring unidirectional between main equipment and the slave unit
Prolong.A usual RTC includes three sections:Second s, nanosecond ns and subnanosecond sub-ns, as shown in Figure 4.
Virtual time corresponding to each slave unit stored in main equipment of the embodiment of the present invention is periodically constantly change
, initially by when virtual time is stored in main equipment corresponding to slave unit, corresponded to the actual time of main equipment as slave unit
Virtual time initial value.
It is virtual corresponding to multiple slave units storing when main equipment needs to measure virtual time corresponding to multiple slave units
During the time, it can be stored using following two ways.
Mode 1, by virtual time separate storage corresponding to multiple slave units;
Virtual time corresponding to i.e. each slave unit takes a resource, is independently updated.
Wherein, the resource that virtual time takes includes:Storage resource (being used to store virtual time) and computing resource (are used for
Update virtual time).
Exemplary, the storage organization of each virtual time is identical, and computing resource is identical.As can be seen here, have in the program
How many individual virtual times, which must correspond to, expends how many parts of resources, suitable for the situation of virtual time negligible amounts.
Mode 2, the main equipment are suitable according to the sequence number of each slave unit by virtual time corresponding to the multiple slave unit
Sequence forms virtual time array.
Optionally, main equipment by virtual time array it is centralized and unified be stored in RAM (random access memory, with
Machine memory) in.
It is using the unification pair of a resource in addition, when each virtual time in virtual time array is updated
Virtual time in virtual time array is updated, more economical real so as to reduce the consumption of storage and computing resource
The now storage and renewal to multiple virtual times.
For example, virtual time array as shown in Figure 5.Wherein RTC virtual-1 are slave unit B-1 virtual time,
The virtual time that virtual time ... the RTC virtual-N that RTC virtual-2 are slave unit B-2 are slave unit B-N.
Because the time is dynamic change in itself, so main equipment need to be according to predetermined period (preset time precision), to each
Virtual time corresponding to individual slave unit enter Mobile state renewal, become can accurately track slave unit time change it is virtual when
Between.
Main equipment of the embodiment of the present invention using it is following it is different by the way of periodically update corresponding to each slave unit it is virtual
Time, illustrate separately below.
First, the main equipment, will be empty corresponding to each slave unit in the virtual time array at interval of the update cycle
Pseudotime is updated simultaneously.
Such as clock frequency, when being 125MHz, the clock cycle was 8 nanoseconds, then main equipment is being updated corresponding to each slave unit
During virtual time, the update cycle determined was 8 nanoseconds;It is i.e. every a update cycle, main equipment that each slave unit is corresponding
Virtual time add up 8 nanoseconds.
In real PTP1588 realizations, the clock for driving actual RTC has higher frequency, such as m Hz.When
When needing the slave unit number for carrying out one-way delay measurement in real time less, namely the virtual time number stored in main equipment is less
When, it is that the renewal to these virtual times can be completed within a clock cycle under m Hz clock frequency.
Accordingly, when employing mode one updates virtual time corresponding to each slave unit, main equipment is according to following manner
Determine first time point:
Optionally, the main equipment will be sent during the measured message described in virtual time conduct corresponding to the slave unit
First time point;
Also, main equipment determined for the 4th time point according to following manner:
Described in virtual time corresponding to the slave unit is used as when the main equipment will receive the measurement response message
4th time point.
2nd, within a update cycle, the main equipment according to each slave unit numeric order, at interval of fixed duration
Update virtual time corresponding to a slave unit in the virtual time array;A length of update cycle when wherein described fixed
With the business of the virtual time number included in the virtual time array.
Optionally, a length of empirical value during the fixation, or be numerical value set in advance.
In the second way, main equipment updates each virtual time corresponding to slave unit in virtual array successively, and
It is virtual time corresponding to each slave unit of renewal of constant duration.I.e. main equipment is updated each successively by the way of poll
Virtual time corresponding to slave unit.
Assuming that main equipment needs to measure the One Way Delay with 1000 slave units, need to store in main equipment this 1000 from
The virtual time array that virtual time corresponding to equipment forms.For the imaginary time array of unified storage, in m Hz high clock
Renewal processing can not possibly be completed to up to 1000 RTCvirtual within a clock cycle under frequency.Therefore, the present invention is real
Apply example and processing, such as each virtual time are updated to the virtual time in virtual time array per n using pole low speed frequency
Hz is updated once, and virtual time is added into the 1/n seconds on the basis of original value.Here it was exactly 8000 nanoseconds when n is 125KHz
Renewal once, added up for 8000 nanoseconds every time.And high-frequency clock m Hz poll virtual time arrays are used, namely virtual time battle array
Two adjacent virtual times are handled once per the renewal of 1/m seconds in row, ensure to be updated per each virtual time in n Hz
Once, as shown in Figure 6.
Under embodiment as shown in Figure 6, update cycle (the time essence of each virtual time in virtual time array
Degree) be:1/n.For example when n is 125KHz, every 8000 nanosecond of virtual time corresponding to each slave unit updates once, when virtual
Between precision be 8000 nanoseconds.It is 8 to receive per adjacent two virtual times renewal interval when the high-frequency clock m of poll is 125MHz
Second, in such 8000 nanosecond, each imaginary time in imaginary time array can be updated once.Here m and n should meet as follows
Relation:M is multiplied by n equal to virtual time number, such as 125MHz is multiplied by 125KHz equal to 1000.
Generally whether use second of update mode, the realization and cost requirement to main equipment are related, it is proposed that empty
Using the unified storage of virtual time array and unified renewal when pseudotime number is more than 10, economizing on resources reduces cost.
When using second of update mode, the update cycle of virtual time corresponding to each slave unit is 1/n, such as when
When n is 125KHz, every 8000 nanosecond of virtual time corresponding to slave unit just updates once, and virtual time precision was 8000 nanoseconds.
Sampled if this virtual time be directly used in the time stamp of measured message during main equipment false synchronization, timestamp precision damage
Mistake is too big, and for upper layer software (applications) according to 8000 nanoseconds, i.e. the Offset precision that the time stamp accuracy computation of 8 microseconds goes out also is up to 8us, from
And prevent time of the main device from exactly accurate tracking slave unit.
Optionally, main equipment determines first time point according to following manner:
The main equipment according to corresponding to the current or last virtual time once updated slave unit sequence number, need receive institute
The sequence number of the slave unit of measured message and the fixed duration are stated, it is determined that the slave unit is corresponding when sending the measured message
Virtual time deviation;The main equipment will send during the measured message virtual time corresponding to the slave unit with it is described
Deviation sum is as the first time point.
Because in second of update mode, master polls update virtual time corresponding to each slave unit.At one
In update cycle, if a period of time after the slave unit is updated sends measured message to the slave unit, if now continuing to make
Virtual time then produces larger error corresponding to the slave unit of storage, it is therefore desirable to sending measured message moment slave unit
Corresponding virtual time is modified.
The slave unit is corresponding when the main equipment of the embodiment of the present invention determines to send the measured message according to following manner
Virtual time deviation:
The 1st, if the sequence number of slave unit corresponding to the current or last virtual time once updated is not less than described in needs reception
The sequence number of the slave unit of measured message, then by the sequence number of slave unit corresponding to the current or last virtual time once updated with needing
The difference of the sequence number of the slave unit of the measured message is received, and the product of the fixed duration is reported as the measurement is sent
The deviation of virtual time corresponding to slave unit when literary.
That is, measurement is received not less than needs in the sequence number of slave unit corresponding to the current or last virtual time once updated
During the sequence number of the slave unit of message, the deviation of virtual time corresponding to the slave unit is calculated using following equation:
Δ T=(m-n) * t;
Wherein, Δ T is the deviation of virtual time corresponding to the slave unit;M be it is current or last once update it is virtual when
Between corresponding slave unit sequence number;N is the sequence number for needing to receive the slave unit of measured message;T is fixed duration set in advance.
For example, virtual time array as shown in Figure 7 A.When being stored with virtual corresponding to 1000 slave units in main equipment
Between the virtual time array that forms;Wherein, RTC virtual-1 be slave unit 1 virtual time, RTC virtual-2 be from
Virtual time ... the RTC virtual-N of equipment 2 are slave unit N virtual time.Assuming that currently updating slave unit 5
Virtual time;If main equipment needs to send measured message to slave unit 2, and main equipment is at interval of the fixed nanosecond of duration 8 renewal
Virtual time corresponding to one slave unit, it is determined that the deviation of the virtual time of slave unit 2 is (5- during the transmission measured message gone out
2) nanosecond * 8 nanoseconds=24.When being then modified to virtual time corresponding to transmission measured message moment slave unit, surveyed sending
Increase by 24 nanoseconds as first time point on the virtual time of slave unit 2 when measuring message.
The 2nd, if the sequence number of slave unit corresponding to the current or last virtual time once updated is less than and needs to receive the survey
Measure the sequence number of the slave unit of message, it is determined that the sequence number of slave unit and institute corresponding to the current or last virtual time once updated
State the number and value of slave unit in imaginary time array;And by described and value and need to receive the slave unit of the measured message
The difference of sequence number, and the product of the fixed duration are used as virtual time corresponding to slave unit when sending the measured message
Deviation.
That is, it is less than needs reception measurement report in the sequence number of slave unit corresponding to the current or last virtual time once updated
During the sequence number of the slave unit of text, the deviation of virtual time corresponding to the slave unit is calculated using following equation:
Δ T=(X+m-n) * t;
Wherein, Δ T is the deviation of virtual time corresponding to the slave unit;X is the number of slave unit in imaginary time array;m
For the sequence number of slave unit corresponding to the current or last virtual time once updated;N is the slave unit for needing to receive measured message
Sequence number;T is fixed duration set in advance.
For example, virtual time array as shown in Figure 7 B.When being stored with virtual corresponding to 1000 slave units in main equipment
Between the virtual time array that forms;Wherein, RTC virtual-1 be slave unit 1 virtual time, RTC virtual-2 be from
Virtual time ... the RTC virtual-N of equipment 2 are slave unit N virtual time.Assuming that currently updating slave unit 5
Virtual time;If main equipment needs to send measured message to slave unit 10, and main equipment is at interval of the fixed nanosecond of duration 8 renewal
Virtual time corresponding to one slave unit, it is determined that the deviation of the virtual time of slave unit 10 is during the transmission measured message gone out
Nanosecond (5-10+1000) * 8 nanosecond=7960.Then virtual time corresponding to transmission measured message moment slave unit is modified
When, increase by 7960 nanoseconds as first time point on the virtual time of slave unit 10 when sending measured message.
Optionally, main equipment is determined corresponding to the current or last virtual time once updated by the way of counter
Slave unit sequence number.
Specifically, one high-frequency clock counter of main equipment internal maintenance, and the counter counts one number time is second
Update the fixation duration in virtual time mode.For example, if main equipment updates void corresponding to a slave unit at interval of t1 durations
Pseudotime, then the counting cycle of the counter is t1, i.e., at interval of one number of t1 durations meter.
If for example, there are 1000 virtual times in virtual time array now, sampled using 125MHz high-frequency clocks, each
The nanosecond of virtual time 8000 updates once, updates the nanosecond of precision 8000;And update a virtual time at interval of 8 nanoseconds.It is main
Device interior safeguards that uses a 125MHz high-frequency clock counters, is one from 1 and count down to 1000 (1000=virtual times
Number) cycle counter, that is, counted again since 1 after counting down to 1000.It was 8 nanoseconds that counter, which often accumulates once, circulation one
Secondary exactly 8000 nanoseconds.
As shown in figure 8, cycle counter and virtual time renewal are synchronous, i.e., when counter counts count to 5, main equipment is worked as
The preceding virtual time for updating slave unit 5.Current master needs to send the void of measured message, then slave unit 2 to slave unit 2
Pseudotime deviation is:Nanosecond (5-2) * 8 nanosecond=24.Then the virtual time for sending measured message moment slave unit 2 is repaiied
Timing, increase by 24 nanoseconds as first time point on the virtual time of slave unit 2 when sending measured message.
Main equipment determined for the 4th time point according to following manner:
The main equipment slave unit sequence number, transmission survey according to corresponding to the current or last virtual time once updated
The sequence number of the slave unit of response message and the fixed duration are measured, it is determined that from setting described in when receiving the measurement response message
The deviation of standby corresponding virtual time;It is empty corresponding to the slave unit when main equipment will receive the measurement response message
Pseudotime and the deviation sum are as the 4th time point.
Because in second of update mode, master polls update virtual time corresponding to each slave unit.At one
In update cycle, if a period of time after the slave unit is updated receives the measurement response message of slave unit transmission, now
Larger error is produced if virtual time corresponding to the slave unit of storage is continuing with, it is therefore desirable to receiving measurement response
Virtual time corresponding to message moment slave unit is modified.
From setting described in when the main equipment of the embodiment of the present invention determines to receive the measurement response message according to following manner
The deviation of standby corresponding virtual time:
The 1st, if the sequence number of slave unit corresponding to the current or last virtual time once updated is not less than the transmission measurement
The sequence number of the slave unit of response message, then by the sequence number and hair of slave unit corresponding to the current or last virtual time once updated
The difference of the sequence number of the slave unit of the measurement response message, and the product conduct of the fixed duration is sent to receive the measurement
The deviation of virtual time corresponding to slave unit during response message;
The 2nd, if the sequence number of slave unit corresponding to the current or last virtual time once updated, which is less than, sends the measurement sound
Answer the sequence number of the slave unit of message, it is determined that the sequence number of slave unit and institute corresponding to the current or last virtual time once updated
State the number and value of slave unit in imaginary time array;And by described and value with sending the slave unit for measuring response message
The difference of sequence number, and the product of the fixed duration are used as void corresponding to slave unit when receiving the measurement response message
The deviation of pseudotime.
It should be noted that time-delay measuring method of the embodiment of the present invention is according to first time point, the second time point, the 3rd
Time point and the 4th time point are determined before One Way Delay between main equipment and slave unit, it is necessary to ensure to store in main equipment
Slave unit corresponding to virtual time it is synchronous with the official time of the slave unit.
Specifically, judge virtual time corresponding to the slave unit that is stored in main equipment and the slave unit actual time whether
Following method can synchronously be used:
1st, main equipment according to the first time point, second time point, the 3rd time point and it is described 4th when
Between point determine virtual time corresponding to the slave unit and the offset of the actual time of the slave unit, if the offset is little
In first threshold, it is determined that virtual time corresponding to the slave unit stored in equipment is synchronous with the actual time of the slave unit.
2nd, main equipment according to the first time point, second time point, the 3rd time point and it is described 4th when
Between point determine virtual time corresponding to the slave unit and the offset of the actual time of the slave unit, if the offset is little
In first threshold, and determine that this time is not more than first threshold for the offset that continuous n-th is determined, it is determined that in equipment
Virtual time corresponding to the slave unit of storage is synchronous with the actual time of the slave unit.
Optionally, in the embodiment of the present invention main equipment according to corresponding to following manner determines slave unit virtual time with from setting
The offset of standby actual time:
The main equipment determines first difference at second time point and the first time point, and determines described the
Four time points and second difference at the 3rd time point;The main equipment is by the difference of first difference and second difference
Value, and offset of the business as virtual time corresponding to the slave unit and the actual time of the slave unit of parameter preset;
Optionally, parameter preset 2.
Specifically, main equipment can use following equation calculate virtual time and slave unit corresponding to slave unit it is true when
Between offset:
Offset=[(T2-T1)-(T4-T3)]/2 --- formula one;
Offset is the offset of the actual time of virtual time and slave unit corresponding to slave unit;T1 is the very first time
Point, T2 were the second time point, and T3 was the 3rd time point, and T4 was the 4th time point.
It should be noted that the offset of the actual time of virtual time and slave unit corresponding to above-mentioned calculating slave unit
Formula is to present invention implementation calculating offset for example, the embodiment of the present invention is to be protected to determine that slave unit is corresponding
Virtual time and the mode of offset of actual time of slave unit be not limited to the example above, it is any to be capable of determining that from setting
The mode of the offset of the actual time of standby corresponding virtual time and slave unit is applied to the present invention.
, it is necessary to ensure the corresponding virtual time of the slave unit before the One Way Delay between main equipment and slave unit is calculated
It is synchronous with actual time.
With reference to Fig. 9, describe the embodiment of the present invention in detail and carry out virtual time corresponding to slave unit and actual time
Synchronous process.
As shown in figure 9, the bulk flow that virtual time corresponding to slave unit of the embodiment of the present invention synchronizes with actual time
Cheng Tu.
Wherein, the initial value of virtual time corresponding to main equipment storage slave unit is the actual time of the slave unit.
For example, when storing slave unit B virtual time in the host, the time of main equipment is t0, then using t0 as from
The initial value of equipment B virtual time.
Illustrate below main equipment storage slave unit the initial virtual time after, by virtual time corresponding to slave unit with
The process that actual time synchronizes.
Step 901, main equipment send measured message to slave unit, and according to slave unit when sending the measured message
Corresponding virtual time determines to represent the first time point for sending the measured message moment;
Wherein, main equipment can add the first time point determined in measured message;It is or true in local record
The first time point made.
Step 902, the main equipment receive the measurement response message that the slave unit returns, and according to receiving the survey
Virtual time corresponding to the slave unit determines to represent to receive the 4th of the measurement response message moment when measuring response message
Time point;
When in the measurement response message also comprising representing that the slave unit receives the second of the measured message moment
Between put and represent that the slave unit sends the 3rd time point at the measurement response message moment.
Wherein, main equipment can add the 4th time point determined in response message is measured;Or in local note
Record the 4th time point determined;
If main equipment is added by the way of measuring in response message using the 4th time point that will be determined, specifically, main
The packet sending and receiving module of equipment receives the measurement response message of slave unit return, and the time stamp sampling module of main equipment is according to reception
Determined for the 4th time point to virtual time corresponding to slave unit during measurement response message, the addition of the 4th time point is responded in measurement
In message, and the measurement response message after renewal is sent to message and produces termination block.
Step 903, the main equipment according to the first time point, second time point, the 3rd time point and
4th time point determines virtual time corresponding to the slave unit and the offset of the actual time of the slave unit;
Specifically, the inclined of virtual time corresponding to slave unit and actual time can be calculated by the way of shown in formula one
Shifting amount.
Step 904, main equipment judge whether the offset is not more than first threshold, if it is not, performing step 905;If so, hold
Row step 906;
Optionally, the Rule of judgment in the step can be the offset that main equipment judges whether that continuous n times are determined
No more than first threshold.
Step 905, the main equipment are modified according to the offset to virtual time corresponding to the slave unit, and
Return to step 901;
Wherein, the mode according to formula one calculates the offset of virtual time corresponding to slave unit and actual time, then
Using the virtual time corresponding as amended slave unit with the difference of the offset of virtual time corresponding to slave unit before modification;
For example, the offset calculated is Offset, it is assumed that virtual time corresponding to slave unit is t1 before a modification, then repaiies
It is t1-Offset to change virtual time corresponding to rear slave unit.
Step 906, main equipment determine that virtual time corresponding to the slave unit is synchronous with the actual time of the slave unit.
Optionally, main equipment connects the last time after it is determined that virtual time corresponding to slave unit is synchronous with actual time
The difference for the first time point that the second time point in the measurement response message received determines with the last time is set as the master
The standby One Way Delay for arriving the slave unit, and the 4th time point that the last time is determined and the last measurement received
One Way Delay of the difference at the 3rd time point in response message as the slave unit to the main equipment.
For example, main equipment is during virtual time corresponding to slave unit and actual time are synchronized, if altogether to
Slave unit sends five measured messages, and after the 5th measured message is sent, according to during the 5th measured message of transmission from
Second in the first time point that virtual time corresponding to equipment determines, and the 5th measurement response message of slave unit return
Time point, using One Way Delay of the difference of the second time point and first time point as main equipment to slave unit.According to receiving
The 4th time point that virtual time corresponding to slave unit determines during the 5th measurement response message, and the 5th of slave unit return the
The 3rd time point in secondary measurement response message, using the difference at the 4th time point and the 3rd time point as slave unit to main equipment
One Way Delay.
The main equipment of the embodiment of the present invention borrows measured message and interacted with each slave unit, slave unit response measurement report
Text, so as to obtain first time point, the second time point, the 3rd time point and the 4th time point;So that main equipment is according to acquisition
First time point, the second time point, the 3rd time point and the 4th time point are by virtual time corresponding to slave unit and actual time
It is synchronous, and the One Way Delay between main equipment and slave unit is calculated after synchronization.
The measured message of the embodiment of the present invention can be message for time synchronized, such as DMM/DMR messages, be based on
NTP (Network Time Protocol, NTP) message, based on TWAMP (Two-Way Active
Measurement Protocol, two-way active measurement agreement) message.
It should be noted that the type of the measured message of the above-mentioned embodiment of the present invention provided is simply to the embodiment of the present invention
For example, the type of measured message to be protected of the embodiment of the present invention is not limited to the example above, it is any to make master
Equipment determines first time point, the second time point, the 3rd time point and the 4th time by carrying out message interaction with slave unit
The measured message of point is applied to the present invention.
Below using measured message as DMM messages, measurement response message be DMR messages exemplified by, when illustrating the embodiment of the present invention
Prolong measuring method, as shown in Figure 10.
Step 1001, main equipment send DMM messages to slave unit, and according to corresponding to slave unit when sending DMM messages
Virtual time adds very first time stamp in DMM messages;
Specifically, virtual time corresponding to the slave unit stabs as the very first time when will send DMM messages.
Step 1002, main equipment receive the DMR messages that slave unit returns, and according to slave unit when receiving DMR messages
Corresponding virtual time adds the 4th timestamp in DMR messages;Wherein, also comprising expression, the slave unit receives in DMR messages
To second timestamp and the 3rd timestamp at expression slave unit transmission DMR message moment at DMR message moment.
Step 1003, main equipment stab according to the very first time, the second timestamp, the 3rd timestamp and the 4th timestamp determine from
The offset of the actual time of virtual time corresponding to equipment and slave unit;
Specifically, the inclined of virtual time corresponding to slave unit and actual time can be calculated by the way of shown in formula one
Shifting amount.
Step 1004, main equipment judge whether the offset is not more than first threshold, if it is not, performing step 1005;If so,
Perform step 1006;
Optionally, the Rule of judgment in the step can be the offset that main equipment judges whether that continuous n times are determined
No more than first threshold.
Step 1005, the main equipment are modified according to the offset to virtual time corresponding to the slave unit,
And return to step 1001.
Step 1006, main equipment determine that virtual time corresponding to slave unit is synchronous with the actual time of slave unit.
Step 1007, main equipment using the second timestamp with the difference that the very first time stabs as main equipment to the unidirectional of slave unit
Time delay, and the One Way Delay using the difference of the 4th timestamp and the 3rd timestamp as slave unit to main equipment.
Based on same inventive concept, a kind of latency measurement device is additionally provided in the embodiment of the present invention, due to the device solution
Certainly the principle of problem is similar to above-mentioned latency measurement system, therefore the implementation of the device may refer to the implementation of system, repetition
Place repeats no more.
As shown in figure 11, a kind of latency measurement device of the embodiment of the present invention, the measurement apparatus is located in main equipment, including void
Pseudotime module 1101, packet sending and receiving module 1102, time stamp sampling module 1103, synchronous calculating filtration module 1104, index meter
Calculate module 1105;
At least one virtual time for being synchronized with slave unit is stored in wherein described virtual time module 1101,
And the virtual time corresponds with the slave unit for needing to measure;The virtual time module 1101 is used to periodically update
Each virtual time;
The packet sending and receiving module 1102 sends measured message to slave unit;The time stamp sampling module 1003 is used for basis
Virtual time corresponding to the slave unit during measured message is sent to determine to represent to send the first of the measured message moment
Time point;
The packet sending and receiving module 1102 is additionally operable to receive the measurement response message that the slave unit returns;The time stamp is adopted
Egf block 1103 is additionally operable to determine to represent according to virtual time corresponding to slave unit when receiving the measurement response message
Receive the 4th time point at the measurement response message moment;Comprising representing described from setting in wherein described measurement response message
Standby the second time point for receiving the measured message moment and the expression slave unit send the measurement response message moment
The 3rd time point;
The synchronous filtration module 1104 that calculates is used for according to the first time point, second time point, described the
Three time points and the 4th time point determine virtual time corresponding to the slave unit and the actual time of the slave unit
Offset, if the offset is not more than first threshold, it is determined that virtual time corresponding to the slave unit and the slave unit
Actual time it is synchronous;The index computing module 1105 is used for the difference by second time point and the first time point
One Way Delay as the main equipment to the slave unit, and the difference by the 4th time point and the 3rd time point
It is worth the One Way Delay as the slave unit to the main equipment.
It should be noted that also including message in the latency measurement device of the embodiment of the present invention produces termination block 1106,
Message produces termination block 1106 and is used to produce measured message and/or termination measurement response message;Message produces termination block
After 1106 produce measured message, the measured message is transmitted to packet sending and receiving module 1102 to send to slave unit;
Time stamp sampling module 1103 can locally record for the 4th time point after determining for the 4th time point, or
Person added for the 4th time point in response message is measured;Responded according to the 4th time point addition that will be determined in measurement
Mode in message, specifically, packet sending and receiving module 1102 receives the measurement response message of slave unit return, time stamp sampling mould
Block 1103 determined for the 4th time point, by the addition of the 4th time point in response message is measured, and the measurement after renewal was responded into report
Text is sent to message and produces termination block 1106.
Optionally, the synchronous filtration module 1104 that calculates is additionally operable to:If the offset is more than the first threshold, root
Virtual time corresponding to the slave unit is modified according to the offset, and returns to the main equipment and is sent to slave unit
The step of measured message.
Optionally, the synchronous filtration module 1104 that calculates is specifically used for:Determine second time point and described first
First difference at time point, and determine second difference at the 4th time point and the 3rd time point;By described first
The difference of difference and second difference, and parameter preset business as virtual time corresponding to the slave unit with described from setting
The offset of standby actual time.
Optionally, if the virtual time module stores virtual time corresponding to multiple slave units, synchronous calculate is filtered
Ripple module 1104 is additionally operable to:
Virtual time corresponding to the multiple slave unit is formed into virtual time battle array according to the numeric order of each slave unit
Row.
Optionally, the synchronous calculating filtration module 1104, is specifically used for:
At interval of the update cycle, by virtual time corresponding to each slave unit in the virtual time array simultaneously
It is updated.
Optionally, the time stamp sampling module 1103, is specifically used for:
Virtual time corresponding to the slave unit will be sent during the measured message as the first time point;
The time stamp sampling module 1103, is specifically used for:
Virtual time corresponding to the slave unit is as the 4th time point when will receive the measurement response message.
Optionally, the synchronous calculating filtration module 1104, is specifically used for:
It is described virtual at interval of fixed duration renewal according to the numeric order of each slave unit within a update cycle
Virtual time corresponding to a slave unit in time array;When wherein described fixed a length of update cycle with it is described virtual when
Between the business of virtual time number that includes in array.
Optionally, the time stamp sampling module 1103, is specifically used for:
According to slave unit sequence number corresponding to the current or last virtual time once updated, need to receive the measured message
Slave unit sequence number and the fixed duration, it is determined that virtual time corresponding to slave unit when sending the measured message
Deviation;Virtual time corresponding to the slave unit and the deviation sum will be sent during the measured message as described first
Time point.
Optionally, the time stamp sampling module 1103, is specifically used for:
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is not less than, to be needed to receive the survey
The sequence number of the slave unit of message is measured, then by the sequence number and needs of slave unit corresponding to the current or last virtual time once updated
The difference of the sequence number of the slave unit of the measured message is received, and the product of the fixed duration is used as the transmission measured message
The deviation of virtual time corresponding to Shi Suoshu slave units;
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is less than, to be needed to receive the measurement
The sequence number of the slave unit of message, it is determined that the sequence number of slave unit corresponding to the current or last virtual time once updated with it is described
The number and value of slave unit in imaginary time array;And by described and value and need to receive the sequence of the slave unit of the measured message
Number difference, and the fixed duration product as send the measured message when virtual time corresponding to the slave unit
Deviation.
Optionally, the time stamp sampling module 1103, is specifically used for:
According to slave unit sequence number, the transmission measurement response message corresponding to the current or last virtual time once updated
Slave unit sequence number and the fixed duration, it is determined that empty corresponding to the slave unit when receiving the measurement response message
The deviation of pseudotime;Virtual time corresponding to the slave unit and the deviation sum when will receive the measurement response message
As the 4th time point.
Optionally, if the sequence number of slave unit corresponding to the current or last virtual time once updated is not less than described in transmission
The sequence number of the slave unit of response message is measured, then by the sequence number of slave unit corresponding to the current or last virtual time once updated
It is described as receiving with the difference for the sequence number for sending the slave unit for measuring response message, and the product of the fixed duration
The deviation of virtual time corresponding to slave unit when measuring response message;
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is less than, sends the measurement response
The sequence number of the slave unit of message, it is determined that the sequence number of slave unit corresponding to the current or last virtual time once updated with it is described
The number and value of slave unit in imaginary time array;And by it is described and value with send it is described measurement response message slave unit sequence
Number difference, and the fixed duration product as virtual corresponding to slave unit when receiving the measurement response message
The deviation of time.
In specific implementation, the virtual time module 1101 of the embodiment of the present invention can be by FPGA (Field-
Programmable Gate Array, field programmable gate array), ASIC (Application Specific
Integrated Circuit, application specific integrated circuit) realize;
Packet sending and receiving module 1102 can be realized by ethernet PHY (physical layer) chip;
Time stamp sampling module 1103 can be realized by FPGA;
Index computing module 1105 can be realized by FPGA;
Message produces termination block 1106 and realized by FPGA.
As shown in figure 12, the embodiment of the present invention also provides a kind of latency measurement device, and the measurement apparatus is located in main equipment,
Including processor 1201, memory 1202 and transceiver 1203;
Wherein, at least one virtual time synchronized with slave unit is stored with memory 1202, and it is described virtual
Time corresponds with the slave unit for needing to measure;Have program stored therein code in memory 1202, when described program code is located
When managing the execution of device 1201 so that processor 1201 performs following process:
Measured message is sent to slave unit by transceiver 1203;According to the slave unit pair when sending the measured message
The virtual time answered determines to represent the first time point for sending the measured message moment;
The measurement response message of the slave unit return is received by transceiver 1203;Responded according to the measurement is received
Virtual time corresponding to the slave unit determines to represent the 4th time point for receiving the measurement response message moment during message;
In wherein described measurement response message comprising represent the slave unit receive the measured message moment the second time point and
Represent that the slave unit sends the 3rd time point at the measurement response message moment;
Determined according to the first time point, second time point, the 3rd time point and the 4th time point
Virtual time corresponding to the slave unit and the offset of the actual time of the slave unit, if the offset is not more than first
Threshold value, it is determined that virtual time corresponding to the slave unit is synchronous with the actual time of the slave unit;By second time
Point and the One Way Delay of the difference of the first time point as the main equipment to the slave unit, and during by the described 4th
Between point and the One Way Delay of the difference at the 3rd time point as the slave unit to the main equipment;
Processor 1201 is additionally operable to periodically update each virtual time.
Transceiver 1203, for message to be received and sent under the control of processing 1201.
Optionally, if storing virtual time corresponding to multiple slave units in the memory, processor 1201 is additionally operable to:
Virtual time corresponding to the multiple slave unit is formed into virtual time battle array according to the numeric order of each slave unit
Row.
Optionally, processor 1201 is specifically used for:Determine the first poor of second time point and the first time point
Value, and determine second difference at the 4th time point and the 3rd time point;By first difference and described second
The difference of difference, and parameter preset business as the actual time of virtual time corresponding to the slave unit and the slave unit
Offset.
Optionally, processor 1201 is specifically used for:At interval of the update cycle, by the virtual time array it is each from
Virtual time is updated simultaneously corresponding to equipment.
Optionally, processor 1201 is specifically used for:When will send virtual corresponding to the slave unit during measured message
Between be used as the first time point;Virtual time corresponding to the slave unit is as institute when will receive the measurement response message
Stated for the 4th time point.
Optionally, processor 1201 is specifically used for:Within a update cycle, according to the numeric order of each slave unit,
Virtual time corresponding to a slave unit in the virtual time array is updated at interval of fixed duration;Wherein described fixed duration
For the business of the virtual time number included in the update cycle and the virtual time array.
Optionally, processor 1201 is specifically used for:From setting according to corresponding to the current or last virtual time once updated
Standby sequence number, need to receive the sequence number of the slave unit of the measured message and the fixed duration, it is determined that sending the measurement report
The deviation of virtual time corresponding to slave unit when literary;When will send virtual corresponding to the slave unit during measured message
Between and the deviation sum as the first time point.
Optionally, processor 1201 is specifically used for:If slave unit corresponding to the current or last virtual time once updated
Sequence number be not less than need to receive the measured message slave unit sequence number, then by it is current or last once update it is virtual when
Between corresponding slave unit sequence number and need to receive the difference of the sequence number of the slave unit of the measured message, and the fixed duration
Product as send the measured message when virtual time corresponding to the slave unit deviation;
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is less than, to be needed to receive the measurement
The sequence number of the slave unit of message, it is determined that the sequence number of slave unit corresponding to the current or last virtual time once updated with it is described
The number and value of slave unit in imaginary time array;And by described and value and need to receive the sequence of the slave unit of the measured message
Number difference, and the fixed duration product as send the measured message when virtual time corresponding to the slave unit
Deviation.
Optionally, processor 1201 is specifically used for:From setting according to corresponding to the current or last virtual time once updated
Standby sequence number, the sequence number for sending the slave unit for measuring response message and the fixed duration, it is determined that receiving the measurement
The deviation of virtual time corresponding to slave unit during response message;Slave unit when will receive the measurement response message
Corresponding virtual time and the deviation sum are as the 4th time point.
Optionally, processor 1201 is specifically used for:If slave unit corresponding to the current or last virtual time once updated
Sequence number not less than send it is described measurement response message slave unit sequence number, then by it is current or last once update it is virtual when
Between corresponding slave unit slave unit of the sequence number with sending the measurement response message sequence number difference, and the fixed duration
Product as receive it is described measurement response message when virtual time corresponding to the slave unit deviation;
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is less than, sends the measurement response
The sequence number of the slave unit of message, it is determined that the sequence number of slave unit corresponding to the current or last virtual time once updated with it is described
The number and value of slave unit in imaginary time array;And by it is described and value with send it is described measurement response message slave unit sequence
Number difference, and the fixed duration product as virtual corresponding to slave unit when receiving the measurement response message
The deviation of time.
Optionally, processor 1201 can be CPU (centre buries device), ASIC, FPGA or CPLD (Complex
Programmable Logic Device, CPLD).
Based on same inventive concept, a kind of time-delay measuring method is additionally provided in the embodiment of the present invention, due to this method solution
Certainly the principle of problem is similar to above-mentioned latency measurement system, therefore the implementation of this method may refer to the implementation of system, repetition
Place repeats no more.
As shown in figure 13, time-delay measuring method of the embodiment of the present invention includes:
Step 1301, main equipment send measured message to slave unit, and from setting according to when sending the measured message
Standby corresponding virtual time determines to represent the first time point for sending the measured message moment;
Step 1302, the main equipment receive the measurement response message that the slave unit returns, and according to receiving
Virtual time corresponding to the slave unit determines to represent to receive the of the measurement response message moment when measuring response message
Four time points;In wherein described measurement response message the second of the measured message moment is received comprising the expression slave unit
Time point and the 3rd time point for representing the slave unit transmission measurement response message moment;
Step 1303, the main equipment according to the first time point, second time point, the 3rd time point and
4th time point determines virtual time corresponding to the slave unit and the offset of the actual time of the slave unit, if institute
State offset and be not more than first threshold, it is determined that virtual time corresponding to the slave unit and the actual time of the slave unit are same
Step;And using the difference of second time point and the first time point as the main equipment to the slave unit it is unidirectional when
Prolong, and using the difference at the 4th time point and the 3rd time point as the slave unit to the unidirectional of the main equipment
Time delay;
Wherein, store at least one virtual time for being synchronized with slave unit in main equipment, and it is described virtual when
Between with needing the slave unit that measures to correspond;Main equipment periodically updates each virtual time.
Optionally, this method also includes:
If the offset is more than the first threshold, the main equipment is corresponding to the slave unit according to the offset
Virtual time modify, and return to the main equipment to slave unit send measured message the step of.
Optionally, the main equipment is according to the first time point, second time point, the 3rd time point and institute
The offset that the 4th time point determined the actual time of virtual time corresponding to the slave unit and the slave unit is stated, including:
The main equipment determines first difference at second time point and the first time point, and determines described the
Four time points and second difference at the 3rd time point;
The main equipment by the difference of first difference and second difference, and parameter preset business be used as it is described from
Virtual time corresponding to equipment and the offset of the actual time of the slave unit.
Optionally, if virtual time, the main equipment corresponding to the multiple slave units for needing to measure of main equipment storage
Virtual time corresponding to the multiple slave unit is formed into virtual time array according to the numeric order of each slave unit.
Optionally, the main equipment periodically updates each virtual time, including:
The main equipment, will be empty corresponding to each slave unit in the virtual time array at interval of the update cycle
Pseudotime is updated simultaneously.
Optionally, main equipment virtual time according to corresponding to slave unit when sending the measured message determines table
Show the first time point for sending the measured message moment, including:
When the main equipment will send that virtual time is as described first corresponding to the slave unit during measured message
Between point;
Main equipment virtual time according to corresponding to slave unit when receiving the measurement response message determines table
Show the 4th time point for receiving the measurement response message moment, including:
Described in virtual time corresponding to the slave unit is used as when the main equipment will receive the measurement response message
4th time point.
Optionally, the main equipment periodically updates each virtual time, including:
Within a update cycle, the main equipment according to each slave unit numeric order, at interval of fixed duration more
Virtual time corresponding to a slave unit in the new virtual time array;When wherein described fixed a length of update cycle with
The business of the virtual time number included in the virtual time array.
Optionally, main equipment virtual time according to corresponding to slave unit when sending the measured message determines table
Show the first time point for sending the measured message moment, including:
The main equipment according to corresponding to the current or last virtual time once updated slave unit sequence number, need receive institute
The sequence number of the slave unit of measured message and the fixed duration are stated, it is determined that the slave unit is corresponding when sending the measured message
Virtual time deviation;
The main equipment will send virtual time corresponding to the slave unit and the deviation sum during measured message
As the first time point.
Optionally, main equipment slave unit sequence number, need according to corresponding to the current or last virtual time once updated
Receive the sequence number of the slave unit of the measured message and the fixed duration, it is determined that described in when sending the measured message from
The deviation of virtual time corresponding to equipment, including:
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is not less than, to be needed to receive the survey
The sequence number of the slave unit of message is measured, then the main equipment is by slave unit corresponding to the current or last virtual time once updated
Sequence number receives the difference of the sequence number of the slave unit of the measured message with needing, and the product of the fixed duration is used as transmission institute
State the deviation of virtual time corresponding to slave unit during measured message;
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is less than, to be needed to receive the measurement
The sequence number of the slave unit of message, then the main equipment determine slave unit corresponding to the current or last virtual time once updated
The number and value of sequence number and slave unit in the imaginary time array;And by described and value and need to receive the measured message
The difference of the sequence number of slave unit, and the product of the fixed duration are used as when sending the measured message corresponding to the slave unit
The deviation of virtual time.
Optionally, when the main equipment root is virtual according to corresponding to slave unit when receiving the measurement response message
Between determine represent receive it is described measurement the response message moment the 4th time point, including:
The main equipment slave unit sequence number, transmission survey according to corresponding to the current or last virtual time once updated
The sequence number of the slave unit of response message and the fixed duration are measured, it is determined that from setting described in when receiving the measurement response message
The deviation of standby corresponding virtual time;
The main equipment will receive it is described measurement response message when virtual time corresponding to the slave unit with it is described partially
Poor sum is as the 4th time point.
Optionally, main equipment slave unit sequence number, hair according to corresponding to the current or last virtual time once updated
The sequence number of the slave unit of the measurement response message and the fixed duration are sent, it is determined that when receiving the measurement response message
The deviation of virtual time corresponding to the slave unit, including:
If the sequence number of slave unit corresponding to the current or last virtual time once updated is rung not less than the measurement is sent
The sequence number of the slave unit of message is answered, then the main equipment is by slave unit corresponding to the current or last virtual time once updated
The difference of the sequence number of slave unit of the sequence number with sending the measurement response message, and the product conduct of the fixed duration receive
The deviation of virtual time corresponding to the slave unit during measurement response message;
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is less than, sends the measurement response
The sequence number of the slave unit of message, then the main equipment determine slave unit corresponding to the current or last virtual time once updated
The number and value of sequence number and slave unit in the imaginary time array;And by described and value with sending the measurement response message
The difference of the sequence number of slave unit, and the product of the fixed duration are used as slave unit when receiving the measurement response message
The deviation of corresponding virtual time.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or computer program
Product.Therefore, the present invention can use the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Apply the form of example.Moreover, the present invention can use the computer for wherein including computer usable program code in one or more
The computer program production that usable storage medium is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram
Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided
The processors of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real
The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which produces, to be included referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, so as in computer or
The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in individual square frame or multiple square frames.
Although preferred embodiments of the present invention have been described, but those skilled in the art once know basic creation
Property concept, then can make other change and modification to these embodiments.So appended claims be intended to be construed to include it is excellent
Select embodiment and fall into having altered and changing for the scope of the invention.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the present invention to the present invention
God and scope.So, if these modifications and variations of the present invention belong to the scope of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to comprising including these changes and modification.
Claims (22)
1. a kind of time-delay measuring method, it is characterised in that stored in main equipment and at least one be used to synchronize with slave unit
Virtual time, and the virtual time corresponds with the slave unit for needing to measure;The main equipment periodically renewal is each
Virtual time, this method include:
Main equipment to slave unit send measured message, and according to send the measured message when slave unit corresponding to it is virtual when
Between determine to represent the first time point for sending measured message moment;
The main equipment receives the measurement response message that the slave unit returns, and during according to receiving the measurement response message
Virtual time corresponding to the slave unit determines to represent the 4th time point for receiving the measurement response message moment;Wherein institute
State and receive second time point at the measured message moment comprising the expression slave unit in measurement response message and represent institute
State the 3rd time point that slave unit sends the measurement response message moment;
The main equipment is according to the first time point, second time point, the 3rd time point and the 4th time
Point determines virtual time corresponding to the slave unit and the offset of the actual time of the slave unit, if the offset is little
In first threshold, it is determined that virtual time corresponding to the slave unit is synchronous with the actual time of the slave unit;And by described in
One Way Delay of the difference of second time point and the first time point as the main equipment to the slave unit, and by institute
State the 4th time point and One Way Delay of the difference at the 3rd time point as the slave unit to the main equipment.
2. the method as described in claim 1, it is characterised in that this method also includes:
If the offset is more than the first threshold, the main equipment is according to the offset to empty corresponding to the slave unit
Pseudotime modifies, and returns to the step of main equipment is to slave unit transmission measured message.
3. the method as described in claim 1, it is characterised in that the main equipment is according to the first time point, described second
Time point, the 3rd time point and the 4th time point determine virtual time corresponding to the slave unit and the slave unit
Actual time offset, including:
The main equipment determines first difference at second time point and the first time point, and during determination the described 4th
Between point and the 3rd time point the second difference;
The main equipment by the difference of first difference and second difference, and parameter preset business as the slave unit
Corresponding virtual time and the offset of the actual time of the slave unit.
4. the method as described in claim 1, it is characterised in that if the main equipment stores virtual corresponding to multiple slave units
Between, when virtual time corresponding to the multiple slave unit is formed virtual by the main equipment according to the numeric order of each slave unit
Between array.
5. method as claimed in claim 4, it is characterised in that the main equipment periodically updates each virtual time, bag
Include:
The main equipment is same by virtual time corresponding to each slave unit in the virtual time array at interval of the update cycle
When be updated.
6. method as claimed in claim 5, it is characterised in that the main equipment according to send the measured message when described in from
Virtual time corresponding to equipment determines that expression sends the first time point at the measured message moment, including:
The main equipment will send during the measured message virtual time corresponding to the slave unit as the first time point;
Main equipment virtual time according to corresponding to slave unit when receiving the measurement response message determines that expression connects
The 4th time point at the measurement response message moment is received, including:
Virtual time corresponding to the slave unit is as the described 4th when the main equipment will receive the measurement response message
Time point.
7. method as claimed in claim 4, it is characterised in that the main equipment is periodically updated corresponding to each slave unit
Virtual time, including:
Within a update cycle, the main equipment updates institute according to the numeric order of each slave unit at interval of fixed duration
State virtual time corresponding to a slave unit in virtual time array;When wherein described fixed a length of update cycle with it is described
The business of the virtual time number included in virtual time array.
8. method as claimed in claim 7, it is characterised in that the main equipment according to send the measured message when described in from
Virtual time corresponding to equipment determines that expression sends the first time point at the measured message moment, including:
The main equipment according to corresponding to the current or last virtual time once updated slave unit sequence number, need to receive the survey
The sequence number of the slave unit of message and the fixed duration are measured, it is determined that empty corresponding to the slave unit when sending the measured message
The deviation of pseudotime;
The main equipment will send virtual time corresponding to the slave unit and the deviation sum conduct during measured message
The first time point.
9. method as claimed in claim 8, it is characterised in that the main equipment according to it is current or last once update it is virtual
Slave unit sequence number corresponding to time, need to receive the sequence number of the slave unit of the measured message and the fixed duration, it is determined that
The deviation of virtual time corresponding to the slave unit during measured message is sent, including:
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is not less than, to be needed to receive the measurement report
The sequence number of the slave unit of text, then the main equipment is by the sequence number of slave unit corresponding to the current or last virtual time once updated
With the difference of the sequence number of the slave unit that needs to receive the measured message, and the fixed duration product as sending the survey
The deviation of virtual time corresponding to slave unit when measuring message;
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is less than, to be needed to receive the measured message
Slave unit sequence number, then the main equipment determine the sequence number of slave unit corresponding to the current or last virtual time once updated
With the number and value of slave unit in the imaginary time array;And by described and value with need to receive the measured message from setting
The difference of standby sequence number, and the fixed duration product as virtual corresponding to slave unit when sending the measured message
The deviation of time.
10. method as claimed in claim 7, it is characterised in that the main equipment root is reported according to the measurement response is received
Virtual time corresponding to the slave unit determines to represent the 4th time point for receiving the measurement response message moment, bag when literary
Include:
The main equipment slave unit sequence number, transmission measurement according to corresponding to the current or last virtual time once updated ring
The sequence number of the slave unit of message and the fixed duration are answered, it is determined that the slave unit pair when receiving the measurement response message
The deviation for the virtual time answered;
The main equipment will receive it is described measurement response message when virtual time corresponding to the slave unit and the deviation it
With as the 4th time point.
11. method as claimed in claim 10, it is characterised in that the main equipment is according to the current or last void once updated
Slave unit sequence number, the sequence number for sending the slave unit for measuring response message and the fixed duration corresponding to pseudotime, really
The deviation of virtual time corresponding to slave unit when receiving the measurement response message surely, including:
If the sequence number of slave unit corresponding to the current or last virtual time once updated is reported not less than the measurement response is sent
The sequence number of the slave unit of text, then the main equipment is by the sequence number of slave unit corresponding to the current or last virtual time once updated
It is described as receiving with the difference for the sequence number for sending the slave unit for measuring response message, and the product of the fixed duration
The deviation of virtual time corresponding to slave unit when measuring response message;
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is less than, sends the measurement response message
Slave unit sequence number, then the main equipment determine the sequence number of slave unit corresponding to the current or last virtual time once updated
With the number and value of slave unit in the imaginary time array;And by described and value with send the measurement response message from setting
The difference of standby sequence number, and the product of the fixed duration are corresponding as slave unit when receiving the measurement response message
Virtual time deviation.
12. a kind of latency measurement device, it is characterised in that described device includes virtual time module, packet sending and receiving module, time stamp
Sampling module, synchronous calculating filtration module, index computing module;At least one be used for is stored in wherein described virtual time module
The virtual time synchronized with slave unit, and the virtual time corresponds with the slave unit for needing to measure;It is described virtual
Time module is used to periodically update each virtual time;
The packet sending and receiving module sends measured message to slave unit;The time stamp sampling module is used for according to the transmission measurement
Virtual time corresponding to the slave unit determines to represent the first time point for sending the measured message moment during message;
The packet sending and receiving module is additionally operable to receive the measurement response message that the slave unit returns;The time stamp sampling module is also
For determining that expression receives the survey according to virtual time corresponding to slave unit when receiving the measurement response message
Measure the 4th time point at response message moment;Received in wherein described measurement response message comprising the expression slave unit described
Second time point at measured message moment and the 3rd time point for representing the slave unit transmission measurement response message moment;
The synchronous filtration module that calculates was used for according to the first time point, second time point, the 3rd time point
Virtual time corresponding to the slave unit and the offset of the actual time of the slave unit are determined with the 4th time point, if
The offset is not more than first threshold, it is determined that virtual time corresponding to the slave unit and the actual time of the slave unit
It is synchronous;The index computing module is used for using the difference of second time point and the first time point as the main equipment
To the One Way Delay of the slave unit, and using the difference at the 4th time point and the 3rd time point as described from setting
The standby One Way Delay for arriving the main equipment.
13. device as claimed in claim 12, it is characterised in that the synchronous filtration module that calculates is additionally operable to:
If the offset is more than the first threshold, virtual time corresponding to the slave unit is carried out according to the offset
Modification, and return to the step of main equipment is to slave unit transmission measured message.
14. device as claimed in claim 12, it is characterised in that the synchronous filtration module that calculates is specifically used for:
Determine first difference at second time point and the first time point, and determine the 4th time point and described
Second difference at the 3rd time point;By the difference of first difference and second difference, and parameter preset business as institute
State virtual time corresponding to slave unit and the offset of the actual time of the slave unit.
15. device as claimed in claim 12, it is characterised in that if the virtual time module stores multiple slave units and corresponded to
Virtual time, the synchronous filtration module that calculates is additionally operable to:
Virtual time corresponding to the multiple slave unit is formed into virtual time array according to the numeric order of each slave unit.
16. device as claimed in claim 15, it is characterised in that the synchronous calculating filtration module, be specifically used for:
At interval of the update cycle, virtual time corresponding to each slave unit in the virtual time array is carried out more simultaneously
Newly.
17. device as claimed in claim 16, it is characterised in that the time stamp sampling module, be specifically used for:
Virtual time corresponding to the slave unit will be sent during the measured message as the first time point;
The time stamp sampling module, is specifically used for:
Virtual time corresponding to the slave unit is as the 4th time point when will receive the measurement response message.
18. device as claimed in claim 15, it is characterised in that the synchronous calculating filtration module, be specifically used for:
Within a update cycle, according to the numeric order of each slave unit, the virtual time is updated at interval of fixed duration
Virtual time corresponding to a slave unit in array;A length of update cycle and the virtual time battle array when wherein described fixed
The business of the virtual time number included in row.
19. device as claimed in claim 18, it is characterised in that the time stamp sampling module, be specifically used for:
According to slave unit sequence number corresponding to the current or last virtual time once updated, need to receive the measured message from
The sequence number of equipment and the fixed duration, it is determined that when sending the measured message virtual time corresponding to the slave unit it is inclined
Difference;Virtual time corresponding to the slave unit and the deviation sum will be sent during the measured message as the very first time
Point.
20. device as claimed in claim 19, it is characterised in that the time stamp sampling module, be specifically used for:
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is not less than, to be needed to receive the measurement report
The sequence number of the slave unit of text, then receive the sequence number of slave unit corresponding to the current or last virtual time once updated with needing
The difference of the sequence number of the slave unit of the measured message, and the product of the fixed duration are used as transmission measured message when institute
State the deviation of virtual time corresponding to slave unit;
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is less than, to be needed to receive the measured message
Slave unit sequence number, it is determined that the sequence number of slave unit corresponding to the current or last virtual time once updated with it is described empty when
Between in array slave unit number and value;And by described and value and need to receive the sequence number of the slave unit of the measured message
Difference, and the fixed duration product as send the measured message when virtual time corresponding to the slave unit it is inclined
Difference.
21. device as claimed in claim 18, it is characterised in that the time stamp sampling module, be specifically used for:
According to slave unit sequence number corresponding to the current or last virtual time once updated, send the measurement response message from
The sequence number of equipment and the fixed duration, it is determined that when virtual corresponding to the slave unit when receiving the measurement response message
Between deviation;Virtual time corresponding to the slave unit and the deviation sum conduct when will receive the measurement response message
4th time point.
22. device as claimed in claim 21, it is characterised in that the time stamp sampling module, be specifically used for:
If the sequence number of slave unit corresponding to the current or last virtual time once updated is reported not less than the measurement response is sent
The sequence number of the slave unit of text, then by described in the sequence number of slave unit corresponding to the current or last virtual time once updated and transmission
The difference of the sequence number of the slave unit of response message is measured, and the product of the fixed duration is reported as the measurement response is received
The deviation of virtual time corresponding to slave unit when literary;
If the sequence number of slave unit corresponding to the current or last virtual time once updated, which is less than, sends the measurement response message
Slave unit sequence number, it is determined that the sequence number of slave unit corresponding to the current or last virtual time once updated with it is described empty when
Between in array slave unit number and value;And by the sequence number of described and value and the slave unit for sending the measurement response message
Difference, and the product of the fixed duration are used as virtual time corresponding to slave unit when receiving the measurement response message
Deviation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710666460.1A CN107360060B (en) | 2017-08-07 | 2017-08-07 | Time delay measuring method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710666460.1A CN107360060B (en) | 2017-08-07 | 2017-08-07 | Time delay measuring method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107360060A true CN107360060A (en) | 2017-11-17 |
CN107360060B CN107360060B (en) | 2020-04-10 |
Family
ID=60286992
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710666460.1A Active CN107360060B (en) | 2017-08-07 | 2017-08-07 | Time delay measuring method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107360060B (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108768576A (en) * | 2018-06-29 | 2018-11-06 | 广东星舆科技有限公司 | A kind of method and device obtaining sensor precise synchronization data |
CN109450582A (en) * | 2018-11-01 | 2019-03-08 | 百度在线网络技术(北京)有限公司 | Sensor time stabs synchronous detecting method, device, equipment, medium and vehicle |
CN109462453A (en) * | 2018-11-22 | 2019-03-12 | 电信科学技术第五研究所有限公司 | A kind of high-precision time synchronization method based on fiber optic network |
CN109815102A (en) * | 2019-01-21 | 2019-05-28 | 武汉斗鱼鱼乐网络科技有限公司 | A kind of test data statistical method, device and storage medium |
CN110572233A (en) * | 2019-09-20 | 2019-12-13 | 上海东土远景工业科技有限公司 | time keeping method and device using NTP (network time protocol) as auxiliary source |
CN111490843A (en) * | 2020-04-03 | 2020-08-04 | 腾讯科技(深圳)有限公司 | Time checking method and device, computer equipment and storage medium |
CN112752119A (en) * | 2019-10-31 | 2021-05-04 | 中兴通讯股份有限公司 | Time delay error correction method, terminal equipment, server and storage medium |
CN113157046A (en) * | 2021-03-25 | 2021-07-23 | 山东英信计算机技术有限公司 | Method, device and system for managing server BMC time |
WO2022042748A1 (en) * | 2020-08-31 | 2022-03-03 | 华为技术有限公司 | Method and device |
WO2022247463A1 (en) * | 2021-05-28 | 2022-12-01 | 中国移动通信有限公司研究院 | Delay measurement method and apparatus, and digital twin network |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060056563A1 (en) * | 2004-09-13 | 2006-03-16 | Nortel Networks Limited | Method and apparatus for synchronizing clock timing between network elements |
CN1960242A (en) * | 2006-10-17 | 2007-05-09 | 中控科技集团有限公司 | Method, device, system for implementing clock synchronization, and distribution system |
CN101399653A (en) * | 2007-09-25 | 2009-04-01 | 普然通讯技术(上海)有限公司 | Time clock synchronization implementation method |
CN102265549A (en) * | 2008-09-22 | 2011-11-30 | 柯扎特·拉多·拉多莱斯库 | Network Time Synchronization System |
CN102742190A (en) * | 2012-02-01 | 2012-10-17 | 华为技术有限公司 | Synchronization method, device, and system |
CN105794130A (en) * | 2013-12-09 | 2016-07-20 | 哈利法科学技术研究大学 | Method and apparatus for synchronization using linear programming |
-
2017
- 2017-08-07 CN CN201710666460.1A patent/CN107360060B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060056563A1 (en) * | 2004-09-13 | 2006-03-16 | Nortel Networks Limited | Method and apparatus for synchronizing clock timing between network elements |
CN1960242A (en) * | 2006-10-17 | 2007-05-09 | 中控科技集团有限公司 | Method, device, system for implementing clock synchronization, and distribution system |
CN101399653A (en) * | 2007-09-25 | 2009-04-01 | 普然通讯技术(上海)有限公司 | Time clock synchronization implementation method |
CN102265549A (en) * | 2008-09-22 | 2011-11-30 | 柯扎特·拉多·拉多莱斯库 | Network Time Synchronization System |
CN102742190A (en) * | 2012-02-01 | 2012-10-17 | 华为技术有限公司 | Synchronization method, device, and system |
CN105794130A (en) * | 2013-12-09 | 2016-07-20 | 哈利法科学技术研究大学 | Method and apparatus for synchronization using linear programming |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108768576A (en) * | 2018-06-29 | 2018-11-06 | 广东星舆科技有限公司 | A kind of method and device obtaining sensor precise synchronization data |
CN109450582A (en) * | 2018-11-01 | 2019-03-08 | 百度在线网络技术(北京)有限公司 | Sensor time stabs synchronous detecting method, device, equipment, medium and vehicle |
CN109462453A (en) * | 2018-11-22 | 2019-03-12 | 电信科学技术第五研究所有限公司 | A kind of high-precision time synchronization method based on fiber optic network |
CN109815102A (en) * | 2019-01-21 | 2019-05-28 | 武汉斗鱼鱼乐网络科技有限公司 | A kind of test data statistical method, device and storage medium |
CN109815102B (en) * | 2019-01-21 | 2022-10-11 | 武汉斗鱼鱼乐网络科技有限公司 | Test data statistical method, device and storage medium |
CN110572233A (en) * | 2019-09-20 | 2019-12-13 | 上海东土远景工业科技有限公司 | time keeping method and device using NTP (network time protocol) as auxiliary source |
CN112752119A (en) * | 2019-10-31 | 2021-05-04 | 中兴通讯股份有限公司 | Time delay error correction method, terminal equipment, server and storage medium |
CN112752119B (en) * | 2019-10-31 | 2023-12-01 | 中兴通讯股份有限公司 | Delay error correction method, terminal equipment, server and storage medium |
CN111490843A (en) * | 2020-04-03 | 2020-08-04 | 腾讯科技(深圳)有限公司 | Time checking method and device, computer equipment and storage medium |
WO2022042748A1 (en) * | 2020-08-31 | 2022-03-03 | 华为技术有限公司 | Method and device |
CN114726658A (en) * | 2020-08-31 | 2022-07-08 | 华为技术有限公司 | A method and apparatus |
CN114726658B (en) * | 2020-08-31 | 2023-04-11 | 华为技术有限公司 | Method and device for measuring time deviation |
CN113157046A (en) * | 2021-03-25 | 2021-07-23 | 山东英信计算机技术有限公司 | Method, device and system for managing server BMC time |
CN113157046B (en) * | 2021-03-25 | 2023-03-28 | 山东英信计算机技术有限公司 | Method, device and system for managing server BMC time |
WO2022247463A1 (en) * | 2021-05-28 | 2022-12-01 | 中国移动通信有限公司研究院 | Delay measurement method and apparatus, and digital twin network |
Also Published As
Publication number | Publication date |
---|---|
CN107360060B (en) | 2020-04-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107360060A (en) | A kind of time-delay measuring method and device | |
CN103067112B (en) | Clock synchronizing method, device and the network equipment | |
CN108259109B (en) | Network equipment in PTP domain and TOD synchronization method | |
CN103248471B (en) | Clock synchronizing method based on PTP protocol Yu Reflective memory network | |
CN103368721A (en) | Computing method for transparent clock in time-triggered Ethernet | |
CN103929293A (en) | Asymmetric delay time synchronization method and system | |
CN106603183A (en) | Timestamp filtering method and device | |
US20150163154A1 (en) | Method and devices for packet selection | |
CN108872910B (en) | A timing system and method for on-line verification of power quality monitoring device | |
CN104660359A (en) | Clock frequency offset detection method, device and equipment | |
CN109921871A (en) | A kind of method for synchronizing time, device and network system | |
CN102171966B (en) | Method and apparatus for simulating packet delay jitter in current network | |
CN109257133A (en) | A kind of the whole network clock synchronizing method and device applied to LTE rail transit network | |
CN115801175A (en) | Time frequency synchronization method, system, storage medium and electronic device | |
CN108683472A (en) | A kind of clock synchronizing method based on Time delay measurement | |
CN105553593A (en) | SDH (Synchronous Digital Hierarchy)-based multi-time source PTP (Precision Time Protocol) data synchronization and time monitoring system | |
CN106877967A (en) | IEEE1588 transparent clock residence time measuring methods and its device | |
CN107491366A (en) | Export clock generation method and device | |
Pandey et al. | Analysis and design of precision time protocol system based on IEEE1588 standards | |
CN108075853A (en) | A kind of method for synchronizing network time between Helicopter Simulator development system | |
CN106788841A (en) | Synchronous net on-line monitoring system | |
CN205051702U (en) | Wireless ethernet synchronizer of whole us level precision of intelligent substation | |
WO2022247463A1 (en) | Delay measurement method and apparatus, and digital twin network | |
CN109257243A (en) | A kind of round-trip delay determines method, apparatus and computer readable storage medium | |
CN103684730A (en) | Time synchronization method |
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 | ||
CB02 | Change of applicant information |
Address after: 100094 First to Fifth Floors of Building 11, East Yard, No. 10 Wangdong Road, Northwest Haidian District, Beijing Applicant after: Raisecom Technology Inc. Address before: 100085 No. 2 Building, No. 28 Shangdi Sixth Street, Haidian District, Beijing Applicant before: Raisecom Technology Inc. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |