Data processing device and method
By designing a data processing device on the FlexE management channel and using the synchronization message channel to obtain and record the starting timestamp of the time synchronization message, the problem of unclear processing procedures in the FlexE standard protocol is solved and time synchronization on the FlexE management channel is realized. solution.
Patent Information
- Application Number
- CN202210279281.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-21
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-03-21
AI Technical Summary
The FlexE standard protocol does not clearly explain the processing flow of time synchronization messages on the FlexE management channel, resulting in a lack of effective implementation solutions in time synchronization scenarios.
A data processing device and method are designed to obtain time synchronization messages through the synchronization message channel on the FlexE management channel, record the continuous sending length, and write the starting timestamp at the designated location to achieve time synchronization. The device includes a host module, a processing module, a timestamp submodule, a MAC submodule, a coding submodule and a PCS submodule. Message processing and timestamp recording are performed through these modules.
The process of completing time synchronization on the FlexE management channel is implemented, so that the peer device can receive the message data carrying the start timestamp through the FlexE synchronization message channel to complete the time synchronization operation.
Smart Images

Figure CN114629589B
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a data processing device and method. Background Art
[0002] FlexE (Flexible Ethernet) technology provides a general mechanism that can support various Ethernet MAC (Media Access Control) rates. Therefore, FlexE technology is widely used in various scenarios, such as time synchronization scenarios.
[0003] In the time synchronization scenario, the time synchronization message is transmitted based on the FlexE management channel, that is, it is transmitted through the synchronization message channel in the FlexEOverhead. However, the FlexE standard protocol only describes the definition and basic application scenarios of the FlexE management channel, and does not clearly explain the implementation of the processing flow of the time synchronization message on the FlexE management channel. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a data processing device and method to provide a solution for implementing time synchronization on a FlexE management channel. The specific technical solution is as follows:
[0005] In a first aspect, an embodiment of the present application provides a data processing device, which is applied to a chip, wherein the chip communicates with other devices using a clock synchronization protocol, and the device includes:
[0006] A host module, configured to obtain first message data of a time synchronization message, wherein the first message data is message data conforming to the clock synchronization protocol, and an extended header of the time synchronization message includes a message type and a timestamp offset of the time synchronization message; and continuously send the first message data to the processing module;
[0007] A processing module, configured to, if the message type of the time synchronization message is a preset message type, continuously send the first message data through a synchronization message channel, obtain a start timestamp for sending the first message data, and record a continuous sending length of the first message data; when the recorded continuous sending length reaches the timestamp offset, write the start timestamp at a position corresponding to the timestamp offset in the first message data;
[0008] Wherein, the processing module includes: a timestamp submodule, a MAC submodule, a coding submodule, a synchronization message channel submodule and a PCS (physical coding sublayer) submodule;
[0009] The timestamp submodule is used for recording the start timestamp if the message type of the time synchronization message is a preset message type, continuously sending the first message data to the MAC submodule, and recording the continuous sending length of the first message data;
[0010] The MAC submodule is configured to perform link layer processing on the first message data to obtain second message data; and continuously send the second message data to the encoding submodule;
[0011] The encoding submodule is used to encode the second message data to obtain third message data; and continuously send the third message data to the synchronization message channel submodule;
[0012] The synchronization message channel submodule is used to continuously send the third message data to the PCS submodule in the synchronization message channel; when the message header of the time synchronization message is detected, send a frame SFD (Start Frame Delimiter) signal to the PCS submodule;
[0013] The PCS submodule is configured to continuously send the third message data; after receiving the SFD signal, generate a start timestamp for sending the third message data as a start timestamp for the first message data, and send the start timestamp to the timestamp submodule;
[0014] The timestamp submodule is further used to receive the start timestamp sent by the PCS submodule; when the recorded continuous transmission length reaches the timestamp offset, write the start timestamp at the position corresponding to the timestamp offset in the first message data.
[0015] Optionally, the timestamp submodule is further configured to send a pause signal to the host module when the recorded continuous transmission length reaches a first preset offset, if the start timestamp is not obtained, and the first preset offset is less than the timestamp offset; and send a cancel pause signal to the host module when the start timestamp is obtained;
[0016] The host module is further configured to stop sending the first message data to the timestamp submodule according to the pause signal; and continue sending the first message data to the timestamp submodule according to the cancel pause signal.
[0017] Optionally, the extended header also includes an encapsulation type and a checksum offset of the time synchronization message;
[0018] The timestamp submodule is also used to record the checksum offset if the encapsulation type of the time synchronization message is a preset encapsulation type; after receiving the start timestamp, generate a message checksum using the start timestamp; when the recorded continuous sending length reaches the checksum offset, write the message checksum at the position corresponding to the checksum offset in the first message data.
[0019] Optionally, the timestamp submodule is further configured to send a pause signal to the host module when the recorded continuous transmission length reaches a second preset offset, if the start timestamp is not obtained, and the second preset offset is less than the timestamp offset; and send a cancel pause signal to the host module when the start timestamp is obtained;
[0020] The host module is further configured to stop sending the first message data to the timestamp submodule according to the pause signal; and continue sending the first message data to the timestamp submodule according to the cancel pause signal.
[0021] Optionally, the timestamp submodule is further used to send a preparation check signal to the MAC submodule;
[0022] The MAC submodule is further configured to send a first ready signal to the timestamp submodule when the preparation work is completed;
[0023] The timestamp submodule is further configured to send a second ready signal to the host module if the first ready signal sent by the MAC submodule is received;
[0024] The host module is specifically configured to continuously send the first message data to the timestamp submodule according to the second ready signal.
[0025] Optionally, the timestamp submodule is further used to end sending the first message data if the duration of sending the first message data reaches a preset duration.
[0026] In a second aspect, an embodiment of the present application provides a data processing method, which is applied to a chip, wherein the chip communicates with other devices using a clock synchronization protocol, and the method includes:
[0027] The host module acquires first message data of the time synchronization message, where the first message data is message data that complies with the clock synchronization protocol, and the extended header of the time synchronization message includes a message type and a timestamp offset of the time synchronization message;
[0028] If the message type of the time synchronization message is a preset message type, the processing module continuously sends the first message data through the synchronization message channel, records the continuous sending length of the first message data, and obtains the starting timestamp of sending the first message data; when the recorded continuous sending length reaches the timestamp offset, writes the starting timestamp at the position corresponding to the timestamp offset in the first message data;
[0029] Wherein, the processing module includes: a timestamp submodule, a MAC submodule, a coding submodule, a synchronization message channel submodule and a PCS submodule;
[0030] If the message type of the time synchronization message is a preset message type, the timestamp submodule records the start timestamp, continuously sends the first message data to the MAC submodule, and records the continuous sending length of the first message data;
[0031] The MAC submodule performs link layer processing on the first message data to obtain second message data; and continuously sends the second message data to the encoding submodule;
[0032] The encoding submodule encodes the second message data to obtain third message data; and continuously sends the third message data to the synchronization message channel submodule;
[0033] The synchronization message channel submodule continuously sends the third message data to the PCS submodule in the synchronization message channel; when the message header of the time synchronization message is detected, the SFD signal is sent to the PCS submodule;
[0034] The PCS submodule continuously sends the third message data; after receiving the SFD signal, generates a start timestamp for sending the third message data as a start timestamp for the first message data, and sends the start timestamp to the timestamp submodule;
[0035] The timestamp submodule receives the start timestamp sent by the PCS submodule; when the recorded continuous transmission length reaches the timestamp offset, the start timestamp is written at a position corresponding to the timestamp offset in the first message data.
[0036] Optionally, the method further includes:
[0037] When the recorded continuous sending length reaches a first preset offset, if the start timestamp is not obtained, the timestamp submodule stops sending the first message data until the start timestamp is obtained, and the first preset offset is less than the timestamp offset.
[0038] Optionally, the extended header further includes an encapsulation type and a checksum offset of the time synchronization message; and the method further includes:
[0039] The timestamp submodule uses the starting timestamp to generate a message checksum; if the encapsulation type of the time synchronization message is a preset encapsulation type, when the recorded continuous sending length reaches the checksum offset, the message checksum is written at the position corresponding to the checksum offset in the first message data.
[0040] Optionally, the method further includes:
[0041] When the recorded continuous sending length reaches a second preset offset, if the start timestamp is not obtained, the timestamp submodule suspends sending the first message data until the start timestamp is obtained, and the second preset offset is less than the checksum offset.
[0042] Optionally, the method further includes:
[0043] If the duration of sending the first message data reaches a preset duration, the timestamp submodule ends sending the first message data.
[0044] An embodiment of the present application further provides a chip, which includes any of the above-mentioned data processing devices.
[0045] Beneficial effects of the embodiments of the present application:
[0046] In the technical solution provided in the embodiment of the present application, the chip obtains the first message data of the time synchronization message, and then continuously sends the first message data of the time synchronization message of the preset message type through the synchronization message channel of FlexE, and records the continuous sending length of the first message data, obtains the starting timestamp of sending the first message data, and writes the starting timestamp at the position corresponding to the timestamp offset in the first message data. Based on this, the opposite device can receive the message data carrying the starting timestamp through the synchronization message channel of FlexE to complete the processing flow of time synchronization. Therefore, the embodiment of the present application provides a solution for realizing time synchronization on the FlexE management channel.
[0047] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0049] Figure 1 A schematic diagram of the deployment of the FlexE management channel;
[0050] Figure 2 A first flow chart of a data processing method provided in an embodiment of the present application;
[0051] Figure 3 A second flow chart of the data processing method provided in the embodiment of the present application;
[0052] Figure 4 A third flow chart of the data processing method provided in the embodiment of the present application;
[0053] Figure 5 A fourth flow chart of the data processing method provided in the embodiment of the present application;
[0054] Figure 6 A structural schematic diagram of a data processing device provided in an embodiment of the present application;
[0055] Figure 7 A first schematic diagram of a processing flow of a data processing device provided in an embodiment of the present application;
[0056] Figure 8 A second schematic diagram of a processing flow of a data processing device provided in an embodiment of the present application;
[0057] Fig. 9 A schematic diagram of a check state machine provided in an embodiment of the present application;
[0058] Fig.10 A schematic diagram of a setting state machine provided in an embodiment of the present application. DETAILED DESCRIPTION
[0059] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0060] To facilitate understanding, the terms appearing in the embodiments of the present application are explained below.
[0061] FlexE: The FlexE implementation protocol provides a general mechanism for supporting various Ethernet MAC rates, which may or may not correspond to any existing Ethernet PHY (Physics) rates, and may specifically include MAC rates higher than the PHY rate carrying FlexE, and MAC rates lower than the PHY rate carrying FlexE. Among them, MAC rates higher than the PHY rate are achieved by binding one or more PHY rates, and MAC rates lower than the PHY rate are achieved through sub-rates and channelization. This can be seen as a generalization of the Multi-Link Gearbox implementation protocol, which removes the restrictions on the number of bound PHYs and the constraints on the Ethernet rate corresponding to the FlexE clients.
[0062] FlexE Group: A FlexE group includes 1 to n 100G FlexE instances or 50G FlexE instances, which are carried by a group of 1 to m bonded Ethernet PHYs. FlexE groups consisting of one or more bonded 50G BASE-R PHYs, one or more bonded 100G BASE-R PHYs, one or more bonded 200G BASE-R PHYs, or one or more 400GBASE-R PHYs are supported.
[0063] FlexE instance: is an information unit, divided into 50G FlexE instance or 100G FlexE instance, which consists of FlexE Client data capable of carrying 50G or 100G capacity and its related overhead. 50G FlexE instance is carried only through 50G BASE-RPHY. 100G FlexE instance can be carried through 100G BASE-R PHY, 200GBASE-R PHY or 400GBASE-R PHY.
[0064] FlexE Client data: is an Ethernet flow based on the MAC rate, which may or may not correspond to any PHY rate. The FlexE Client MAC rates supported by the FlexE group are 10, 40, and m×25Gb / s. The FlexE Client MAC rates supported by the FlexE group may support all or a subset of these FlexE Client MAC rates, such as m×25Gb / s.
[0065] FlexE shim layer: It is a layer that maps or demaps the FlexE Client carried by the FlexE group. FlexE mapping refers to mapping the FlexE Client data in the sending direction to the FlexE group data; FlexE demapping refers to parsing the FlexE group data into the FlexE Client data in the receiving direction.
[0066] FlexE OH (Overhead) frame: An in-band management channel provided by the FlexE Shim layer, supporting the transmission of configuration information and management information between two interconnected FlexE interfaces to achieve automatic negotiation and establishment of links. It can be understood that a FlexE OH is the OH of a FlexE instance.
[0067] FlexE management channel: A transmission channel in the FlexE OH frame that can be used for user-defined applications.
[0068] The FlexE management channel includes the segment management channel, synchronization message channel, and shim-to-shim channel. In the FlexE OH, the deployment of the FlexE management channel is as follows: Figure 1 As shown, FlexE OH includes 8 data blocks, among which blocks 4 to 5 are defined as segment management channels by the FlexE protocol, block 6 is defined as a synchronization message channel by the FlexE protocol, and blocks 6 to 8 or blocks 7 to 8 are defined as Shim-to-Shim channels by the FlexE protocol.
[0069] 1588 protocol: IEEE 1588version 2, referred to as 1588v2. IEEE 1588 specifies the principles and message interaction processing specifications for high-precision clock synchronization in the network. It was originally used in industrial automation and later mainly used to bridge local area networks. IEEE 1588 does not make mandatory requirements for the network environment and has a wide range of applicability. The IEEE 1588 protocol standard can be customized according to different application environments to enhance or tailor specific functions. The latest version is V2, i.e. 1588v2.
[0070] 1588 One-Step Method: refers to the Sync message in Delay mode and the PDelay_Resp message in Pdelay (Peer Delay) mode, which carries the timestamp of the time when the message is sent.
[0071] In the relevant FlexE technology, for the group configured with the synchronization message channel, block 6 in the FlexE OH is used to transmit the time synchronization message (such as the above-mentioned 1588 message). The format of the time synchronization message is the same as the format requirements of the FlexE management channel. According to the provisions of [802.3] 82, each 66B block is a legal format. The protocol used on the FlexE management channel can be Ethernet-based, using a combination of data and control blocks.
[0072] Regarding the use of time synchronization methods in FlexE, the FlexE standard protocol only describes the definition of the FlexE management channel and basic application scenarios, and does not clearly explain the implementation of the processing flow of time synchronization messages on the FlexE management channel.
[0073] To solve the above problems, an embodiment of the present application provides a data processing method, which can be applied to a chip that can communicate with other devices using a clock synchronization protocol. In this method, the first message data of the time synchronization message is obtained, and then the first message data of the time synchronization message of the preset message type is continuously sent through the synchronization message channel of FlexE, and the continuous sending length of the first message data is recorded, and the start timestamp of sending the first message data is obtained, and the start timestamp is written at the position corresponding to the timestamp offset in the first message data. Based on this, the opposite device can receive the message data carrying the start timestamp through the synchronization message channel of FlexE to complete the processing flow of time synchronization. Therefore, an embodiment of the present application provides a solution for implementing time synchronization on the FlexE management channel.
[0074] The data processing method provided in the embodiment of the present application is described in detail below through specific embodiments. For ease of understanding, the following description is based on the chip as the execution subject, which does not serve as a limitation.
[0075] like Figure 2 As shown, Figure 2 The first flow chart of the data processing method provided in the embodiment of the present application is applied to a chip, which communicates with other devices using a clock synchronization protocol. The clock synchronization protocol may include but is not limited to the IEEE1588v1 protocol, the IEEE1588v2 protocol, or the NTP (Network Time Protocol), etc., which are not limited to this. Figure 2 As shown, the above data processing method includes the following steps:
[0076] Step S21, obtaining first message data of a time synchronization message, wherein the first message data is message data conforming to a clock synchronization protocol, and an extended header of the time synchronization message includes a message type and a timestamp offset of the time synchronization message.
[0077] In the embodiment of the present application, the time synchronization message is a message sent by the upper layer application using the clock synchronization protocol, that is, the message content of the time synchronization message is message data that complies with the clock synchronization protocol. The chip obtains message data that complies with the clock synchronization protocol, that is, obtains the first message data of the time synchronization message.
[0078] The first message data carries an extended header including a message type of a time synchronization message and a timestamp offset, wherein the message type of the time synchronization message may be a message type processed by the 1588 one-step method, a message type processed by the 1588 two-step method, or other message types, which are not limited thereto. The timestamp offset is the length from the message header to the position where the timestamp is inserted.
[0079] Step S22: If the message type of the time synchronization message is a preset message type, the first message data is continuously sent through the synchronization message channel, the continuous sending length of the first message data is recorded, and the start timestamp of sending the first message data is obtained.
[0080] The preset message type can be a message type processed by the 1588 one-step method, or can be other message types that indicate the timestamp of the message carrying the sending time. The synchronization message channel is a channel in the FlexE management channel of the chip that processes time synchronization messages, such as Figure 1 Block 6 in the .
[0081] In an embodiment of the present application, when it is determined that the message type carried in the extended header of the time synchronization message is a preset message type, the chip can continuously send the first message data through the synchronization message channel, record the continuous sending length of the first message data, and obtain the starting timestamp of sending the first message data, that is, the timestamp of the moment when the first message data is sent.
[0082] For example, the first message data has 96 bits in total, and the length of the data sent by the chip at one time is 32 bits. Then the chip sends out the 96-bit first message data three times. After the first message data is sent for the first time, the continuous sending length of the first message data is recorded as 32 bits. After the first message data is sent for the second time, the continuous sending length of the first message data is recorded as 32+32=64 bits. After the first message data is sent for the third time, the continuous sending length of the first message data is recorded as 64+32=96 bits. In addition, the moment when the first message data is sent for the first time is the starting timestamp of sending the first message data. The chip obtains the starting timestamp to complete time synchronization later.
[0083] Step S23: When the recorded continuous sending length reaches the timestamp offset, a start timestamp is written at a position corresponding to the timestamp offset in the first message data.
[0084] As the first message data is continuously sent, the continuous sending length of the first message data recorded by the chip continues to increase. When the recorded continuous sending length reaches the timestamp offset carried in the extension header, the chip writes the start timestamp at the position corresponding to the timestamp offset in the first message data. In this case, the start timestamp, as part of the first message data, will be sent to the peer end as the first message data is continuously sent to complete time synchronization.
[0085] Afterwards, the first message data continues to be sent until the first message data is completely sent, that is, until all the complete data of the time synchronization message is completely sent.
[0086] Still take the example in step S22 as an example for explanation. The first message data has a total of 96 bits, the length of the data sent by the chip once is 32 bits, and the timestamp offset is 64 bits. After the first message data is sent for the second time, the continuous sending length of the first message data is recorded as 32+32=64 bits. At this time, the recorded continuous sending length reaches the timestamp offset. The chip inserts the start timestamp at the 64-bit position from the message header in the first message data, plus the length of the start timestamp is 16 bits. Then the 32-bit first message data sent by the chip for the third time consists of a 16-bit start timestamp and a 16-bit first message data; after the first message data is sent for the third time, the continuous sending length of the first message data is recorded as 64+32=96 bits; after the remaining 16 bits of the first message data are sent for the fourth time, the continuous sending length of the first message data is recorded as 96+16=112 bits.
[0087] In the technical solution provided in the embodiment of the present application, the chip obtains the first message data of the time synchronization message, and then continuously sends the first message data of the time synchronization message of the preset message type through the synchronization message channel of FlexE, and records the continuous sending length of the first message data, obtains the starting timestamp of sending the first message data, and writes the starting timestamp at the position corresponding to the timestamp offset in the first message data. Based on this, the opposite device can receive the message data carrying the starting timestamp through the synchronization message channel of FlexE to complete the processing flow of time synchronization. Therefore, the embodiment of the present application provides a solution for realizing time synchronization on the FlexE management channel.
[0088] In one embodiment of the present application, if the duration of sending the first message data reaches a preset duration, sending the first message data is terminated.
[0089] In the embodiment of the present application, the chip pre-sets a timeout duration for message transmission, that is, a preset duration. The preset duration can be set according to actual needs, and the preset duration can be 5 milliseconds, 1 second or 5 seconds, which is not limited. If the duration of the chip sending the first message data reaches the preset duration, the chip can end sending the first message data and wait again for the message data of the next time synchronization message to be sent, that is, re-execute step S21.
[0090] In the technical solution provided by the embodiment of the present application, the chip can stop sending the first message data when the duration of sending the first message data reaches a preset duration, thereby reducing the resource loss caused by sending useless first message data. In addition, the chip stops sending the first message data according to actual needs, which can improve the working efficiency of the data processing method, and can also increase the applicability of the data processing method, thereby improving user friendliness.
[0091] In one embodiment of the present application, the present application embodiment also provides a data processing method, such as Figure 3 As shown, the method may include steps S31 to S34, where steps S31, S32 and S34 are the same as the above-mentioned steps S21 to S23 and are not described again here.
[0092] Step S33, when the recorded continuous sending length reaches the first preset offset, if the start timestamp is not obtained, stop sending the first message data until the start timestamp is obtained, and the first preset offset is less than the timestamp offset.
[0093] In the embodiment of the present application, a first preset offset is pre-set in the chip. The first preset offset is smaller than the timestamp offset and can be specifically set according to actual needs.
[0094] When the continuous sending length recorded by the chip reaches the first preset offset, it means that the start timestamp is about to be inserted, and the chip stops sending the first message data. When the start timestamp is obtained, the start timestamp is written at the position corresponding to the timestamp offset in the first message data. After that, the first message data continues to be sent until the first message data of the time synchronization message is sent.
[0095] When the continuous sending length recorded by the chip reaches the first preset offset, if the start timestamp is not obtained and the first message data continues to be sent, then before the start timestamp is obtained, the length of the continuous sending of the first message data exceeds the timestamp offset, and the operation of inserting the start timestamp into the first message data cannot be completed. Therefore, in the technical solution provided in the embodiment of the present application, when the continuous sending length of the chip reaches the first preset offset, if the start timestamp is not obtained, the first message data is stopped. In this way, during the process of the chip sending the first message data, the situation where the position corresponding to the timestamp offset has passed but the start timestamp has not been written can be avoided, thereby improving the accuracy of data processing.
[0096] In one embodiment of the present application, the extension header also includes the encapsulation type and checksum offset of the time synchronization message. The encapsulation type can be a message encapsulation type that requires encapsulation of the checksum in the message, such as the UDP (User Datagram Protocol) encapsulation type, or a message encapsulation type that does not require encapsulation of the checksum in the message, such as the TCP / IP (Transmission Control Protocol / Internet Protocol) encapsulation type. The checksum offset is the length from the message header to the position where the checksum is inserted.
[0097] In this case, the embodiment of the present application also provides a data processing method, such as Figure 4 As shown, the method may include step S41 to step S45, and step S41, step S42, and step S45 are the same as the above-mentioned step S21 to step S23, and will not be repeated here.
[0098] Step S43, using the start timestamp to generate a message checksum.
[0099] After obtaining the start timestamp of the first message data, the chip can generate a checksum of the first message data according to the start timestamp, for example, using the start timestamp and the historical message checksum according to a specified checksum algorithm to generate a new message checksum of the first message data.
[0100] Step S44: if the encapsulation type of the time synchronization message is a preset encapsulation type, when the recorded continuous transmission length reaches the checksum offset, a message checksum is written at a position corresponding to the checksum offset in the first message data.
[0101] The preset encapsulation type may be a UDP encapsulation type, or may be other message encapsulation types indicating that a checksum needs to be encapsulated in a message.
[0102] In the embodiment of the present application, when it is determined that the encapsulation type carried in the extension header of the time synchronization message is a preset encapsulation type, when the continuous transmission length recorded by the chip reaches the checksum offset, the message checksum is written at the position corresponding to the checksum offset in the first message data. In this case, the message checksum, as part of the first message data, will be sent to the other end as the first message data is continuously sent to complete time synchronization.
[0103] Afterwards, the first message data continues to be sent until the first message data of the time synchronization message is completely sent.
[0104] In the technical solution provided in the embodiment of the present application, the chip inserts a message checksum into the message data, so that the other end can further verify the start timestamp based on the message checksum, thereby improving the accuracy, effectiveness and security of the start timestamp, and further improving the accuracy, effectiveness and security of time synchronization.
[0105] In one embodiment of the present application, based on Figure 4 The data processing method shown in the embodiment of the present application also provides a data processing method, such as Figure 5 As shown, the method may include steps S51 to S56. Steps S51 to S52 and steps S54 to S56 are the same as the above-mentioned steps S41 to S45, and are not repeated here.
[0106] Step S53, when the recorded continuous sending length reaches a second preset offset, if the start timestamp is not obtained, suspending the sending of the first message data until the start timestamp is obtained, and the second preset offset is less than the checksum offset.
[0107] In the embodiment of the present application, a second preset offset is pre-set in the chip. The second preset offset is smaller than the timestamp offset and can be specifically set according to actual needs.
[0108] When the continuous sending length recorded by the chip reaches the second preset offset, it means that the message checksum is about to be inserted, and the chip stops sending the first message data. When the starting timestamp is obtained, the message checksum is written at the position corresponding to the checksum offset in the first message data. After that, the first message data continues to be sent until the first message data of the time synchronization message is sent.
[0109] When the continuous sending length recorded by the chip reaches the second preset offset, if the start timestamp is not obtained and the first message data continues to be sent, then before the start timestamp is obtained, the length of the first message data continuously sent exceeds the checksum offset, and the message check and the operation of inserting the first message data cannot be completed. Therefore, in the technical solution provided in the embodiment of the present application, when the continuous sending length of the chip reaches the second preset offset, if the start timestamp is not obtained, the first message data is stopped. In this way, during the process of the chip sending the first message data, the situation in which the position corresponding to the checksum offset has been passed but the message checksum has not been written can be avoided, thereby improving the accuracy of data processing.
[0110] Corresponding to the above data processing method, the present application embodiment provides a data processing device. Figure 6 As shown, the data processing device includes a host module 61 and a processing module 62;
[0111] The host module 61 is used to obtain first message data of the time synchronization message, where the first message data is message data that complies with the clock synchronization protocol, and the extended header of the time synchronization message includes the message type and timestamp offset of the time synchronization message; and continuously send the first message data to the processing module;
[0112] Processing module 62 can be used to continuously send the first message data through the synchronization message channel if the message type of the time synchronization message is a preset message type, obtain the starting timestamp of sending the first message data, and record the continuous sending length of the first message data; when the recorded continuous sending length reaches the timestamp offset, write the starting timestamp at the position corresponding to the timestamp offset in the first message data.
[0113] In the technical solution provided in the embodiment of the present application, the chip obtains the first message data of the time synchronization message, and then continuously sends the first message data of the time synchronization message of the preset message type through the synchronization message channel of FlexE, and records the continuous sending length of the first message data, obtains the starting timestamp of sending the first message data, and writes the starting timestamp at the position corresponding to the timestamp offset in the first message data. Based on this, the opposite device can receive the message data carrying the starting timestamp through the synchronization message channel of FlexE to complete the processing flow of time synchronization. Therefore, the embodiment of the present application provides a solution for realizing time synchronization on the FlexE management channel.
[0114] In an optional embodiment, Figure 7As shown, the processing module 62 may include: a timestamp submodule 71, a MAC (Media Access Control) submodule 72, an encoding submodule 73, a synchronization message channel submodule 74 and a PCS (physical coding sublayer) submodule 75;
[0115] The timestamp submodule 71 may be used to record a start timestamp if the message type of the time synchronization message is a preset message type, continuously send the first message data to the MAC submodule 72, and record the continuous sending length of the first message data;
[0116] The MAC submodule 72 may be used to perform link layer processing on the first message data to obtain second message data; and continuously send the second message data to the encoding submodule 73;
[0117] The encoding submodule 73 may be used to encode the second message data to obtain third message data; and continuously send the third message data to the synchronous message channel submodule 74;
[0118] The synchronization message channel submodule 74 can be used to continuously send the third message data to the PCS submodule 75 in the synchronization message channel; when the message header of the time synchronization message is detected, an SFD (Start Frame Delimiter) signal is sent to the PCS submodule 75;
[0119] The PCS submodule 75 can be used to continuously send the third message data; after receiving the frame start delimiter SFD signal, generate a start timestamp for sending the third message data as the start timestamp for sending the first message data, and send the start timestamp to the timestamp submodule 71;
[0120] The timestamp submodule 71 can also be used to receive the start timestamp sent by the PCS submodule 75; when the recorded continuous transmission length reaches the timestamp offset, the start timestamp is written at the position corresponding to the timestamp offset in the first message data.
[0121] Optionally, in the receiving direction of the time synchronization message, the data processing device may further include a decoding submodule.
[0122] The PCS submodule 75 can also be used to obtain the first received data of the time synchronization message; continuously send the first received data to the synchronization message channel submodule 74; generate a timestamp (received timestamp) for receiving the first received data according to the message header of the first received data, and send the received timestamp to the timestamp submodule;
[0123] The synchronous message channel submodule 74 may also be used to continuously send the first received data to the decoding submodule in the synchronous message channel;
[0124] The decoding submodule may also be used to decode the first received data to obtain second received data; and continuously send the second received data to the MAC submodule 72;
[0125] The MAC submodule 72 may also be used to perform link layer processing on the second received data to obtain third received data; and continuously send the third received data to the timestamp submodule 71;
[0126] The timestamp submodule 71 may also be used to add a receiving timestamp to the end of the third received data (i.e., the end of the time synchronization message) according to a preset format, and send it to the host module 61;
[0127] The host module 61 can also be used to continuously send the third received data; parse the tail of the third received data to obtain the receiving timestamp for parsing.
[0128] In an optional embodiment, the timestamp submodule 71 may also be used to send a pause signal to the host module 61 when the recorded continuous transmission length reaches a first preset offset, if the start timestamp is not obtained, and the first preset offset is less than the timestamp offset; when the start timestamp is obtained, send a cancel pause signal to the host module 61;
[0129] The host module 61 may also be configured to stop sending the first message data to the timestamp submodule 71 according to the pause signal; and continue sending the first message data to the timestamp submodule 71 according to canceling the pause signal.
[0130] The above-mentioned first preset offset can be set according to actual needs. Optionally, the first preset offset is less than or equal to the difference between the timestamp offset and the amount of data processed within the delay duration, wherein the delay duration is the sum of the number of delay beats between the host module 61 and the timestamp submodule 71 and the number of beats consumed by the host module 61 in responding to the pause signal.
[0131] In an optional embodiment, the extended header may further include an encapsulation type and a checksum offset of the time synchronization message;
[0132] The timestamp submodule 71 can also be used to record the checksum offset if the encapsulation type of the time synchronization message is a preset encapsulation type; after receiving the start timestamp, use the start timestamp to generate a message checksum; when the recorded continuous sending length reaches the checksum offset, write the message checksum at the position corresponding to the checksum offset in the first message data.
[0133] In an optional embodiment, the timestamp submodule 71 may also be used to send a pause signal to the host module 61 when the recorded continuous transmission length reaches a second preset offset, if the start timestamp is not obtained, and the second preset offset is less than the timestamp offset; when the start timestamp is obtained, send a cancel pause signal to the host module 61;
[0134] The host module 61 may also be configured to stop sending the first message data to the timestamp submodule 71 according to the pause signal; and continue sending the first message data to the timestamp submodule 71 according to canceling the pause signal.
[0135] The above-mentioned second preset offset can be set according to actual needs. Optionally, the second preset offset is less than or equal to the difference between the checksum offset and the amount of data processed within the delay period, wherein the delay period is the sum of the number of delay beats between the host module 61 and the timestamp submodule 71 and the number of beats consumed by the host module 61 in responding to the pause signal.
[0136] In an optional embodiment, the timestamp submodule 71 may also be used to send a check signal of preparation to the MAC submodule 72;
[0137] The MAC submodule 72 may also be used to send a first ready signal to the timestamp submodule 71 when the preparation work is completed;
[0138] The timestamp submodule 71 may also be used to send a second ready signal to the host module 61 if the first ready signal sent by the MAC submodule 72 is received;
[0139] The host module 61 may be specifically configured to continuously send the first message data to the timestamp submodule 71 according to the second ready signal.
[0140] In an optional embodiment, the timestamp submodule 71 may also be configured to terminate sending the first message data if the duration of sending the first message data reaches a preset duration.
[0141] The following can be Figure 8 A schematic diagram of the processing flow of the above-mentioned data processing device is shown, and the above-mentioned data processing device is described in detail.
[0142] Step S80: The host module checks whether its own port is normal.
[0143] Step S81, the timestamp submodule sends a check signal for preparation to the MAC submodule, such as Figure 8 The check signal in.
[0144] Step S82: When the preparation work is completed, the MAC submodule sends a first ready signal indicating that the preparation work is completed to the timestamp submodule. Figure 8 The ready ok signal in.
[0145] Step S83: If the timestamp submodule receives the first ready signal sent by the MAC submodule 82, it sends a second ready signal to the host module. Figure 8 The tx ready signal in.
[0146] Step S84: the host module continuously sends message data of the time synchronization message, such as the first message data, to the timestamp submodule according to the second ready signal.
[0147] Step S85, the timestamp submodule continues to send message data to the MAC submodule, and records the continuous sending length of the message data.
[0148] If the message type of the time synchronization message is a preset message type, the timestamp submodule may further record a timestamp offset; if the encapsulation type of the time synchronization message is a preset encapsulation type, the timestamp submodule may further record a checksum offset.
[0149] Step S86: When the continuous transmission length recorded by the timestamp submodule reaches the first preset offset / the second preset offset, if the start timestamp is not obtained, a pause signal is sent to the host module. Figure 8 Subsequently, the timestamp submodule waits to receive the start timestamp sent by the PCS submodule.
[0150] If the message type of the time synchronization message is a preset message type, and the encapsulation type of the time synchronization message is not a preset encapsulation type, then when the continuous sending length recorded by the timestamp submodule reaches a first preset offset, if the start timestamp is not obtained, a pause signal is sent to the host module; if the message type of the time synchronization message is a preset message type, and the encapsulation type of the time synchronization message is a preset encapsulation type, then when the continuous sending length recorded by the timestamp submodule reaches a second preset offset, if the start timestamp is not obtained, a pause signal is sent to the host module.
[0151] Step S87: the host module stops sending message data to the timestamp submodule according to the pause signal.
[0152] Step S88, the MAC submodule performs link layer processing on the message data, and sends it to the synchronous message channel submodule through the encoding submodule to write the message data into the synchronous message channel. Figure 8 The encoding submodule is omitted in the code. The structure of the encoding submodule can be found in Figure 7 shown.
[0153] Step S89: When the synchronization message channel submodule receives the message header of the time synchronization message, it sends an SFD signal to the PCS submodule.
[0154] Step S810: The PCS submodule generates a start timestamp according to the SFD signal and sends it to the timestamp submodule.
[0155] When receiving message data and sending it out, if an SFD signal is received, the PCS submodule can consider the current time as the start time of sending a time synchronization message, generate a start timestamp based on the current time, and send the start timestamp to the timestamp submodule.
[0156] Step S811, after receiving the start timestamp, the timestamp submodule sends a cancel pause signal to the host module, such as Figure 8 The tx ready signal in.
[0157] Step S812: the host module continues to send message data to the timestamp submodule according to the cancel pause signal.
[0158] If the message type of the time synchronization message is the preset message type, and the encapsulation type of the time synchronization message is the preset encapsulation type, then the timestamp submodule executes step S813 and then executes step S814; if the message type of the time synchronization message is the preset message type, and the encapsulation type of the time synchronization message is not the preset encapsulation type, then step S813 is skipped and the timestamp submodule directly executes step S814.
[0159] Step S813, when the continuous transmission length recorded by the timestamp submodule reaches the checksum offset, the message checksum is written at the position corresponding to the checksum offset in the first message data, and the message data with the written message checksum is sent to the MAC submodule.
[0160] Step S814, when the continuous transmission length recorded by the timestamp submodule reaches the timestamp offset, a start timestamp is written at a position corresponding to the timestamp offset in the first message data, and the message data with the start timestamp written is sent to the MAC submodule.
[0161] Step S815: The MAC submodule performs link layer processing on the message data and sends it to the synchronization message channel submodule through the encoding submodule.
[0162] In one embodiment of the present application, in order to facilitate the control of the above data processing flow, two processing state machines can be set in the timestamp submodule, and the state switching in the state machine controls the execution of the data processing flow. The above state machine may include a check state machine and a setting state machine. The structures of the two state machines are as follows: Fig. 9 and Fig.10 shown.
[0163] Fig. 9 A schematic diagram of a check state machine provided in an embodiment of the present application. The check state machine is mainly used to check whether a message is a message of a preset message type, and calculate the relationship between the message sending length and the timestamp offset, the checksum offset, and wait for the start timestamp. The check state machine may include an idle state (such as Fig. 9 Idle state in the Fig. 9 WaitTS state in ), setting timestamp state (such as Fig. 9 SetTS status in ), set the checksum status (such as Fig. 9 SetCS status) and timeout status (such as Fig. 9 Timeout status in ).
[0164] Idle state: The timestamp submodule detects whether the message type of the received message data is the preset message type; if so, it enters the WaitTS state and records the continuous sending length of the message data. For details, see the above step S85.
[0165] WaitTS state: The timestamp submodule detects whether the received start timestamp is valid, and detects the association between the message sending length (i.e. the recorded continuous sending length), the timestamp offset and the checksum offset. If the message sending length is about to reach the checksum offset / timestamp offset, the timestamp submodule sends a pause signal to the host module; if the message checksum is valid and the message sending length reaches the checksum offset, it enters the SetCS state; if the start timestamp is valid and the message sending length reaches the timestamp offset, it enters the SetTS state. See the above steps S86-S87, and steps S812-S814 for details.
[0166] Timeout state: When the state machine is in the WaitTs state and the Timeout setting is enabled, the state machine will jump to the Idle state after the time reaches the Timeout threshold.
[0167] SetCS state: the timestamp submodule sends a cancel pause signal to the host module; in addition, the timestamp submodule sends a checksum update signal (such as a CS update signal) to the setting state machine to notify the setting state machine to modify the message content (i.e., message data) and wait for a setting checksum success signal (such as a CS set update signal); when a valid setting checksum success signal is received, it means that the message checksum is successfully written into the message content, and the message content is modified to enter the SetTS state. See the above steps S812-S814 for details.
[0168] SetTS state: the timestamp submodule sends a cancel pause signal to the host module; in addition, the timestamp submodule sends a timestamp update signal (such as TS update signal) to the setting state machine to notify the setting state machine to modify the message content (i.e., message data), and wait for a timestamp setting success signal (such as TS set update signal); when a valid timestamp setting success signal is received, it means that the start timestamp is successfully written into the message content, and the message content is modified to, and enters the Idle state. For details, see the above steps S812-S814.
[0169] Fig.10 A schematic diagram of a setting state machine provided in an embodiment of the present application. The setting state machine is mainly used to modify the message checksum and the start timestamp into the message data. The setting state machine may include sending a passing state (such as Fig.10 TX PASS status in), checksum and set start status (such as Fig.10 Set CS start state in ), check and set the first end state (such as Fig.10 Set CS end1 state in ), check and set the second end state (such as Fig.10 Set CSend2 status in ), timestamp setting start status (such as Fig.10 Set TS start status in the Fig.10 Set TS state in ) and timestamp setting end state (such as Fig.10 Set TS end state in ).
[0170] TX PASS state: the timestamp submodule sends the message data to the MAC submodule through the bus between it and the MAC submodule; after receiving the checksum update signal (such as CS update signal) sent by the check state machine, it detects whether the checksum update signal is valid. If it is valid, it enters the Set CS start state; after receiving the timestamp update signal (such as TS update signal) sent by the check state machine, it detects whether the timestamp update signal is valid. If it is valid, it enters the SetTS start state.
[0171] The bit width of the bus between the timestamp submodule and the MAC submodule may be 16 bits, 32 bits, or 64 bits.
[0172] Set CS start state: When the recorded continuous transmission length reaches the checksum offset, the timestamp submodule splices part of the data in the current message with the message checksum as the transmission data according to the position corresponding to the checksum offset in the message data, and transmits it to the MAC submodule through the bus between it and the MAC submodule. If the message checksum is not sent, it enters the Set Cs end1 state. If the message checksum is sent, it enters the Set Cs end2 state. The transmission data mentioned here can be understood as: data sent once with the same bus width as the timestamp submodule and the MAC submodule.
[0173] Set CS end1 state: The timestamp submodule concatenates the remaining message checksum that has not been sent and part of the data in the current message into the transmission data, and transmits it to the MAC submodule through the bus between it and the MAC submodule, and enters the Set CSend2 state.
[0174] Set CS end2 state: The timestamp submodule pulls the checksum write completion signal (such as Set CS fin signal) high, and sends a checksum set success signal (such as CS set update signal) to the check state machine, and then jumps to the TX PASS state and waits for the next message to be modified.
[0175] In the embodiment of the present application, the message checksum bit width is smaller than the bit width of the bus between the timestamp submodule and the MAC submodule. Therefore, for a message checksum, at most two groups of sent data can be used to complete the transmission.
[0176] For example, the bit width of the bus between the timestamp submodule and the MAC submodule is 32 bits, and the bit width of the message checksum is 16 bits. If the current timestamp submodule needs to write the message checksum in the data sent to the MAC submodule, and needs to write it after 25 bits, then the state machine is set to enter the Set CS start state, splice the 25-bit message data and the 7-bit message checksum into 32-bit send data 1, and transmit the send data 1 to the 32-bit bus; then, enter the Set CS end1 state, splice the remaining 9-bit message checksum and the 23-bit message into 32-bit send data 2, and transmit the send data 2 to the 32-bit bus, and then enter the Set CS end2 state.
[0177] If the current timestamp submodule needs to write the message checksum in the data sent to the MAC submodule, and needs to write it after 4 bits, the state machine is set to enter the Set CS start state, and the 4-bit message data, the 16-bit message checksum and the 12-bit message data are spliced into 32-bit send data 3, and the send data 3 is transmitted to the 32-bit bus. After that, the Set CS end2 state is entered.
[0178] Set TS start state: When the recorded continuous transmission length reaches the timestamp offset, the timestamp submodule splices part of the data in the current message with the start timestamp as the transmission data according to the position corresponding to the timestamp offset in the message data, transmits it to the MAC submodule through the bus between it and the MAC submodule, and enters the Set TS state.
[0179] Set TS state: The timestamp submodule sets the unsent timestamp as the sent data, transmits it to the MAC submodule through the bus between it and the MAC submodule, and enters the Set TS end state.
[0180] Set TS end state: The timestamp submodule combines the remaining timestamps that have not been sent with part of the data in the current message into the transmission data, and transmits it to the MAC submodule through the bus between it and the MAC submodule. In addition, the timestamp submodule pulls the timestamp writing completion signal (such as Set TS fin signal) high, and sends a timestamp update signal (such as TS update signal) to the check state machine, and then jumps to the TX PASS state, waiting for the next message to be modified.
[0181] In the embodiment of the present application, the bit width of the start timestamp is greater than the bit width of the bus between the timestamp submodule and the MAC submodule. Therefore, for a start timestamp, multiple groups of data need to be sent to complete the transmission.
[0182] For example, the bit width of the bus between the timestamp submodule and the MAC submodule is 32 bits, and the bit width of the start timestamp is 80 bits. If the current timestamp submodule needs to write the start timestamp in the data sent to the MAC submodule, and needs to write it after 25 bits, then the state machine is set to enter the Set TS start state, splice the 25-bit message data and the 7-bit start timestamp into 32-bit send data 4, and transmit the send data 4 to the 32-bit bus; then, enter the Set TS state, use the two 32-bit remaining start timestamps as send data 5, and transmit the send data 5 to the 32-bit bus; then, enter the Set TS end state, splice the remaining 80-7-32*2=9 bits of the start timestamp and the 23-bit remaining message data into send data 6, and transmit the send data 6 to the 32-bit bus, and then enter the TX PASS state.
[0183] In the embodiment of the present application, only the message checksum bit width is less than the bit width of the bus between the timestamp submodule and the MAC submodule, and the start timestamp bit width is greater than the bit width of the bus between the timestamp submodule and the MAC submodule is used as an example to illustrate the check state machine and the setting state machine. In actual situations, the states included in the check state machine and the setting state machine can be set according to the actual situation of the message checksum, the start timestamp, and the bit width of the bus, and this is not limited.
[0184] The present application also provides a chip, which may include the above-mentioned Figure 6-Figure 8 The device according to any embodiment.
[0185] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0186] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0187] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the chip, since it is basically similar to the method and device embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method and device embodiments.
[0188] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A data processing device, characterized in that: Applied to a chip, the chip uses a clock synchronization protocol to communicate with other devices, and the device includes: A host module, configured to obtain first message data of a time synchronization message, wherein the first message data is message data conforming to the clock synchronization protocol, and an extended header of the time synchronization message includes a message type and a timestamp offset of the time synchronization message; and continuously send the first message data to a processing module; A processing module, configured to, if the message type of the time synchronization message is a preset message type, continuously send the first message data through a synchronization message channel, obtain a start timestamp for sending the first message data, and record a continuous sending length of the first message data; when the recorded continuous sending length reaches the timestamp offset, write the start timestamp at a position corresponding to the timestamp offset in the first message data; Wherein, the processing module includes: a timestamp submodule, a media access control MAC submodule, a coding submodule, a synchronization message channel submodule and a physical coding sublayer PCS submodule; The timestamp submodule is used for recording the start timestamp if the message type of the time synchronization message is a preset message type, continuously sending the first message data to the MAC submodule, and recording the continuous sending length of the first message data; The MAC submodule is configured to perform link layer processing on the first message data to obtain second message data; and continuously send the second message data to the encoding submodule; The encoding submodule is used to encode the second message data to obtain third message data; and continuously send the third message data to the synchronization message channel submodule; The synchronization message channel submodule is used to continuously send the third message data to the PCS submodule in the synchronization message channel; when the message header of the time synchronization message is detected, send a frame start delimiter SFD signal to the PCS submodule; The PCS submodule is configured to continuously send the third message data; after receiving the SFD signal, generate a start timestamp for sending the third message data as a start timestamp for the first message data, and send the start timestamp to the timestamp submodule; The timestamp submodule is further used to receive the start timestamp sent by the PCS submodule; when the recorded continuous transmission length reaches the timestamp offset, write the start timestamp at the position corresponding to the timestamp offset in the first message data.
2. The device according to claim 1, characterized in that The timestamp submodule is further configured to send a pause signal to the host module when the recorded continuous transmission length reaches a first preset offset and if the start timestamp is not obtained, the first preset offset is less than the timestamp offset; and send a cancel pause signal to the host module when the start timestamp is obtained; The host module is further configured to stop sending the first message data to the timestamp submodule according to the pause signal; and continue sending the first message data to the timestamp submodule according to the cancel pause signal.
3. The device according to claim 1, characterized in that The extended header also includes the encapsulation type and checksum offset of the time synchronization message; The timestamp submodule is also used to record the checksum offset if the encapsulation type of the time synchronization message is a preset encapsulation type; after receiving the start timestamp, generate a message checksum using the start timestamp; when the recorded continuous sending length reaches the checksum offset, write the message checksum at the position corresponding to the checksum offset in the first message data.
4. The device according to claim 3, characterized in that The timestamp submodule is further configured to send a pause signal to the host module when the recorded continuous transmission length reaches a second preset offset, if the start timestamp is not obtained, and the second preset offset is less than the timestamp offset; and send a cancel pause signal to the host module when the start timestamp is obtained; The host module is further configured to stop sending the first message data to the timestamp submodule according to the pause signal; and continue sending the first message data to the timestamp submodule according to the cancel pause signal.
5. The device according to claim 1, characterized in that The timestamp submodule is further configured to send a check signal for preparation to the MAC submodule; The MAC submodule is further configured to send a first ready signal to the timestamp submodule when the preparation work is completed; The timestamp submodule is further configured to send a second ready signal to the host module if the first ready signal sent by the MAC submodule is received; The host module is specifically configured to continuously send the first message data to the timestamp submodule according to the second ready signal.
6. The device according to any one of claims 1 to 5, characterized in that: The timestamp submodule is further configured to terminate sending the first message data if the duration of sending the first message data reaches a preset duration.
7. A data processing method, characterized in that: Applied to a chip, the chip uses a clock synchronization protocol to communicate with other devices, the method comprising: The host module acquires first message data of the time synchronization message, where the first message data is message data that complies with the clock synchronization protocol, and the extended header of the time synchronization message includes the message type and timestamp offset of the time synchronization message; and continuously sends the first message data to the processing module; If the message type of the time synchronization message is a preset message type, the processing module continuously sends the first message data through the synchronization message channel, records the continuous sending length of the first message data, and obtains the starting timestamp of sending the first message data; when the recorded continuous sending length reaches the timestamp offset, writes the starting timestamp at the position corresponding to the timestamp offset in the first message data; Wherein, the processing module includes: a timestamp submodule, a media access control MAC submodule, a coding submodule, a synchronization message channel submodule and a physical coding sublayer PCS submodule; If the message type of the time synchronization message is a preset message type, the timestamp submodule records the start timestamp, continuously sends the first message data to the MAC submodule, and records the continuous sending length of the first message data; The MAC submodule performs link layer processing on the first message data to obtain second message data; and continuously sends the second message data to the encoding submodule; The encoding submodule encodes the second message data to obtain third message data; and continuously sends the third message data to the synchronization message channel submodule; The synchronization message channel submodule continuously sends the third message data to the PCS submodule in the synchronization message channel; when detecting the message header of the time synchronization message, sending a frame start delimiter SFD signal to the PCS submodule; The PCS submodule continuously sends the third message data; after receiving the SFD signal, generates a start timestamp for sending the third message data as a start timestamp for the first message data, and sends the start timestamp to the timestamp submodule; The timestamp submodule receives the start timestamp sent by the PCS submodule; when the recorded continuous transmission length reaches the timestamp offset, the start timestamp is written at a position corresponding to the timestamp offset in the first message data.
8. The method according to claim 7, characterized in that The method further comprises: When the recorded continuous sending length reaches a first preset offset, if the start timestamp is not obtained, the timestamp submodule stops sending the first message data until the start timestamp is obtained, and the first preset offset is less than the timestamp offset.
9. The method according to claim 8, characterized in that The extended header also includes the encapsulation type and checksum offset of the time synchronization message; the method also includes: The timestamp submodule uses the starting timestamp to generate a message checksum; if the encapsulation type of the time synchronization message is a preset encapsulation type, when the recorded continuous sending length reaches the checksum offset, the message checksum is written at the position corresponding to the checksum offset in the first message data.
10. The method according to claim 9, characterized in that The method further comprises: When the recorded continuous sending length reaches a second preset offset, if the start timestamp is not obtained, the timestamp submodule suspends sending the first message data until the start timestamp is obtained, and the second preset offset is less than the checksum offset.
11. The method according to any one of claims 7 to 10, characterized in that: The method further comprises: If the duration of sending the first message data reaches a preset duration, the timestamp submodule ends sending the first message data.
