WO2021147042A1 - Time synchronization method and device - Google Patents

Time synchronization method and device Download PDF

Info

Publication number
WO2021147042A1
WO2021147042A1 PCT/CN2020/073915 CN2020073915W WO2021147042A1 WO 2021147042 A1 WO2021147042 A1 WO 2021147042A1 CN 2020073915 W CN2020073915 W CN 2020073915W WO 2021147042 A1 WO2021147042 A1 WO 2021147042A1
Authority
WO
WIPO (PCT)
Prior art keywords
cell
time
bit
reference bit
information element
Prior art date
Application number
PCT/CN2020/073915
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 华为技术有限公司
Priority to CN202080088865.1A priority Critical patent/CN114868354A/en
Priority to PCT/CN2020/073915 priority patent/WO2021147042A1/en
Publication of WO2021147042A1 publication Critical patent/WO2021147042A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter

Definitions

  • This application relates to the field of communication technology, in particular to design a time synchronization method and device.
  • the 1588 protocol (also known as the precision time protocol (PTP)) usually needs to implement time synchronization between communication devices via Ethernet, that is, messages used for time synchronization need to pass Ethernet messages The way to transmit between communication devices.
  • PTP precision time protocol
  • communication devices that also need to perform accurate time synchronization transmit service data in the form of cells, such as in the scenario of a cell system and a multi-frame cluster of products. Then, if the traditional time synchronization method is still implemented in these scenarios, additional Ethernet ports need to be added between the communication devices to send Ethernet packets, which increases the cost of the communication devices.
  • This application provides a time synchronization method and device to support precise time synchronization between communication devices for cell transmission.
  • the embodiments of the present application provide a time synchronization method, which can be applied to two communication devices that perform service transmission in the cell mode.
  • the delay requester is referred to as the first device below.
  • the delayed responder is called the second device.
  • the method includes the following steps:
  • the first device sends the first information element to the second device, and determines the first moment, where the first information element contains the first reference bit, and the first moment is for the first device to send the first The moment of the first reference bit in the cell; the first device receives a second cell from the second device, wherein the second cell contains a first time bit field and a second reference bit , The first time bit field is used to indicate the second moment when the second device receives the first reference bit in the first cell; the first device determines the third moment, the first Time three is the time when the first device receives the second reference bit in the second information element; the first device receives the third information element from the second device, where the third information element The element includes a second time bit field, and the second time bit field is used to indicate the fourth moment when the second device sends the second reference bit in the second cell; finally, the first The device performs time synchronization with the second device according to the first time, the second time, the third time, and the fourth time.
  • the first device and the second device can interact with information elements to realize the time synchronization of the 1588 protocol. Therefore, this method can achieve precise time synchronization between communication devices that support cell transmission.
  • any communication system that supports cell transmission can realize time synchronization based on the 1588 protocol in cell mode through this method, which can replace the traditional method of carrying the 1588 protocol based on the Ethernet mode, which is convenient for the deployment of the 1588 system.
  • the communication device supporting cell transmission can realize the time synchronization of the 1588 protocol without adding an additional Ethernet port, this method can also save the overhead caused by the hardware port.
  • the first reference bit and the second reference bit may be set in the following manner:
  • Manner 1 The first reference bit is the most significant bit MSB in the first cell, and the second reference bit is the MSB in the second cell;
  • the first reference bit is the nth bit in the first cell
  • the second reference bit is the nth bit in the second cell, where n is greater than or equal to 1.
  • Manner 3 The first reference bit is the last bit in the first cell, and the second reference bit is the last bit in the second cell.
  • This design can improve the flexibility of setting the reference bit in the time synchronization related cell.
  • the first device saves the time corresponding to each clock cycle during the process of receiving the second cell; after receiving the second cell, the first device determines to receive Determining the target clock cycle where the second reference bit in the second cell is located, and determining that the time corresponding to the target clock cycle is the third time.
  • the first device In the process of receiving the second cell, the first device cannot determine the type of the cell, nor can it directly determine the moment of receiving the second reference bit in the second cell. By design, the first device may determine by determining the target clock cycle in which the second reference bit is received after receiving the second cell.
  • the first time is the time when the first device physically encodes the first reference bit; the third time is the first device to the second reference bit The moment of physical decoding.
  • the first cell is a delay request cell
  • the second cell is a delay response cell
  • the third cell is a follow cell.
  • the embodiments of the present application provide a time synchronization method, which can be applied to two communication devices that perform service transmission in a cell manner.
  • the delay requester is hereinafter referred to as the first device
  • the delayed responder is called the second device.
  • the method includes the following steps:
  • the second device receives the first information element from the first device, and determines a second time, the first information element includes a first reference bit, and the second time is when the second device receives the first information element
  • the first reference bit time in the second device the second device sends a second information element to the first device, and determines the fourth time, and the second information element contains the first time bit field and the second time bit field.
  • Reference bit, the first time bit field is used to indicate the second moment, and the fourth moment is the moment when the second device sends the second reference bit in the second cell;
  • the second device sends a third information element to the first device, where the third information element includes a second time bit field, and the second time bit field is used to indicate the fourth time.
  • the first device and the second device can interact with information elements to realize the time synchronization of the 1588 protocol. Therefore, this method can achieve precise time synchronization between communication devices that support cell transmission.
  • any communication system that supports cell transmission can realize time synchronization based on the 1588 protocol in cell mode through this method, which can replace the traditional method of carrying the 1588 protocol based on the Ethernet mode, which is convenient for the deployment of the 1588 system.
  • the communication device supporting cell transmission can realize the time synchronization of the 1588 protocol without adding an additional Ethernet port, this method can also save the overhead caused by the hardware port.
  • the first reference bit and the second reference bit may be set in the following manner:
  • Manner 1 The first reference bit is the most significant bit MSB in the first cell, and the second reference bit is the MSB in the second cell;
  • the first reference bit is the nth bit in the first cell
  • the second reference bit is the nth bit in the second cell, where n is greater than or equal to 1.
  • an integer less than or equal to N where N is less than or equal to the total number of bits contained in the first cell, and less than or equal to the total number of bits contained in the second cell;
  • Manner 3 The first reference bit is the last bit in the first cell, and the second reference bit is the last bit in the second cell.
  • This design can improve the flexibility of setting the reference bit in the time synchronization related cell.
  • the second device saves the time corresponding to each clock cycle during the process of receiving the first cell; after receiving the first cell, the second device determines to receive Determining the target clock cycle where the first reference bit in the first cell is located, and determining that the time corresponding to the target clock cycle is the second time.
  • the second device In the process of receiving the first cell, the second device cannot determine the type of the cell, nor can it directly determine the moment of receiving the first reference bit in the first cell. By design, the second device may determine the target clock cycle in which the first reference bit is received after receiving the first cell.
  • the second moment is the moment when the second device physically decodes the first reference bit; the fourth moment is when the second device performs physical decoding on the second reference bit.
  • the moment of physical encoding is the moment when the second device physically decodes the first reference bit;
  • the first cell is a delay request cell
  • the second cell is a delay response cell
  • the third cell is a follow cell.
  • an embodiment of the present application provides a communication device, which includes a unit for executing each step in the first aspect or the second aspect above.
  • an embodiment of the present application provides a communication device, including at least one processing element and at least one storage element, wherein the at least one storage element is used to store programs and data, and the at least one processing element is used to execute the above The method provided by the first or second aspect.
  • an embodiment of the present application provides a communication system, including a first device and a second device, wherein the first device has the function of executing the method provided in the first aspect of the present application, and the second device has The function of the method provided in the second aspect of this application.
  • the embodiments of the present application also provide a computer program, which when the computer program runs on a computer, causes the computer to execute the method provided in the first aspect or the second aspect.
  • the embodiments of the present application also provide a computer-readable storage medium in which a computer program is stored.
  • the computer program is executed by a computer, the computer is caused to execute the first The method provided by the aspect or the second aspect.
  • an embodiment of the present application also provides a chip, which is used to read a computer program stored in a memory and execute the method provided in the first aspect or the second aspect.
  • an embodiment of the present application also provides a chip system, which includes a processor, and is configured to support a computer device to implement the method provided in the first aspect or the second aspect.
  • the chip system further includes a memory, and the memory is used to store necessary programs and data of the computer device.
  • the chip system can be composed of chips, or it can include chips and other discrete devices.
  • FIG. 1 is a schematic diagram of a time synchronization process based on the 1588 protocol provided by the prior art
  • FIG. 2 is a structural diagram of a communication system provided by an embodiment of this application.
  • FIG. 3 is a flowchart of a time synchronization method provided by an embodiment of this application.
  • FIG. 4 is a schematic diagram of a logical function structure of a communication device provided by an embodiment of this application.
  • FIG. 5 is a flowchart of a time synchronization example provided by an embodiment of the application.
  • FIG. 6 is a structural diagram of a communication device provided by an embodiment of this application.
  • FIG. 7 is a structural diagram of a communication device provided by an embodiment of this application.
  • This application provides a time synchronization method and device to support accurate time synchronization between devices for cell transmission.
  • the method and the device are based on the same technical idea. Since the principles of the method and the device to solve the problem are similar, the implementation of the device and the method can be referred to each other, and the repetition will not be repeated.
  • a communication device is a device that transmits service data in a cell mode, and can also be referred to as a communication node or node.
  • the communication device may be a communication device in a frame cell system or a product multi-frame cluster.
  • Cell Model is a technology that transmits information or data in units of cells.
  • the cell method can cut information or data into multiple cells through the adaptation layer of the communication device.
  • the length of the cell may be fixed.
  • the length of the cell may also be variable.
  • the cell is mainly composed of two parts, namely the cell header and the cell payload.
  • the cell header contains address and control information
  • the cell payload contains data.
  • the cell can include two types: control cell and service cell.
  • the control cell is used to transmit control and management related data
  • the business cell is used to transmit business data.
  • the delay requester device A sends a delay request message (Pdelay_Request) to device B at time T1; device B receives the delay request message at time T2, and then sends a delay response message to device A at time T3 ( Pdelay_Response), wherein the delay response message includes the time T2 when the device B receives the delay request message; the device B sends the delay response message to the device A sends a follow-up message (Pdelay_Response_Follow_Up) of a delayed response message, where the follow-up message includes the time T3 when the device B sends the delayed response message; the device A receives the delay response message at time T4 Delay response message, and then receive the follow-up message, obtain T2 from the delayed response message, and obtain T3 from the follow-up message.
  • the device A can use the following formula to determine all The average path delay between the device A and the device B:
  • the device A can perform time synchronization with the device B according to the calculated average path delay.
  • Ethernet messages that is, delayed response messages, delayed response messages, and follow-up messages of delayed response messages.
  • Ethernet message This requires device A and device B to have Ethernet ports and be able to send Ethernet packets.
  • communication devices that also need to perform accurate time synchronization transmit service data in the form of cells, such as in the scenario of a box cell system and a product multi-chassis cluster. Then, if the traditional time synchronization method is still implemented in these scenarios, additional Ethernet ports need to be added between communication devices to send Ethernet packets, which increases the cost of communication devices.
  • FIG. 2 shows the architecture of a possible communication system to which the time synchronization method provided by the embodiment of the present application is applicable.
  • the communication between the communication devices does not use the Ethernet port, and the communication device The service transmission is carried out in the cell mode between each other.
  • the communication system includes multiple communication devices (communication device a, communication device b, and communication device c as shown in the figure), and each communication device can communicate with other communication devices.
  • each communication device maintains a local device time, and each communication device transmits and receives service data according to the locally maintained device time.
  • each communication device transmits and receives service data according to the locally maintained device time.
  • the transmission between the sender and the receiver Business data has a certain time delay.
  • the sender and receiver of each service transmission are also different. Therefore, the service transmission delay between the sender and receiver of each service transmission is not the same.
  • the service transmission delay of communication device a as the sender when performing service transmission with communication device b is 0.6 ms; for another example, the service transmission delay of communication device a as the sender when performing service transmission with communication device c is 0.4ms; for another example, the service transmission delay of the communication device b as the sender when performing service transmission with the communication device c is 0.5ms.
  • an embodiment of the present application provides a time synchronization method.
  • This method can be applied to the communication system supporting cell transmission as shown in FIG. 2.
  • the time synchronization method is implemented through the time synchronization principle of the 1588 protocol similar to FIG. 1.
  • the method provided in the embodiment of the present application will be described in detail below with reference to the flowchart shown in FIG. 3.
  • the delay requester in the communication system is referred to as the "first device”
  • the delay responder on the other side is referred to as the "second device”.
  • the first device sends a first information element to the second device, and determines a first time T1, where the first information element contains a first reference bit, and the first time T1 is sent by the first device The time of the first reference bit in the first cell.
  • the first information element may be referred to as a delay request information element.
  • the second device receives the first information element from the first device, and determines a second time T2.
  • the second time T2 is when the second device receives all of the first information elements. The moment of the first reference bit.
  • the second device sends a second information element to the first device, and determines a third time T3, where the second information element includes a first time bit field and a second reference bit, and the second information element includes a first time bit field and a second reference bit.
  • a time bit field is used to indicate the second time T2
  • the third time T3 is the time when the second device sends the second reference bit in the second cell.
  • the second cell may be referred to as a delayed response cell.
  • S304 The first device receives the second information element from the second device, and determines a fourth time T4, where the fourth time T4 is when the first device receives the second information element The moment of the second reference bit.
  • the second device sends a third information element to the first device, where the third information element includes a second time bit field, and the second time bit field is used to indicate the third time T3.
  • the first device receives the third information element from the second device.
  • the third cell may be referred to as a follow cell of the delayed response cell, or a follow cell.
  • the first device performs time synchronization with the second device according to the first time T1, the second time T2, the third time T3, and the fourth time T4.
  • the first device may perform time synchronization in the manner described in the time synchronization principle based on the 1588 protocol above, which will not be repeated here.
  • the first device and the second device when the first device and the second device send corresponding information elements, they usually encode information elements, for example, physical encoding is performed through a physical coding sublayer (PCS). Therefore, the first device and the second device may use the time at which the reference bit in the cell to be sent is encoded as the time at which the reference bit is sent, that is, the time at which the cell is sent.
  • PCS physical coding sublayer
  • the first device and the second device may record the corresponding time for each clock cycle in the process of receiving the encoded cell, the reception is completed and the cell is decoded After that, the clock cycle of the reference bit in the cell is determined, and finally the recorded time corresponding to the clock cycle can be used as the time of receiving the cell.
  • the second device may determine the second time T2 in the following manner:
  • the second device saves the time corresponding to each clock cycle during the process of receiving the first cell
  • the second device After receiving the first cell, the second device determines the target clock cycle in which the first reference bit in the first cell is received, and then determines that the time corresponding to the target clock cycle is the second Time T2.
  • the first device may determine the fourth time T4 in the following manner:
  • the first device saves the time corresponding to each clock cycle during the process of receiving the second cell
  • the first device After receiving the second cell, the first device determines the target clock cycle in which the second reference bit in the second cell is received, and then determines that the time corresponding to the target clock cycle is the fourth Time T4.
  • the first device and the second device need to be negotiated in advance or stipulated by agreement.
  • the selection rule of the reference bit in the cell used for time synchronization that is, the first reference bit in the first cell and the second reference bit in the second cell use the same As determined by the rules, the two may have the same position or the same function in the cell where they are located.
  • first reference bit and the second reference bit may be, but not limited to, the following forms:
  • Form 1 The first reference bit is the most significant bit (MSB) in the first cell, and the second reference bit is the MSB in the second cell.
  • MSB most significant bit
  • the first reference bit is the least significant bit (LSB) in the first cell
  • the second reference bit is the LSB in the second cell.
  • Form 3 The first reference bit is the nth bit in the first cell, the second reference bit is the nth bit in the second cell, where n is greater than or An integer equal to 1 and less than or equal to N, where N is less than or equal to the total number of bits contained in the first cell and less than or equal to the total number of bits contained in the second cell.
  • Form 4 The first reference bit is the last bit in the first cell, and the second reference bit is the last bit in the second cell.
  • the embodiment of the present application does not limit the timing of executing the above-mentioned time synchronization process.
  • the first device may initiate the time synchronization process when performing service transmission with the second device for the first time, or the first device may periodically perform the time synchronization process, or the first device The time synchronization process may be executed after receiving the time synchronization instruction, or the first device may periodically execute the time synchronization process.
  • the embodiment of the present application does not limit the types of related cells in the execution of the above-mentioned time synchronization process.
  • the above-mentioned first cell, second cell, and third cell may be control cells.
  • the embodiment of the present application provides a time synchronization method.
  • the first device and the second device can exchange information elements to achieve time synchronization of the 1588 protocol. Therefore, this method can achieve precise time synchronization between communication devices that support cell transmission.
  • any communication system that supports cell transmission can realize time synchronization based on the 1588 protocol in cell mode through this method, which can replace the traditional method of carrying the 1588 protocol based on the Ethernet mode, which is convenient for the deployment of the 1588 system.
  • the communication device supporting cell transmission can realize the time synchronization of the 1588 protocol without adding an additional Ethernet port, this method can also save the overhead caused by the hardware port.
  • an embodiment of the present application also provides a communication device.
  • Each unit/module in the communication device is divided according to the logic function of the communication device in the embodiment shown in FIG. 3.
  • the communication device includes: a time processing unit, a cell processor, a PCS, and a physical interface. The function of each module is described in detail below.
  • the time processing unit is used to record and save the time stamp of the communication device, and perform time synchronization according to the saved time stamp information.
  • the time processing unit may record the time T2 when the reference bit in the delayed request cell is received, and send the delayed response cell to the delayed requester.
  • Reference bit time T3 may be recorded.
  • the time processing unit may record the time T1 at which the communication device sends the reference bit in the delay request cell to the delay responder, and the communication device receives the delay response The time T4 of the reference bit in the cell, the time T2 when the delay responder obtained from the delay response cell receives the reference bit in the delay request cell, and the cell processing unit The time T3 at which the delayed responder, obtained from the following cell of the delayed response cell, sends the reference bit in the delayed response cell.
  • the cell processing unit may also perform time synchronization in accordance with the method in the time synchronization principle of the 1588 protocol according to the above-mentioned four saved times.
  • the cell processing unit is configured to process related cells for service transmission performed by the communication device, and may also process cells related to time synchronization. As shown in FIG. 4, according to different functions in the transmit (Tx) direction and the receive (Rx) direction, the cell processing unit can be divided into a transmit (Tx) unit and a receive (Rx) unit.
  • the sending unit is mainly used to generate a cell, send the cell to the PCS for encoding, and finally send it out through a physical interface.
  • the sending unit is mainly used to receive the cell decoded by the PCS, and perform related operations according to the type of the cell and the data in the cell.
  • the PCS is used to perform physical encoding and physical decoding processing on cells.
  • the cell processing unit can be divided into an encoding unit and a decoding unit.
  • the encoding unit is used to perform physical encoding processing on the information element to be sent, and send the physically encoded information element to other communication devices through the physical interface.
  • the decoding unit is configured to perform physical decoding processing on the physically encoded cells received by the physical interface to obtain the cells, and send the cells obtained after physical decoding to the cell processing unit for further processing.
  • the physical interface can be connected to other communication devices through cables, and is used to communicate and interact with other communication devices by receiving and sending cells.
  • the physical interface may be a serial interface (serdes).
  • the physical interfaces can be divided into Tx physical interfaces and Rx physical interfaces.
  • the Tx physical interface is used to send physically encoded cells to other communication devices.
  • the Rx physical interface is used to receive physically encoded cells from other communication devices.
  • the embodiment of the present application also provides a time synchronization example.
  • this example refers to the delay requester as "communication device A”, and the delay responder as "communication device B". Since the communication equipment A and the communication equipment B have the same unit/module, in order to distinguish the units/modules, this example adds A after the names of the units/modules belonging to the communication equipment A, and will belong to the units/modules of the communication equipment B /Add B after the name of the module.
  • Figure 5 to describe the process of this time synchronization instance:
  • the sending unit A in the communication device A generates a delay request cell (Prequest-cell) (abbreviated as Preq-cell in the figure). Then the sending unit A sends the delay request information element to the coding unit A in the PCS A.
  • Prequest-cell a delay request cell
  • Preq-cell a delay request cell
  • the encoding unit A physically encodes the received delay request information element, and sends the physically encoded delay request information element to the Tx physical interface A.
  • the encoding unit A physically encodes the delay request cell when the encoding unit A physically encodes the MSB in the delay request cell, collect the current time T1 (communication The time when the device A sends the delay request cell), and sends it to the time processing unit A of the communication device A.
  • the time processing unit A saves the time T1.
  • the Tx physical interface A sends the encoded delay request cell to the communication device B.
  • the Rx physical interface B in the communication device B After receiving the encoded delay request cell, the Rx physical interface B in the communication device B sends it to the decoding unit B in the PCS B.
  • the decoding unit B records the time corresponding to each clock cycle during the process of receiving the encoded delay request information element.
  • the decoding unit B physically decodes the received encoded delay request cell, and after obtaining the delay request cell, it records multiple clocks in the process of receiving the encoded delay request cell
  • the time corresponding to the cycle and the delay request cell obtained by decoding are sent to the receiving unit B in the cell processing unit B.
  • the receiving unit B After receiving the above content, the receiving unit B determines that the received cell is a delay request cell (for example, it can be determined by the indication in the delay request cell, or determined according to the cell identifier, or After determining according to the type of the cell), identify the MSB in the delay request cell, determine the target clock cycle where the MSB is received, and finally determine the time T2 corresponding to the target clock cycle, and use this time as the communication The time when the device B receives the delay request cell. The receiving unit B sends the time T2 to the sending unit B, and notifies the sending unit B to make a delayed response.
  • a delay request cell for example, it can be determined by the indication in the delay request cell, or determined according to the cell identifier, or After determining according to the type of the cell
  • identify the MSB in the delay request cell identify the MSB in the delay request cell, determine the target clock cycle where the MSB is received, and finally determine the time T2 corresponding to the target clock cycle, and use this time as the communication
  • the sending unit B After receiving the notification from the receiving unit B, the sending unit B generates a delayed response cell (Presponse-cell) (abbreviated as Prsp-cell in the figure) containing the received time T2. Then, the sending unit B sends the delayed response information element to the coding unit B in the PCS B.
  • Presponse-cell a delayed response cell (Presponse-cell) (abbreviated as Prsp-cell in the figure) containing the received time T2. Then, the sending unit B sends the delayed response information element to the coding unit B in the PCS B.
  • the encoding unit B physically encodes the received delay response information element, and sends the physically encoded delay response information element to the Tx physical interface B.
  • the encoding unit B physically encodes the delay response cell
  • the encoding unit B physically encodes the MSB in the delay response cell
  • collect the current time T3 (communication The time when the device B sends the delayed response cell), and sends it back to the sending unit B.
  • the sending unit B generates a follow-up cell (Presponse-follow-up-cell) containing the delayed response cell at the time T3 when receiving the time T3 returned by the coding unit B ( Figure Chinese abbreviated as Prfu-cell). Then, the sending unit B sends the following information element to the coding unit B in the PCS B.
  • a follow-up cell Presponse-follow-up-cell
  • Prfu-cell Figure Chinese abbreviated as Prfu-cell
  • the encoding unit B physically encodes the received follow-up cell, and sends the encoded follow-up cell to the Tx physical interface B.
  • the Tx physical interface B sends the encoded delayed response cell and the encoded follow cell to the communication device A respectively.
  • the decoding unit A records the time corresponding to each clock cycle during the process of receiving the encoded delayed response cell.
  • the decoding unit A physically decodes the received encoded delayed response cell, and after obtaining the delayed response cell, it records multiple clocks during the process of receiving the encoded delayed response cell
  • the time corresponding to the cycle and the delayed response cell obtained by decoding are sent to the receiving unit A in the cell processing unit A.
  • the decoding unit A After receiving the encoded follower cell, the decoding unit A physically decodes the encoded follower cell to obtain the follower cell. Then the decoding unit A sends the following information element obtained by decoding to the receiving unit A.
  • the receiving unit A determines that the received information element is a delayed response signal after receiving the time corresponding to the multiple clock cycles recorded by the decoding unit A and the delayed response cell obtained by decoding. After the element (for example, it can be determined by the indication in the delayed response cell, or determined according to the cell identifier, or determined according to the type of the cell), the MSB in the delayed response cell is identified, and the MSB is determined to be received Where the target clock cycle is located, the time T4 corresponding to the target clock cycle is finally determined, and this time is used as the time at which the communication device A receives the delayed response cell. The receiving unit A sends the time T4 to the time processing unit A of the communication device A. The time processing unit A saves the time T4.
  • the receiving unit A obtains the time T2 contained in the delayed response cell, and sends the time T2 to the time processing unit A.
  • the time processing unit A saves the time T2.
  • the receiving unit A After receiving the decoded follower cell, the receiving unit A obtains the time T3 contained in the follower cell from the follower cell, and sends the time T3 to the time processing unit A. The time processing unit A saves the time T3.
  • the time processing unit A performs time synchronization with the communication device B according to the four saved moments.
  • the communication device A may initiate the above time synchronization process to multiple other communication devices at the same time, and the communication device A may also initiate the above time synchronization process to the same communication device multiple times.
  • the two communication devices of time synchronization can recognize that clock synchronization related cells (delay request cell, delay response cell, and follow cell of delay response cell) belong to the same time synchronization
  • the process identifier can be added to the above-mentioned relevant information element.
  • the process identifier can be any one or a combination of the following:
  • Time synchronization sequence number (sequence ID), link number of the physical interface, identification of the communication device A, and identification of the communication device B.
  • the time processing unit A in the communication device A is also grouped with the saved time according to the process identifier. That is, all the moments in the same moment group are saved for the same process ID.
  • the receiving unit A in the communication device A can first perform pairing verification after receiving the delayed response cell and the follow cell, that is, verify whether the received delayed response cell and the process identifier in the follow cell are the same as the sender
  • the process ID in the delay request cell is the same. If they are not the same, the receiving unit A discards the delayed response cell and the following cell; if they are the same, the receiving unit A performs subsequent operations according to the delayed response cell and the following cell.
  • the communication device A should finally determine the time T3. Therefore, the order of the time when the communication device A saves time synchronization is: T1-T2/T4-T3. Therefore, when the communication device A determines that any one of the time groups saved for the same process identifier is invalid, the time group is discarded.
  • this example uses the physical medium attachment (PMA) mechanism of the communication device to time stamp.
  • PMA physical medium attachment
  • This mechanism can avoid the traditional PCS layer and forward error correction.
  • the time jitter caused by the time stamping of the forward error correction (FEC) layer can further improve the accuracy of time synchronization.
  • an embodiment of the present application also provides a communication device.
  • the structure of the device is shown in FIG. 6 and includes a communication unit 601 and a processing unit 602.
  • the communication device 600 can be applied to the communication device of the communication system shown in FIG. 2 and can implement the time synchronization method provided in the above embodiments or examples.
  • the communication device 600 can be applied to both the delay requester in the communication system (referred to as the first device for short) and the delay responder in the communication system (referred to as the second device for short). ).
  • the communication unit 601 is used to receive and send information elements.
  • the communication unit 601 can implement the above-mentioned transceiver function through a physical interface (for example, serdes) and a PCS.
  • each unit when the communication device 600 is applied to the first device, the functions of each unit are as follows:
  • the processing unit 602 is configured to send a first information element to the second device through the communication unit 601 and determine a first moment, where the first information element includes a first reference bit, and the first moment Is the time when the communication unit 601 sends the first reference bit in the first cell; the second cell is received from the second device through the communication unit 601, and the second cell contains A first time bit field and a second reference bit, where the first time bit field is used to indicate the second moment when the second device receives the first reference bit in the first cell; determining the third Time, the third time is the time when the communication unit 601 receives the second reference bit in the second information element; the third information element is received from the second device through the communication unit 601, where The third information element includes a second time bit field, and the second time bit field is used to indicate the moment when the second device sends the second reference bit in the second information element; and according to the Perform time synchronization with the second device at the first time, the second time, the third time, and the fourth time;
  • the communication unit 601 is configured to send the first information element, and receive the second information element and the third information element.
  • the first reference bit is the most significant bit MSB in the first cell, and the second reference bit is the MSB in the second cell; or
  • the first reference bit is the nth bit in the first cell
  • the second reference bit is the nth bit in the second cell, where n is greater than or equal to 1, and less than Or an integer equal to N, where N is less than or equal to the total number of bits contained in the first cell and less than or equal to the total number of bits contained in the second cell; or
  • the first reference bit is the last bit in the first cell
  • the second reference bit is the last bit in the second cell.
  • the processing unit 602 when receiving the second information element from the second device through the communication unit 601 and determining the third time, is specifically configured to:
  • the communication unit 601 After the communication unit 601 receives the second cell, it determines the target clock cycle in which the second reference bit in the second cell is received, and determines that the time corresponding to the target clock cycle is the first Three moments.
  • the first cell is a delay request cell
  • the second cell is a delay response cell
  • the third cell is a follow cell.
  • each unit when the communication device 600 is applied to a second device, the functions of each unit are as follows:
  • the processing unit 602 is configured to receive a first information element from a first device through the communication unit 601, and determine a second time, where the first information element includes a first reference bit, and the second time is the communication
  • the unit 601 receives the moment of the first reference bit in the first cell; sends a second cell to the first device through the communication unit 601, and determines the fourth moment, the second cell Contains a first time bit field and a second reference bit, the first time bit field is used to indicate the second time, and the fourth time is all the information in the second cell sent by the communication unit 601 The time of the second reference bit; and sending a third information element to the first device through the communication unit 601, wherein the third information element includes a second time bit field, and the second time bit field Used to indicate the fourth moment;
  • the communication unit 601 is configured to receive the first information element, and send the second information element and the third information element.
  • the first reference bit is the most significant bit MSB in the first cell, and the second reference bit is the MSB in the second cell; or
  • the first reference bit is the nth bit in the first cell
  • the second reference bit is the nth bit in the second cell, where n is greater than or equal to 1, and less than Or an integer equal to N, where N is less than or equal to the total number of bits contained in the first cell and less than or equal to the total number of bits contained in the second cell; or
  • the first reference bit is the last bit in the first cell
  • the second reference bit is the last bit in the second cell.
  • the processing unit 602 when receiving the first information element from the first device through the communication unit 601 and determining the second time, is specifically configured to:
  • the communication unit 601 After the communication unit 601 receives the first cell, it determines the target clock period in which the first reference bit in the first cell is received, and determines that the time corresponding to the target clock period is the The second moment.
  • the first cell is a delay request cell
  • the second cell is a delay response cell
  • the third cell is a follow cell.
  • each function in each embodiment of the present application can be integrated into one processing unit, or it can exist alone physically, or two or more units can be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including a number of instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .
  • the embodiments of the present application also provide a communication device, which can be applied to the communication system as shown in FIG. 2 and can implement the time synchronization method provided by the above embodiments or examples, and has The function of the communication device shown in FIG. 6.
  • the communication device 700 includes: a communication interface 701, a processor 702, and a memory 703. Wherein, the communication interface 701, the processor 702, and the memory 703 are connected to each other.
  • the communication interface 701, the processor 702, and the memory 703 are connected to each other through a bus 704.
  • the bus 704 may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • PCI peripheral component interconnect standard
  • EISA extended industry standard architecture
  • the bus can be divided into an address bus, a data bus, a control bus, and so on. For ease of representation, only one thick line is used in FIG. 7, but it does not mean that there is only one bus or one type of bus.
  • the communication interface 701 is used to receive and send information elements to realize communication interaction with other communication devices.
  • the processor 702 is configured to process information elements, including processing such as generation, analysis, physical encoding and physical decoding, and time synchronization.
  • the processor 702 when the communication device 700 is applied to the delay requester of two communication devices that require time synchronization (wherein, the delay requester is referred to as the first device, and the delay responder is referred to as the first In the case of two devices), the processor 702 is specifically configured to:
  • the first information element is sent to the second device through the communication interface 701, and the first time is determined, where the first information element includes the first reference bit, and the first time is the first device sending the first time.
  • the moment of the first reference bit in a cell; a second cell is received from the second device through the communication interface 701, and the second cell includes a first time bit field and a second reference bit ,
  • the first time bit field is used to indicate the second time at which the second device receives the first reference bit in the first cell;
  • the third time is determined, and the third time is the The moment when the first device receives the second reference bit in the second cell;
  • the third cell is received from the second device through the communication interface 701, where the third cell contains the second time Bit field, the second time bit field is used to indicate the time when the second device sends the second reference bit in the second cell; and according to the first time, the second time,
  • the third time and the fourth time are synchronized with the second device.
  • processor 702 is specifically configured to:
  • the processor 702 when the communication device 700 is applied to the delayed responder of two communication devices that need time synchronization (wherein, the delayed responder is referred to as the second device for short, and the delayed requester is referred to as When it is the first device), the processor 702 is specifically configured to:
  • the first information element is received from the first device through the communication interface 701, and the second time is determined.
  • the first information element includes the first reference bit, and the second time is when the second device receives the first information.
  • the time of the first reference bit in the element send a second information element to the first device through the communication interface 701, and determine the fourth time, the second information element contains the first time bit field and A second reference bit, where the first time bit field is used to indicate the second moment, and the fourth moment is the moment when the second device sends the second reference bit in the second cell; And sending a third information element to the first device through the communication interface 701, where the third information element includes a second time bit field, and the second time bit field is used to indicate the fourth time .
  • processor 702 is specifically configured to:
  • the function of the processor 702 may refer to the description in the time synchronization method provided in the above embodiments and examples, and the specific function description of the communication device 600 in the embodiment shown in FIG. Go into details again.
  • the memory 703 is used to store program instructions and data.
  • the program instructions may include program code, and the program code includes computer operation instructions.
  • the memory 703 may include a random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
  • the processor 702 executes the program instructions stored in the memory 703, and uses the data stored in the memory 703 to implement the above-mentioned functions, thereby realizing the time synchronization method provided in the above-mentioned embodiment.
  • the memory 703 in FIG. 7 of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), and electrically available Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory.
  • the volatile memory may be a random access memory (Random Access Memory, RAM), which is used as an external cache.
  • RAM random access memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • DRAM synchronous dynamic random access memory
  • DDR SDRAM Double Data Rate Synchronous Dynamic Random Access Memory
  • Enhanced SDRAM, ESDRAM Enhanced Synchronous Dynamic Random Access Memory
  • Synchronous Link Dynamic Random Access Memory Synchronous Link Dynamic Random Access Memory
  • DR RAM Direct Rambus RAM
  • the embodiments of the present application also provide a computer program, which when the computer program runs on a computer, causes the computer to execute the time synchronization method provided in the above embodiments.
  • the embodiments of the present application also provide a computer-readable storage medium in which a computer program is stored.
  • the computer program When the computer program is executed by a computer, the computer can execute the time provided in the above embodiment. Synchronization method.
  • the storage medium may be any available medium that can be accessed by a computer. Take this as an example but not limited to: computer readable media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage media or other magnetic storage devices, or can be used to carry or store instructions or data in the form of structure The desired program code and any other medium that can be accessed by the computer.
  • an embodiment of the present application also provides a chip, which is used to read a computer program stored in a memory to implement the time synchronization method provided in the above embodiment.
  • the embodiments of the present application provide a chip system including a processor, which is used to support a computer device to implement the functions related to the communication device in the above embodiment.
  • the chip system further includes a memory, and the memory is used to store necessary programs and data of the computer device.
  • the chip system can be composed of chips, or include chips and other discrete devices.
  • the embodiments of the present application provide a time synchronization method and device.
  • the first device and the second device can exchange information elements to realize the time synchronization of the 1588 protocol. Therefore, this method can achieve precise time synchronization between communication devices that support cell transmission.
  • any communication system that supports cell transmission can realize time synchronization based on the 1588 protocol in cell mode through this method, which can replace the traditional method of carrying the 1588 protocol based on the Ethernet mode to facilitate the deployment of the 1588 system.
  • the communication device supporting cell transmission can realize the time synchronization of the 1588 protocol without adding an additional Ethernet port, this method can also save the overhead caused by the hardware port.
  • this application can be provided as methods, systems, or computer program products. Therefore, this application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.

