WO2012012999A1 - Method and apparatus for clock recovery based on time stamps - Google Patents

Method and apparatus for clock recovery based on time stamps Download PDF

Info

Publication number
WO2012012999A1
WO2012012999A1 PCT/CN2010/080020 CN2010080020W WO2012012999A1 WO 2012012999 A1 WO2012012999 A1 WO 2012012999A1 CN 2010080020 W CN2010080020 W CN 2010080020W WO 2012012999 A1 WO2012012999 A1 WO 2012012999A1
Authority
WO
WIPO (PCT)
Prior art keywords
packet
service data
tdm service
clock frequency
message
Prior art date
Application number
PCT/CN2010/080020
Other languages
French (fr)
Chinese (zh)
Inventor
曾名志
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012012999A1 publication Critical patent/WO2012012999A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0664Clock or time synchronisation among packet nodes using timestamps unidirectional timestamps

Definitions

  • the present invention relates to the field of circuit simulation technology for Time Division Multiplexing (TDM) service data in the field of communications, and in particular to a time stamp based clock recovery method and apparatus.
  • TDM Time Division Multiplexing
  • TDM services are a common service in the communications field, such as voice calls. Renting a TDM leased line for TDM service transmission usually requires expensive costs and low resource utilization.
  • TDM services are now usually grouped and encapsulated into edge-to-edge pseudowire simulations by circuit simulation technology (PWE3, Pseudo Wire Emulation Edge). -to-Edge ) The message is transmitted on the Packet Transport Network (PTN).
  • PWE3 Packet Transport Network
  • the TDM service When the TDM service is transmitted in the packet transport network, it must keep the clock frequency at the entrance and exit synchronized. Otherwise, due to the long-term misalignment of the frequency at the entrance and exit, the data buffer at the exit overflows or reads empty, which leads to Data loss and service degradation. Since the current packet transmission technology does not support the transmission of the clock frequency information of the TDM service transmitting end in the packet, the service clock frequency recovery needs to be performed at the receiving end.
  • the first two need to have a high-precision common reference clock at both the TDM transmitter and the receiver, which cannot be satisfied in the currently widely used packet transport network.
  • the adaptive clock recovery method extracts relevant information according to the TDM service data received by the receiving end, and restores the service clock through feedback adjustment, which is more suitable for the current packet transmission network.
  • the adaptive clock recovery method can be mainly divided into two types according to the usage information: An adaptive clock recovery method based on cache fill level, and another is a time stamp based adaptive clock recovery method.
  • the adaptive clock recovery method based on the cache fill level measures the difference between the clock frequencies of the sender and the receiver according to the buffer fill level of the receiver, and adjusts the frequency of the receiver to synchronize with the service clock of the sender.
  • the time-stamp-based adaptive clock recovery method is: transmitting, at the transmitting end, a packet containing a TDM service, and acquiring a transmission time stamp of the packet, encapsulating it in a packet, and transmitting the packet to the receiving end through the packet transmission network.
  • the sending time stamp information of the transmitting end is extracted, and compared with the local receiving time stamp, the clock frequency of the receiving end is adjusted according to the difference between the sending time stamp and the receiving time stamp to synchronize with the sending end service clock.
  • the technical problem to be solved by the present invention is to provide a time stamp based clock recovery method and device. During the clock recovery process, the frequency of the transmitting end can be suddenly changed, and the transmitting frequency of the transmitting end can be quickly locked.
  • the present invention provides the following solutions:
  • a time stamp based clock recovery method comprising:
  • the receiving end receives the packet packet from the packet transport network and sometimes multiplexes the TDM service data, and records the receiving time stamp of the packet packet; the packet delay deviation transmitted in the sending network, calculates and updates the clock frequency of the receiving end .
  • the method for recovering the clock further includes: receiving, by the receiving end, TDM service data from the received packet message and buffering, and extracting a sending time stamp carried in a header of each packet message;
  • the clock frequency of the terminal includes: a first difference between the sending time stamps of the two adjacent packet messages received by the receiving end, and the previous one of the two adjacent packet messages in the read buffer
  • the first clock frequency of the first TDM service data, and the packet delay deviation of the packet data transmitted in the packet transport network are calculated for reading the adjacent two packets in the buffer "the next one of the texts" ⁇ a second clock frequency of the second TDM service data, where the second clock frequency is a second between the actual read time of the second TDM service data and the actual read time of the first TDM service data
  • the calculating, by the second clock frequency, the second clock frequency of the second TDM service data of the next one of the two adjacent packet messages in the cache is further calculated according to the following formula + ⁇ : r ⁇ n+l
  • is the packet delay deviation of the packet message transmitted in the packet transmission network, which is the reception time stamp of the "+1, 1" packet, respectively, d, ⁇ is the transmission time stamp of the first " + 1, " group of texts;
  • the method further includes: the receiving end reads the second TDM service data from the cache at the second clock frequency and sends the data to the TDM circuit.
  • the calculating, by the second clock frequency, the second TDM service data for reading the second TDM service data of the next one of the two adjacent packet messages in the cache further comprising: receiving When the received packet packet is out of order or lost, the clock frequency of the TDM service data used for reading the cache is kept unchanged, and the clock frequency is used to read the TDM service data in the buffer. Until the disorder or packet loss disappears.
  • the receiving end reads the second TDM service data from the cache by using the second clock frequency, and the receiving end further extracts the message sequence number from the header of each packet message. And packet length information, where the packet length information is a length of the TDM service data encapsulated in the packet packet;
  • the receiving end determines the neighbor relationship between the packet messages according to the message sequence number, and determines the location of the second TDM service data in the cache according to the packet length information, and reads the number from the cache.
  • the data corresponding to the two TDM service data is the same.
  • the invention also provides a time stamp based clock recovery device, comprising:
  • a message receiving module configured to receive a packet packet encapsulated with TDM service data from a packet transmission network, and record a reception time stamp of the packet; and a packet delay deviation transmitted by the packet in the packet transmission network , Calculate and update the clock frequency of the receiver.
  • the clock recovery device further includes: a storage processing module, configured to extract TDM service data from the packet message received by the message receiving module, and cache, and extract a packet carried in a header of each packet message Transmitting a time stamp;
  • the clock calculation module includes: a clock recovery module, configured to: according to a first difference of a transmission time stamp between two adjacent packet messages, used to read the adjacent two in the cache The first clock frequency of the first TDM service data of the previous message in the packet message, and the packet delay deviation of the packet transmission in the packet transport network, calculated for reading the neighbor in the buffer a second clock frequency of the second TDM service data of the subsequent one of the two packet messages, wherein the second clock frequency causes the second TDM service number
  • the second difference between the actual readout time and the actual readout time of the first TDM service data is equal to the sum of the first difference and the packet delay deviation.
  • the clock recovery module is further configured to calculate, according to the following formula, the reading formula when the two adjacent packet messages are the first "+" group message
  • ⁇ ⁇ , nl , nk , nkl ⁇
  • the clock recovery device further includes: a reading module, configured to read from the cache at the second clock frequency, wherein the receiving time stamp of the one packet message is a predetermined positive number.
  • the second TDM service data is described and sent to the TDM circuit.
  • the reading module is further configured to: when the received packet packet is out of order or lost, keep the last calculated TDM service data for reading the cache.
  • the clock frequency is unchanged, and the clock frequency is used to read the TDM service data in the cache until the out-of-order or packet loss phenomenon disappears.
  • the storage processing module is further configured to extract a message sequence number and packet length information from a header of each packet packet, where the packet length information is a length of the TDM service data encapsulated in the packet packet.
  • the clock recovery module is further configured to determine, between the packet messages, according to the message sequence number Adjacent relationship
  • the reading module is further configured to determine, according to the packet length information, a location of the second TDM service data in a cache, and read data corresponding to the second TDM service data from a cache.
  • the time-stamp-based clock recovery method and apparatus considers the payload TMD service payload packet interval in the clock recovery process, so that the receiving end can change according to the packet interval, and the transmitting end The frequency changes abruptly to track and quickly lock.
  • the present invention also takes into account the PDV in clock recovery, thereby reducing the adverse effects of PDV on clock recovery.
  • the present invention also learns to keep the recovered read clock frequency unchanged for packet loss and out-of-order situations. After the message is received normally, the clock recovery is performed according to the corresponding clock recovery algorithm, thereby being able to reduce The impact of small packet loss and out-of-order on the receiving end.
  • Figure 1 is a schematic diagram of the main idea of the present invention
  • FIG. 2 is a schematic flowchart of a time-stamp-based clock recovery method according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of a situation in which a sending end sends a timestamp according to an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of another clock recovery apparatus according to an embodiment of the present invention
  • FIG. 6 is a detailed circuit module of a time stamp based clock recovery apparatus according to an embodiment of the present invention
  • the present invention provides a time stamp based clock recovery method and apparatus, which can perform a fast response when a transmission frequency changes at a transmitting end during a clock recovery process. Moreover, the present invention further adopts a strategy of keeping the clock frequency constant in the case of packet loss and out-of-order in the packet packet transmission process, so that the impact of packet loss and out-of-order conditions on the frequency recovery algorithm is greatly reduced.
  • the present invention will be further described by way of specific embodiments with reference to the accompanying drawings.
  • the main idea of the present invention is to regard the transmitting end, the receiving end and the PTN network as a "black box" (as shown in FIG. 1), and keep the TDM service payload packet interval at the transmitting end equal to the ideal packet sending interval at the receiving end. Then, the TDM service clock frequency of the transmitting end can be faithfully restored at the receiving end.
  • the sender TDM service payload packet interval may be characterized by the difference of the transmission time stamp carried in the packet message, and the ideal packet transmission interval of the receiver may use the ideal read interval of the TDM service data of the packet packet in the buffer. To characterize.
  • the receiving end receives a packet from the packet transport network that encapsulates the TDM service data, and records the received time stamp of the packet.
  • the clock frequency of the receiving end is calculated and updated according to the transmission time difference between two adjacent packet messages and the packet delay deviation of the packet message transmitted in the packet transmission network.
  • the transmission time difference of the packet packet of the transmitting end and the packet delay deviation of the packet packet are considered, so that the receiving end can change according to the packet spacing of the transmitting end, The frequency of the transmitting end suddenly changes to track and quickly lock, and can reduce the adverse effect of d and packet delay deviation on clock recovery.
  • the difference is used to characterize.
  • the time stamp based clock recovery method includes the following steps:
  • Step 21 The receiving end receives the packet message encapsulated with the TDM service data from the packet transmission network, and records the receiving time stamp of the packet message.
  • the receiving time stamp refers to the time when the packet message enters the receiving end.
  • Step 22 The receiving end extracts and buffers the TDM service data from the received packet message, and extracts a sending time stamp carried in the header of each packet message.
  • Step 23 The first end of the sending time stamp according to the sending time stamp between the two adjacent packet messages, and the first end of the previous one of the two adjacent packet messages in the buffer TDM industry
  • the first clock frequency of the data, and the packet delay deviation of the packet transmitted in the packet transport network, and the number of the next one of the adjacent two packet messages in the read buffer is calculated.
  • a second clock frequency of the second TDM service data wherein the second clock frequency causes the actual read time of the second TDM service data from the cache and the actual read time of the first TDM service data from the cache
  • a second difference between the two is equal to a sum of the first difference and the packet delay deviation.
  • the embodiment may further use the calculated second clock frequency to read the second TDM service data from the cache and send the data to the TDM circuit, where the TDM circuit receives the second TDM service data. After that, the corresponding TDM code stream is restored.
  • the packet length information of the receiving end is the length of the TDM service data encapsulated in the packet packet. Then, the receiving end may determine the neighbor relationship between the packet packets according to the message sequence number, and the adjacent two packet messages.
  • the difference of the message sequence number is 1; and, when the second TDM service data is read, the receiving end may determine the location of the second TDM service data in the cache according to the packet length information of the packet message ( a limit), and further reading data corresponding to the second TDM service data from the cache.
  • the time when the packet arrives at the receiving end includes the packet delay (transmission delay) of the network transmission. Therefore, the actual readout interval (ie, the second difference) of the TDM service data of two adjacent packets in the receiving end buffer further includes a packet delay offset.
  • the second difference is required to be equal to the first difference and The sum of the packet delay errors.
  • the network When the network is running normally, when the transmission frequency of the sender changes abruptly, it will directly respond to the completion time interval (transmission time stamp) of the packet payload at the sender (the payload is TDM service data).
  • the above clock recovery method is calculated.
  • the clock frequency of the TDM service data used for reading the cache that is calculated last time is kept unchanged, and the clock frequency is used to read Take the TDM service data in the cache until the out-of-order or packet loss phenomenon disappears.
  • the embodiment further calculates the clock frequency according to step 23 above to read the TDM service data, so that the impact of packet loss and out-of-order on the receiving end can be reduced.
  • the header of the packet packet carries the transmission time stamp sent by the sender.
  • FIG. 3 schematically illustrates a case where the sender sends a timestamp, but the present invention is not limited to the example.
  • the sender sends a payload packet to the TDM service data (such as T1/E1 data) uploaded by the TDM link.
  • the local clock is used to time the packet completion time.
  • a 50 can be used on the sending end.
  • the high-speed clock of MHz is timed.
  • the link is initialized, the same initialization is performed on the timer counter.
  • One count beat represents 20 ns
  • the unit of the transmit time stamp is in ns
  • the coded width of the transmit time stamp is 32 bits (bits). ).
  • the packets sent by the link are started.
  • the counter value is input to the time stamp generator to generate the transmission time stamp.
  • the timestamp is generated, it is encapsulated in the timestamp position of the PWE3 packet, and the occupied bit width is 32 bits.
  • the encapsulated packet (PWE3 packet) is transmitted to the PTN network through the sender and finally sent to the corresponding receiver.
  • the packet length of the packet packet whose message sequence number is n (that is, the length of the TDM service data encapsulated by it) is that the timestamp in the header indicates that the payload packet completion time at the sender is ⁇ time, and the packet enters the receiving end.
  • the system time ie, the reception timestamp
  • the read time of the packaged TDM service data from the first in first out buffer (FIFO) is, the read clock frequency is; the message sequence number is "+1 of the packet message.
  • the packet length is d
  • the timestamp inside the header shows that it is sending
  • the moment of the payload of the terminal is the time
  • the time of entering the system of the receiving end is ⁇
  • the read time of the packaged TDM service data from the FIFO is the read clock frequency is ".
  • + 1 respectively to represent the packet message n and the packet report.
  • the time difference between the entry n + 1 and the first input first out of the queue ( FIFO , First Input First Output ) is d ( 1 )
  • the time interval between the entry and the completion of the header processing is as follows: Since each message is subjected to the same header processing, each message can be regarded as equal. Then there is
  • the receiving end After receiving the packet message, the receiving end extracts the TDM service data and caches the TDM service data, and then sends the TDM service data to the TDM circuit to recover the TDM code stream. If the sender packet interval (equivalent to the sender TDM service payload packet interval) is equal to the ideal packet transmission interval at the receiving end (corresponding to the read interval of the ideal TDM service data at the receiving end), that is, the TDM of the receiving end is indicated.
  • the transmission frequency of the service data is consistent with the service clock frequency of the sender, and the following formula (5) is established:
  • is the Packet Delay Variation (PDV)
  • PDV Packet Delay Variation
  • Equation (5) can be converted to the following formula (5,): If it is regarded as the actual read time of the second TDM service data from the cache in the above step 23, it is the actual read time of the first TDM service data from the cache, and the above formula (5, ) indicates the first a second difference (ie) between the actual read time of the second TDM service data and the actual read time of the first TDM service data is equal to the sum of the first difference (ie) and the packet delay deviation .
  • can be updated according to the following formula (6), where is a predetermined positive number: k ( 6 )
  • the read clock frequency of the "+1 packet depends on the read clock frequency of the "packet", the packet length of two packets, the transmission time difference of the two packets, and two The time difference between the packet entering the receiving end, and the moving average of the interval between two adjacent packets when the previous packet of the +1 packet enters the receiving end.
  • the frequency adjustment algorithm may track the sudden change of the frequency of the sender and respond quickly according to the extracted time interval information of the sender packet.
  • the embodiment further provides a time-stamp-based clock recovery device.
  • the clock recovery device specifically includes: a message receiving module, configured to receive a packet message from a packet transport network that encapsulates and sometimes multiplexes TDM service data, and records a time stamp of receiving the packet message; and a packet delay transmitted by the packet in the packet transport network Deviation, calculate and update the clock frequency at the receiving end.
  • the embodiment further provides another time-stamp-based clock recovery device.
  • the clock recovery device specifically includes:
  • a message receiving module configured to receive a packet packet encapsulated with TDM service data from the packet transport network, and record a receiving time stamp of the packet;
  • a storage processing module configured to extract, from a packet received by the packet receiving module
  • the TDM service data is buffered, and the transmission time stamp carried in the header of each packet packet is extracted; the packet delay deviation transmitted by the packet in the packet transmission network is calculated, and the clock frequency of the receiving end is calculated and updated.
  • the clock calculation module includes a clock recovery module, configured to read, according to a first difference of a transmission time stamp between two adjacent packet messages, the two adjacent packet messages in the read buffer.
  • the first clock frequency of the first TDM service data of the previous message in the packet, and the packet delay deviation of the packet message transmitted in the packet transport network, are calculated for reading the adjacent two packet reports in the buffer a second clock frequency of the second TDM service data of the subsequent message in the text, wherein the second clock frequency causes the actual read time of the second TDM service data and the first TDM service data to be actually read out
  • the second difference between the times is equal to the sum of the first difference and the packet delay deviation.
  • the clock recovery device further includes:
  • a reading module configured to read the second TDM service data from the cache at the second clock frequency and send the data to the TDM circuit.
  • the reading module is further configured to: when the received packet packet is out of order or lost, keep the last calculated clock frequency for reading the TDM service data in the cache unchanged, and use the Clock frequency to read TDM service data in the cache, straight The disorder or packet loss disappeared.
  • the clock recovery module is further configured to: when the two adjacent packet messages are the first ",” + 1 packet message, calculate according to the following formula for reading the first" + 1 packet to read the TDM service data read clock frequency +1:
  • k , , are the " -1, n _ k, and the received time stamps of the packet messages, respectively, which are a predetermined positive number.
  • the storage processing module may be further configured to extract a message sequence number and packet length information from a header of each packet message, where the packet length information is a length of TDM service data encapsulated in the packet message.
  • the clock recovery module is further configured to determine, according to the message sequence number, an adjacency relationship between the packet messages.
  • the reading module is further configured to determine, according to the packet length information, a location of the second TDM service data in the cache, and further read data corresponding to the second TDM service data from the cache.
  • FIG. Figure 6 schematically illustrates how the receiving end utilizes the transmit timestamp and local timestamp information of the packet message for frequency adjustment and recovery through a circuit block diagram of a refined clock recovery device.
  • the clock recovery device shown in FIG. 6 includes a message receiving module, a timing module, a header processing module, a FIFO buffer, an Arithmetic Logic Unit (ALU), a read bit counting module, and a direct frequency synthesis (DDS, Direct). Digital Synthesis) module and frequency
  • the rate control algorithm module is composed of the same, and the connection relationship of each module is as shown in FIG. 6.
  • the first timing module times each packet message entering the system, and sends the accurate time information (ie, the received time stamp) of each packet message into the system to the ALU module; the header processing module processes the packet report.
  • the message header of the text, and the encapsulated payload (TDM service data) in the message is input into the FIFO buffer, and the message sequence number, the transmission time stamp timestamp, and the packet length information in the header are sent to the ALU module.
  • FIFO buffer is used to buffer the message payload (TDM service data) after stripping the header information, and read the data in the FIFO buffer according to the clock frequency provided by the DDS module and send it to the TDM circuit;
  • ALU module pair extraction The related information is calculated to provide corresponding information for the frequency control algorithm module; the frequency control algorithm module calculates the clock frequency according to the formula (8) according to the information provided by the ALU module or retrieves the corresponding frequency adjustment strategy; the DDS module according to the frequency control algorithm
  • the clock frequency provided by the module, the corresponding frequency adjustment is implemented to control the read clock frequency of the FIFO and the TDM circuit transmits Clock frequency.
  • Step 51 On the receiving end, set the initial read clock frequency of the FIFO buffer, the parameters of the DDS module, and the counter for timing.
  • the receiving end uses a high-speed clock, which can be 50MHz or 100MHz, as a timing counting clock (for example, a 50MHz clock, one counting beat represents 20ns, a 100MHz clock, and one counting section represents 10ns).
  • a 50 MHz clock is used as the count clock
  • a 32-bit register is used to register the local count clock information.
  • the read clock frequency of the FIFO buffer is initialized.
  • the E1 data is initially initialized to its nominal frequency of 2.048 MHz
  • the T1 data is initialized to its nominal clock frequency of 1.544 MHz, and the first and second timings are simultaneously performed.
  • the module is initialized.
  • Step 52 At the receiving end, time each message entering the system is scheduled, and the accurate time information of each packet entering the system is recorded.
  • the first timing module advances the message.
  • the time information entered into the system is sent to the ALU module.
  • the second timing module also sends the timing information at this time back to the ALU module, and each subsequent message is ⁇ Take the same operation.
  • Step 53 At the receiving end, the header processing module extracts the message sequence number of each message, the corresponding packet length information, and the timestamp information in the corresponding header.
  • Step 54 The read bit counting module counts the number of data bits read from the FIFO buffer, and determines the exact position of each TDM service data limit by reading the bit count value and the packet length information.
  • Step 55 Determine, according to the boundary of the TDM service data, a moment when each TDM service data is completely read out from the FIFO buffer.
  • Step 56 According to the message sequence number, the timestamp in the corresponding header, the time when the message enters the system, the time when the message is read from the FIFO, and the current read clock frequency of the FIFO buffer, the previous message in the current message
  • the adjacent two messages enter the interval information of the system, and the ALU module performs corresponding operations according to the above formula (8), and outputs the operation result to the frequency control algorithm module, and the frequency control algorithm module extracts the corresponding frequency according to the obtained information. Adjust the strategy and adjust the output frequency of the DDS to adjust the read clock frequency of the FIFO buffer accordingly. Considering the amount of calculation and speed of the ALU module, you can consider using software instead.
  • the inventors conducted a simulation test on the above-described clock recovery method of the present embodiment.
  • the content of the packet is used in the E1 service, and the corresponding test standard uses the test case of G.8261.
  • this embodiment can quickly track the frequency mutation of the transmitting end and lock it. After the frequency is locked, the Maximum Time Interval Error (MTIE) indicator and the Time Deviation (TDEV, Time Deviation) indicator are tested, and the measured indicators all meet the relevant standards well. If packet loss occurs, this embodiment can detect packet loss according to the packet sequence number. When a packet loss occurs, the strategy of capturing is to keep the read clock frequency recovered before.
  • MTIE Maximum Time Interval Error
  • TDEV Time Deviation
  • the message number is saved after it is extracted.
  • the ALU module is entered (the number of pre-stored sequence numbers is determined by the configuration), and the ALU module extracts the useful information of the out-of-order message without any influence. Therefore, the out-of-order does not have much influence on the clock recovery method of this embodiment.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The present invention provides a method and an apparatus for clock recovery based on time stamps. The method includes that: a reception end receives packet messages, which are encapsulated with Time Division Multiplexing TDM service data, from a Package Transport Network PTN and records the reception time stamps of said packet messages; the reception end calculates and updates the clock frequency of the reception end according to the sending time difference between adjacent two packet messages and the Packet Delay Variation PDV of the packet messages transmission in a PTN. The present invention can track a sudden change of the frequency of the sending end and lock onto the sending frequency of the sending end quickly.