Landscapes

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

Abstract

Disclosed in the present application are a time synchronization method and device. In the method, a first device and a second device can achieve time synchronization of a 1588 protocol by means of cell switch. Thus, the method can achieve accurate time synchronization among communication devices supporting cell transmission.

Description

一种时间同步方法及设备Time synchronization method and equipment 技术领域Technical field
本申请涉及通信技术领域,尤其设计一种时间同步方法及设备。This application relates to the field of communication technology, in particular to design a time synchronization method and device.
背景技术Background technique
在数字通信系统中,1588协议(又称为精准时间协议(precision time protocol,PTP))通常需要通过以太网实现通信设备之间的时间同步,即用于时间同步的消息需要通过以太网报文的方式在通信设备间进行传输。然而在一些场景中,同样需要进行精准地时间同步的通信设备之间,是通过信元的形式传输业务数据的,例如框式信元(cell)系统和产品多框集群的场景中。那么如果在这些场景中依然按照传统的时间同步方法实现的话,则需要在通信设备之间增加额外的以太网端口,以发送以太网报文,这样就增加了通信设备成本。In digital communication systems, the 1588 protocol (also known as the precision time protocol (PTP)) usually needs to implement time synchronization between communication devices via Ethernet, that is, messages used for time synchronization need to pass Ethernet messages The way to transmit between communication devices. However, in some scenarios, communication devices that also need to perform accurate time synchronization transmit service data in the form of cells, such as in the scenario of a cell system and a multi-frame cluster of products. Then, if the traditional time synchronization method is still implemented in these scenarios, additional Ethernet ports need to be added between the communication devices to send Ethernet packets, which increases the cost of the communication devices.
发明内容Summary of the invention
本申请提供一种时间同步方法及设备,用以支持信元传输的通信设备之间的精准时间同步。This application provides a time synchronization method and device to support precise time synchronization between communication devices for cell transmission.
第一方面,本申请实施例提供了一种时间同步方法,该方法可以应用于通过信元方式进行业务传输的两个通信设备中,为了便于说明,以下将延时请求方称为第一设备,延时响应方称为第二设备。其中,该方法包括以下步骤:In the first aspect, the embodiments of the present application provide a time synchronization method, which can be applied to two communication devices that perform service transmission in the cell mode. For ease of description, the delay requester is referred to as the first device below. , The delayed responder is called the second device. Among them, the method includes the following steps:
第一设备向第二设备发送第一信元,并确定第一时刻,其中,所述第一信元中包含第一参考比特,所述第一时刻为所述第一设备发送所述第一信元中的所述第一参考比特的时刻;所述第一设备从所述第二设备接收第二信元,其中,所述第二信元中包含第一时间比特域和第二参考比特,所述第一时间比特域用于指示所述第二设备接收到所述第一信元中的所述第一参考比特的第二时刻;所述第一设备确定第三时刻,所述第三时刻为所述第一设备接收所述第二信元中的所述第二参考比特的时刻;所述第一设备从所述第二设备接收第三信元,其中,所述第三信元中包含第二时间比特域,所述第二时间比特域用于指示所述第二设备发送所述第二信元中的所述第二参考比特的第四时刻;最后,所述第一设备根据所述第一时刻、所述第二时刻、所述第三时刻和所述第四时刻,进行与所述第二设备之间的时间同步。The first device sends the first information element to the second device, and determines the first moment, where the first information element contains the first reference bit, and the first moment is for the first device to send the first The moment of the first reference bit in the cell; the first device receives a second cell from the second device, wherein the second cell contains a first time bit field and a second reference bit , The first time bit field is used to indicate the second moment when the second device receives the first reference bit in the first cell; the first device determines the third moment, the first Time three is the time when the first device receives the second reference bit in the second information element; the first device receives the third information element from the second device, where the third information element The element includes a second time bit field, and the second time bit field is used to indicate the fourth moment when the second device sends the second reference bit in the second cell; finally, the first The device performs time synchronization with the second device according to the first time, the second time, the third time, and the fourth time.
通过该方法,所述第一设备和所述第二设备可以通过信元交互,实现1588协议的时间同步。因此,该方法可以实现支持信元传输的通信设备之间的精准时间同步。另外,任何支持信元传输的通信系统可以通过该方法实现基于信元方式的1588协议的时间同步,从而可以替换传统的基于以太网方式承载1588协议的方法,便于1588系统的部署,进一步的,由于支持信元传输的通信设备无需增加额外的以太网端口即可实现1588协议的时间同步,因此,该方法也可以节省硬件端口造成的开销。Through this method, the first device and the second device can interact with information elements to realize the time synchronization of the 1588 protocol. Therefore, this method can achieve precise time synchronization between communication devices that support cell transmission. In addition, any communication system that supports cell transmission can realize time synchronization based on the 1588 protocol in cell mode through this method, which can replace the traditional method of carrying the 1588 protocol based on the Ethernet mode, which is convenient for the deployment of the 1588 system. Further, Since the communication device supporting cell transmission can realize the time synchronization of the 1588 protocol without adding an additional Ethernet port, this method can also save the overhead caused by the hardware port.
在一种可能的设计中,所述第一参考比特和所述第二参考比特可以通过以下方式设置:In a possible design, the first reference bit and the second reference bit may be set in the following manner:
方式一:所述第一参考比特为所述第一信元中的最高有效位MSB,所述第二参考比特为所述第二信元中的MSB;Manner 1: The first reference bit is the most significant bit MSB in the first cell, and the second reference bit is the MSB in the second cell;
方式二:所述第一参考比特为所述第一信元中的第n个比特,所述第二参考比特位为 所述第二信元中的第n个比特,其中n为大于或等于1,且小于或等于N的整数,N小于或等于所述第一信元中包含的比特总量,且小于或等于所述第二信元中包含的比特总量;Manner 2: The first reference bit is the nth bit in the first cell, the second reference bit is the nth bit in the second cell, where n is greater than or equal to 1. An integer less than or equal to N, where N is less than or equal to the total number of bits contained in the first cell and less than or equal to the total number of bits contained in the second cell;
方式三:所述第一参考比特为所述第一信元中的最后一个比特,所述第二参考比特为所述第二信元中的最后一个比特。Manner 3: The first reference bit is the last bit in the first cell, and the second reference bit is the last bit in the second cell.
该设计可以提高时间同步相关信元中的参考比特的设置灵活性。This design can improve the flexibility of setting the reference bit in the time synchronization related cell.
在一种可能的设计中,所述第一设备在接收所述第二信元的过程中保存每个时钟周期对应的时刻;所述第一设备在接收所述第二信元后,确定接收所述第二信元中所述第二参考比特所在的目标时钟周期,并确定所述目标时钟周期对应的时刻为所述第三时刻。In a possible design, the first device saves the time corresponding to each clock cycle during the process of receiving the second cell; after receiving the second cell, the first device determines to receive Determining the target clock cycle where the second reference bit in the second cell is located, and determining that the time corresponding to the target clock cycle is the third time.
由于所述第一设备在接收所述第二信元的过程中,不能确定该信元的类型,也无法直接确定接收所述第二信元中的所述第二参考比特的时刻,通过该设计,所述第一设备可以在接收所述第二信元结束后,通过确定接收所述第二参考比特所在的目标时钟周期来确定。In the process of receiving the second cell, the first device cannot determine the type of the cell, nor can it directly determine the moment of receiving the second reference bit in the second cell. By design, the first device may determine by determining the target clock cycle in which the second reference bit is received after receiving the second cell.
在一种可能的设计中,所述第一时刻为所述第一设备对所述第一参考比特进行物理编码的时刻;所述第三时刻为所述第一设备对所述第二参考比特进行物理解码的时刻。In a possible design, the first time is the time when the first device physically encodes the first reference bit; the third time is the first device to the second reference bit The moment of physical decoding.
在一种可能的设计中,所述第一信元为延时请求信元,所述第二信元为延时响应信元,所述第三信元为跟随信元。In a possible design, the first cell is a delay request cell, the second cell is a delay response cell, and the third cell is a follow cell.
第二方面,本申请实施例提供了一种时间同步方法,该方法可以应用于通过信元方式进行业务传输的两个通信设备中,为了便于说明,以下将延时请求方称为第一设备,延时响应方称为第二设备。其中,该方法包括以下步骤:In the second aspect, the embodiments of the present application provide a time synchronization method, which can be applied to two communication devices that perform service transmission in a cell manner. For ease of description, the delay requester is hereinafter referred to as the first device , The delayed responder is called the second device. Among them, the method includes the following steps:
第二设备从第一设备接收第一信元,并确定第二时刻,所述第一信元中包括第一参考比特,所述第二时刻为所述第二设备接收所述第一信元中的所述第一参考比特的时刻;所述第二设备向所述第一设备发送第二信元,并确定第四时刻,所述第二信元中包含第一时间比特域和第二参考比特,所述第一时间比特域用于指示所述第二时刻,所述第四时刻为所述第二设备发送所述第二信元中的所述第二参考比特的时刻;所述第二设备向所述第一设备发送第三信元,其中,所述第三信元中包含第二时间比特域,所述第二时间比特域用于指示所述第四时刻。The second device receives the first information element from the first device, and determines a second time, the first information element includes a first reference bit, and the second time is when the second device receives the first information element The first reference bit time in the second device; the second device sends a second information element to the first device, and determines the fourth time, and the second information element contains the first time bit field and the second time bit field. Reference bit, the first time bit field is used to indicate the second moment, and the fourth moment is the moment when the second device sends the second reference bit in the second cell; the The second device sends a third information element to the first device, where the third information element includes a second time bit field, and the second time bit field is used to indicate the fourth time.
通过该方法,所述第一设备和所述第二设备可以通过信元交互,实现1588协议的时间同步。因此,该方法可以实现支持信元传输的通信设备之间的精准时间同步。另外,任何支持信元传输的通信系统可以通过该方法实现基于信元方式的1588协议的时间同步,从而可以替换传统的基于以太网方式承载1588协议的方法,便于1588系统的部署,进一步的,由于支持信元传输的通信设备无需增加额外的以太网端口即可实现1588协议的时间同步,因此,该方法也可以节省硬件端口造成的开销。Through this method, the first device and the second device can interact with information elements to realize the time synchronization of the 1588 protocol. Therefore, this method can achieve precise time synchronization between communication devices that support cell transmission. In addition, any communication system that supports cell transmission can realize time synchronization based on the 1588 protocol in cell mode through this method, which can replace the traditional method of carrying the 1588 protocol based on the Ethernet mode, which is convenient for the deployment of the 1588 system. Further, Since the communication device supporting cell transmission can realize the time synchronization of the 1588 protocol without adding an additional Ethernet port, this method can also save the overhead caused by the hardware port.
在一种可能的设计中,所述第一参考比特和所述第二参考比特可以通过以下方式设置:In a possible design, the first reference bit and the second reference bit may be set in the following manner:
方式一:所述第一参考比特为所述第一信元中的最高有效位MSB,所述第二参考比特为所述第二信元中的MSB;Manner 1: The first reference bit is the most significant bit MSB in the first cell, and the second reference bit is the MSB in the second cell;
方式二:所述第一参考比特为所述第一信元中的第n个比特,所述第二参考比特为所述第二信元中的第n个比特,其中n为大于或等于1,且小于或等于N的整数,N小于或等于所述第一信元中包含的比特总量,且小于或等于所述第二信元中包含的比特总量;Manner 2: The first reference bit is the nth bit in the first cell, the second reference bit is the nth bit in the second cell, where n is greater than or equal to 1. , And an integer less than or equal to N, where N is less than or equal to the total number of bits contained in the first cell, and less than or equal to the total number of bits contained in the second cell;
方式三:所述第一参考比特为所述第一信元中的最后一个比特,所述第二参考比特为所述第二信元中的最后一个比特。Manner 3: The first reference bit is the last bit in the first cell, and the second reference bit is the last bit in the second cell.
该设计可以提高时间同步相关信元中的参考比特的设置灵活性。This design can improve the flexibility of setting the reference bit in the time synchronization related cell.
在一种可能的设计中,所述第二设备在接收所述第一信元的过程中保存每个时钟周期对应的时刻;所述第二设备在接收所述第一信元后,确定接收所述第一信元中所述第一参考比特所在的目标时钟周期,并确定所述目标时钟周期对应的时刻为所述第二时刻。In a possible design, the second device saves the time corresponding to each clock cycle during the process of receiving the first cell; after receiving the first cell, the second device determines to receive Determining the target clock cycle where the first reference bit in the first cell is located, and determining that the time corresponding to the target clock cycle is the second time.
由于所述第二设备在接收所述第一信元的过程中,不能确定该信元的类型,也无法直接确定接收所述第一信元中的所述第一参考比特的时刻,通过该设计,所述第二设备可以在接收所述第一信元结束后,通过确定接收所述第一参考比特所在的目标时钟周期来确定。In the process of receiving the first cell, the second device cannot determine the type of the cell, nor can it directly determine the moment of receiving the first reference bit in the first cell. By design, the second device may determine the target clock cycle in which the first reference bit is received after receiving the first cell.
在一个可能的设计中,所述第二时刻为所述第二设备对所述第一参考比特进行物理解码的时刻;所述第四时刻为所述第二设备对所述第二参考比特进行物理编码的时刻。In a possible design, the second moment is the moment when the second device physically decodes the first reference bit; the fourth moment is when the second device performs physical decoding on the second reference bit. The moment of physical encoding.
在一种可能的设计中,所述第一信元为延时请求信元,所述第二信元为延时响应信元,所述第三信元为跟随信元。In a possible design, the first cell is a delay request cell, the second cell is a delay response cell, and the third cell is a follow cell.
第三方面,本申请实施例提供了一种通信装置,包括用于执行以上第一方面或第二方面中各个步骤的单元。In a third aspect, an embodiment of the present application provides a communication device, which includes a unit for executing each step in the first aspect or the second aspect above.
第四方面,本申请实施例提供了一种通信设备,包括至少一个处理元件和至少一个存储元件,其中该至少一个存储元件用于存储程序和数据,该至少一个处理元件用于执行本申请以上第一方面或第二方面提供的方法。In a fourth aspect, an embodiment of the present application provides a communication device, including at least one processing element and at least one storage element, wherein the at least one storage element is used to store programs and data, and the at least one processing element is used to execute the above The method provided by the first or second aspect.
第五方面,本申请实施例提供了一种通信系统,包括第一设备和第二设备,其中,所述第一具有执行本申请第一方面提供的方法的功能,所述第二设备具有执行本申请第二方面提供的方法的功能。In a fifth aspect, an embodiment of the present application provides a communication system, including a first device and a second device, wherein the first device has the function of executing the method provided in the first aspect of the present application, and the second device has The function of the method provided in the second aspect of this application.
第六方面,本申请实施例还提供了一种计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行上述第一方面或第二方面提供的方法。In a sixth aspect, the embodiments of the present application also provide a computer program, which when the computer program runs on a computer, causes the computer to execute the method provided in the first aspect or the second aspect.
第七方面,本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当所述计算机程序被计算机执行时,使得所述计算机执行上述第一方面或第二方面提供的方法。In a seventh aspect, the embodiments of the present application also provide a computer-readable storage medium in which a computer program is stored. When the computer program is executed by a computer, the computer is caused to execute the first The method provided by the aspect or the second aspect.
第八方面,本申请实施例还提供了一种芯片,所述芯片用于读取存储器中存储的计算机程序,执行上述第一方面或第二方面提供的方法。In an eighth aspect, an embodiment of the present application also provides a chip, which is used to read a computer program stored in a memory and execute the method provided in the first aspect or the second aspect.
第十三方面,本申请实施例还提供了一种芯片系统,该芯片系统包括处理器,用于支持计算机装置实现上述第一方面或第二方面提供的方法。在一种可能的设计中,所述芯片系统还包括存储器,所述存储器用于保存该计算机装置必要的程序和数据。该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。In a thirteenth aspect, an embodiment of the present application also provides a chip system, which includes a processor, and is configured to support a computer device to implement the method provided in the first aspect or the second aspect. In a possible design, the chip system further includes a memory, and the memory is used to store necessary programs and data of the computer device. The chip system can be composed of chips, or it can include chips and other discrete devices.
附图说明Description of the drawings
图1为现有技术提供的基于1588协议的时间同步流程示意图;FIG. 1 is a schematic diagram of a time synchronization process based on the 1588 protocol provided by the prior art;
图2为本申请实施例提供的一种通信系统的结构图;FIG. 2 is a structural diagram of a communication system provided by an embodiment of this application;
图3为本申请实施例提供的一种时间同步方法流程图;FIG. 3 is a flowchart of a time synchronization method provided by an embodiment of this application;
图4为本申请实施例提供的一种通信设备的逻辑功能结构示意图;FIG. 4 is a schematic diagram of a logical function structure of a communication device provided by an embodiment of this application;
图5为本申请实施例提供的一种时间同步实例流程图;FIG. 5 is a flowchart of a time synchronization example provided by an embodiment of the application;
图6为本申请实施例提供的一种通信装置的结构图;FIG. 6 is a structural diagram of a communication device provided by an embodiment of this application;
图7为本申请实施例提供的一种通信设备的结构图。FIG. 7 is a structural diagram of a communication device provided by an embodiment of this application.
具体实施方式Detailed ways
本申请提供一种时间同步方法及设备,用以支持信元传输的设备之间的精准时间同步。其中,方法和设备是基于同一技术构思的,由于方法及设备解决问题的原理相似,因此设备与方法的实施可以相互参见,重复之处不再赘述。This application provides a time synchronization method and device to support accurate time synchronization between devices for cell transmission. Among them, the method and the device are based on the same technical idea. Since the principles of the method and the device to solve the problem are similar, the implementation of the device and the method can be referred to each other, and the repetition will not be repeated.
以下,对本申请中的部分用语进行解释说明,以便于本领域技术人员理解。Hereinafter, some terms in this application will be explained to facilitate the understanding of those skilled in the art.
1)通信设备,为通过信元方式进行业务数据传输的设备,又可以称为通信节点、节点。示例性的,所述通信设备可以为框式信元系统或产品多框集群中的通信设备。1) A communication device is a device that transmits service data in a cell mode, and can also be referred to as a communication node or node. Exemplarily, the communication device may be a communication device in a frame cell system or a product multi-frame cluster.
2)信元方式(Cell Model),是将信息或数据以信元为单位进行传送的一种技术。信元方式作为一种快速分组技术,它可以将信息或数据通过通信设备的适配层切割成多个信元。其中,信元的长度可以是固定的,另外,在某些实现方案中,信元的长度也可以是不固定的。2) Cell Model is a technology that transmits information or data in units of cells. As a fast grouping technology, the cell method can cut information or data into multiple cells through the adaptation layer of the communication device. Among them, the length of the cell may be fixed. In addition, in some implementation schemes, the length of the cell may also be variable.
通常,信元主要由两部分构成,即信元头和信元净荷。信元头所包含的是地址和控制信息,信元净荷包含的数据。按照功能划分,信元可以包括控制信元和业务信元两种。其中控制信元用于传输控制管理相关数据,而业务信元用于传输业务数据。Usually, the cell is mainly composed of two parts, namely the cell header and the cell payload. The cell header contains address and control information, and the cell payload contains data. According to the function division, the cell can include two types: control cell and service cell. The control cell is used to transmit control and management related data, and the business cell is used to transmit business data.
3)、“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。3), "and/or", describes the association relationship of the associated objects, which means that there can be three kinds of relationships, for example, A and/or B, which can mean: A alone exists, A and B exist at the same time, and B alone exists. condition. The character "/" generally indicates that the associated objects are in an "or" relationship.
需要说明的是,本申请中所涉及的多个,是指两个或两个以上。至少一个,是指一个或多个。It should be noted that the multiple involved in this application refers to two or more. At least one refers to one or more.
另外,需要理解的是,在本申请的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。In addition, it should be understood that in the description of this application, words such as “first” and “second” are only used for the purpose of distinguishing description, and cannot be understood as indicating or implying relative importance, nor can it be understood as indicating Or imply the order.
下面参阅图1,以设备A和设备B为例,对传统的基于1588协议的对等延时(peerdelay)机制的时间同步原理进行说明。Referring to FIG. 1 below, taking device A and device B as an example, the time synchronization principle of the traditional peer delay mechanism based on the 1588 protocol will be described.
延时请求方设备A在T1时刻向设备B发送延时请求报文(Pdelay_Request);设备B在T2时刻接收所述延时请求报文,然后在T3时刻向设备A发送延时响应报文(Pdelay_Response),其中,所述延时响应报文中包含所述设备B接收到所述延时请求报文的时刻T2;所述设备B在发送所述延时响应报文后,向所述设备A发送延时响应报文的跟随报文(Pdelay_Response_Follow_Up),其中,所述跟随报文中包含所述设备B发送所述延时响应报文的时刻T3;所述设备A在T4时刻接收所述延时响应报文,以及之后接收所述跟随报文,从所述延时响应报文中获取T2,从所述跟随报文中获取T3,最后,所述设备A可以通过以下公式,确定所述设备A和所述设备B之间的平均路径延时:The delay requester device A sends a delay request message (Pdelay_Request) to device B at time T1; device B receives the delay request message at time T2, and then sends a delay response message to device A at time T3 ( Pdelay_Response), wherein the delay response message includes the time T2 when the device B receives the delay request message; the device B sends the delay response message to the device A sends a follow-up message (Pdelay_Response_Follow_Up) of a delayed response message, where the follow-up message includes the time T3 when the device B sends the delayed response message; the device A receives the delay response message at time T4 Delay response message, and then receive the follow-up message, obtain T2 from the delayed response message, and obtain T3 from the follow-up message. Finally, the device A can use the following formula to determine all The average path delay between the device A and the device B:
meanPathDelay=[(T2-T1)+(T4-T3)]/2=[(T2-T3)+(T4-T1)]/2。meanPathDelay=[(T2-T1)+(T4-T3)]/2=[(T2-T3)+(T4-T1)]/2.
最后,所述设备A可以根据计算的平均路径延时,进行与所述设备B之间的时间同步。Finally, the device A can perform time synchronization with the device B according to the calculated average path delay.
其中,设备A和设备B之间为了实现时间同步,交互的报文类型为以太网报文,即延时响应报文、延时响应报文,以及延时响应报文的跟随报文均为以太网报文。这就需要设备A和设备B具有以太网端口,能够发送以太网报文。Among them, in order to achieve time synchronization between device A and device B, the types of messages exchanged are Ethernet messages, that is, delayed response messages, delayed response messages, and follow-up messages of delayed response messages. Ethernet message. This requires device A and device B to have Ethernet ports and be able to send Ethernet packets.
然而,我们知道,在一些通信场景中,同样需要进行精准地时间同步的通信设备之间,是通过信元的形式传输业务数据的,例如框式信元系统和产品多框集群的场景中。那么如果在这些场景中依然按照传统的时间同步方法实现的话,则需要在通信设备之间增加额外 的以太网端口,以发送以太网报文,这样就增加了通信设备成本。However, we know that in some communication scenarios, communication devices that also need to perform accurate time synchronization transmit service data in the form of cells, such as in the scenario of a box cell system and a product multi-chassis cluster. Then, if the traditional time synchronization method is still implemented in these scenarios, additional Ethernet ports need to be added between communication devices to send Ethernet packets, which increases the cost of communication devices.
下面将结合附图,对本申请实施例进行详细描述。The embodiments of the present application will be described in detail below in conjunction with the accompanying drawings.
图2示出了本申请实施例提供的时间同步方法适用的一种可能的通信系统的架构,其中,在所述通信系统中,通信设备之间的通讯并不使用以太网端口,且通信设备之间通过信元方式进行业务传输。如图中所示,在所述通信系统中,包含多个通信设备(如图中所示的通信设备a、通信设备b和通信设备c),每个通信设备可以与其他通信设备进行通信。FIG. 2 shows the architecture of a possible communication system to which the time synchronization method provided by the embodiment of the present application is applicable. In the communication system, the communication between the communication devices does not use the Ethernet port, and the communication device The service transmission is carried out in the cell mode between each other. As shown in the figure, the communication system includes multiple communication devices (communication device a, communication device b, and communication device c as shown in the figure), and each communication device can communicate with other communication devices.
在所述通信系统中,每个通信设备均维护一个本地的设备时间,每个通信设备均根据本地维护的设备时间进行业务数据的收发。然而,由于进行业务传输的发送方和接收方之间的物理位置、业务数据传输经过的通信设备或线缆,以及通信接口之间的通信情况等各种因素,因此发送方和接收方传输的业务数据具有一定的时延。In the communication system, each communication device maintains a local device time, and each communication device transmits and receives service data according to the locally maintained device time. However, due to various factors such as the physical location between the sender and the receiver of the service transmission, the communication equipment or cables through which the service data is transmitted, and the communication conditions between the communication interfaces, the transmission between the sender and the receiver Business data has a certain time delay.
另一步的,每次业务传输的发送方和接收方也不同,因此,每次业务传输的发送方和接收方之间的业务传输时延也不尽相同。例如,通信设备a作为发送方在与通信设备b进行业务传输时的业务传输时延为0.6ms;又例如,通信设备a作为发送方在与通信设备c进行业务传输时的业务传输时延为0.4ms;再例如,通信设备b作为发送方在与通信设备c进行业务传输时的业务传输时延为0.5ms。In another step, the sender and receiver of each service transmission are also different. Therefore, the service transmission delay between the sender and receiver of each service transmission is not the same. For example, the service transmission delay of communication device a as the sender when performing service transmission with communication device b is 0.6 ms; for another example, the service transmission delay of communication device a as the sender when performing service transmission with communication device c is 0.4ms; for another example, the service transmission delay of the communication device b as the sender when performing service transmission with the communication device c is 0.5ms.
我们知道,时间同步的精准度,能够决定收发双方的业务传输效率。因此,为了保证业务传输的效率,所述通信系统中的发送方和接收方需要进行精准时间同步流程。We know that the accuracy of time synchronization can determine the business transmission efficiency of the sender and receiver. Therefore, in order to ensure the efficiency of service transmission, the sender and receiver in the communication system need to perform a precise time synchronization process.
为了实现支持信元传输的通信设备之间的精准时间同步,本申请实施例提供了一种时间同步方法。该方法可以适用于图2所示的支持信元方式传输的通信系统。其中,该时间同步方法是通过与图1类似的1588协议的时间同步原理实现的。下面参考图3所示的流程图,对本申请实施例提供的方法进行详细说明。在本申请实施例中,为了便于区分和描述,将通信系统中的延时请求方称为“第一设备”,而另一侧的延时响应方称为“第二设备”。In order to achieve precise time synchronization between communication devices that support cell transmission, an embodiment of the present application provides a time synchronization method. This method can be applied to the communication system supporting cell transmission as shown in FIG. 2. Among them, the time synchronization method is implemented through the time synchronization principle of the 1588 protocol similar to FIG. 1. The method provided in the embodiment of the present application will be described in detail below with reference to the flowchart shown in FIG. 3. In the embodiments of the present application, in order to facilitate distinction and description, the delay requester in the communication system is referred to as the "first device", and the delay responder on the other side is referred to as the "second device".
S301:第一设备向第二设备发送第一信元,并确定第一时刻T1,其中,所述第一信元中包含第一参考比特,所述第一时刻T1为所述第一设备发送所述第一信元中的所述第一参考比特的时刻。可选的,所述第一信元可以称为延时请求信元。S301: The first device sends a first information element to the second device, and determines a first time T1, where the first information element contains a first reference bit, and the first time T1 is sent by the first device The time of the first reference bit in the first cell. Optionally, the first information element may be referred to as a delay request information element.
S302:所述第二设备从所述第一设备接收所述第一信元,并确定第二时刻T2,所述第二时刻T2为所述第二设备接收所述第一信元中的所述第一参考比特的时刻。S302: The second device receives the first information element from the first device, and determines a second time T2. The second time T2 is when the second device receives all of the first information elements. The moment of the first reference bit.
S303:所述第二设备向所述第一设备发送第二信元,并确定第三时刻T3,其中,所述第二信元中包含第一时间比特域和第二参考比特,所述第一时间比特域用于指示所述第二时刻T2,所述第三时刻T3为所述第二设备发送所述第二信元中的所述第二参考比特的时刻。可选的,所述第二信元可以称为延时响应信元。S303: The second device sends a second information element to the first device, and determines a third time T3, where the second information element includes a first time bit field and a second reference bit, and the second information element includes a first time bit field and a second reference bit. A time bit field is used to indicate the second time T2, and the third time T3 is the time when the second device sends the second reference bit in the second cell. Optionally, the second cell may be referred to as a delayed response cell.
S304:所述第一设备从所述第二设备接收所述第二信元,并确定第四时刻T4,其中,所述第四时刻T4为所述第一设备接收所述第二信元中的所述第二参考比特的时刻。S304: The first device receives the second information element from the second device, and determines a fourth time T4, where the fourth time T4 is when the first device receives the second information element The moment of the second reference bit.
S305:所述第二设备向所述第一设备发送第三信元,所述第三信元中包含第二时间比特域,所述第二时间比特域用于指示所述第三时刻T3。所述第一设备从所述第二设备接收所述第三信元。所述第三信元可以称为所述延时响应信元的跟随信元,或跟随信元。S305: The second device sends a third information element to the first device, where the third information element includes a second time bit field, and the second time bit field is used to indicate the third time T3. The first device receives the third information element from the second device. The third cell may be referred to as a follow cell of the delayed response cell, or a follow cell.
S306:所述第一设备根据所述第一时刻T1、所述第二时刻T2、所述第三时刻T3和所述第四时刻T4,进行与所述第二设备之间的时间同步。S306: The first device performs time synchronization with the second device according to the first time T1, the second time T2, the third time T3, and the fourth time T4.
所述第一设备可以通过以上基于1588协议的时间同步原理中记载的方式,进行时间同步,此处不再赘述。The first device may perform time synchronization in the manner described in the time synchronization principle based on the 1588 protocol above, which will not be repeated here.
在本申请中,由于所述第一设备和所述第二设备在发送对应的信元时,通常会对信元进行编码,例如通过物理编码子层(physical coding sublayer,PCS)进行物理编码。因此所述第一设备和所述第二设备可以将对其需要发送的信元中的参考比特进行编码的时刻,作为发送该参考比特的时刻,即发送该信元的时刻。In this application, when the first device and the second device send corresponding information elements, they usually encode information elements, for example, physical encoding is performed through a physical coding sublayer (PCS). Therefore, the first device and the second device may use the time at which the reference bit in the cell to be sent is encoded as the time at which the reference bit is sent, that is, the time at which the cell is sent.
然而所述第一设备和所述第二设备接收对应的信元时,实际上是接收编码后的信元,因此,所述第一设备和所述第二设备是无法确定编码后的信元中参考比特的具体位置,从而无法确定接收该参考比特的时刻。在本申请实施例中,所述第一设备和所述第二设备可以在接收编码后的信元的过程中,针对每个时钟周期均记录对应的时刻,接收完成并对该信元进行解码后,确定该信元中的参考比特所在的时钟周期,最后可以将记录的该时钟周期对应的时刻,作为接收该信元的时刻。However, when the first device and the second device receive the corresponding cells, they actually receive the encoded cells. Therefore, the first device and the second device cannot determine the encoded cells. The specific position of the reference bit in the middle, so that the moment of receiving the reference bit cannot be determined. In the embodiment of the present application, the first device and the second device may record the corresponding time for each clock cycle in the process of receiving the encoded cell, the reception is completed and the cell is decoded After that, the clock cycle of the reference bit in the cell is determined, and finally the recorded time corresponding to the clock cycle can be used as the time of receiving the cell.
基于以上描述,在本实施例的步骤S302中,所述第二设备可以通过以下方式,确定所述第二时刻T2:Based on the above description, in step S302 of this embodiment, the second device may determine the second time T2 in the following manner:
所述第二设备在接收所述第一信元的过程中保存每个时钟周期对应的时刻;The second device saves the time corresponding to each clock cycle during the process of receiving the first cell;
所述第二设备在接收所述第一信元后,确定接收所述第一信元中所述第一参考比特所在的目标时钟周期,然后确定该目标时钟周期对应的时刻为所述第二时刻T2。After receiving the first cell, the second device determines the target clock cycle in which the first reference bit in the first cell is received, and then determines that the time corresponding to the target clock cycle is the second Time T2.
同样的,在本实施例的步骤S304中,所述第一设备可以通过以下方式,确定所述第四时刻T4:Similarly, in step S304 of this embodiment, the first device may determine the fourth time T4 in the following manner:
所述第一设备在接收所述第二信元的过程中保存每个时钟周期对应的时刻;The first device saves the time corresponding to each clock cycle during the process of receiving the second cell;
所述第一设备在接收所述第二信元后,确定接收所述第二信元中所述第二参考比特所在的目标时钟周期,然后确定该目标时钟周期对应的时刻为所述第四时刻T4。After receiving the second cell, the first device determines the target clock cycle in which the second reference bit in the second cell is received, and then determines that the time corresponding to the target clock cycle is the fourth Time T4.
另外,还需要说明的是,在本申请实施例中,为了保证所述第一设备最后在进行时间同步时的精准度,所述第一设备和所述第二设备需要提前协商或通过协议规定用于时间同步的信元中参考比特位的选择规则,即所述第一信元中的所述第一参考比特和所述第二信元中的所述第二参考比特,是采用相同的规则确定的,二者可能在各自所在的信元中的位置相同或者作用相同。In addition, it should be noted that, in the embodiment of the present application, in order to ensure the accuracy of the first device's final time synchronization, the first device and the second device need to be negotiated in advance or stipulated by agreement. The selection rule of the reference bit in the cell used for time synchronization, that is, the first reference bit in the first cell and the second reference bit in the second cell use the same As determined by the rules, the two may have the same position or the same function in the cell where they are located.
示例性的,所述第一参考比特位和所述第二参考比特位可以但不限于为以下几种形式:Exemplarily, the first reference bit and the second reference bit may be, but not limited to, the following forms:
形式一:所述第一参考比特为所述第一信元中的最高有效位(most significant bit,MSB),所述第二参考比特为所述第二信元中的MSB。Form 1: The first reference bit is the most significant bit (MSB) in the first cell, and the second reference bit is the MSB in the second cell.
形式二:所述第一参考比特为所述第一信元中的最低有效位(least significant bit,LSB),所述第二参考比特为所述第二信元中的LSB。Form 2: The first reference bit is the least significant bit (LSB) in the first cell, and the second reference bit is the LSB in the second cell.
形式三:所述第一参考比特为所述第一信元中的第n个比特位,所述第二参考比特为所述第二信元中的第n个比特位,其中n为大于或等于1,且小于或等于N的整数,N小于或等于所述第一信元中包含的比特总量,且小于或等于所述第二信元中包含的比特总量。Form 3: The first reference bit is the nth bit in the first cell, the second reference bit is the nth bit in the second cell, where n is greater than or An integer equal to 1 and less than or equal to N, where N is less than or equal to the total number of bits contained in the first cell and less than or equal to the total number of bits contained in the second cell.
形式四:所述第一参考比特为所述第一信元中的最后一个比特,所述第二参考比特为所述第二信元中的最后一个比特。Form 4: The first reference bit is the last bit in the first cell, and the second reference bit is the last bit in the second cell.
最后,还需要注意的一点是,本申请实施例不对执行上述时间同步流程的时机进行限定。可选的,所述第一设备可以在首次与所述第二设备进行业务传输时发起该时间同步流程,或者所述第一设备可以周期性地执行该时间同步流程,或者所述第一设备可以在接收 到时间同步指令后执行该时间同步流程,再或者所述第一设备可以定时执行该时间同步流程。另外,本申请实施例也不对执行上述时间同步流程中相关信元的类型进行限定,以上第一信元、第二信元和第三信元可以为控制信元。Finally, it should be noted that the embodiment of the present application does not limit the timing of executing the above-mentioned time synchronization process. Optionally, the first device may initiate the time synchronization process when performing service transmission with the second device for the first time, or the first device may periodically perform the time synchronization process, or the first device The time synchronization process may be executed after receiving the time synchronization instruction, or the first device may periodically execute the time synchronization process. In addition, the embodiment of the present application does not limit the types of related cells in the execution of the above-mentioned time synchronization process. The above-mentioned first cell, second cell, and third cell may be control cells.
本申请实施例提供了一种时间同步方法,在该方法中,所述第一设备和所述第二设备可以通过信元交互,实现1588协议的时间同步。因此,该方法可以实现支持信元传输的通信设备之间的精准时间同步。另外,任何支持信元传输的通信系统可以通过该方法实现基于信元方式的1588协议的时间同步,从而可以替换传统的基于以太网方式承载1588协议的方法,便于1588系统的部署,进一步的,由于支持信元传输的通信设备无需增加额外的以太网端口即可实现1588协议的时间同步,因此,该方法也可以节省硬件端口造成的开销。The embodiment of the present application provides a time synchronization method. In this method, the first device and the second device can exchange information elements to achieve time synchronization of the 1588 protocol. Therefore, this method can achieve precise time synchronization between communication devices that support cell transmission. In addition, any communication system that supports cell transmission can realize time synchronization based on the 1588 protocol in cell mode through this method, which can replace the traditional method of carrying the 1588 protocol based on the Ethernet mode, which is convenient for the deployment of the 1588 system. Further, Since the communication device supporting cell transmission can realize the time synchronization of the 1588 protocol without adding an additional Ethernet port, this method can also save the overhead caused by the hardware port.
基于图2所示的通信系统中每个通信设备的功能,以及图3所示的时间同步方法,本申请实施例还提供了一种通信设备。该通信设备中的各个单元/模块是按照实现图3所示的实施例中的通信设备的逻辑功能划分的。参阅图4所示,所述通信设备包括:时间处理单元、信元处理单元(cell processor)、PCS,以及物理接口。下面对各个模块的功能进行详细描述。Based on the function of each communication device in the communication system shown in FIG. 2 and the time synchronization method shown in FIG. 3, an embodiment of the present application also provides a communication device. Each unit/module in the communication device is divided according to the logic function of the communication device in the embodiment shown in FIG. 3. Referring to FIG. 4, the communication device includes: a time processing unit, a cell processor, a PCS, and a physical interface. The function of each module is described in detail below.
所述时间处理单元,用于记录和保存通信设备的时间戳,以及根据保存的时间戳信息进行时间同步。The time processing unit is used to record and save the time stamp of the communication device, and perform time synchronization according to the saved time stamp information.
例如,当所述通信设备为延时响应方时,所述时间处理单元可以记录接收到延时请求信元中的参考比特的时刻T2,以及向延时请求方发送延时响应信元中的参考比特的时刻T3。For example, when the communication device is the delayed responder, the time processing unit may record the time T2 when the reference bit in the delayed request cell is received, and send the delayed response cell to the delayed requester. Reference bit time T3.
当所述通信设备为延时请求方时,所述时间处理单元可以记录所述通信设备向延时响应方发送延时请求信元中的参考比特的时刻T1、所述通信设备接收延时响应信元中的参考比特的时刻T4,所述信元处理单元从延时响应信元中获取的延时响应方接收延时请求信元中的参考比特的时刻T2,以及所述信元处理单元从延时响应信元的跟随信元中获取的延时响应方发送延时响应信元中的参考比特的时刻T3。并且,所述信元处理单元还可以根据保存的上述4个时刻,按照1588协议的时间同步原理中的方式,进行时间同步。When the communication device is the delay requester, the time processing unit may record the time T1 at which the communication device sends the reference bit in the delay request cell to the delay responder, and the communication device receives the delay response The time T4 of the reference bit in the cell, the time T2 when the delay responder obtained from the delay response cell receives the reference bit in the delay request cell, and the cell processing unit The time T3 at which the delayed responder, obtained from the following cell of the delayed response cell, sends the reference bit in the delayed response cell. In addition, the cell processing unit may also perform time synchronization in accordance with the method in the time synchronization principle of the 1588 protocol according to the above-mentioned four saved times.
所述信元处理单元,用于对所述通信设备进行业务传输的相关信元进行处理,还可以对时间同步相关的信元进行处理。如图4所示,按照发送(transmit,Tx)方向和接收(receive,Rx)方向的不同功能,所述信元处理单元可以分为发送(Tx)单元和接收(Rx)单元。其中,所述发送单元主要用于生成信元,并将该信元发送给PCS进行编码,最终通过物理接口发送出去。所述发送单元主要用于接收PCS解码得到的信元,并根据该信元的类型以及该信元中的数据,执行相关操作。The cell processing unit is configured to process related cells for service transmission performed by the communication device, and may also process cells related to time synchronization. As shown in FIG. 4, according to different functions in the transmit (Tx) direction and the receive (Rx) direction, the cell processing unit can be divided into a transmit (Tx) unit and a receive (Rx) unit. Wherein, the sending unit is mainly used to generate a cell, send the cell to the PCS for encoding, and finally send it out through a physical interface. The sending unit is mainly used to receive the cell decoded by the PCS, and perform related operations according to the type of the cell and the data in the cell.
所述PCS,用于对信元进行物理编码和物理解码处理。如图4所示,按照Tx方向和Rx的不同功能,所述信元处理单元可以分为编码单元和解码单元。其中,所述编码单元,用于对待发送的信元进行物理编码处理,并将物理编码后的信元通过物理接口发送给其他通信设备。所述解码单元,用于对物理接口接收的物理编码后的信元进行物理解码处理,得到信元,并将物理解码后得到的信元发送给信元处理单元进行进一步处理。The PCS is used to perform physical encoding and physical decoding processing on cells. As shown in FIG. 4, according to the different functions of the Tx direction and the Rx, the cell processing unit can be divided into an encoding unit and a decoding unit. Wherein, the encoding unit is used to perform physical encoding processing on the information element to be sent, and send the physically encoded information element to other communication devices through the physical interface. The decoding unit is configured to perform physical decoding processing on the physically encoded cells received by the physical interface to obtain the cells, and send the cells obtained after physical decoding to the cell processing unit for further processing.
所述物理接口,可以通过线缆连接其他通信设备,用于通过接收和发送信元与其他通信设备进行通信交互。可选的,所述物理接口可以为串行接口(serdes)。如图4所示,按 照Tx方向和Rx的不同功能,所述物理接口可以分为Tx物理接口和Rx物理接口。其中,所述Tx物理接口,用于向其他通信设备发送物理编码后的信元。所述Rx物理接口,用于从其他通信设备接收物理编码后的信元。The physical interface can be connected to other communication devices through cables, and is used to communicate and interact with other communication devices by receiving and sending cells. Optionally, the physical interface may be a serial interface (serdes). As shown in Figure 4, according to the Tx direction and the different functions of the Rx, the physical interfaces can be divided into Tx physical interfaces and Rx physical interfaces. Wherein, the Tx physical interface is used to send physically encoded cells to other communication devices. The Rx physical interface is used to receive physically encoded cells from other communication devices.
基于图3所示的时间同步方法,以及图4所示的通信设备的逻辑功能结构,本申请实施例还提供了一种时间同步实例。其中,为了便于区分和描述,本实例将延时请求方称为“通信设备A”,将延时响应方称为“通信设备B”。由于通信设备A和通信设备B中具有相同的单元/模块,为了区分单元/模块,本实例将归属于通信设备A的各个单元/模块的名称后添加A,将归属于通信设备B的各个单元/模块的名称后添加B。下面参阅图5,对该时间同步实例的流程进行描述:Based on the time synchronization method shown in FIG. 3 and the logical function structure of the communication device shown in FIG. 4, the embodiment of the present application also provides a time synchronization example. Among them, in order to facilitate the distinction and description, this example refers to the delay requester as "communication device A", and the delay responder as "communication device B". Since the communication equipment A and the communication equipment B have the same unit/module, in order to distinguish the units/modules, this example adds A after the names of the units/modules belonging to the communication equipment A, and will belong to the units/modules of the communication equipment B /Add B after the name of the module. Refer to Figure 5 below to describe the process of this time synchronization instance:
(1):通信设备A中发送单元A生成延时请求信元(Prequest-cell)(图中简写为Preq-cell)。然后所述发送单元A将所述延时请求信元发送给PCS A中的编码单元A。(1): The sending unit A in the communication device A generates a delay request cell (Prequest-cell) (abbreviated as Preq-cell in the figure). Then the sending unit A sends the delay request information element to the coding unit A in the PCS A.
(2):编码单元A对接收到的延时请求信元进行物理编码,并将物理编码后的延时请求信元发送给Tx物理接口A。其中,在所述编码单元A对所述延时请求信元进行物理编码过程中,当所述编码单元A对所述延时请求信元中的MSB进行物理编码时,采集当前时刻T1(通信设备A发送延时请求信元的时刻),并发送给通信设备A的时间处理单元A。时间处理单元A保存该时刻T1。(2): The encoding unit A physically encodes the received delay request information element, and sends the physically encoded delay request information element to the Tx physical interface A. Wherein, when the encoding unit A physically encodes the delay request cell, when the encoding unit A physically encodes the MSB in the delay request cell, collect the current time T1 (communication The time when the device A sends the delay request cell), and sends it to the time processing unit A of the communication device A. The time processing unit A saves the time T1.
(3):Tx物理接口A将编码后的延时请求信元发送给通信设备B。(3): The Tx physical interface A sends the encoded delay request cell to the communication device B.
(4):通信设备B中的Rx物理接口B在接收到编码后的延时请求信元后,将其发送给PCS B中的解码单元B。(4): After receiving the encoded delay request cell, the Rx physical interface B in the communication device B sends it to the decoding unit B in the PCS B.
(5):所述解码单元B在接收所述编码后的延时请求信元的过程中,记录每个时钟周期对应的时刻。所述解码单元B对接收到的编码后的延时请求信元进行物理解码,得到所述延时请求信元之后,将在接收编码后的延时请求信元的过程中记录的多个时钟周期对应的时刻、解码得到的所述延时请求信元发送给信元处理单元B中的接收单元B。(5): The decoding unit B records the time corresponding to each clock cycle during the process of receiving the encoded delay request information element. The decoding unit B physically decodes the received encoded delay request cell, and after obtaining the delay request cell, it records multiple clocks in the process of receiving the encoded delay request cell The time corresponding to the cycle and the delay request cell obtained by decoding are sent to the receiving unit B in the cell processing unit B.
(6):所述接收单元B在接收以上内容后,确定接收到的信元为延时请求信元(例如,可以通过延时请求信元中的指示确定,或者根据信元标识确定,或根据信元的类型确定)后,识别所述延时请求信元中的MSB,并确定接收该MSB所在的目标时钟周期,最后确定该目标时钟周期对应的时刻T2,将该时刻作为所述通信设备B接收所述延时请求信元的时刻。所述接收单元B将时刻T2发送给发送单元B,并通知发送单元B进行延时响应。(6): After receiving the above content, the receiving unit B determines that the received cell is a delay request cell (for example, it can be determined by the indication in the delay request cell, or determined according to the cell identifier, or After determining according to the type of the cell), identify the MSB in the delay request cell, determine the target clock cycle where the MSB is received, and finally determine the time T2 corresponding to the target clock cycle, and use this time as the communication The time when the device B receives the delay request cell. The receiving unit B sends the time T2 to the sending unit B, and notifies the sending unit B to make a delayed response.
(7):所述发送单元B接收到接收单元B的通知后,生成包含接收的时刻T2的延时响应信元(Presponse-cell)(图中简写为Prsp-cell)。然后,所述发送单元B将所述延时响应信元发送给PCS B中的编码单元B。(7): After receiving the notification from the receiving unit B, the sending unit B generates a delayed response cell (Presponse-cell) (abbreviated as Prsp-cell in the figure) containing the received time T2. Then, the sending unit B sends the delayed response information element to the coding unit B in the PCS B.
(8):所述编码单元B对接收到的延时响应信元进行物理编码,并将物理编码后的延时响应信元发送给Tx物理接口B。其中,在所述编码单元B对所述延时响应信元进行物理编码过程中,当所述编码单元B对所述延时响应信元中的MSB进行物理编码时,采集当前时刻T3(通信设备B发送延时响应信元的时刻),并回传给所述发送单元B。(8): The encoding unit B physically encodes the received delay response information element, and sends the physically encoded delay response information element to the Tx physical interface B. Wherein, when the encoding unit B physically encodes the delay response cell, when the encoding unit B physically encodes the MSB in the delay response cell, collect the current time T3 (communication The time when the device B sends the delayed response cell), and sends it back to the sending unit B.
(9):所述发送单元B在接收到所述编码单元B回传的时刻T3时,生成包含所述时刻T3延时响应信元的跟随信元(Presponse-follow-up-cell)(图中简写为Prfu-cell)。然后,所述发送单元B将所述跟随信元发送给PCS B中的编码单元B。(9): The sending unit B generates a follow-up cell (Presponse-follow-up-cell) containing the delayed response cell at the time T3 when receiving the time T3 returned by the coding unit B (Figure Chinese abbreviated as Prfu-cell). Then, the sending unit B sends the following information element to the coding unit B in the PCS B.
(10):所述编码单元B对接收到的跟随信元进行物理编码,并将编码后的跟随信元发 送给Tx物理接口B。(10): The encoding unit B physically encodes the received follow-up cell, and sends the encoded follow-up cell to the Tx physical interface B.
(11):Tx物理接口B分别将编码后的延时响应信元,以及编码后的跟随信元发送给通信设备A。(11): The Tx physical interface B sends the encoded delayed response cell and the encoded follow cell to the communication device A respectively.
(12):所述通信设备A中的Rx物理接口A分别在接收到编码后的延时响应信元、编码后的跟随信元后,将其发送给PCS A中的解码单元A。(12): After the Rx physical interface A in the communication device A receives the encoded delayed response cell and the encoded follow-up cell, respectively, it sends them to the decoding unit A in the PCS A.
(13):所述解码单元A在接收到编码后的延时响应信元的过程中,记录每个时钟周期对应的时刻。所述解码单元A对接收到的编码后的延时响应信元进行物理解码,得到所述延时响应信元之后,将在接收编码后的延时响应信元的过程中记录的多个时钟周期对应的时刻、解码得到的所述延时响应信元发送给信元处理单元A中的接收单元A。(13): The decoding unit A records the time corresponding to each clock cycle during the process of receiving the encoded delayed response cell. The decoding unit A physically decodes the received encoded delayed response cell, and after obtaining the delayed response cell, it records multiple clocks during the process of receiving the encoded delayed response cell The time corresponding to the cycle and the delayed response cell obtained by decoding are sent to the receiving unit A in the cell processing unit A.
所述解码单元A在接收到编码后的跟随信元后,对该编码后的跟随信元进行物理解码,得到跟随信元。然后所述解码单元A将解码得到的所述跟随信元发送给所述接收单元A。After receiving the encoded follower cell, the decoding unit A physically decodes the encoded follower cell to obtain the follower cell. Then the decoding unit A sends the following information element obtained by decoding to the receiving unit A.
(14):所述接收单元A在接收到所述解码单元A记录的多个时钟周期对应的时刻、解码得到的所述延时响应信元后,确定接收到的信元为延时响应信元(例如,可以通过延时响应信元中的指示确定,或者根据信元标识确定,或根据信元的类型确定)后,识别所述延时响应信元中的MSB,并确定接收该MSB所在的目标时钟周期,最后确定该目标时钟周期对应的时刻T4,将该时刻作为所述通信设备A接收所述延时响应信元的时刻。所述接收单元A将时刻T4发送给通信设备A的时间处理单元A。时间处理单元A保存该时刻T4。(14): The receiving unit A determines that the received information element is a delayed response signal after receiving the time corresponding to the multiple clock cycles recorded by the decoding unit A and the delayed response cell obtained by decoding. After the element (for example, it can be determined by the indication in the delayed response cell, or determined according to the cell identifier, or determined according to the type of the cell), the MSB in the delayed response cell is identified, and the MSB is determined to be received Where the target clock cycle is located, the time T4 corresponding to the target clock cycle is finally determined, and this time is used as the time at which the communication device A receives the delayed response cell. The receiving unit A sends the time T4 to the time processing unit A of the communication device A. The time processing unit A saves the time T4.
所述接收单元A从所述延时响应信元中获取其包含的时刻T2,并将所述时刻T2发送给时间处理单元A。所述时间处理单元A保存该时刻T2。The receiving unit A obtains the time T2 contained in the delayed response cell, and sends the time T2 to the time processing unit A. The time processing unit A saves the time T2.
所述接收单元A在接收到解码后的跟随信元后,从所述跟随信元中获取其包含的时刻T3,并将所述时刻T3发送给时间处理单元A。所述时间处理单元A保存该时刻T3。After receiving the decoded follower cell, the receiving unit A obtains the time T3 contained in the follower cell from the follower cell, and sends the time T3 to the time processing unit A. The time processing unit A saves the time T3.
(15):所述时间处理单元A根据保存的四个时刻,进行与所述通信设备B之间的时间同步。(15): The time processing unit A performs time synchronization with the communication device B according to the four saved moments.
需要说明的是,在实例中,所述通信设备A可能会同时向多个其他通信设备发起以上时间同步流程,所述通信设备A也可能向同一通信设备发起多次上述时间同步流程。为了保证时间同步的精准度,使时间同步的双方通信设备能够识别时钟同步相关信元(延时请求信元、延时响应信元,延时响应信元的跟随信元)是属于同一时间同步流程的,在本实例中可以在上述相关信元中添加流程标识。可选的,所述流程标识可以为以下任意一项或组合:It should be noted that, in an example, the communication device A may initiate the above time synchronization process to multiple other communication devices at the same time, and the communication device A may also initiate the above time synchronization process to the same communication device multiple times. In order to ensure the accuracy of time synchronization, the two communication devices of time synchronization can recognize that clock synchronization related cells (delay request cell, delay response cell, and follow cell of delay response cell) belong to the same time synchronization For the process, in this example, the process identifier can be added to the above-mentioned relevant information element. Optionally, the process identifier can be any one or a combination of the following:
时间同步序列号(sequence ID)、物理接口的链路号、所述通信设备A的标识、所述通信设备B的标识。Time synchronization sequence number (sequence ID), link number of the physical interface, identification of the communication device A, and identification of the communication device B.
同样的,所述通信设备A中的时间处理单元A也是根据流程标识,保存的时刻组的。即同一时刻组中的所有时刻是针对同一流程标识保存的。Similarly, the time processing unit A in the communication device A is also grouped with the saved time according to the process identifier. That is, all the moments in the same moment group are saved for the same process ID.
这样,通信设备A中的接收单元A可以接收到延时响应信元和跟随信元后,先进行配对验证,即验证接收的延时响应信元和跟随信元中的流程标识,是否与发送的延时请求信元中的流程标识相同。若不相同,则所述接收单元A丢弃该延时响应信元和跟随信元;若相同,所述接收单元A根据延时响应信元和跟随信元,进行后续操作。In this way, the receiving unit A in the communication device A can first perform pairing verification after receiving the delayed response cell and the follow cell, that is, verify whether the received delayed response cell and the process identifier in the follow cell are the same as the sender The process ID in the delay request cell is the same. If they are not the same, the receiving unit A discards the delayed response cell and the following cell; if they are the same, the receiving unit A performs subsequent operations according to the delayed response cell and the following cell.
根据跟随信元的发送时间可知,所述通信设备A应该最后确定时刻T3,因此所述通信设备A保存时间同步的时刻的顺序为:T1-T2/T4-T3。因此当所述通信设备A确定针对 同一流程标识保存的时刻组中任一个是无效的,则丢弃该时刻组。According to the sending time of the following cell, it can be known that the communication device A should finally determine the time T3. Therefore, the order of the time when the communication device A saves time synchronization is: T1-T2/T4-T3. Therefore, when the communication device A determines that any one of the time groups saved for the same process identifier is invalid, the time group is discarded.
另外,通过以上实例的具体流程描述可知,该实例使用通信设备中的物理媒介连接层(physical medium attachment,PMA)打时间戳的机制,这种机制可以避免由传统的PCS层和前向错误纠错(forward error correction,FEC)层打时间戳带来的时间抖动,可以进一步提高时间同步的精准度。In addition, from the specific process description of the above example, it can be seen that this example uses the physical medium attachment (PMA) mechanism of the communication device to time stamp. This mechanism can avoid the traditional PCS layer and forward error correction. The time jitter caused by the time stamping of the forward error correction (FEC) layer can further improve the accuracy of time synchronization.
基于相同的技术构思,本申请实施例还提供了一种通信装置,该装置的结构如图6所示,包括通信单元601和处理单元602。所述通信装置600可以应用于图2所示的通信系统的通信设备中,并可以实现以上实施例或实例提供的时间同步方法。在本申请实施例中,所述通信装置600既可以应用于通信系统中的延时请求方(简称为第一设备),也可以应用于通信系统中的延时响应方(简称为第二设备)。Based on the same technical concept, an embodiment of the present application also provides a communication device. The structure of the device is shown in FIG. 6 and includes a communication unit 601 and a processing unit 602. The communication device 600 can be applied to the communication device of the communication system shown in FIG. 2 and can implement the time synchronization method provided in the above embodiments or examples. In the embodiment of the present application, the communication device 600 can be applied to both the delay requester in the communication system (referred to as the first device for short) and the delay responder in the communication system (referred to as the second device for short). ).
下面对装置600中的各个单元的功能进行介绍。The functions of each unit in the device 600 are introduced below.
所述通信单元601,用于接收和发送信元。其中,所述通信单元601可以通过物理接口(例如serdes)和PCS实现上述收发功能。The communication unit 601 is used to receive and send information elements. Wherein, the communication unit 601 can implement the above-mentioned transceiver function through a physical interface (for example, serdes) and a PCS.
在一种实施方式中,所述通信装置600应用于第一设备时,各个单元的功能如下:In an implementation manner, when the communication device 600 is applied to the first device, the functions of each unit are as follows:
所述处理单元602,用于通过所述通信单元601向第二设备发送第一信元,并确定第一时刻,其中,所述第一信元中包括第一参考比特,所述第一时刻为所述通信单元601发送所述第一信元中的所述第一参考比特的时刻;通过所述通信单元601从所述第二设备接收第二信元,所述第二信元中包含第一时间比特域和第二参考比特,所述第一时间比特域用于指示所述第二设备接收到所述第一信元中的所述第一参考比特的第二时刻;确定第三时刻,所述第三时刻为所述通信单元601接收所述第二信元中的第二参考比特的时刻;通过所述通信单元601从所述第二设备接收第三信元,其中,所述第三信元中包含第二时间比特域,所述第二时间比特域用于指示所述第二设备发送所述第二信元中的所述第二参考比特的时刻;以及根据所述第一时刻、所述第二时刻、所述第三时刻和所述第四时刻,进行与所述第二设备之间的时间同步;The processing unit 602 is configured to send a first information element to the second device through the communication unit 601 and determine a first moment, where the first information element includes a first reference bit, and the first moment Is the time when the communication unit 601 sends the first reference bit in the first cell; the second cell is received from the second device through the communication unit 601, and the second cell contains A first time bit field and a second reference bit, where the first time bit field is used to indicate the second moment when the second device receives the first reference bit in the first cell; determining the third Time, the third time is the time when the communication unit 601 receives the second reference bit in the second information element; the third information element is received from the second device through the communication unit 601, where The third information element includes a second time bit field, and the second time bit field is used to indicate the moment when the second device sends the second reference bit in the second information element; and according to the Perform time synchronization with the second device at the first time, the second time, the third time, and the fourth time;
所述通信单元601,用于发送所述第一信元,以及接收所述第二信元和所述第三信元。The communication unit 601 is configured to send the first information element, and receive the second information element and the third information element.
可选的,所述第一参考比特为所述第一信元中的最高有效位MSB,所述第二参考比特为所述第二信元中的MSB;或者Optionally, the first reference bit is the most significant bit MSB in the first cell, and the second reference bit is the MSB in the second cell; or
所述第一参考比特为所述第一信元中的第n个比特,所述第二参考比特为所述第二信元中的第n个比特,其中n为大于或等于1,且小于或等于N的整数,N小于或等于所述第一信元中包含的比特总量,且小于或等于所述第二信元中包含的比特总量;或者The first reference bit is the nth bit in the first cell, the second reference bit is the nth bit in the second cell, where n is greater than or equal to 1, and less than Or an integer equal to N, where N is less than or equal to the total number of bits contained in the first cell and less than or equal to the total number of bits contained in the second cell; or
所述第一参考比特为所述第一信元中的最后一个比特,所述第二参考比特为所述第二信元中的最后一个比特。The first reference bit is the last bit in the first cell, and the second reference bit is the last bit in the second cell.
可选的,所述处理单元602,在通过所述通信单元601从所述第二设备接收所述第二信元,并确定所述第三时刻时,具体用于:Optionally, the processing unit 602, when receiving the second information element from the second device through the communication unit 601 and determining the third time, is specifically configured to:
在所述通信单元601接收所述第二信元的过程中保存每个时钟周期对应的时刻;Save the time corresponding to each clock cycle during the process of receiving the second cell by the communication unit 601;
在所述通信单元601接收所述第二信元后,确定接收所述第二信元中所述第二参考比特所在的目标时钟周期,并确定所述目标时钟周期对应的时刻为所述第三时刻。After the communication unit 601 receives the second cell, it determines the target clock cycle in which the second reference bit in the second cell is received, and determines that the time corresponding to the target clock cycle is the first Three moments.
可选的,所述第一信元为延时请求信元,所述第二信元为延时响应信元,所述第三信元为跟随信元。Optionally, the first cell is a delay request cell, the second cell is a delay response cell, and the third cell is a follow cell.
在另一种实施方式中,所述通信装置600应用于第二设备时,各个单元的功能如下:In another implementation manner, when the communication device 600 is applied to a second device, the functions of each unit are as follows:
处理单元602,用于通过所述通信单元601从第一设备接收第一信元,并确定第二时刻,所述第一信元中包括第一参考比特,所述第二时刻为所述通信单元601接收所述第一信元中的所述第一参考比特的时刻;通过所述通信单元601向所述第一设备发送第二信元,并确定第四时刻,所述第二信元中包含第一时间比特域和第二参考比特,所述第一时间比特域用于指示所述第二时刻,所述第四时刻为所述通信单元601发送所述第二信元中的所述第二参考比特的时刻;以及通过所述通信单元601向所述第一设备发送第三信元,其中,所述第三信元中包含第二时间比特域,所述第二时间比特域用于指示所述第四时刻;The processing unit 602 is configured to receive a first information element from a first device through the communication unit 601, and determine a second time, where the first information element includes a first reference bit, and the second time is the communication The unit 601 receives the moment of the first reference bit in the first cell; sends a second cell to the first device through the communication unit 601, and determines the fourth moment, the second cell Contains a first time bit field and a second reference bit, the first time bit field is used to indicate the second time, and the fourth time is all the information in the second cell sent by the communication unit 601 The time of the second reference bit; and sending a third information element to the first device through the communication unit 601, wherein the third information element includes a second time bit field, and the second time bit field Used to indicate the fourth moment;
通信单元601,用于接收所述第一信元,以及发送所述第二信元和所述第三信元。The communication unit 601 is configured to receive the first information element, and send the second information element and the third information element.
可选的,所述第一参考比特为所述第一信元中的最高有效位MSB,所述第二参考比特为所述第二信元中的MSB;或者Optionally, the first reference bit is the most significant bit MSB in the first cell, and the second reference bit is the MSB in the second cell; or
所述第一参考比特为所述第一信元中的第n个比特,所述第二参考比特为所述第二信元中的第n个比特,其中n为大于或等于1,且小于或等于N的整数,N小于或等于所述第一信元中包含的比特总量,且小于或等于所述第二信元中包含的比特总量;或者The first reference bit is the nth bit in the first cell, the second reference bit is the nth bit in the second cell, where n is greater than or equal to 1, and less than Or an integer equal to N, where N is less than or equal to the total number of bits contained in the first cell and less than or equal to the total number of bits contained in the second cell; or
所述第一参考比特为所述第一信元中的最后一个比特,所述第二参考比特为所述第二信元中的最后一个比特。The first reference bit is the last bit in the first cell, and the second reference bit is the last bit in the second cell.
可选的,所述处理单元602,在通过所述通信单元601从第一设备接收第一信元,并确定第二时刻时,具体用于:Optionally, the processing unit 602, when receiving the first information element from the first device through the communication unit 601 and determining the second time, is specifically configured to:
在所述通信单元601接收所述第一信元的过程中保存每个时钟周期对应的时刻;Save the time corresponding to each clock cycle during the process of receiving the first cell by the communication unit 601;
在所述通信单元601接收所述第一信元后,确定接收所述第一信元中所述第一参考比特位所在的目标时钟周期,并确定所述目标时钟周期对应的时刻为所述第二时刻。After the communication unit 601 receives the first cell, it determines the target clock period in which the first reference bit in the first cell is received, and determines that the time corresponding to the target clock period is the The second moment.
可选的,所述第一信元为延时请求信元,所述第二信元为延时响应信元,所述第三信元为跟随信元。Optionally, the first cell is a delay request cell, the second cell is a delay response cell, and the third cell is a follow cell.
需要说明的是,本申请以上实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。It should be noted that the division of modules in the above embodiments of the present application is illustrative, and is only a logical function division. In actual implementation, there may be other division methods. In addition, each function in each embodiment of the present application The unit can be integrated into one processing unit, or it can exist alone physically, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including a number of instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .
基于相同的技术构思,本申请实施例还提供了一种通信设备,所述通信设备可以应用于如图2所示的通信系统中,可以实现以上实施例或实例提供的时间同步方法,且具有图6所示的通信装置的功能。参阅图7所示,所述通信设备700包括:通信接口701、处理 器702以及存储器703。其中,所述通信接口701、所述处理器702以及所述存储器703之间相互连接。Based on the same technical concept, the embodiments of the present application also provide a communication device, which can be applied to the communication system as shown in FIG. 2 and can implement the time synchronization method provided by the above embodiments or examples, and has The function of the communication device shown in FIG. 6. Referring to FIG. 7, the communication device 700 includes: a communication interface 701, a processor 702, and a memory 703. Wherein, the communication interface 701, the processor 702, and the memory 703 are connected to each other.
可选的,所述通信接口701、所述处理器702以及所述存储器703之间通过总线704相互连接。所述总线704可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图7中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。Optionally, the communication interface 701, the processor 702, and the memory 703 are connected to each other through a bus 704. The bus 704 may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, and so on. For ease of representation, only one thick line is used in FIG. 7, but it does not mean that there is only one bus or one type of bus.
所述通信接口701,用于接收和发送信元,实现与其他通信设备之间的通信交互。The communication interface 701 is used to receive and send information elements to realize communication interaction with other communication devices.
所述处理器702,用于对信元进行处理,包括生成、解析、物理编码和物理解码等处理,以及进行时间同步。The processor 702 is configured to process information elements, including processing such as generation, analysis, physical encoding and physical decoding, and time synchronization.
在一种实施方式中,当所述通信设备700应用于需要时间同步的两个通信设备中的延时请求方(其中,所述延时请求方简称第一设备,延时响应方简称为第二设备)时,所述处理器702,具体用于:In one embodiment, when the communication device 700 is applied to the delay requester of two communication devices that require time synchronization (wherein, the delay requester is referred to as the first device, and the delay responder is referred to as the first In the case of two devices), the processor 702 is specifically configured to:
通过所述通信接口701向第二设备发送第一信元,并确定第一时刻,其中,所述第一信元中包括第一参考比特,所述第一时刻为第一设备发送所述第一信元中的所述第一参考比特的时刻;通过所述通信接口701从所述第二设备接收第二信元,所述第二信元中包含第一时间比特域和第二参考比特,所述第一时间比特域用于指示所述第二设备接收到所述第一信元中的所述第一参考比特的第二时刻;确定第三时刻,所述第三时刻为所述第一设备接收所述第二信元中的第二参考比特的时刻;通过所述通信接口701从所述第二设备接收第三信元,其中,所述第三信元中包含第二时间比特域,所述第二时间比特域用于指示所述第二设备发送所述第二信元中的所述第二参考比特的时刻;以及根据所述第一时刻、所述第二时刻、所述第三时刻和所述第四时刻,进行与所述第二设备之间的时间同步。The first information element is sent to the second device through the communication interface 701, and the first time is determined, where the first information element includes the first reference bit, and the first time is the first device sending the first time. The moment of the first reference bit in a cell; a second cell is received from the second device through the communication interface 701, and the second cell includes a first time bit field and a second reference bit , The first time bit field is used to indicate the second time at which the second device receives the first reference bit in the first cell; the third time is determined, and the third time is the The moment when the first device receives the second reference bit in the second cell; the third cell is received from the second device through the communication interface 701, where the third cell contains the second time Bit field, the second time bit field is used to indicate the time when the second device sends the second reference bit in the second cell; and according to the first time, the second time, The third time and the fourth time are synchronized with the second device.
可选的,所述处理器702,具体用于:Optionally, the processor 702 is specifically configured to:
在对所述第二信元进行物理解码的过程中保存每个时钟周期对应的时刻;Saving the time corresponding to each clock cycle in the process of physically decoding the second cell;
在对所述第二信元物理解码完成后,确定接收所述第二信元中所述第二参考比特所在的目标时钟周期,并确定所述目标时钟周期对应的时刻为所述第三时刻。After the physical decoding of the second cell is completed, determine the target clock cycle in which the second reference bit in the second cell is received, and determine that the time corresponding to the target clock cycle is the third time .
在另一种实施方式中,当所述通信设备700应用于需要时间同步的两个通信设备中的延时响应方(其中,所述延时响应方简称为第二设备,延时请求方简称为第一设备)时,所述处理器702,具体用于:In another embodiment, when the communication device 700 is applied to the delayed responder of two communication devices that need time synchronization (wherein, the delayed responder is referred to as the second device for short, and the delayed requester is referred to as When it is the first device), the processor 702 is specifically configured to:
通过所述通信接口701从第一设备接收第一信元,并确定第二时刻,所述第一信元中包括第一参考比特,所述第二时刻为第二设备接收所述第一信元中的所述第一参考比特的时刻;通过所述通信接口701向所述第一设备发送第二信元,并确定第四时刻,所述第二信元中包含第一时间比特域和第二参考比特,所述第一时间比特域用于指示所述第二时刻,所述第四时刻为所述第二设备发送所述第二信元中的所述第二参考比特的时刻;以及通过所述通信接口701向所述第一设备发送第三信元,其中,所述第三信元中包含第二时间比特域,所述第二时间比特域用于指示所述第四时刻。The first information element is received from the first device through the communication interface 701, and the second time is determined. The first information element includes the first reference bit, and the second time is when the second device receives the first information. The time of the first reference bit in the element; send a second information element to the first device through the communication interface 701, and determine the fourth time, the second information element contains the first time bit field and A second reference bit, where the first time bit field is used to indicate the second moment, and the fourth moment is the moment when the second device sends the second reference bit in the second cell; And sending a third information element to the first device through the communication interface 701, where the third information element includes a second time bit field, and the second time bit field is used to indicate the fourth time .
可选的,所述处理器702,具体用于:Optionally, the processor 702 is specifically configured to:
在对所述第一信元进行物理解码的过程中保存每个时钟周期对应的时刻;Saving the time corresponding to each clock cycle in the process of physically decoding the first cell;
在对所述第一信元物理解码完成后,确定接收所述第一信元中所述第一参考比特所在的目标时钟周期,并确定所述目标时钟周期对应的时刻为所述第二时刻。After the physical decoding of the first cell is completed, determine the target clock cycle where the first reference bit in the first cell is received, and determine that the time corresponding to the target clock cycle is the second time .
需要说明的是,所述处理器702的功能可以参考以上实施例以及实例提供的时间同步方法中的描述,以及图6所示实施例中对所述通信装置600的具体功能描述,此处不再赘述。It should be noted that the function of the processor 702 may refer to the description in the time synchronization method provided in the above embodiments and examples, and the specific function description of the communication device 600 in the embodiment shown in FIG. Go into details again.
所述存储器703,用于存放程序指令和数据等。具体地,程序指令可以包括程序代码,该程序代码包括计算机操作指令。存储器703可能包含随机存取存储器(random access memory,RAM),也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。处理器702执行存储器703所存放的程序指令,并使用所述存储器703中存储的数据,实现上述功能,从而实现上述实施例提供的时间同步方法。The memory 703 is used to store program instructions and data. Specifically, the program instructions may include program code, and the program code includes computer operation instructions. The memory 703 may include a random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory. The processor 702 executes the program instructions stored in the memory 703, and uses the data stored in the memory 703 to implement the above-mentioned functions, thereby realizing the time synchronization method provided in the above-mentioned embodiment.
可以理解,本申请图7中的存储器703可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。应注意,本文描述的系统和方法的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the memory 703 in FIG. 7 of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), and electrically available Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. The volatile memory may be a random access memory (Random Access Memory, RAM), which is used as an external cache. By way of exemplary but not restrictive description, many forms of RAM are available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (Double Data Rate SDRAM, DDR SDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced SDRAM, ESDRAM), Synchronous Link Dynamic Random Access Memory (Synchlink DRAM, SLDRAM) ) And Direct Rambus RAM (DR RAM). It should be noted that the memories of the systems and methods described herein are intended to include, but are not limited to, these and any other suitable types of memories.
基于以上实施例,本申请实施例还提供了一种计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行以上实施例提供的时间同步方法。Based on the above embodiments, the embodiments of the present application also provide a computer program, which when the computer program runs on a computer, causes the computer to execute the time synchronization method provided in the above embodiments.
基于以上实施例,本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,所述计算机程序被计算机执行时,使得计算机执行以上实施例提供的时间同步方法。Based on the above embodiments, the embodiments of the present application also provide a computer-readable storage medium in which a computer program is stored. When the computer program is executed by a computer, the computer can execute the time provided in the above embodiment. Synchronization method.
其中,存储介质可以是计算机能够存取的任何可用介质。以此为例但不限于:计算机可读介质可以包括RAM、ROM、EEPROM、CD-ROM或其他光盘存储、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质。The storage medium may be any available medium that can be accessed by a computer. Take this as an example but not limited to: computer readable media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage media or other magnetic storage devices, or can be used to carry or store instructions or data in the form of structure The desired program code and any other medium that can be accessed by the computer.
基于以上实施例,本申请实施例还提供了一种芯片,所述芯片用于读取存储器中存储的计算机程序,实现以上实施例提供的时间同步方法。Based on the above embodiments, an embodiment of the present application also provides a chip, which is used to read a computer program stored in a memory to implement the time synchronization method provided in the above embodiment.
基于以上实施例,本申请实施例提供了一种芯片系统,该芯片系统包括处理器,用于支持计算机装置实现以上实施例中通信设备所涉及的功能。在一种可能的设计中,所述芯片系统还包括存储器,所述存储器用于保存该计算机装置必要的程序和数据。该芯片系统,可以由芯片构成,也可以包含芯片和其他分立器件。Based on the above embodiments, the embodiments of the present application provide a chip system including a processor, which is used to support a computer device to implement the functions related to the communication device in the above embodiment. In a possible design, the chip system further includes a memory, and the memory is used to store necessary programs and data of the computer device. The chip system can be composed of chips, or include chips and other discrete devices.
综上所述,本申请实施例提供了一种时间同步方法及设备。在该方案中,第一设备和第二设备可以通过信元交互,实现1588协议的时间同步。因此,该方法可以实现支持信元传输的通信设备之间的精准时间同步。另外,任何支持信元传输的通信系统可以通过该方法实现基于信元方式的1588协议的时间同步,从而可以替换传统的基于以太网方式承载1588协议的方法,便于1588系统的部署,进一步的,由于支持信元传输的通信设备无 需增加额外的以太网端口即可实现1588协议的时间同步,因此,该方法也可以节省硬件端口造成的开销。In summary, the embodiments of the present application provide a time synchronization method and device. In this solution, the first device and the second device can exchange information elements to realize the time synchronization of the 1588 protocol. Therefore, this method can achieve precise time synchronization between communication devices that support cell transmission. In addition, any communication system that supports cell transmission can realize time synchronization based on the 1588 protocol in cell mode through this method, which can replace the traditional method of carrying the 1588 protocol based on the Ethernet mode to facilitate the deployment of the 1588 system. Further, Since the communication device supporting cell transmission can realize the time synchronization of the 1588 protocol without adding an additional Ethernet port, this method can also save the overhead caused by the hardware port.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, this application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
本申请是参照根据本申请的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。This application is described with reference to flowcharts and/or block diagrams of methods, equipment (systems), and computer program products according to this application. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are generated It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. The instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的保护范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to this application without departing from the protection scope of this application. In this way, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, then this application is also intended to include these modifications and variations.

Claims (20)

  1. 一种时间同步方法,其特征在于,包括:A time synchronization method, characterized in that it comprises:
    第一设备向第二设备发送第一信元,并确定第一时刻,其中,所述第一信元中包含第一参考比特,所述第一时刻为所述第一设备发送所述第一信元中的所述第一参考比特的时刻;The first device sends the first information element to the second device, and determines the first moment, where the first information element contains the first reference bit, and the first moment is for the first device to send the first The time of the first reference bit in the cell;
    所述第一设备从所述第二设备接收第二信元,其中,所述第二信元中包含第一时间比特域和第二参考比特,所述第一时间比特域用于指示所述第二设备接收到所述第一信元中的所述第一参考比特的第二时刻;所述第一设备确定第三时刻,所述第三时刻为所述第一设备接收所述第二信元中的所述第二参考比特的时刻;The first device receives a second information element from the second device, where the second information element includes a first time bit field and a second reference bit, and the first time bit field is used to indicate the The second device receives the second moment of the first reference bit in the first cell; the first device determines the third moment, and the third moment is the first device receiving the second moment The time of the second reference bit in the cell;
    所述第一设备从所述第二设备接收第三信元,其中,所述第三信元中包含第二时间比特域,所述第二时间比特域用于指示所述第二设备发送所述第二信元中的所述第二参考比特的第四时刻;The first device receives a third information element from the second device, where the third information element includes a second time bit field, and the second time bit field is used to instruct the second device to send The fourth moment of the second reference bit in the second cell;
    所述第一设备根据所述第一时刻、所述第二时刻、所述第三时刻和所述第四时刻,进行与所述第二设备之间的时间同步。The first device performs time synchronization with the second device according to the first time, the second time, the third time, and the fourth time.
  2. 如权利要求1所述的方法,其特征在于,所述第一参考比特为所述第一信元中的最高有效位MSB,所述第二参考比特为所述第二信元中的MSB;或者The method according to claim 1, wherein the first reference bit is the most significant bit MSB in the first cell, and the second reference bit is the MSB in the second cell; or
    所述第一参考比特为所述第一信元中的第n个比特,所述第二参考比特位为所述第二信元中的第n个比特,其中n为大于或等于1,且小于或等于N的整数,N小于或等于所述第一信元中包含的比特总量,且小于或等于所述第二信元中包含的比特总量;或者The first reference bit is the nth bit in the first cell, the second reference bit is the nth bit in the second cell, where n is greater than or equal to 1, and An integer less than or equal to N, where N is less than or equal to the total number of bits contained in the first cell, and less than or equal to the total number of bits contained in the second cell; or
    所述第一参考比特为所述第一信元中的最后一个比特,所述第二参考比特为所述第二信元中的最后一个比特。The first reference bit is the last bit in the first cell, and the second reference bit is the last bit in the second cell.
  3. 如权利要求1或2所述的方法,其特征在于,所述第一设备从所述第二设备接收所述第二信元,包括:The method according to claim 1 or 2, wherein the first device receiving the second information element from the second device comprises:
    所述第一设备在接收所述第二信元的过程中保存每个时钟周期对应的时刻;The first device saves the time corresponding to each clock cycle during the process of receiving the second cell;
    所述第一设备确定所述第三时刻,包括:The determining, by the first device, the third moment includes:
    所述第一设备在接收所述第二信元后,确定接收所述第二信元中所述第二参考比特所在的目标时钟周期,并确定所述目标时钟周期对应的时刻为所述第三时刻。After receiving the second cell, the first device determines the target clock cycle in which the second reference bit in the second cell is received, and determines that the time corresponding to the target clock cycle is the first Three moments.
  4. 如权利要求1-3任一项所述的方法,其特征在于,所述第一信元为延时请求信元,所述第二信元为延时响应信元,所述第三信元为跟随信元。The method according to any one of claims 1-3, wherein the first cell is a delay request cell, the second cell is a delay response cell, and the third cell To follow the cell.
  5. 一种时间同步方法,其特征在于,包括:A time synchronization method, characterized in that it comprises:
    第二设备从第一设备接收第一信元,并确定第二时刻,所述第一信元中包括第一参考比特,所述第二时刻为所述第二设备接收所述第一信元中的所述第一参考比特的时刻;The second device receives the first information element from the first device, and determines a second time, the first information element includes a first reference bit, and the second time is when the second device receives the first information element The time of the first reference bit in;
    所述第二设备向所述第一设备发送第二信元,并确定第四时刻,所述第二信元中包含第一时间比特域和第二参考比特,所述第一时间比特域用于指示所述第二时刻,所述第四时刻为所述第二设备发送所述第二信元中的所述第二参考比特的时刻;The second device sends a second information element to the first device and determines a fourth time. The second information element includes a first time bit field and a second reference bit, and the first time bit field uses When indicating the second moment, the fourth moment is the moment when the second device sends the second reference bit in the second cell;
    所述第二设备向所述第一设备发送第三信元,其中,所述第三信元中包含第二时间比特域,所述第二时间比特域用于指示所述第四时刻。The second device sends a third information element to the first device, where the third information element includes a second time bit field, and the second time bit field is used to indicate the fourth time.
  6. 如权利要求5所述的方法,其特征在于,所述第一参考比特为所述第一信元中的最高有效位MSB,所述第二参考比特为所述第二信元中的MSB;或者The method according to claim 5, wherein the first reference bit is the most significant bit MSB in the first cell, and the second reference bit is the MSB in the second cell; or
    所述第一参考比特为所述第一信元中的第n个比特,所述第二参考比特为所述第二信元中的第n个比特,其中n为大于或等于1,且小于或等于N的整数,N小于或等于所述第一信元中包含的比特总量,且小于或等于所述第二信元中包含的比特总量;或者The first reference bit is the nth bit in the first cell, the second reference bit is the nth bit in the second cell, where n is greater than or equal to 1, and less than Or an integer equal to N, where N is less than or equal to the total number of bits contained in the first cell and less than or equal to the total number of bits contained in the second cell; or
    所述第一参考比特为所述第一信元中的最后一个比特,所述第二参考比特为所述第二信元中的最后一个比特。The first reference bit is the last bit in the first cell, and the second reference bit is the last bit in the second cell.
  7. 如权利要求5或6所述的方法,其特征在于,第二设备从第一设备接收第一信元,包括:The method according to claim 5 or 6, wherein the second device receiving the first information element from the first device comprises:
    所述第二设备在接收所述第一信元的过程中保存每个时钟周期对应的时刻;The second device saves the time corresponding to each clock cycle during the process of receiving the first cell;
    所述第二设备确定所述第二时刻,包括:The determining of the second moment by the second device includes:
    所述第二设备在接收所述第一信元后,确定接收所述第一信元中所述第一参考比特所在的目标时钟周期,并确定所述目标时钟周期对应的时刻为所述第二时刻。After receiving the first cell, the second device determines the target clock cycle where the first reference bit in the first cell is received, and determines that the time corresponding to the target clock cycle is the first cell. Two moments.
  8. 如权利要求5-7任一项所述的方法,其特征在于,所述第一信元为延时请求信元,所述第二信元为延时响应信元,所述第三信元为跟随信元。7. The method according to any one of claims 5-7, wherein the first cell is a delay request cell, the second cell is a delay response cell, and the third cell To follow the cell.
  9. 一种通信装置,所述装置应用于第一设备,其特征在于,所述装置包括:A communication device applied to a first device, characterized in that the device includes:
    通信单元,用于接收和发送信元;The communication unit is used to receive and send cells;
    处理单元,用于通过所述通信单元向第二设备发送第一信元,并确定第一时刻,其中,所述第一信元中包括第一参考比特,所述第一时刻为所述通信单元发送所述第一信元中的所述第一参考比特的时刻;通过所述通信单元从所述第二设备接收第二信元,所述第二信元中包含第一时间比特域和第二参考比特,所述第一时间比特域用于指示所述第二设备接收到所述第一信元中的所述第一参考比特的第二时刻;确定第三时刻,所述第三时刻为所述通信单元接收所述第二信元中的第二参考比特的时刻;通过所述通信单元从所述第二设备接收第三信元,其中,所述第三信元中包含第二时间比特域,所述第二时间比特域用于指示所述第二设备发送所述第二信元中的所述第二参考比特的时刻;以及根据所述第一时刻、所述第二时刻、所述第三时刻和所述第四时刻,进行与所述第二设备之间的时间同步。The processing unit is configured to send a first information element to the second device through the communication unit and determine a first moment, wherein the first information element includes a first reference bit, and the first moment is the communication The moment when the unit sends the first reference bit in the first cell; receives a second cell from the second device through the communication unit, and the second cell contains the first time bit field and The second reference bit, the first time bit field is used to indicate the second moment when the second device receives the first reference bit in the first cell; to determine the third moment, the third The time is the time when the communication unit receives the second reference bit in the second information element; the third information element is received from the second device through the communication unit, wherein the third information element contains the second reference bit A two-time bit field, where the second time bit field is used to indicate the moment when the second device sends the second reference bit in the second cell; and according to the first moment, the second Time, the third time, and the fourth time are synchronized with the second device.
  10. 如权利要求9所述的装置,其特征在于,所述第一参考比特为所述第一信元中的最高有效位MSB,所述第二参考比特为所述第二信元中的MSB;或者9. The apparatus of claim 9, wherein the first reference bit is the most significant bit MSB in the first cell, and the second reference bit is the MSB in the second cell; or
    所述第一参考比特为所述第一信元中的第n个比特,所述第二参考比特为所述第二信元中的第n个比特,其中n为大于或等于1,且小于或等于N的整数,N小于或等于所述第一信元中包含的比特总量,且小于或等于所述第二信元中包含的比特总量;或者The first reference bit is the nth bit in the first cell, the second reference bit is the nth bit in the second cell, where n is greater than or equal to 1, and less than Or an integer equal to N, where N is less than or equal to the total number of bits contained in the first cell and less than or equal to the total number of bits contained in the second cell; or
    所述第一参考比特为所述第一信元中的最后一个比特,所述第二参考比特为所述第二信元中的最后一个比特。The first reference bit is the last bit in the first cell, and the second reference bit is the last bit in the second cell.
  11. 如权利要求9或10所述的装置,其特征在于,所述处理单元,具体用于:The device according to claim 9 or 10, wherein the processing unit is specifically configured to:
    在所述通信单元接收所述第二信元的过程中保存每个时钟周期对应的时刻;Saving the time corresponding to each clock cycle during the process of receiving the second cell by the communication unit;
    在所述通信单元接收所述第二信元后,确定接收所述第二信元中所述第二参考比特所在的目标时钟周期,并确定所述目标时钟周期对应的时刻为所述第三时刻。After the communication unit receives the second cell, it determines the target clock cycle where the second reference bit in the second cell is received, and determines that the time corresponding to the target clock cycle is the third time.
  12. 如权利要求9-11任一项所述的装置,其特征在于,所述第一信元为延时请求信元,所述第二信元为延时响应信元,所述第三信元为跟随信元。The device according to any one of claims 9-11, wherein the first cell is a delay request cell, the second cell is a delay response cell, and the third cell is To follow the cell.
  13. 一种通信装置,所述装置应用于第二设备,其特征在于,所述装置包括:A communication device applied to a second device, characterized in that the device includes:
    通信单元,用于接收和发送信元;The communication unit is used to receive and send cells;
    处理单元,用于通过所述通信单元从第一设备接收第一信元,并确定第二时刻,所述 第一信元中包括第一参考比特,所述第二时刻为所述通信单元接收所述第一信元中的所述第一参考比特的时刻;通过所述通信单元向所述第一设备发送第二信元,并确定第四时刻,所述第二信元中包含第一时间比特域和第二参考比特,所述第一时间比特域用于指示所述第二时刻,所述第四时刻为所述通信单元发送所述第二信元中的所述第二参考比特的时刻;以及通过所述通信单元向所述第一设备发送第三信元,其中,所述第三信元中包含第二时间比特域,所述第二时间比特域用于指示所述第四时刻。A processing unit, configured to receive a first information element from a first device through the communication unit, and determine a second time, the first information element includes a first reference bit, and the second time is received by the communication unit The time of the first reference bit in the first cell; the second cell is sent to the first device through the communication unit, and the fourth time is determined, and the second cell contains the first A time bit field and a second reference bit, the first time bit field is used to indicate the second moment, and the fourth moment is the second reference bit in the second cell sent by the communication unit And sending a third information element to the first device through the communication unit, wherein the third information element includes a second time bit field, and the second time bit field is used to indicate the first Four moments.
  14. 如权利要求13所述的装置,其特征在于,所述第一参考比特为所述第一信元中的最高有效位MSB,所述第二参考比特为所述第二信元中的MSB;或者The apparatus according to claim 13, wherein the first reference bit is the most significant bit MSB in the first cell, and the second reference bit is the MSB in the second cell; or
    所述第一参考比特为所述第一信元中的第n个比特,所述第二参考比特为所述第二信元中的第n个比特,其中n为大于或等于1,且小于或等于N的整数,N小于或等于所述第一信元中包含的比特总量,且小于或等于所述第二信元中包含的比特总量;或者The first reference bit is the nth bit in the first cell, the second reference bit is the nth bit in the second cell, where n is greater than or equal to 1, and less than Or an integer equal to N, where N is less than or equal to the total number of bits contained in the first cell and less than or equal to the total number of bits contained in the second cell; or
    所述第一参考比特为所述第一信元中的最后一个比特,所述第二参考比特为所述第二信元中的最后一个比特。The first reference bit is the last bit in the first cell, and the second reference bit is the last bit in the second cell.
  15. 如权利要求13或14所述的装置,其特征在于,所述处理单元,具体用于:The device according to claim 13 or 14, wherein the processing unit is specifically configured to:
    在所述通信单元接收所述第一信元的过程中保存每个时钟周期对应的时刻;Saving the time corresponding to each clock cycle during the process of receiving the first cell by the communication unit;
    在所述通信单元接收所述第一信元后,确定接收所述第一信元中所述第一参考比特所在的目标时钟周期,并确定所述目标时钟周期对应的时刻为所述第二时刻。After the communication unit receives the first cell, it determines the target clock cycle where the first reference bit in the first cell is received, and determines that the time corresponding to the target clock cycle is the second time.
  16. 如权利要求13-15任一项所述的装置,其特征在于,所述第一信元为延时请求信元,所述第二信元为延时响应信元,所述第三信元为跟随信元。The apparatus according to any one of claims 13-15, wherein the first cell is a delay request cell, the second cell is a delay response cell, and the third cell To follow the cell.
  17. 一种通信设备,其特征在于,包括:A communication device, characterized in that it comprises:
    通信接口,用于接收和发送信元;Communication interface for receiving and sending cells;
    存储器,用于存储程序指令和数据;Memory, used to store program instructions and data;
    处理器,用于调用存储在所述存储器中的所述程序指令和数据,通过所述通信接口执行如权利要求1-8任一项所述的方法。The processor is configured to call the program instructions and data stored in the memory, and execute the method according to any one of claims 1-8 through the communication interface.
  18. 一种计算机程序,其特征在于,当所述计算机程序在计算机上运行时,使得所述计算机执行如权利要求1-8任一项所述的方法。A computer program, characterized in that, when the computer program runs on a computer, the computer is caused to execute the method according to any one of claims 1-8.
  19. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序,当所述计算机程序被计算机执行时,使得所述计算机执行如权利要求1-8任一项所述的方法。A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a computer, the computer is caused to execute any one of claims 1-8. The method described.
  20. 一种芯片,其特征在于,所述芯片用于读取存储器中存储的计算机程序,执行如权利要求1-8任一项所述的方法。A chip, characterized in that the chip is used to read a computer program stored in a memory and execute the method according to any one of claims 1-8.