Description

一种基于时戳的时钟恢复方法及装置 技术领域  Time stamp based clock recovery method and device
本发明涉及通讯领域中的时分复用( TDM, Time Division Multiplexing ) 业务数据的电路仿真技术领域, 具体涉及一种基于时戳的时钟恢复方法及 装置。 背景技术  The present invention relates to the field of circuit simulation technology for Time Division Multiplexing (TDM) service data in the field of communications, and in particular to a time stamp based clock recovery method and apparatus. Background technique
TDM 业务是通讯领域中的一种常见业务, 比如语音通话。 租用 TDM 专线进行 TDM业务传输, 通常需要昂贵的费用, 且资源利用率不高。 随着 电路仿真技术和分组传输技术的发展, 为节省费用并提高资源利用率, 现 在通常都将 TDM业务进行分组,通过电路仿真技术封装成边缘到边缘的伪 线仿真(PWE3 , Pseudo Wire Emulation Edge-to-Edge )报文, 在分组传送 网 (PTN, Package Transport Network )上进行传送。  TDM services are a common service in the communications field, such as voice calls. Renting a TDM leased line for TDM service transmission usually requires expensive costs and low resource utilization. With the development of circuit simulation technology and packet transmission technology, in order to save costs and improve resource utilization, TDM services are now usually grouped and encapsulated into edge-to-edge pseudowire simulations by circuit simulation technology (PWE3, Pseudo Wire Emulation Edge). -to-Edge ) The message is transmitted on the Packet Transport Network (PTN).
TDM业务在分组传送网中传输时, 必须保持在入口处和出口处的时钟 频率同步, 否则, 由于入口处与出口处的频率长期失调, 导致出口处数据 緩存出现溢出或者读空现象, 进而导致数据丟失和服务降低。 由于现今分 组传输技术不支持在包中传输 TDM业务发送端的时钟频率信息, 因此, 需 要在接收端进行业务时钟频率恢复。  When the TDM service is transmitted in the packet transport network, it must keep the clock frequency at the entrance and exit synchronized. Otherwise, due to the long-term misalignment of the frequency at the entrance and exit, the data buffer at the exit overflows or reads empty, which leads to Data loss and service degradation. Since the current packet transmission technology does not support the transmission of the clock frequency information of the TDM service transmitting end in the packet, the service clock frequency recovery needs to be performed at the receiving end.
目前, 电路仿真技术中, 时钟恢复技术有三种: 网络时钟法、 差分时 钟法, 自适应时钟恢复方法。 前两种需要在 TDM发送端和接收端都具备高 精度的公共参考时钟, 这在目前普遍应用的分组传送网中无法满足。 自适 应时钟恢复方法, 则根据接收端接收到的 TDM业务数据, 提取相关信息, 通过反馈调节来恢复业务时钟, 较适用于现在的分组传送网。  At present, there are three kinds of clock recovery techniques in circuit simulation technology: network clock method, differential clock method, and adaptive clock recovery method. The first two need to have a high-precision common reference clock at both the TDM transmitter and the receiver, which cannot be satisfied in the currently widely used packet transport network. The adaptive clock recovery method extracts relevant information according to the TDM service data received by the receiving end, and restores the service clock through feedback adjustment, which is more suitable for the current packet transmission network.
自适应时钟恢复方法, 根据使用信息不同, 主要可分为两种: 一种是 基于緩存填充水平的自适应时钟恢复方法, 另一种是基于时戳的自适应时 钟恢复方法。 The adaptive clock recovery method can be mainly divided into two types according to the usage information: An adaptive clock recovery method based on cache fill level, and another is a time stamp based adaptive clock recovery method.
其中, 基于緩存填充水平的自适应时钟恢复方法, 根据接收端的緩存 填充水平来衡量发送端和接收端的时钟频率之差, 并以此来调节接收端频 率, 以使其与发送端业务时钟同步。  The adaptive clock recovery method based on the cache fill level measures the difference between the clock frequencies of the sender and the receiver according to the buffer fill level of the receiver, and adjusts the frequency of the receiver to synchronize with the service clock of the sender.
其中,基于时戳的自适应时钟恢复方法则为:在发送端,发送包含 TDM 业务的报文, 并获取该包的发送时戳, 将其封在包中, 通过分组传送网传 送到接收端; 在接收端, 提取发送端的发送时戳信息, 并与本地的接收时 戳相比较, 根据发送时戳和接收时戳差异来调节接收端时钟频率, 以与发 送端业务时钟同步。  The time-stamp-based adaptive clock recovery method is: transmitting, at the transmitting end, a packet containing a TDM service, and acquiring a transmission time stamp of the packet, encapsulating it in a packet, and transmitting the packet to the receiving end through the packet transmission network. At the receiving end, the sending time stamp information of the transmitting end is extracted, and compared with the local receiving time stamp, the clock frequency of the receiving end is adjusted according to the difference between the sending time stamp and the receiving time stamp to synchronize with the sending end service clock.
由于器件老化或业务频率改变等原因, 发送端的业务频率可能会发生 一定幅度的突变。 发明人对现有的自适应时钟恢复技术进行研究后发现, 现有技术在实施自适应时钟恢复时, 大多未考虑发送端频率发生突然改变 对自适应时钟恢复的影响, 因此不能对发送端的频率突然改变做出快速反 应。 发明内容  Due to aging of the device or changes in service frequency, the frequency of the service at the transmitting end may be abruptly changed. The inventors have studied the existing adaptive clock recovery technology and found that in the prior art, when implementing adaptive clock recovery, most of the effects of sudden changes in the frequency of the transmitting end on the adaptive clock recovery are not considered, so the frequency of the transmitting end cannot be used. Sudden changes make a quick response. Summary of the invention
本发明所要解决的技术问题是提供一种基于时戳的时钟恢复方法及装 置, 在时钟恢复过程中, 能够对发送端频率突然改变进行跟踪, 并快速锁 定发送端的发送频率。  The technical problem to be solved by the present invention is to provide a time stamp based clock recovery method and device. During the clock recovery process, the frequency of the transmitting end can be suddenly changed, and the transmitting frequency of the transmitting end can be quickly locked.
为解决上述技术问题, 本发明提供方案如下:  In order to solve the above technical problems, the present invention provides the following solutions:
一种基于时戳的时钟恢复方法, 所述方法包括:  A time stamp based clock recovery method, the method comprising:
接收端接收来自分组传送网的封装有时分复用 TDM 业务数据的分组 报文, 并记录所述分组报文的接收时戳; 送网中传输的分组时延偏差, 计算并更新接收端的时钟频率。 优选地, 上述时钟恢复方法中, 还包括: 接收端从接收到的分组报文 中提取 TDM业务数据并緩存,以及提取各个分组报文的报头中携带的发送 时戳; 所述计算并更新接收端的时钟频率包括: 接收端根据相邻两个分组 报文之间的发送时戳的第一差值、 用于读取緩存中的所述相邻两个分组报 文中的前一个 ^艮文的第一 TDM业务数据的第一时钟频率、和分组 文在分 组传送网中传输的分组时延偏差, 计算用于读取緩存中的所述相邻两个分 组"¾文中的后一个 "^文的第二 TDM业务数据的第二时钟频率, 其中, 所述 第二时钟频率使得所述第二 TDM业务数据实际读出时刻与所述第一 TDM 业务数据实际读出时刻之间的第二差值, 等于所述第一差值与所述分组时 延偏差之和。 The receiving end receives the packet packet from the packet transport network and sometimes multiplexes the TDM service data, and records the receiving time stamp of the packet packet; the packet delay deviation transmitted in the sending network, calculates and updates the clock frequency of the receiving end . Preferably, the method for recovering the clock further includes: receiving, by the receiving end, TDM service data from the received packet message and buffering, and extracting a sending time stamp carried in a header of each packet message; The clock frequency of the terminal includes: a first difference between the sending time stamps of the two adjacent packet messages received by the receiving end, and the previous one of the two adjacent packet messages in the read buffer The first clock frequency of the first TDM service data, and the packet delay deviation of the packet data transmitted in the packet transport network, are calculated for reading the adjacent two packets in the buffer "the next one of the texts" ^ a second clock frequency of the second TDM service data, where the second clock frequency is a second between the actual read time of the second TDM service data and the actual read time of the first TDM service data The difference is equal to the sum of the first difference and the packet delay deviation.
优选地, 上述时钟恢复方法中, 所述计算用于读取緩存中的所述相邻 两个分组报文中后一个报文的第二 TDM业务数据的第二时钟频率, 包括: 在所述相邻两个分组 ^艮文为第"、 "+ 1个分组 文时, 进一步按照以下 公式计算用于读取第 "+ 1个分组报文的 TDM业务数据的读取时钟频率 +ι: r ^n+l  Preferably, in the clock recovery method, the calculating, by the second clock frequency, the second clock frequency of the second TDM service data of the next one of the two adjacent packet messages in the cache, When the two adjacent packets are the first ", " + 1 packet, the read clock frequency of the TDM service data for reading the "+ 1 packet" is further calculated according to the following formula + ι: r ^n+l
J n+l― J  J n+l― J
tn+l - tn + Atn k + r -( l - t ) 其中, 为用于读取第 "个分组报文的 TDM业务数据的读取时钟频率, d、 分别为第" + 1、 "个分组报文的 TDM业务数据的长度, Δ 为分组报 文在分组传送网中传输的分组时延偏差, 分别为第" +1、 "个分组才艮 文的接收时戳, d、 ^分别为第" + 1、 "个分组 ^艮文的发送时戳; t n+l - t n + At n k + r -( l - t ) where is the read clock frequency of the TDM service data for reading the "packet packet", d, respectively, " + 1 "The length of the TDM service data of the packet message, Δ is the packet delay deviation of the packet message transmitted in the packet transmission network, which is the reception time stamp of the "+1, 1" packet, respectively, d, ^ is the transmission time stamp of the first " + 1, " group of texts;
, ΔΓΜ = ,n-l ,n-k , ΔΓ Μ = , nl , nk
, k , 、 ,n-k-l ^  , k , , , n-k-l ^
其中 、 分别为第" -1、 n _ k、 Where, respectively, the first "-1, n _ k,
"- -1个分组报文的接收时戳, 为一预定正数。 "- - Receive time stamp of 1 packet message, which is a predetermined positive number.
优选地, 上述时钟恢复方法中, 还包括: 接收端以所述第二时钟频率 从緩存中读取所述第二 TDM业务数据并发送给 TDM电路。 优选地, 上述时钟恢复方法中, 所述计算用于读取緩存中的所述相邻 两个分组报文中后一个报文的第二 TDM 业务数据的第二时钟频率, 还包 括: 在接收到的分组报文发生乱序或丟包时, 保持最近一次计算得到的用 于读取緩存中的 TDM业务数据的时钟频率不变,并利用所述时钟频率去读 取緩存中的 TDM业务数据, 直到乱序或丟包现象消失。 Preferably, in the clock recovery method, the method further includes: the receiving end reads the second TDM service data from the cache at the second clock frequency and sends the data to the TDM circuit. Preferably, in the foregoing clock recovery method, the calculating, by the second clock frequency, the second TDM service data for reading the second TDM service data of the next one of the two adjacent packet messages in the cache, further comprising: receiving When the received packet packet is out of order or lost, the clock frequency of the TDM service data used for reading the cache is kept unchanged, and the clock frequency is used to read the TDM service data in the buffer. Until the disorder or packet loss disappears.
优选地, 上述时钟恢复方法中, 所述接收端以所述第二时钟频率从緩 存中读取所述第二 TDM业务数据, 为: 接收端进一步从各个分组报文的报 头中提取报文序号和包长信息, 所述包长信息为所述分组报文中封装的 TDM业务数据的长度;  Preferably, in the clock recovery method, the receiving end reads the second TDM service data from the cache by using the second clock frequency, and the receiving end further extracts the message sequence number from the header of each packet message. And packet length information, where the packet length information is a length of the TDM service data encapsulated in the packet packet;
接收端根据所述报文序号, 确定分组报文之间的相邻关系, 以及根据 所述包长信息, 确定所述第二 TDM业务数据在緩存中的位置, 从緩存中读 取所述第二 TDM业务数据对应的数据。  The receiving end determines the neighbor relationship between the packet messages according to the message sequence number, and determines the location of the second TDM service data in the cache according to the packet length information, and reads the number from the cache. The data corresponding to the two TDM service data.
本发明还提供了一种基于时戳的时钟恢复装置, 包括:  The invention also provides a time stamp based clock recovery device, comprising:
报文接收模块,用于接收来自分组传送网的封装有 TDM业务数据的分 组才艮文, 并记录所述分组 ^艮文的接收时戳; 报文在分组传送网中传输的分组时延偏差, 计算并更新接收端的时钟频率。  a message receiving module, configured to receive a packet packet encapsulated with TDM service data from a packet transmission network, and record a reception time stamp of the packet; and a packet delay deviation transmitted by the packet in the packet transmission network , Calculate and update the clock frequency of the receiver.
优选地, 上述时钟恢复装置中, 还包括: 存储处理模块, 用于从所述 报文接收模块接收到的分组报文中提取 TDM业务数据并緩存,以及提取各 个分组报文的报头中携带的发送时戳; 所述时钟计算模块包括: 时钟恢复 模块, 用于根据相邻两个分组报文之间的发送时戳的第一差值、 用于读取 緩存中的所述相邻两个分组报文中的前一个报文的第一 TDM 业务数据的 第一时钟频率、 和分组 ^艮文在分组传送网中传输的分组时延偏差, 计算用 于读取緩存中的所述相邻两个分组报文中的后一个报文的第二 TDM 业务 数据的第二时钟频率, 其中, 所述第二时钟频率使得所述第二 TDM业务数 据实际读出时刻与所述第一 TDM业务数据实际读出时刻之间的第二差值, 等于所述第一差值与所述分组时延偏差之和。 Preferably, the clock recovery device further includes: a storage processing module, configured to extract TDM service data from the packet message received by the message receiving module, and cache, and extract a packet carried in a header of each packet message Transmitting a time stamp; the clock calculation module includes: a clock recovery module, configured to: according to a first difference of a transmission time stamp between two adjacent packet messages, used to read the adjacent two in the cache The first clock frequency of the first TDM service data of the previous message in the packet message, and the packet delay deviation of the packet transmission in the packet transport network, calculated for reading the neighbor in the buffer a second clock frequency of the second TDM service data of the subsequent one of the two packet messages, wherein the second clock frequency causes the second TDM service number The second difference between the actual readout time and the actual readout time of the first TDM service data is equal to the sum of the first difference and the packet delay deviation.
优选地, 上述时钟恢复装置中, 所述时钟恢复模块, 还用于在所述相 邻两个分组报文为第"、 "+ 1个分组报文时, 按照以下公式计算用于读取第  Preferably, in the above clock recovery device, the clock recovery module is further configured to calculate, according to the following formula, the reading formula when the two adjacent packet messages are the first "+" group message
"+ 1个分组 4艮文的 TDM业务数据的读取时钟频率 +1: "+ 1 packet 4 的 的 TDM service data read clock frequency +1:
r ^n+l  r ^n+l
J n+l ― /  J n+l ― /
tn+l - tn + Atn k + r -( l -0 其中, 为用于读取第 "个分组报文的 TDM业务数据的读取时钟频率, d、 ^分别为第" + 1、 "个分组报文的 TDM业务数据的长度, Δ 为分组报 文在分组传送网中传输的分组时延偏差, 、 分别为第" + 1、 "个分组才艮 文的接收时戳, d、 ^分别为第" + 1、 "个分组 ^艮文的发送时戳; t n+l - t n + At n k + r -( l -0 where is the read clock frequency of the TDM service data for reading the "first packet", d, ^ are respectively "+1""The length of the TDM service data of the packet message, Δ is the packet delay deviation of the packet message transmitted in the packet transmission network, respectively, and the reception time stamp of the "+1", "group packet", d , ^ are the transmission time stamps of the first " + 1, " group of texts;
, ΔΓΜ = ,n-l ,n-k ,n-k-l ^ , ΔΓ Μ = , nl , nk , nkl ^
其中, k , 、 、 分别为第" - 1、 n _ k、 Where k , , , and are respectively " - 1 , n _ k,
" - - 1个分组报文的接收时戳, 为一预定正数。 优选地, 上述时钟恢复装置中, 还包括: 读取模块, 用于以所述第二 时钟频率从緩存中读取所述第二 TDM业务数据并发送给 TDM电路。 Preferably, the clock recovery device further includes: a reading module, configured to read from the cache at the second clock frequency, wherein the receiving time stamp of the one packet message is a predetermined positive number. The second TDM service data is described and sent to the TDM circuit.
优选地, 上述时钟恢复装置中, 所述读取模块, 还用于在接收到的分 组报文发生乱序或丟包时, 保持最近一次计算得到的用于读取緩存中的 TDM业务数据的时钟频率不变,并利用所述时钟频率去读取緩存中的 TDM 业务数据, 直到乱序或丟包现象消失。  Preferably, in the clock recovery device, the reading module is further configured to: when the received packet packet is out of order or lost, keep the last calculated TDM service data for reading the cache. The clock frequency is unchanged, and the clock frequency is used to read the TDM service data in the cache until the out-of-order or packet loss phenomenon disappears.
优选地, 上述时钟恢复装置中,  Preferably, in the above clock recovery device,
所述存储处理模块, 进一步用于从各个分组报文的报头中提取报文序 号和包长信息,所述包长信息为所述分组报文中封装的 TDM业务数据的长 度;  The storage processing module is further configured to extract a message sequence number and packet length information from a header of each packet packet, where the packet length information is a length of the TDM service data encapsulated in the packet packet.
所述时钟恢复模块, 还用于根据所述报文序号, 确定分组报文之间的 相邻关系; The clock recovery module is further configured to determine, between the packet messages, according to the message sequence number Adjacent relationship
所述读取模块, 还用于根据所述包长信息, 确定所述第二 TDM业务数 据在緩存中的位置, 从緩存中读取所述第二 TDM业务数据对应的数据。  The reading module is further configured to determine, according to the packet length information, a location of the second TDM service data in a cache, and read data corresponding to the second TDM service data from a cache.
从以上所述可以看出, 本发明提供的基于时戳的时钟恢复方法及装置, 在时钟恢复过程中考虑到发送端 TDM业务净荷封包间隔,使得接收端能够 根据封包间隔变化, 对发送端频率突然改变进行跟踪并快速锁定。 并且, 本发明还在时钟恢复中考虑到了 PDV,从而减小了 PDV对时钟恢复的不良 影响。 另外, 本发明还对报文丟包和乱序情况釆取保持恢复出来的读取时 钟频率不变的策略, 在报文接收正常后再按照相应的时钟恢复算法重新进 行时钟恢复, 从而能够减小丟包和乱序对接收端的影响。 附图说明  It can be seen from the above that the time-stamp-based clock recovery method and apparatus provided by the present invention considers the payload TMD service payload packet interval in the clock recovery process, so that the receiving end can change according to the packet interval, and the transmitting end The frequency changes abruptly to track and quickly lock. Moreover, the present invention also takes into account the PDV in clock recovery, thereby reducing the adverse effects of PDV on clock recovery. In addition, the present invention also learns to keep the recovered read clock frequency unchanged for packet loss and out-of-order situations. After the message is received normally, the clock recovery is performed according to the corresponding clock recovery algorithm, thereby being able to reduce The impact of small packet loss and out-of-order on the receiving end. DRAWINGS
图 1为本发明的主体思想示意图;  Figure 1 is a schematic diagram of the main idea of the present invention;
图 2为本发明实施例所述基于时戳的时钟恢复方法的流程示意图; 图 3为本发明实施例中发送端打发送时戳的一种情况示意图; 图 4为本发明实施例所述基于时戳的时钟恢复装置的结构示意图; 图 5为本发明实施例提供的另一时钟恢复装置的结构示意图; 图 6为本发明实施例所述基于时戳的时钟恢复装置的细化的电路模块 图。 具体实施方式  2 is a schematic flowchart of a time-stamp-based clock recovery method according to an embodiment of the present invention; FIG. 3 is a schematic diagram of a situation in which a sending end sends a timestamp according to an embodiment of the present invention; FIG. 5 is a schematic structural diagram of another clock recovery apparatus according to an embodiment of the present invention; FIG. 6 is a detailed circuit module of a time stamp based clock recovery apparatus according to an embodiment of the present invention; Figure. detailed description
本发明提供了一种基于时戳的时钟恢复方法及装置, 在进行时钟恢复 过程中, 能在发送端发送频率发生改变时, 进行快速反应。 并且, 本发明 还进一步对分组报文传输过程中的丟包和乱序情况釆取了保持时钟频率不 变的策略, 使得丟包和乱序情况对频率恢复算法的影响大为降低。  The present invention provides a time stamp based clock recovery method and apparatus, which can perform a fast response when a transmission frequency changes at a transmitting end during a clock recovery process. Moreover, the present invention further adopts a strategy of keeping the clock frequency constant in the case of packet loss and out-of-order in the packet packet transmission process, so that the impact of packet loss and out-of-order conditions on the frequency recovery algorithm is greatly reduced.
以下将结合附图, 通过具体实施例对本发明做进一步的说明。 本发明的主体思想, 是将发送端、 接收端以及 PTN网络看成一个 "黑 匣子"(如图 1所示 ), 在保持发送端 TDM业务净荷封包间隔与接收端理想 的包发送间隔相等,则发送端 TDM业务时钟频率在接收端能够得到如实地 恢复。上述发送端 TDM业务净荷封包间隔可以用分组报文中携带的发送时 戳的差值来表征, 上述接收端理想的包发送间隔可以用緩存中分组报文的 TDM业务数据的理想读出间隔来表征。 The present invention will be further described by way of specific embodiments with reference to the accompanying drawings. The main idea of the present invention is to regard the transmitting end, the receiving end and the PTN network as a "black box" (as shown in FIG. 1), and keep the TDM service payload packet interval at the transmitting end equal to the ideal packet sending interval at the receiving end. Then, the TDM service clock frequency of the transmitting end can be faithfully restored at the receiving end. The sender TDM service payload packet interval may be characterized by the difference of the transmission time stamp carried in the packet message, and the ideal packet transmission interval of the receiver may use the ideal read interval of the TDM service data of the packet packet in the buffer. To characterize.
本发明实施例所述基于时戳的时钟恢复方法中, 接收端接收来自分组 传送网的封装有时分复用 TDM业务数据的分组>¾文,并记录所述分组 "^文 的接收时戳; 根据相邻两个分组报文之间的发送时间差和分组报文在分组 传送网中传输的分组时延偏差, 计算并更新接收端的时钟频率。  In the time-stamp-based clock recovery method of the embodiment of the present invention, the receiving end receives a packet from the packet transport network that encapsulates the TDM service data, and records the received time stamp of the packet. The clock frequency of the receiving end is calculated and updated according to the transmission time difference between two adjacent packet messages and the packet delay deviation of the packet message transmitted in the packet transmission network.
本实施例所述时钟恢复方法中, 在更新接收端时钟频率时, 考虑到发 送端分组报文的发送时间差以及分组报文的分组时延偏差, 使得接收端能 够根据发送端封包间隔变化, 对发送端频率突然改变进行跟踪并快速锁定, 并能够减 d、分组时延偏差对时钟恢复的不良影响。 差值来表征。 以下结合图 2 , 对本实施例做进一步的说明。  In the clock recovery method of the embodiment, when the clock frequency of the receiving end is updated, the transmission time difference of the packet packet of the transmitting end and the packet delay deviation of the packet packet are considered, so that the receiving end can change according to the packet spacing of the transmitting end, The frequency of the transmitting end suddenly changes to track and quickly lock, and can reduce the adverse effect of d and packet delay deviation on clock recovery. The difference is used to characterize. The present embodiment will be further described below with reference to FIG.
如图 2所示, 本发明实施例所述基于时戳的时钟恢复方法, 包括以下 步骤:  As shown in FIG. 2, the time stamp based clock recovery method according to the embodiment of the present invention includes the following steps:
步骤 21 , 接收端接收来自分组传送网的封装有 TDM业务数据的分组 报文, 并记录所述分组报文的接收时戳。 接收时戳是指分组报文进入接收 端的时刻。  Step 21: The receiving end receives the packet message encapsulated with the TDM service data from the packet transmission network, and records the receiving time stamp of the packet message. The receiving time stamp refers to the time when the packet message enters the receiving end.
步骤 22, 接收端从接收到的分组报文中提取 TDM业务数据并緩存, 以及提取各个分组报文的报头中携带的发送时戳。  Step 22: The receiving end extracts and buffers the TDM service data from the received packet message, and extracts a sending time stamp carried in the header of each packet message.
步骤 23 , 接收端根据相邻两个分组报文之间的发送时戳的第一差值、 用于读取緩存中的所述相邻两个分组报文中的前一个报文的第一 TDM 业 务数据的第一时钟频率、 和分组 "^文在分组传送网中传输的分组时延偏差, 计算用于读取緩存中的所述相邻两个分组报文中的后一个报文的第二 TDM 业务数据的第二时钟频率, 其中, 所述第二时钟频率使得所述第二 TDM业 务数据从緩存中的实际读出时刻与所述第一 TDM 业务数据从緩存中的实 际读出时刻之间的第二差值, 等于所述第一差值与所述分组时延偏差之和。 Step 23: The first end of the sending time stamp according to the sending time stamp between the two adjacent packet messages, and the first end of the previous one of the two adjacent packet messages in the buffer TDM industry The first clock frequency of the data, and the packet delay deviation of the packet transmitted in the packet transport network, and the number of the next one of the adjacent two packet messages in the read buffer is calculated. a second clock frequency of the second TDM service data, wherein the second clock frequency causes the actual read time of the second TDM service data from the cache and the actual read time of the first TDM service data from the cache A second difference between the two is equal to a sum of the first difference and the packet delay deviation.
在上述步骤 23之后, 本实施例还可以进一步利用计算得到的所述第二 时钟频率 ,从緩存中读取所述第二 TDM业务数据并发送给 TDM电路, TDM 电路接收到第二 TDM业务数据后, 恢复相应的 TDM码流。 这里, 接收端 包长信息为分组报文中封装的 TDM业务数据的长度; 然后, 接收端可以根 据所述报文序号, 确定分组报文之间的相邻关系, 相邻两个分组报文的报 文序号的差值为 1 ; 以及, 在读取所述第二 TDM业务数据时, 接收端可以 根据分组报文的包长信息, 确定所述第二 TDM 业务数据在緩存中的位置 (界限 ), 进而从緩存中读取所述第二 TDM业务数据对应的数据。  After the foregoing step 23, the embodiment may further use the calculated second clock frequency to read the second TDM service data from the cache and send the data to the TDM circuit, where the TDM circuit receives the second TDM service data. After that, the corresponding TDM code stream is restored. Here, the packet length information of the receiving end is the length of the TDM service data encapsulated in the packet packet. Then, the receiving end may determine the neighbor relationship between the packet packets according to the message sequence number, and the adjacent two packet messages. The difference of the message sequence number is 1; and, when the second TDM service data is read, the receiving end may determine the location of the second TDM service data in the cache according to the packet length information of the packet message ( a limit), and further reading data corresponding to the second TDM service data from the cache.
从以上步骤可以看出, 上述时钟恢复方法中, 由于接收端接收到的分 组报文经过了 PTN传输, 其到达接收端时的时间中就包括了网络传输的分 组时延(传输时延), 因此接收端緩存中相邻的两个分组 4艮文的 TDM业务 数据的实际读出间隔 (即所述第二差值) 中还包含了分组时延偏差。 为使 发送端 TDM业务净荷封包间隔与接收端理想的报文发送间隔(接收端会读 取 TDM业务数据并发送给 TDM电路)相等, 则需要第二差值等于所述第 一差值与所述分组时延偏差之和。 在网络正常运行时, 当发送端发送频率 突然改变时, 将直接反应在发送端封包净荷(净荷为 TDM业务数据)的完 成时间间隔 (发送时戳)上, 上述时钟恢复方法在计算第二时钟频率的过 程中, 考虑到分组报文的发送时戳间隔信息和分组时延偏差, 从而能够对 发送端频率突然改变进行跟踪, 并快速锁定发送端的发送频率。 本实施例中, 在接收到的分组报文发生乱序或丟包时, 保持最近一次 计算得到的用于读取緩存中的 TDM业务数据的时钟频率不变,并利用所述 时钟频率去读取緩存中的 TDM业务数据, 直到乱序或丟包现象消失。 在报 文接收正常后, 本实施例再按照上述步骤 23计算时钟频率以读取 TDM业 务数据, 从而能够减小丟包和乱序对接收端的影响。 It can be seen from the above steps that, in the foregoing clock recovery method, since the packet received by the receiving end passes the PTN transmission, the time when the packet arrives at the receiving end includes the packet delay (transmission delay) of the network transmission. Therefore, the actual readout interval (ie, the second difference) of the TDM service data of two adjacent packets in the receiving end buffer further includes a packet delay offset. In order to make the TDM service payload interval of the transmitting end and the ideal message sending interval of the receiving end (the receiving end will read the TDM service data and send it to the TDM circuit), the second difference is required to be equal to the first difference and The sum of the packet delay errors. When the network is running normally, when the transmission frequency of the sender changes abruptly, it will directly respond to the completion time interval (transmission time stamp) of the packet payload at the sender (the payload is TDM service data). The above clock recovery method is calculated. In the process of the second clock frequency, considering the transmission time stamp interval information of the packet message and the packet delay deviation, it is possible to track the sudden change of the frequency of the transmitting end and quickly lock the transmission frequency of the transmitting end. In this embodiment, when the received packet packet is out of order or lost, the clock frequency of the TDM service data used for reading the cache that is calculated last time is kept unchanged, and the clock frequency is used to read Take the TDM service data in the cache until the out-of-order or packet loss phenomenon disappears. After the packet is received normally, the embodiment further calculates the clock frequency according to step 23 above to read the TDM service data, so that the impact of packet loss and out-of-order on the receiving end can be reduced.
为帮助理解上述步骤, 以下通过具体示例做更为详细的说明。  To help understand the above steps, the following is a more detailed description of the specific examples.
上述分组报文的报头中携带有发送端打上的发送时戳,请参照图 3 , 图 3示意性地说明了发送端打发送时戳的一种情况,但本发明并不局限于该示 例。 首先发送端对 TDM链路上传来的 TDM业务数据 (如 T1/E1数据 )进 行净荷封包, 在封包完成时, 利用本地时钟, 对封包完成的时刻进行定时, 具体可以在发送端使用一个 50 MHz的高速时钟进行定时, 在链路初始化 时, 对定时计数器进行同样的初始化, 一个计数节拍代表 20 ns, 发送时戳 的单位以 ns为单位, 发送时戳的编码位宽为 32位(bits )。链路和定时计数 器初始化完成后, 开始对链路发送的包进行定时。 在第一个包的净荷完成 封装时, 将计数器的计数值输入到时戳生成器中, 进行发送时戳的生成。 发送时戳生成后, 封装在 PWE3报文的头部时戳(timestamp )位置, 占用 位宽为 32bits。 所有发送端发送的报文, 釆用上述同样的操作。 封装完成的 分组报文(PWE3报文)通过发送端向 PTN网络传输, 最终被发送到对应 的接收端。  The header of the packet packet carries the transmission time stamp sent by the sender. Referring to FIG. 3, FIG. 3 schematically illustrates a case where the sender sends a timestamp, but the present invention is not limited to the example. First, the sender sends a payload packet to the TDM service data (such as T1/E1 data) uploaded by the TDM link. When the packet is completed, the local clock is used to time the packet completion time. Specifically, a 50 can be used on the sending end. The high-speed clock of MHz is timed. When the link is initialized, the same initialization is performed on the timer counter. One count beat represents 20 ns, the unit of the transmit time stamp is in ns, and the coded width of the transmit time stamp is 32 bits (bits). ). After the link and timing counters are initialized, the packets sent by the link are started. When the payload of the first packet is encapsulated, the counter value is input to the time stamp generator to generate the transmission time stamp. After the timestamp is generated, it is encapsulated in the timestamp position of the PWE3 packet, and the occupied bit width is 32 bits. For all messages sent by the sender, use the same operation as above. The encapsulated packet (PWE3 packet) is transmitted to the PTN network through the sender and finally sent to the corresponding receiver.
下面对步骤 23中的频率恢复的一种具体的计算方式进行说明。  A specific calculation method of frequency recovery in step 23 will be described below.
假设报文序号为 n的分组报文的包长(即其所封装的 TDM业务数据的 长度)为 , 头里面 timestamp显示它在发送端的净荷封包完成时刻为 ^时 刻, 该报文进入接收端***时刻 (即接收时戳)为 , 其所封装的 TDM业 务数据从先进先出緩存(FIFO ) 中的读出时刻为 , 读出时钟频率为 ; 报文序号为 "+ 1的分组报文的包长为 d ,报头里面 timestamp显示它在发送 端的净荷封包时刻为 时刻,进入接收端***时刻为 ^ ,其所封装的 TDM 业务数据从 FIFO的读出时刻为 读出时钟频率为 "。 用 、 +1分别 表示分组报文 n和分组报文 n + 1从进入接收端到流出先入先出队列 ( FIFO , First Input First Output ) 的时间差, 则有 d ( 1 ) Assume that the packet length of the packet packet whose message sequence number is n (that is, the length of the TDM service data encapsulated by it) is that the timestamp in the header indicates that the payload packet completion time at the sender is ^ time, and the packet enters the receiving end. The system time (ie, the reception timestamp) is that the read time of the packaged TDM service data from the first in first out buffer (FIFO) is, the read clock frequency is; the message sequence number is "+1 of the packet message. The packet length is d, the timestamp inside the header shows that it is sending The moment of the payload of the terminal is the time, and the time of entering the system of the receiving end is ^, and the read time of the packaged TDM service data from the FIFO is the read clock frequency is ". Use, + 1 respectively to represent the packet message n and the packet report. The time difference between the entry n + 1 and the first input first out of the queue ( FIFO , First Input First Output ) is d ( 1 )
d' =t" ― (2) d' =t " ― (2)
成立, 4叚设 ^艮文从进入接收端到完成头部处理的时间间隔为 , 由于 每个报文都是是进行相同的头部处理, 故每个报文的 可以看作是相等的, 则有  The time interval between the entry and the completion of the header processing is as follows: Since each message is subjected to the same header processing, each message can be regarded as equal. Then there is
a = a. +—  a = a. +—
' (3)
Figure imgf000012_0001
' (3)
Figure imgf000012_0001
成立。 接收端接收到分组报文后, 提取其中的 TDM业务数据并緩存, 然后将 TDM业务数据发送到 TDM电路以恢复 TDM码流。 如果发送端包 间隔 (相当于发送端 TDM业务净荷封包间隔 ), 与接收端理想的包发送间 隔时刻(相当于接收端理想的 TDM业务数据的读取间隔 )相等, 也即表明 接收端的 TDM 业务数据的发送频率与发送端的业务时钟频率时刻保持一 致, 则需以下公式(5)成立:  Established. After receiving the packet message, the receiving end extracts the TDM service data and caches the TDM service data, and then sends the TDM service data to the TDM circuit to recover the TDM code stream. If the sender packet interval (equivalent to the sender TDM service payload packet interval) is equal to the ideal packet transmission interval at the receiving end (corresponding to the read interval of the ideal TDM service data at the receiving end), that is, the TDM of the receiving end is indicated. The transmission frequency of the service data is consistent with the service clock frequency of the sender, and the following formula (5) is established:
-K = « (5) 其中 Δ 为分组时延偏差 (PDV, Packet Delay Variation ), PDV是指分 组报文在分组传送网中传输的传输时延的变化程度,其值可以取第"个包的 前 个包进入***时相邻两个包之间的间隔差的移动平均值。 -K = « (5) where Δ is the Packet Delay Variation (PDV), and PDV is the degree of change in the transmission delay of the packet message transmitted in the packet transport network. The value can be taken as the first packet. The moving average of the difference between the adjacent two packets when the previous packet enters the system.
公式(5)可转换为以下公式(5,): 若将 看作是上述步骤 23中的第二 TDM业务数据从緩存中的实际读 出时刻,则 是第一 TDM业务数据从緩存中的实际读出时刻,上述公式( 5, ) 表示所述第二 TDM业务数据实际读出时刻与所述第一 TDM业务数据实际 读出时刻之间的第二差值 (即 ), 等于所述第一差值 (即 )与所 述分组时延偏差之和。 Equation (5) can be converted to the following formula (5,): If it is regarded as the actual read time of the second TDM service data from the cache in the above step 23, it is the actual read time of the first TDM service data from the cache, and the above formula (5, ) indicates the first a second difference (ie) between the actual read time of the second TDM service data and the actual read time of the first TDM service data is equal to the sum of the first difference (ie) and the packet delay deviation .
Δ 可以按照以下公式(6 )进行更新, 其中 为一预定正数:
Figure imgf000013_0001
k ( 6 )
Δ can be updated according to the following formula (6), where is a predetermined positive number:
Figure imgf000013_0001
k ( 6 )
由上述公式(1 )、 (2 )、 (3 )、 (4 )、 ( 5 )可得:  From the above formulas (1), (2), (3), (4), (5):
to B+1 - - Atn k t o B+1 - - At n k
Figure imgf000013_0002
Figure imgf000013_0002
进而由公式(7 )可得,
Figure imgf000013_0003
Further obtained by the formula (7),
Figure imgf000013_0003
由公式(8 ) 可知, 第" + 1个包的读出时钟频率, 取决于第"个包的读 出时钟频率、 两个包的包长、 两个包的发送端发送时刻差以及两个包进入 接收端的时刻差, 以及第 "+ 1个包的前 个包进入接收端时相邻两个包之间 的间隔的移动平均值。 当发送端时钟频率突然改变时, 将直接反映在发送 端 TDM业务封包净荷的完成时间间隔上,上述频率调整算法可根据提取到 的发送端封包时间间隔信息, 对发送端频率突然改变进行跟踪并做出快速 反应。  It can be known from equation (8) that the read clock frequency of the "+1 packet depends on the read clock frequency of the "packet", the packet length of two packets, the transmission time difference of the two packets, and two The time difference between the packet entering the receiving end, and the moving average of the interval between two adjacent packets when the previous packet of the +1 packet enters the receiving end. When the clock frequency of the transmitting terminal suddenly changes, it will be directly reflected in the sending. The frequency adjustment algorithm may track the sudden change of the frequency of the sender and respond quickly according to the extracted time interval information of the sender packet.
基于上述基于时戳的时钟恢复方法, 本实施例还提供了一种基于时戳 的时钟恢复装置, 请参照图 4所示, 该时钟恢复装置具体包括: 报文接收模块,用于接收来自分组传送网的封装有时分复用 TDM业务 数据的分组报文, 并记录所述分组报文的接收时戳; 报文在分组传送网中传输的分组时延偏差, 计算并更新接收端的时钟频率。 Based on the time-stamp-based clock recovery method, the embodiment further provides a time-stamp-based clock recovery device. Referring to FIG. 4, the clock recovery device specifically includes: a message receiving module, configured to receive a packet message from a packet transport network that encapsulates and sometimes multiplexes TDM service data, and records a time stamp of receiving the packet message; and a packet delay transmitted by the packet in the packet transport network Deviation, calculate and update the clock frequency at the receiving end.
基于上述基于时戳的时钟恢复方法,, 本实施例还提供了另一种基于时 戳的时钟恢复装置, 请参照图 5所示, 该时钟恢复装置具体包括:  Based on the time-stamp-based clock recovery method, the embodiment further provides another time-stamp-based clock recovery device. Referring to FIG. 5, the clock recovery device specifically includes:
报文接收模块,用于接收来自分组传送网的封装有 TDM业务数据的分 组才艮文, 并记录所述分组 ^艮文的接收时戳;  a message receiving module, configured to receive a packet packet encapsulated with TDM service data from the packet transport network, and record a receiving time stamp of the packet;
存储处理模块, 用于从所述报文接收模块接收到的分组报文中提取 a storage processing module, configured to extract, from a packet received by the packet receiving module
TDM业务数据并緩存, 以及提取各个分组报文的报头中携带的发送时戳; 报文在分组传送网中传输的分组时延偏差, 计算并更新接收端的时钟频率。 The TDM service data is buffered, and the transmission time stamp carried in the header of each packet packet is extracted; the packet delay deviation transmitted by the packet in the packet transmission network is calculated, and the clock frequency of the receiving end is calculated and updated.
其中, 上述时钟计算模块包括一时钟恢复模块, 用于根据相邻两个分 组报文之间的发送时戳的第一差值、 用于读取緩存中的所述相邻两个分组 报文中的前一个报文的第一 TDM业务数据的第一时钟频率、和分组报文在 分组传送网中传输的分组时延偏差, 计算用于读取緩存中的所述相邻两个 分组报文中的后一个报文的第二 TDM业务数据的第二时钟频率, 其中, 所 述第二时钟频率使得所述第二 TDM 业务数据实际读出时刻与所述第一 TDM业务数据实际读出时刻之间的第二差值, 等于所述第一差值与所述分 组时延偏差之和。  The clock calculation module includes a clock recovery module, configured to read, according to a first difference of a transmission time stamp between two adjacent packet messages, the two adjacent packet messages in the read buffer. The first clock frequency of the first TDM service data of the previous message in the packet, and the packet delay deviation of the packet message transmitted in the packet transport network, are calculated for reading the adjacent two packet reports in the buffer a second clock frequency of the second TDM service data of the subsequent message in the text, wherein the second clock frequency causes the actual read time of the second TDM service data and the first TDM service data to be actually read out The second difference between the times is equal to the sum of the first difference and the packet delay deviation.
优选地, 上述时钟恢复装置, 还包括:  Preferably, the clock recovery device further includes:
读取模块,用于以所述第二时钟频率从緩存中读取所述第二 TDM业务 数据并发送给 TDM电路。 所述读取模块, 还用于在接收到的分组报文发生 乱序或丟包时,保持最近一次计算得到的用于读取緩存中的 TDM业务数据 的时钟频率不变, 并利用所述时钟频率去读取緩存中的 TDM业务数据, 直 到乱序或丟包现象消失。 And a reading module, configured to read the second TDM service data from the cache at the second clock frequency and send the data to the TDM circuit. The reading module is further configured to: when the received packet packet is out of order or lost, keep the last calculated clock frequency for reading the TDM service data in the cache unchanged, and use the Clock frequency to read TDM service data in the cache, straight The disorder or packet loss disappeared.
具体的, 本实施例中, 所述时钟恢复模块, 还用于在所述相邻两个分 组报文为第"、 "+ 1个分组报文时, 按照以下公式计算用于读取第" + 1个分 组才艮文的 TDM业务数据的读取时钟频率 +1:  Specifically, in this embodiment, the clock recovery module is further configured to: when the two adjacent packet messages are the first "," + 1 packet message, calculate according to the following formula for reading the first" + 1 packet to read the TDM service data read clock frequency +1:
^n+l  ^n+l
J n+l ― /  J n+l ― /
tn+l - tn + Atn k + r -( l -0 其中, 为用于读取第 "个分组报文的 TDM业务数据的读取时钟频率, i、 分别为第" + 1、 "个分组报文的 TDM业务数据的长度, Δ 为分组报 文在分组传送网中传输的分组时延偏差, 分别为第" +1、 "个分组才艮 文的接收时戳, ^、 ^分别为第" + 1、 "个分组 ^艮文的发送时戳; t n+l - t n + At n k + r -( l -0 where is the read clock frequency of the TDM service data for reading the "first packet", i, respectively, "+1". "The length of the TDM service data of the packet message, Δ is the packet delay deviation of the packet message transmitted in the packet transmission network, which is the reception time stamp of the "+1,1" packet, ^, ^ The transmission time stamps of the first "+1,"groupings;
, ΑίΜ = .n-l ,n-k ,n-k-\ „ , Αί Μ = .nl , nk , nk-\ „
其中, k , 、 、 分别为第" -1、 n _ k、 个分组报文的接收时戳, 为一预定正数。  Where k , , , are the " -1, n _ k, and the received time stamps of the packet messages, respectively, which are a predetermined positive number.
所述存储处理模块, 还可以用于从各个分组报文的报头中提取报文序 号和包长信息,所述包长信息为所述分组报文中封装的 TDM业务数据的长 度。 所述时钟恢复模块, 还用于根据所述报文序号, 确定分组报文之间的 相邻关系。 所述读取模块, 还用于根据所述包长信息, 确定所述第二 TDM 业务数据在緩存中的位置,进而从緩存中读取所述第二 TDM业务数据对应 的数据。  The storage processing module may be further configured to extract a message sequence number and packet length information from a header of each packet message, where the packet length information is a length of TDM service data encapsulated in the packet message. The clock recovery module is further configured to determine, according to the message sequence number, an adjacency relationship between the packet messages. The reading module is further configured to determine, according to the packet length information, a location of the second TDM service data in the cache, and further read data corresponding to the second TDM service data from the cache.
最后再结合图 6对本发明做进一步的说明。 图 6通过一个细化的时钟 恢复装置的电路模块图, 示意性地说明了接收端是如何利用分组报文的发 送时戳和本地时戳信息来进行频率调整和恢复的。  Finally, the present invention will be further described with reference to FIG. Figure 6 schematically illustrates how the receiving end utilizes the transmit timestamp and local timestamp information of the packet message for frequency adjustment and recovery through a circuit block diagram of a refined clock recovery device.
图 6所示的时钟恢复装置, 包括报文接收模块、 定时模块、 报头处理 模块、 FIFO緩存器、 算术逻辑模块(ALU, Arithmetic Logic Unit )、 读出 比特计数模块、 直接频率合成(DDS, Direct Digital Synthesis )模块以及频 率控制算法模块等组成, 各模块的连接关系如图 6所示。 The clock recovery device shown in FIG. 6 includes a message receiving module, a timing module, a header processing module, a FIFO buffer, an Arithmetic Logic Unit (ALU), a read bit counting module, and a direct frequency synthesis (DDS, Direct). Digital Synthesis) module and frequency The rate control algorithm module is composed of the same, and the connection relationship of each module is as shown in FIG. 6.
在接收端, 第一定时模块对进入***的每个分组报文进行定时, 并将 每个分组报文进入***的准确时刻信息 (即接收时戳)发送给 ALU模块; 报头处理模块处理分组报文的报文头部, 并将报文中的封装的净荷 (TDM 业务数据)输入到 FIFO 緩存器中, 同时将报头中的报文序号、 发送时戳 timestamp以及包长信息发送给 ALU模块 13; FIFO緩存器用于緩存剥去头 部信息后的报文净荷 ( TDM业务数据 ), 并按 DDS模块提供的时钟频率读 取 FIFO緩存器中的数据并发往 TDM电路; ALU模块对提取到的相关信息 进行运算,为频率控制算法模块提供相应信息;频率控制算法模块根据 ALU 模块提供的信息,按照公式( 8 )计算时钟频率或釆取相应的频率调整策略; DDS模块根据频率控制算法模块提供的时钟频率, 实施相应的频率调整, 用以控制 FIFO的读出时钟频率和 TDM电路发送时钟频率。  At the receiving end, the first timing module times each packet message entering the system, and sends the accurate time information (ie, the received time stamp) of each packet message into the system to the ALU module; the header processing module processes the packet report. The message header of the text, and the encapsulated payload (TDM service data) in the message is input into the FIFO buffer, and the message sequence number, the transmission time stamp timestamp, and the packet length information in the header are sent to the ALU module. 13; FIFO buffer is used to buffer the message payload (TDM service data) after stripping the header information, and read the data in the FIFO buffer according to the clock frequency provided by the DDS module and send it to the TDM circuit; ALU module pair extraction The related information is calculated to provide corresponding information for the frequency control algorithm module; the frequency control algorithm module calculates the clock frequency according to the formula (8) according to the information provided by the ALU module or retrieves the corresponding frequency adjustment strategy; the DDS module according to the frequency control algorithm The clock frequency provided by the module, the corresponding frequency adjustment is implemented to control the read clock frequency of the FIFO and the TDM circuit transmits Clock frequency.
在利用图 6进行时钟恢复时, 具体包括如下步骤:  When the clock recovery is performed by using FIG. 6, the following steps are specifically included:
步骤 51 , 在接收端,设置好 FIFO緩存器的初始读出时钟频率 、 DDS 模块的各参数以及定时用的计数器。  Step 51: On the receiving end, set the initial read clock frequency of the FIFO buffer, the parameters of the DDS module, and the counter for timing.
这里, 接收端使用一个高速时钟, 可以是 50MHz或者 100MHz, 作为 定时的计数时钟 (例如 50MHz 时钟, 则一个计数节拍代表 20ns , 釆用 100MHz时钟, 一个计数节代表 10ns )。 本实施例中釆用 50MHz时钟作计 数时钟,釆用一个 32位的寄存器寄存本地计数时钟信息。接收端初始化时, 初始化 FIFO緩存器的读出时钟频率, 例如, 对 E1数据初始为其标称频率 2.048MHz, 对 T1数据初始化为其标称时钟频率 1.544MHz, 同时对第一、 第二定时模块进行初始化。  Here, the receiving end uses a high-speed clock, which can be 50MHz or 100MHz, as a timing counting clock (for example, a 50MHz clock, one counting beat represents 20ns, a 100MHz clock, and one counting section represents 10ns). In this embodiment, a 50 MHz clock is used as the count clock, and a 32-bit register is used to register the local count clock information. When the receiving end is initialized, the read clock frequency of the FIFO buffer is initialized. For example, the E1 data is initially initialized to its nominal frequency of 2.048 MHz, and the T1 data is initialized to its nominal clock frequency of 1.544 MHz, and the first and second timings are simultaneously performed. The module is initialized.
步骤 52, 在接收端, 对每个进入***的报文进行定时, 记录每个包进 入***的准确时刻信息。  Step 52: At the receiving end, time each message entering the system is scheduled, and the accurate time information of each packet entering the system is recorded.
在第一个分组报文进入接收端的***时, 第一定时模块将此报文的进 入***的时刻信息, 发送给 ALU模块。 并且, 在后续的第一个分组报文的 TDM业务数据从 FIFO緩存器完全读出时, 第二定时模块也将此时的定时 信息发送回给 ALU模块, 对后续的每个报文都釆取同样操作。 When the first packet message enters the receiving end of the system, the first timing module advances the message. The time information entered into the system is sent to the ALU module. Moreover, when the TDM service data of the subsequent first packet message is completely read out from the FIFO buffer, the second timing module also sends the timing information at this time back to the ALU module, and each subsequent message is 釆Take the same operation.
步骤 53 , 在接收端, 报头处理模块提取每个报文的报文序号、 相应的 包长信息、 以及相应 ^艮头里的 timestamp信息。  Step 53: At the receiving end, the header processing module extracts the message sequence number of each message, the corresponding packet length information, and the timestamp information in the corresponding header.
步骤 54, 读出比特计数模块对从 FIFO緩存器读出数据比特个数进行 计数,通过读出比特计数值以及包长信息来确定每个 TDM业务数据界限的 准确位置。  Step 54: The read bit counting module counts the number of data bits read from the FIFO buffer, and determines the exact position of each TDM service data limit by reading the bit count value and the packet length information.
步骤 55 ,根据 TDM业务数据的界限,确定每个 TDM业务数据从 FIFO 緩存器中完全读出的时刻。  Step 55: Determine, according to the boundary of the TDM service data, a moment when each TDM service data is completely read out from the FIFO buffer.
步骤 56, 根据报文序号、 以及相应报头部里的 timestamp、 报文进入系 统时刻、 报文从 FIFO读出时刻以及 FIFO緩存器当前的读出时钟频率 , 当 前报文的前 个报文中相邻两个报文进入***的间隔信息, ALU模块按照 上述公式(8 )进行相应的运算, 并将运算结果输出给频率控制算法模块, 频率控制算法模块根据所获信息, 釆取相应的频率调整策略, 调整 DDS的 输出频率, 以对 FIFO緩存器的读出时钟频率进行相应调整。 考虑到 ALU 模块的运算量和速度, 具体实现时可以考虑釆用软件进行替代。  Step 56: According to the message sequence number, the timestamp in the corresponding header, the time when the message enters the system, the time when the message is read from the FIFO, and the current read clock frequency of the FIFO buffer, the previous message in the current message The adjacent two messages enter the interval information of the system, and the ALU module performs corresponding operations according to the above formula (8), and outputs the operation result to the frequency control algorithm module, and the frequency control algorithm module extracts the corresponding frequency according to the obtained information. Adjust the strategy and adjust the output frequency of the DDS to adjust the read clock frequency of the FIFO buffer accordingly. Considering the amount of calculation and speed of the ALU module, you can consider using software instead.
最后, 发明人对本实施例的上述时钟恢复方法进行了仿真测试。 仿真 时, 分组 4艮文内容釆用 E1业务, 对应的测试标准釆用 G.8261的测试用例, 通过对发送端频率发生突变进行仿真, 发现本实施例能够快速跟踪发送端 的频率突变并锁定。在频率锁定后,对最大时间间隔误差( MTIE, Maximum Time Interval Error )指标和时间偏差( TDEV, Time Deviation )指标进行了 测试, 测出的指标都很好地满足了相关标准。 如果出现丟包, 本实施例可 以根据报文序号, 侦测出丟包; 在出现丟包时, 釆取的策略是保持之前恢 复出来的读取时钟频率不变。 出现报文乱序时, 由于报文序号提取后都存 入了 ALU模块(预存序号的多少由配置决定), ALU模块对乱序报文的有 用信息提取, 不会受任何影响, 因此, 乱序对本实施例时钟恢复方法并没 有太大影响。 Finally, the inventors conducted a simulation test on the above-described clock recovery method of the present embodiment. In the simulation, the content of the packet is used in the E1 service, and the corresponding test standard uses the test case of G.8261. By simulating the mutation of the frequency at the transmitting end, it is found that this embodiment can quickly track the frequency mutation of the transmitting end and lock it. After the frequency is locked, the Maximum Time Interval Error (MTIE) indicator and the Time Deviation (TDEV, Time Deviation) indicator are tested, and the measured indicators all meet the relevant standards well. If packet loss occurs, this embodiment can detect packet loss according to the packet sequence number. When a packet loss occurs, the strategy of capturing is to keep the read clock frequency recovered before. When the message is out of order, the message number is saved after it is extracted. The ALU module is entered (the number of pre-stored sequence numbers is determined by the configuration), and the ALU module extracts the useful information of the out-of-order message without any influence. Therefore, the out-of-order does not have much influence on the clock recovery method of this embodiment.
以上所述仅是本发明的实施方式, 应当指出, 对于本技术领域的普通 技术人员来说, 在不脱离本发明原理的前提下, 还可以作出若干改进和润 饰, 这些改进和润饰也应视为本发明的保护范围。  The above description is only an embodiment of the present invention, and it should be noted that those skilled in the art can also make several improvements and retouchings without departing from the principles of the present invention. These improvements and retouchings should also be considered. It is the scope of protection of the present invention.