PCT/CN2020/073915 2020-01-22 2020-01-22 Time synchronization method and device WO2021147042A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080088865.1A CN114868354A (en) 2020-01-22 2020-01-22 Time synchronization method and device
PCT/CN2020/073915 WO2021147042A1 (en) 2020-01-22 2020-01-22 Time synchronization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/073915 WO2021147042A1 (en) 2020-01-22 2020-01-22 Time synchronization method and device

Publications (1)

Publication Number Publication Date
WO2021147042A1 true WO2021147042A1 (en) 2021-07-29

Family

ID=76992849

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/073915 WO2021147042A1 (en) 2020-01-22 2020-01-22 Time synchronization method and device

Country Status (2)

Country Link
CN (1) CN114868354A (en)
WO (1) WO2021147042A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101431385A (en) * 2008-08-26 2009-05-13 中兴通讯股份有限公司 Frequency and time synchronization method for passive optical network
US20170150464A1 (en) * 2015-11-20 2017-05-25 Fujitsu Limited Communication apparatus, time synchronizing method, and non-transitory computer-readable storage medium
CN109068384A (en) * 2018-08-23 2018-12-21 平安科技(深圳)有限公司 A kind of method for synchronizing time and system
CN110224806A (en) * 2019-05-05 2019-09-10 中电莱斯信息系统有限公司 Method, system time synchronization under a kind of mixed channel communication condition

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FI124018B (en) * 2010-11-24 2014-02-14 Tellabs Oy Transceiver unit
CA3078834A1 (en) * 2017-10-13 2019-04-18 Huawei Technologies Co., Ltd. Method and apparatus for sending and receiving clock synchronization packet

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101431385A (en) * 2008-08-26 2009-05-13 中兴通讯股份有限公司 Frequency and time synchronization method for passive optical network
US20170150464A1 (en) * 2015-11-20 2017-05-25 Fujitsu Limited Communication apparatus, time synchronizing method, and non-transitory computer-readable storage medium
CN109068384A (en) * 2018-08-23 2018-12-21 平安科技(深圳)有限公司 A kind of method for synchronizing time and system
CN110224806A (en) * 2019-05-05 2019-09-10 中电莱斯信息系统有限公司 Method, system time synchronization under a kind of mixed channel communication condition

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
HUAWEI, HISILICON: "Discussion on over-the-air time synchronization for URLLC", 3GPP DRAFT; R1-1711432, 3RD GENERATION PARTNERSHIP PROJECT (3GPP), MOBILE COMPETENCE CENTRE ; 650, ROUTE DES LUCIOLES ; F-06921 SOPHIA-ANTIPOLIS CEDEX ; FRANCE, vol. RAN WG1, no. Qingdao, China; 20170627 - 20170630, 26 June 2017 (2017-06-26), Mobile Competence Centre ; 650, route des Lucioles ; F-06921 Sophia-Antipolis Cedex ; France, XP051300620 *

Also Published As

Publication number Publication date
CN114868354A (en) 2022-08-05

Similar Documents

Publication Publication Date Title
US20240040435A1 (en) Bandwidth adjustment method, service transmission method, network device and readable storage medium
EP3675398B1 (en) Check code processing method, electronic device, and storage medium
WO2014173267A1 (en) Timestamp generating method, device and system
EP3809636B1 (en) Time delay measuring method and network device
WO2015027813A1 (en) Method and device for determining ethernet clock source
EP4016942A1 (en) Method and apparatus for determining sending period in deterministic ip
EP3541088A1 (en) Method, device and system for bearing frame number of multichannel passive optical network, and storage medium
CN101902291B (en) Method, equipment and system for precise time synchronization
EP3806391A1 (en) Synchronization information transmission method, sending end device, receiving end device and storage medium
WO2021147042A1 (en) Time synchronization method and device
CN104754521A (en) Message transmitting method, wireless access point, wireless controller and system
WO2021000754A1 (en) Measurement reporting method and network node
WO2018133415A1 (en) Method and device for coding and decoding data of physical coding sublayer and storage medium
CN116961808A (en) Clock synchronization method and related equipment
CN103401813A (en) Asymmetric delay compensation method and switch
US20180138922A1 (en) Transmission checking method, node, system and computer storage medium
CN111447026B (en) Method and apparatus for processing data
WO2021097769A1 (en) Clock synchronization method and apparatus
WO2019134607A1 (en) Information processing method and device, communication apparatus, and computer readable storage medium
CN113141322A (en) Data communication method, data communication device and computer storage medium
CN101729345B (en) Message transmitting method and bus controller
WO2020062225A1 (en) Mac device and time point estimation method
CN103546240A (en) Ethernet CRC (cyclic redundancy check) checking method
WO2023123436A1 (en) Data transmission method and apparatus
CN114125921B (en) Time delay measurement method and system, anchor point UPF entity

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: 20915534

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: 20915534

Country of ref document: EP

Kind code of ref document: A1