Claims

权利要求书 Claim
1. 一种基于时戳的时钟恢复方法, 其特征在于, 所述方法包括: 接收端接收来自分组传送网的、 封装有时分复用 (TDM ) 业务数据的 分组 文, 并记录所述分组 ^艮文的接收时戳;  A time-stamp-based clock recovery method, the method comprising: receiving, by a receiving end, a packet packet from a packet transport network that encapsulates time-division-multiplexed (TDM) service data, and recording the packet ^ The receiving time stamp of the text;
接收端根据相邻两个分组 4艮文之间的发送时间差、 和分组 4艮文在分组 传送网中传输的分组时延偏差, 计算并更新接收端的时钟频率。  The receiving end calculates and updates the clock frequency of the receiving end according to the transmission time difference between the adjacent two packets and the packet delay deviation transmitted by the packet in the packet transmission network.
2. 如权利要求 1所述的时钟恢复方法, 其特征在于, 所述方法还包括: 接收端从接收到的分组报文中提取 TDM业务数据并緩存,以及提取各 个分组报文的报头中携带的发送时戳;  2. The clock recovery method according to claim 1, wherein the method further comprises: the receiving end extracting TDM service data from the received packet message and buffering, and extracting a header of each packet message to carry Transmitting time stamp;
所述计算并更新接收端的时钟频率包括:  The calculating and updating the clock frequency of the receiving end includes:
接收端根据相邻两个分组报文之间的发送时戳的第一差值、 用于读取 緩存中的所述相邻两个分组报文中的前一个报文的第一 TDM 业务数据的 第一时钟频率、 和分组 ^艮文在分组传送网中传输的分组时延偏差, 计算用 于读取緩存中的所述相邻两个分组报文中后一个报文的第二 TDM 业务数 据的第二时钟频率, 其中, 所述第二时钟频率使得所述第二 TDM业务数据 实际读出时刻与所述第一 TDM业务数据实际读出时刻之间的第二差值,等 于所述第一差值与所述分组时延偏差之和。  The first TDM service data used by the receiving end to read the previous one of the two adjacent packet messages in the buffer according to the first difference of the sending timestamps between the two adjacent packet messages a first clock frequency, and a packet delay deviation transmitted by the packet in the packet transport network, and calculating a second TDM service for reading the next one of the adjacent two packet messages in the buffer a second clock frequency of the data, wherein the second clock frequency is such that a second difference between the actual readout time of the second TDM service data and the actual readout time of the first TDM service data is equal to the The sum of the first difference and the packet delay deviation.
3. 如权利要求 2所述的时钟恢复方法, 其特征在于, 所述计算用于读 取緩存中的所述相邻两个分组报文中后一个报文的第二 TDM 业务数据的 第二时钟频率, 包括:  The clock recovery method according to claim 2, wherein the calculating second data of the second TDM service data for reading the next one of the adjacent two packet messages in the buffer Clock frequency, including:
在所述相邻两个分组报文为第 w、 《 + 1个分组报文时, 进一步按照以下 公式计算用于读取第《 + 1个分组报文的 TDM业务数据的读取时钟频率 fn+lWhen the two adjacent packet messages are the wth and the +1 packet messages, the read clock frequency f for reading the TDM service data of the +1 packet message is further calculated according to the following formula: n+l :
J J
tn+l - tn + Atn k + r -( l -0 其中, /„为用于读取第 "个分组报文的 TDM业务数据的读取时钟频率, /n+1、 /分别为第 " + 1、 "个分组报文的 TDM业务数据的长度, Δ 为分组报 文在分组传送网中传输的分组时延偏差, ζ+1、 分别为第《 + 1、 w个分组才艮 文的接收时戳, t„+1、 ^分别为第《 + 1、 "个分组报文的发送时戳; 其中, = C d "—1)] , 、 t:-k、 +ι分别为第"— i、 n_k、 k t n+l - t n + At n k + r -( l -0 where /„ is the read clock frequency of the TDM service data for reading the "first packet" message, / n+1 , / are the length of the " + 1, " TDM service data of the group message, and Δ is the packet delay deviation of the packet message transmitted in the packet transmission network, ζ +1 , respectively + 1, w grouping is only the receiving time stamp of the text, t„ +1 and ^ are respectively the transmission time stamp of the "+ 1, " group packet; wherein, = C d " -1 ]], , t : - k , +ι are the first "-i, n _ k , k
个分组报文的接收时戳, 为一预定正数。  The receiving time stamp of the packet message is a predetermined positive number.
4. 如权利要求 2或 3所述的时钟恢复方法, 其特征在于, 所述方法还 包括:  The clock recovery method according to claim 2 or 3, wherein the method further comprises:
接收端以所述第二时钟频率从緩存中读取所述第二 TDM 业务数据并 发送给 TDM电路。  The receiving end reads the second TDM service data from the buffer at the second clock frequency and sends the data to the TDM circuit.
5. 如权利要求 4所述的时钟恢复方法, 其特征在于, 所述计算用于读 取緩存中的所述相邻两个分组报文中后一个报文的第二 TDM 业务数据的 第二时钟频率, 还包括:  The clock recovery method according to claim 4, wherein the calculating second data of the second TDM service data for reading the next one of the adjacent two packet messages in the buffer Clock frequency, also includes:
在接收到的分组报文发生乱序或丟包时, 保持最近一次计算得到的用 于读取緩存中的 TDM业务数据的时钟频率不变,并利用所述时钟频率去读 取緩存中的 TDM业务数据, 直到乱序或丟包现象消失。  When the received packet packet is out of order or lost, the clock frequency for reading the TDM service data in the cache that is calculated last time is kept unchanged, and the clock frequency is used to read the TDM in the buffer. Business data, until out of order or packet loss disappears.
6. 如权利要求 4所述的时钟恢复方法, 其特征在于, 所述接收端以所 述第二时钟频率从緩存中读取所述第二 TDM业务数据, 为:  The clock recovery method according to claim 4, wherein the receiving end reads the second TDM service data from the cache at the second clock frequency, which is:
接收端进一步从各个分组报文的报头中提取报文序号和包长信息, 所 述包长信息为所述分组报文中封装的 TDM业务数据的长度;  The receiving end further extracts the message sequence number and the packet length information from the header of each packet packet, where the packet length information is the length of the TDM service data encapsulated in the packet packet.
接收端根据所述报文序号, 确定分组报文之间的相邻关系, 以及根据 所述包长信息, 确定所述第二 TDM业务数据在緩存中的位置, 从緩存中读 取所述第二 TDM业务数据对应的数据。  The receiving end determines the neighbor relationship between the packet messages according to the message sequence number, and determines the location of the second TDM service data in the cache according to the packet length information, and reads the number from the cache. The data corresponding to the two TDM service data.
7. 一种基于时戳的时钟恢复装置, 其特征在于, 包括:  A time stamp based clock recovery device, comprising:
报文接收模块,用于接收来自分组传送网的封装有 TDM业务数据的分 组才艮文, 并记录所述分组 ^艮文的接收时戳; 报文在分组传送网中传输的分组时延偏差, 计算并更新接收端的时钟频率。 a packet receiving module, configured to receive a packet packet encapsulated with TDM service data from a packet transport network, and record a receiving time stamp of the packet; The packet delay deviation of the message transmitted in the packet transport network, and the clock frequency of the receiving end is calculated and updated.
8. 如权利要求 7所述的时钟恢复装置, 其特征在于, 还包括: 存储处理模块, 用于从所述报文接收模块接收到的分组报文中提取 TDM业务数据并緩存, 以及提取各个分组报文的报头中携带的发送时戳; 所述时钟计算模块包括:  The clock recovery apparatus according to claim 7, further comprising: a storage processing module, configured to extract TDM service data from the packet message received by the message receiving module, cache, and extract each a sending time stamp carried in a header of the packet message; the clock calculation module includes:
时钟恢复模块, 用于根据相邻两个分组报文之间的发送时戳的第一差 值、 用于读取緩存中的所述相邻两个分组报文中的前一个报文的第一 TDM 业务数据的第一时钟频率、 和分组报文在分组传送网中传输的分组时延偏 差, 计算用于读取緩存中的所述相邻两个分组报文中的后一个报文的第二 TDM 业务数据的第二时钟频率, 其中, 所述第二时钟频率使得所述第二 TDM业务数据实际读出时刻与所述第一 TDM业务数据实际读出时刻之间 的第二差值, 等于所述第一差值与所述分组时延偏差之和。  a clock recovery module, configured to: according to a first difference of a sending timestamp between two adjacent packet messages, to read a previous one of the two adjacent packet messages in the buffer a first clock frequency of the TDM service data, and a packet delay deviation of the packet message transmitted in the packet transport network, and is used to calculate the next one of the adjacent two packet messages in the buffer a second clock frequency of the second TDM service data, wherein the second clock frequency causes a second difference between the actual read time of the second TDM service data and the actual read time of the first TDM service data And equal to the sum of the first difference and the packet delay deviation.
9. 如权利要求 8所述的时钟恢复装置, 其特征在于,  9. The clock recovery device of claim 8 wherein:
所述时钟恢复模块, 还用于在所述相邻两个分组报文为第 w、 《 + l个分 组报文时, 按照以下公式计算用于读取第《 + 1个分组报文的 TDM业务数据 的读取时钟频率 /κ+1The clock recovery module is further configured to: when the two adjacent packet messages are the wth and the “+1” packet, calculate the TDM for reading the “+1 packet” according to the following formula: Read clock frequency of business data / κ+1 :
J J
tn+l - tn + Atn k + r -( l -0 其中, /„为用于读取第 "个分组报文的 TDM业务数据的读取时钟频率, /n+1、 /分别为第《 + 1、 "个分组报文的 TDM业务数据的长度, Δ 为分组报 文在分组传送网中传输的分组时延偏差, t:+1、 分别为第《 + 1、 w个分组才艮 文的接收时戳, „+1、 „分别为第《 + 1、 "个分组报文的发送时戳; t n+l - t n + At n k + r -( l -0 where /„ is the read clock frequency of the TDM service data for reading the "packet packet", / n+1 , / respectively The length of the TDM service data of the "+1" packet, Δ is the packet delay deviation of the packet message transmitted in the packet transport network, t: +1 , respectively, the + + 1, w packets The receiving time stamp of the essay, „ +1 , „ are the transmission time stamps of the “ +1 ,” packet messages respectively;
其中, ^ J -C1)- (CW- , t -k、 H分别为第"— L N _K、 个分组报文的接收时戳, 为一预定正数。 Where ^ J -C 1 )- (CW- , t - k , H are the first "- L N _ K , The receiving time stamp of the packet message is a predetermined positive number.
10. 如权利要求 8或 9所述的时钟恢复装置, 其特征在于, 所述装置还 包括:  The clock recovery device according to claim 8 or 9, wherein the device further comprises:
读取模块,用于以所述第二时钟频率从緩存中读取所述第二 TDM业务 数据并发送给 TDM电路。  And a reading module, configured to read the second TDM service data from the cache at the second clock frequency and send the data to the TDM circuit.
11. 如权利要求 10所述的时钟恢复装置, 其特征在于,  11. The clock recovery device of claim 10, wherein
所述读取模块, 还用于在接收到的分组报文发生乱序或丟包时, 保持 最近一次计算得到的用于读取緩存中的 TDM业务数据的时钟频率不变,并 利用所述时钟频率去读取緩存中的 TDM业务数据,直到乱序或丟包现象消 失。  The reading module is further configured to: when the received packet packet is out of order or lost, keep the last calculated clock frequency for reading the TDM service data in the cache unchanged, and use the The clock frequency reads the TDM service data in the cache until the out-of-order or packet loss phenomenon disappears.
12. 如权利要求 10所述的时钟恢复装置, 其特征在于,  12. The clock recovery device of claim 10, wherein
所述存储处理模块, 进一步用于从各个分组报文的报头中提取报文序 号和包长信息,所述包长信息为所述分组报文中封装的 TDM业务数据的长 度;  The storage processing module is further configured to extract a message sequence number and packet length information from a header of each packet packet, where the packet length information is a length of the TDM service data encapsulated in the packet packet.
所述时钟恢复模块, 还用于根据所述报文序号, 确定分组报文之间的 相邻关系;  The clock recovery module is further configured to determine, according to the message sequence number, an adjacent relationship between the packet messages;
所述读取模块, 还用于根据所述包长信息, 确定所述第二 TDM业务数 据在緩存中的位置, 从緩存中读取所述第二 TDM业务数据对应的数据。  The reading module is further configured to determine, according to the packet length information, a location of the second TDM service data in a cache, and read data corresponding to the second TDM service data from a cache.
PCT/CN2010/080020 2010-07-27 2010-12-20 Method and apparatus for clock recovery based on time stamps WO2012012999A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010239628.9A CN102340365B (en) 2010-07-27 2010-07-27 Timestamp-based clock recovery method and device
CN201010239628.9 2010-07-27

Publications (1)

Publication Number Publication Date
WO2012012999A1 true WO2012012999A1 (en) 2012-02-02

Family

ID=45515890

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/080020 WO2012012999A1 (en) 2010-07-27 2010-12-20 Method and apparatus for clock recovery based on time stamps

Country Status (2)

Country Link
CN (1) CN102340365B (en)
WO (1) WO2012012999A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016074152A1 (en) * 2014-11-11 2016-05-19 华为技术有限公司 Method and apparatus for processing differential clock recovery
CN106559159B (en) * 2015-09-30 2018-11-16 北京华为数字技术有限公司 Circuit emulation service clock synchronization detecting method and device
CN108494542B (en) * 2018-03-23 2020-09-08 成都信息工程大学 Method for compensating influence of network load change on CES ACR clock recovery in PTN
CN113259038B (en) * 2021-04-29 2022-06-21 北京邮电大学 Time synchronization method, node, device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101510850A (en) * 2009-04-03 2009-08-19 华为技术有限公司 Apparatus and method for clock optimization process
CN101640578A (en) * 2009-08-25 2010-02-03 北京邮电大学 TDM service clock recovery method for packet transport network
US7711009B2 (en) * 2006-09-29 2010-05-04 Agere Systems Inc. Methods and apparatus for timing synchronization in packet networks
CN101772151A (en) * 2009-12-25 2010-07-07 中兴通讯股份有限公司 Device and method for recovering clock signal of time division multiplex output

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101674174B (en) * 2008-09-12 2013-06-05 华为技术有限公司 Method and equipment for increasing clock stability
CN101719867B (en) * 2009-11-23 2012-07-25 中兴通讯股份有限公司 Method and system for clock recovery in packet switching network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7711009B2 (en) * 2006-09-29 2010-05-04 Agere Systems Inc. Methods and apparatus for timing synchronization in packet networks
CN101510850A (en) * 2009-04-03 2009-08-19 华为技术有限公司 Apparatus and method for clock optimization process
CN101640578A (en) * 2009-08-25 2010-02-03 北京邮电大学 TDM service clock recovery method for packet transport network
CN101772151A (en) * 2009-12-25 2010-07-07 中兴通讯股份有限公司 Device and method for recovering clock signal of time division multiplex output

Also Published As

Publication number Publication date
CN102340365A (en) 2012-02-01
CN102340365B (en) 2014-06-11

Similar Documents

Publication Publication Date Title
US10623123B2 (en) Virtual HDBaseT link
US9203725B2 (en) Update of a cumulative residence time of a packet in a packet-switched communication network
US9282024B2 (en) Physical layer processing of timestamps and MAC security
US8971352B2 (en) High accuracy 1588 timestamping over high speed multi lane distribution physical code sublayers
CN109787703B (en) Timestamp correction method, clock synchronization method and system
US9391728B2 (en) Methods and apparatus for precision time stamping
JP6214008B2 (en) Method and apparatus for communicating time information between time recognition devices
KR100715736B1 (en) Adaptive clock recovery
CN109699199B (en) Message processing method and network equipment
US20150078405A1 (en) Monitoring clock accuracy in asynchronous traffic environments
EP2882120B1 (en) A method and apparatus for mitigation of packet delay variation
Exel Mitigation of asymmetric link delays in IEEE 1588 clock synchronization systems
WO2010028550A1 (en) A method and a device for improving the clock stability
WO2012012999A1 (en) Method and apparatus for clock recovery based on time stamps
WO2011015078A1 (en) Method and device for adaptive clock restoration
US8817826B2 (en) Aggregating lower bandwidth asynchronously clocked communication links into a higher bandwidth link
US20100284425A1 (en) System and method of using tdm variable frame lengths in a telecommunications network
US8315167B2 (en) Multiplexing of DS1 traffic across wired and wireless Ethernet devices
CN112751637A (en) Time delay calculation method, related equipment and system
KR20010039212A (en) Apparatus for setting time stamp offset and method thereof
US20100315941A1 (en) Maintaining time-division multiplexing over pseudowire connections during network outages
JP2013030873A (en) Communication apparatus, packetization period change method, and program
US20070201491A1 (en) System and method for synchronizing serial digital interfaces over packet data networks
WO2010043128A1 (en) Method and device for transmitting and receiving mapping overheads
WO2014141681A1 (en) Communication apparatus

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10855226

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10855226

Country of ref document: EP

Kind code of ref document: A1