A PTP message return method and device

By actively passing the synchronous information back to the processor in the 5G bearer network chip, the problem of high load and slow speed in the synchronization information acquisition method in the prior art is solved, and high frequency and high precision time synchronization is achieved.

CN115150017BActive Publication Date: 2025-04-29WUHAN XINSAIWEISI TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210755182.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-30
Publication Date
2025-04-29
Estimated Expiration
2042-06-30

AI Technical Summary

Technical Problem

In the prior art, the 5G bearer network chip has a high load and slow speed when acquiring synchronization information, and cannot support high frequency and high precision time synchronization.

Method used

By actively passing the synchronization information back to the processor when sending the first byte of the original PTP message, the processor needs to read synchronization information from the interrupt register or timestamp pipeline.

Benefits of technology

It shortens the time for the processor to obtain synchronization information, reduces the processor load, and makes it easier to support large-capacity and multi-interface interactions, achieving high-precision time synchronization and frequency synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115150017B_ABST
    Figure CN115150017B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of time synchronization supported by 5G bearer network chips, and provides a PTP message backhaul method and device. The method comprises: when the sending module detects that the first identification word backhaul mark has been set and the first byte of the original PTP message is being sent, the sending module sends an indication of the completion of the backhaul to the backhaul processing module, and continues to read out the message at the same time to complete the subsequent sending processing of the original PTP message; the backhaul processing module also receives the compensated sending timestamp sent by the sending module, and writes the compensated sending timestamp and the original PTP message into the backhaul cache together for waiting; when the backhaul processing module receives the indication of the completion of the backhaul sent by the sending module, the backhaul processing module sends the original PTP message and the compensated sending timestamp to the processor. The present invention reduces the time for the processor to obtain synchronization information, making it easier for the processor to support large-capacity, multi-interface interaction to achieve high-precision time synchronization and support PTP frequency synchronization.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to the field of 5G bearer network chip support time synchronization technology, and in particular to a PTP message return method and device. [Background technology]

[0002] With the development and evolution of 5G technology, various bearer service ports have brought about the application demand for time synchronization technology. The SPN / MTN / OTN / OSU of the 5G bearer network supports many types of service interfaces. FlexE (Flex Ethernet) and FlexO (Flexible Optical Transport Network) technologies have been widely used in 5G bearer networks, making it an inevitable trend for FlexE and FlexO interfaces, various OTN service interfaces, and emerging rate interfaces such as OTU25 and OTU50 to support high-precision time synchronization technology.

[0003] At present, time synchronization and frequency synchronization are mainly achieved through PTP (Precision Time Protocol) messages. The time difference between sending and receiving PTP messages between two ports is used to adjust the clocks corresponding to the two ports to achieve time synchronization or frequency synchronization.

[0004] With the development of 5G technology, the bandwidth of synchronization information including PTP messages and timestamps in 5G bearer network chips is getting higher and higher. In the existing technology, interrupt registers or timestamp pipes are usually used to store synchronization information, and the processor actively accesses and reads the synchronization information. Both methods have the disadvantages of bringing high load to the processor and slow acquisition of synchronization information. When processing the large-capacity, multi-port, and high-frequency (interaction frequency greater than 16 packet / s) PTP messages and timestamp information of the 5G bearer network, the CPU is under heavy load and runs the IEEE1588 synchronization protocol. It can hardly support the single-step clock mode and the two-step clock mode and the synchronization information processing with an interaction frequency of 256 packet / s, and it cannot support the application scenarios of PTP frequency synchronization.

[0005] In view of this, overcoming the defects of the prior art is an urgent problem to be solved in the field of this technology. [Summary of the invention]

[0006] The technical problem to be solved by the present invention is that the acquisition method of synchronization information in the current technology has high load and slow acquisition speed.

[0007] The present invention adopts the following technical solution:

[0008] In a first aspect, the present invention provides a PTP message return method, comprising:

[0009] When the sending module detects that the first identification word return flag has been set and the first byte of the original PTP message is being sent, it sends an indication of return completion to the return processing module, and continues to read the message to complete the subsequent sending processing of the original PTP message;

[0010] The backhaul processing module also receives the compensated sending timestamp sent by the sending module, writes the compensated sending timestamp, the original PTP message and other synchronization information into the backhaul buffer and waits;

[0011] When the backhaul processing module receives the backhaul completion indication sent by the sending module, the backhaul processing module sends the original PTP message, the compensated sending timestamp and other synchronization information to the processor so that the processor completes the corresponding synchronization operation.

[0012] Preferably, the backhaul processing module sends the original PTP message, the compensated sending timestamp and other synchronization information to the processor, specifically including:

[0013] The return processing module sends the original PTP message, the compensated sending timestamp and other synchronization information to the normalized receiving module. The normalized receiving module generates a return PTP message according to the original PTP message, the compensated sending timestamp and other synchronization information, and sends the return PTP message and the message received on the normal path to the processor according to priority.

[0014] Preferably, the sending module detects that the first identification word return flag has been set, specifically including:

[0015] The processor encapsulates the original PTP message into the custom message, sets the first identification word return flag in the custom message, and sends the custom message to the sending module, wherein the sending module detects whether the custom message carries the set first identification word return flag;

[0016] Or the processor sends the original PTP message to the sending module, and the sending module determines whether to record the set first identification word return mark corresponding to the original PTP message in the register according to the original PTP message to be sent.

[0017] Preferably, sending the returned PTP message and the message received by the normal path to the processor according to priority specifically includes:

[0018] The returned PTP message carries a set first identification word return mark, and the normalized receiving module preferentially sends the message carrying the set first identification word return mark to the processor;

[0019] When there are multiple return PTP messages in the normalized receiving module at the same time, the normalized receiving module determines the priority order according to the size of the virtual port ID carried in the return PTP message, and sends the return PTP message to the processor according to the priority order.

[0020] Preferably, the compensated sending timestamp is obtained by compensating the original sending timestamp obtained when the original PTP message is sent, and specifically includes:

[0021] The sending module records the original sending timestamp when the original PTP message is sent, and then performs numerical correction on the original sending timestamp according to a first compensation value preset by a technician in this field or a second compensation value calculated according to a precise time synchronization protocol to obtain a compensated sending timestamp.

[0022] Preferably, the step of enabling the processor to complete the corresponding synchronization operation specifically includes:

[0023] When the processor is located at the master clock side, the processor generates a corresponding message according to the original PTP message, the compensated sending timestamp and other synchronization information, and sends the corresponding message to the slave clock so that the slave clock corrects the local clock to achieve time synchronization or frequency synchronization with the master clock;

[0024] When the processor is located on the slave clock side, the processor obtains the master-slave clock deviation and transmission delay based on the original PTP message, the compensated transmission timestamp and other synchronization information, corrects the local clock based on the master-slave clock deviation and transmission delay, and achieves time synchronization or frequency synchronization with the master clock.

[0025] Preferably, the method is applicable to various services in a 5G bearer network, and the various services include: one or more of flexible Ethernet FlexE, flexible optical transport network FlexO, OTN services, OTU25 services, OTU50 services, OTUCn services and OSU services.

[0026] Preferably, the method further includes: if the first identification word return flag is not detected to be set, the sending module does not perform return processing of the original PTP message, the compensated sending timestamp and other synchronization information, and directly completes subsequent sending processing of the message.

[0027] Preferably, the normalized receiving module generates a return PTP message according to the original PTP message, the compensated sending timestamp and other synchronization information, specifically including:

[0028] The return PTP message consists of a custom message header, an original PTP message and an FCS byte. The normalization processing module encapsulates the original PTP message excluding the FCS byte in the original message field of the return PTP message, and adds a custom message header before the original message field. The information contained in the custom message header includes a first identification word return tag, a VLAN field and a compensated sending timestamp, wherein the VLAN field is used to store a virtual port ID, and the virtual port ID is used to distinguish the receiving port of the original PTP message. The FCS byte of the assembled return PTP message is added after the original message field.

[0029] In a second aspect, the present invention further provides a PTP message feedback system, the system comprising at least one port, wherein the port uses the PTP message feedback method described in the first aspect to perform PTP message feedback.

[0030] In a third aspect, the present invention further provides a PTP message return device, which is used to implement the PTP message return method described in the first aspect, and the device includes:

[0031] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to execute the PTP message return method described in the first aspect.

[0032] In a fourth aspect, the present invention further provides a non-volatile computer storage medium, wherein the computer storage medium stores computer executable instructions, which are executed by one or more processors to complete the PTP message feedback method described in the first aspect.

[0033] The present invention uses the PTP message return method to actively return the synchronization information to the processor when sending the first byte of the original PTP message, so that the processor does not need to read the synchronization information from the interrupt register or the timestamp pipe, thereby reducing the time for the processor to obtain the synchronization information and alleviating the load of the processor, making it easier for the processor to support large-capacity, multi-interface interaction to achieve high-precision time synchronization and support PTP frequency synchronization.

Brief Description of the Drawings

[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0035] Figure 1It is a flow chart of a PTP message return method provided by an embodiment of the present invention;

[0036] Figure 2 It is a flow chart of a PTP message return method provided by an embodiment of the present invention;

[0037] Figure 3 This is an application scenario diagram of a PTP message return method provided by an embodiment of the present invention;

[0038] Figure 4 It is a flow chart of a method for implementing time synchronization by using a PTP message return method provided by an embodiment of the present invention;

[0039] Figure 5 It is a schematic diagram of the architecture of a PTP message return method provided by an embodiment of the present invention;

[0040] Figure 6 It is a structural diagram of a PTP message returned according to an embodiment of the present invention;

[0041] Figure 7 It is a flow chart of a PTP message return method provided by an embodiment of the present invention;

[0042] Figure 8 It is a schematic diagram of the architecture of a PTP message return method provided by an embodiment of the present invention;

[0043] Fig. 9 It is a flow chart of a PTP message return method provided by an embodiment of the present invention;

[0044] Fig.10 It is a schematic diagram of the architecture of a PTP message return system provided by an embodiment of the present invention;

[0045] Fig.11 It is a schematic diagram of the architecture of a PTP message return device provided in an embodiment of the present invention. [Specific implementation method]

[0046] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0047] In the description of the present invention, the terms "inside", "outside", "longitudinal", "lateral", "upper", "lower", "top", "bottom" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings. They are only for the convenience of describing the present invention and do not require that the present invention must be constructed and operated in a specific orientation. Therefore, they should not be understood as limitations on the present invention.

[0048] In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0049] Embodiment 1:

[0050] Embodiment 1 of the present invention provides a method for returning a PTP message, such as Figure 1 As shown, specifically including:

[0051] In step 201, when the sending module detects that the first identification word return flag is set and the first byte of the original PTP message is being sent, it sends a return completion indication to the return processing module and continues to read the message to complete the subsequent sending processing of the original PTP message.

[0052] The first identifier can be represented by pkts_side in the PTP message. The subsequent content of the embodiment of the present invention will also directly use pkts_side as a representative form of the first identifier description; correspondingly, the indication of the completion of the backhaul is also exemplarily and intuitively expressed as a finish indication of the completion of the backhaul.

[0053] The original PTP message is a PTP message that needs to be returned. The sending module and the return processing module are included in the port, the processor is included in the service processing side, the sending module is used to send the message received from the processor to the external port, and the sending module determines whether the message needs to be returned according to the pkts_side return mark.

[0054] There may be multiple messages to be sent in a port, and the time when the first byte of the original PTP message is being sent is when the port receives a message that needs to be sent to an external port and is sending the first byte of the original PTP message according to the port sending rate requirement.

[0055] The pkts_side return flag may be a flag bit present in the sending module, obtained by the port reading its own cache, or obtained by other means, such as from a processor, or may be generated by encapsulating the original message to generate a new message, and the pkts_side return flag may be carried in the new message.

[0056] In step 202, the backhaul processing module also receives the compensated sending timestamp sent by the sending module, and writes the compensated sending timestamp, the original PTP message and other synchronization information into the backhaul buffer and waits.

[0057] The compensated sending timestamp is obtained by compensating the original sending timestamp obtained when the original PTP message is sent, and specifically includes:

[0058] The sending module records the original sending timestamp when the original PTP message is sent, and then performs numerical correction on the original sending timestamp according to a first compensation value preset by a technician in this field or a second compensation value calculated according to the IEEE1588 synchronization protocol to obtain a compensated sending timestamp.

[0059] The first compensation value is obtained by a technician in this field based on the clock design of the sending module side, and the second compensation value is obtained by a module with data processing function such as a register or processor of the sending module according to a fixed calculation method. Since the second compensation value is calculated by a module with data processing function, different second compensation values ​​can be generated according to different environments, so it has a certain degree of versatility. The first compensation value can compensate the original sending timestamp according to the design requirements of technicians in this field.

[0060] The return processing module also receives the compensated sending timestamp sent by the sending module. Specifically, after the sending module receives the custom message from the processor, the sending module reads out the original PTP message and other synchronization information in the custom message and sends them to the return processing module, and generates a compensated sending timestamp when sending the original PTP message, and sends the compensated sending timestamp to the return processing module. After sending the original PTP message, other synchronization information and the compensated sending timestamp to the return processing module, the sending module continues to complete the subsequent sending of the original PTP message. Among them, the original PTP message and the compensated sending timestamp are both synchronization information, and together with other synchronization information, they constitute all the synchronization information required by the processor. The other synchronization information includes but is not limited to: the receiving port of the original PTP message, the type of the original PTP message, etc.

[0061] In step 203, when the backhaul processing module receives the finish indication of the backhaul completion sent by the sending module, the backhaul processing module sends the original PTP message, the compensated sending timestamp and other synchronization information to the processor so that the processor completes the corresponding synchronization operation.

[0062] The finish indication is generated when the first byte of the original PTP message is sent. Therefore, the return processing module has sent the original PTP message, the compensated sending timestamp and related information to the processor before the original PTP message is sent. The processor can quickly obtain the original PTP message, the compensated sending timestamp and related information for time synchronization or frequency synchronization.

[0063] The method further includes: if the pkts_side return flag is not detected to be set, the sending module does not perform return processing of the original PTP message, the compensated sending timestamp and other synchronization information, and directly completes subsequent sending processing of the message.

[0064] The direct completion of the subsequent sending processing of the message specifically includes: when the message is a PTP message that needs to carry a timestamp, the sending module records the original sending timestamp when the original PTP message is sent, performs timestamp compensation to obtain a compensated sending timestamp, writes the compensated sending timestamp to a specific position of the PTP message, and sends the PTP message with the compensated sending timestamp written. When the message is not a PTP message that needs to carry a timestamp, the message is sent directly.

[0065] The method of enabling the processor to complete the corresponding synchronization operation specifically includes:

[0066] When the processor is located on the master clock side, the processor generates a corresponding message based on the original PTP message, the compensated sending timestamp and other synchronization information, and sends the corresponding message to the slave clock so that the slave clock corrects the local clock to achieve time synchronization or frequency synchronization with the master clock.

[0067] When the processor is located on the slave clock side, the processor obtains the master-slave clock deviation and transmission delay based on the original PTP message, the compensated transmission timestamp and other synchronization information, corrects the local clock based on the master-slave clock deviation and transmission delay, and achieves time synchronization or frequency synchronization with the master clock.

[0068] The master clock and slave clock both refer to systems that need to perform time synchronization or frequency synchronization. Whether a system is a master clock or a slave clock is configured by the technician who needs to perform time synchronization or frequency synchronization. The master clock provides an accurate time reference, and the slave clock corrects the local clock according to the sending and receiving of PTP messages to achieve time synchronization or frequency synchronization with the master clock. The local clock refers to the clock located on the slave clock side.

[0069] The embodiment of the present invention actively returns the synchronization information to the processor when sending the first byte of the original PTP message, so that the processor can obtain the synchronization information before the port finishes sending the PTP message, thereby improving the speed at which the processor obtains the synchronization information, thereby being able to support high-frequency, high-precision time synchronization or frequency synchronization. In addition, the embodiment of the present invention does not require the participation of the interrupt register and the timestamp pipe, and the processor does not need to actively read the synchronization information, thereby reducing the load on the processor.

[0070] In actual use, since a processor may correspond to multiple ports, when multiple ports send synchronization information to the processor, the processor needs to control the order in which the synchronization information is received. One implementation method is to add a receiving module dedicated to receiving synchronization information in the processor to process the order in which the synchronization information is received. This implementation method requires additional processor resources and increases the processor load. In order to control the order in which synchronization information is received, such as Figure 2 As shown, there are also the following preferred implementations:

[0071] In step 301, the return processing module sends the original PTP message, the compensated sending timestamp and other synchronization information to the normalized receiving module.

[0072] In step 302, the normalized receiving module generates a return PTP message according to the original PTP message, the compensated sending timestamp and other synchronization information, and sends the return PTP message and the message received on the normal path to the processor according to priority.

[0073] The normalized receiving module is a module used to process multi-port message scheduling in the normal receiving path of the message. When a processor corresponds to multiple ports, the processor needs to receive messages from multiple ports. Therefore, a normalized receiving module is usually connected between the processor and the port to schedule the message reception of multiple ports, so that the processor does not need to pay attention to which port the message is received, thereby reducing the load on the processor.

[0074] The normalized receiving module generates a return PTP message according to the original PTP message, the compensated sending timestamp and other synchronization information, specifically including:

[0075] The return PTP message consists of a custom message header, an original PTP message and an FCS byte. The normalization processing module encapsulates the original PTP message excluding the FCS byte in the original message field of the return PTP message, and adds a custom message header before the original message field. The information contained in the custom message header includes a first identification word return tag, a VLAN field and a compensated sending timestamp, wherein the VLAN field is used to store a virtual port ID, and the virtual port ID is used to distinguish the receiving port of the original PTP message. The FCS byte of the assembled return PTP message is added after the original message field.

[0076] The FCS byte is a frame check sequence, which is used to verify the integrity of the message during transmission. When the original PTP message is encapsulated into the return PTP message, the message to be verified changes, and the FCS byte of the original PTP message can no longer verify the entire message. Therefore, a new FCS byte is generated based on the return PTP message and added to the original message field.

[0077] Among them, the custom message header will be directly presented in the representative form of FSL_Header as described in the subsequent content of the embodiment of the present invention.

[0078] This implementation method packages the synchronization information into a return PTP message through a normalized receiving module, and schedules it into the processor together with the messages received on the normal path, so that the processor does not need to pay attention to whether the received message is a message or synchronization information, and does not need to add additional modules to schedule and process the synchronization information, thereby reducing the load on the processor.

[0079] In the above preferred implementation, since the returned PTP message and the message received by the normal path are sent to the processor according to the priority, depending on the priority adopted, there may be a situation where the processor receives other messages first and then receives the returned PTP message. When the number of messages received from the external port is too large or the volume is too large, it may cause the reception time of the returned PTP message to be extended, and the speed at which the processor obtains synchronization information is slowed down. For this problem, there are the following preferred embodiments:

[0080] The returned PTP message carries a set pkts_side return flag, and the normalized receiving module preferentially sends the message carrying the set pkts_side return flag to the processor.

[0081] When there are multiple return PTP messages in the normalized receiving module at the same time, the normalized receiving module determines the priority order according to the size of the virtual port ID carried in the return PTP message, and sends the return PTP message to the processor according to the priority order.

[0082] The normalized receiving module determines whether the message to be scheduled is a return PTP message through the pkts_side return mark. If it is a return PTP message, the return PTP message will be scheduled before the message received by the external interface. When there are multiple return PTP messages, scheduling is performed through the virtual port ID. The virtual port ID is obtained by mapping the port ID of the receiving port in the original PTP message, and one port ID is mapped to one virtual port ID.

[0083] This preferred embodiment enables the processor to obtain synchronization information more quickly by scheduling the returned PTP message with priority, thereby improving the speed at which the processor obtains synchronization information, thereby supporting higher frequency and higher precision time synchronization.

[0084] In the above step 201, the sending module may detect that the custom message with the pkts_side return flag set may be generated by the processor and carry the pkts_side return flag set, and the sending module performs detection. The implementation method specifically includes:

[0085] The processor encapsulates the original PTP message into the custom message, sets the pkts_side return flag in the custom message, and sends the custom message to the sending module, and the sending module detects whether the custom message carries the set pkts_side return flag.

[0086] The processor encapsulates the original PTP message into a custom message, specifically including: the processor determines which PTP messages are to be returned based on internal configuration information, and encapsulates the messages to be returned into the custom message. The present invention does not limit the structure of the custom message. Any message structure that can carry the original PTP message and the pkts_side return mark can be used as the structure of the custom message. However, as a preferred structural implementation method, the custom message and the return PTP message can be set to the same structure, so that part of the synchronization information can be carried when the custom message is generated. The internal configuration information is obtained by those skilled in the art based on experience or IEEE1588 synchronization protocol design.

[0087] Taking time synchronization as an example, the PTP messages involved in the synchronization process are different depending on the synchronization mode used in the synchronization process. When the single-step clock mode is adopted, the PTP message types involved in the synchronization process include sync messages, delay_req messages, and delay_resp messages. When the two-step clock mode is adopted, the PTP message types include sync messages, follow_up messages, delay_req messages, and delay_resp messages. Among them, the sync message is generated by the master clock. In the two-step clock mode, it is necessary to obtain the synchronization information when sending the sync message, add the obtained synchronization information to the follow_up message and send it to the slave clock. The delay_req message is generated by the slave clock. In both the single-step clock mode and the two-step clock mode, it is necessary to obtain the synchronization information when sending the delay_req message to synchronize the local clock according to the synchronization information.

[0088] The internal configuration information for returning the delay_req message in the single-step clock mode and returning the sync message and the delay_req message in the two-step clock mode is designed by a technician in this field. When the processor generates a message to be sent, it determines the current synchronization mode and whether the message to be sent is a sync message and a delay_req message according to the internal configuration information. It also determines whether to encapsulate the sync message and the delay_req message as the original message into the custom message and set the pkts_side return flag in the custom message according to the system configuration, such as whether the receiving port of the message is the port that needs to be synchronized and whether the synchronization switch in the system is turned on.

[0089] There are also the following preferred implementations, specifically including:

[0090] Or the processor sends the original PTP message to the sending module, and the sending module determines whether to record the set pkts_side return flag corresponding to the original PTP message in the register according to the original PTP message to be sent.

[0091] In this preferred implementation, the processor does not set the pkts_side return flag, but the sending module of the port selects whether to store the set pkts_side return flag in the register according to the type of the original PTP message and the configuration in the port, thereby reducing the load of the processor, one of which is:

[0092] A technician in this field stores a configuration file for distinguishing messages in a register of the sending module. When the sending module receives the original PTP message from the processor, the original PTP message is read to obtain the type of the original PTP message and the receiving port of the original PTP message. At the same time, the configuration file in the register is read to obtain the type of the PTP message to be returned and the receiving ports to which the PTP messages need to be sent back. Then, according to the synchronization switch in the configuration file, when the synchronization switch is turned on, the message that meets the PTP message type and receiving port to be returned in the configuration file is used as the original PTP message, and the set pkts_side return mark is stored in the register to facilitate the subsequent execution of the return operation of the original PTP message.

[0093] When the synchronization process is required to be more stringent, this preferred implementation method can also be used together with the above-mentioned implementation method in which the processor generates a message carrying a set pkts_side return flag, that is, a custom message with a set pkts_side return flag is generated in the processor, and the original message is detected in the sending module of the port, and the set pkts_side return flag corresponding to the original message is stored. Through double detection and control, the original PTP message that needs to obtain synchronization information has a corresponding set pkts_side return flag, and the processor can obtain the corresponding synchronization information.

[0094] This embodiment can be applied to various services in a 5G bearer network, including but not limited to: flexible Ethernet FlexE, flexible optical transport network FlexO, OTN service, OTU25 service, OTU50 service, OTUCn service, and OSU service.

[0095] Embodiment 2:

[0096] The present invention is based on the method described in Example 1, combined with specific application scenarios, and uses technical descriptions in related scenarios to illustrate the implementation process of the present invention in characteristic scenarios. Figure 3 As shown in FIG. 1 , it is a time synchronization scenario in a two-step clock mode, wherein the ports used for time synchronization on the master clock side and the slave clock side are both FlexE interfaces, and the method in Example 1 is applied to both FlexE interfaces. In the two-step clock mode, the process of performing time synchronization by applying the method in Example 1 is as follows: Figure 4 As shown, specifically including:

[0097] In step 401, the master clock generates a sync message and sends the sync message to the slave clock. The master clock obtains synchronization information through the sync message, adds the sending time of the sync message in the synchronization information to the follow_up message, and sends the follow_up message to the slave clock.

[0098] In step 402, when the slave clock receives the sync message, the receiving time is recorded as t2, and when the slave clock receives the follow_up message, the sending time of the sync message is read from the follow_up message as t1.

[0099] In step 403, the slave clock generates a delay_req message and sends the delay_req message to the master clock. The slave clock obtains synchronization information by returning the delay_req message, and records the sending time of the delay_req message in the synchronization information as t3.

[0100] In step 404, when the master clock receives the delay_req message, it records the receiving time as t4, adds t4 to the delay_resp message, sends the delay_resp message to the slave clock, and the slave clock obtains the receiving time t4 of the delay_req message from the delay_resp message.

[0101] In step 405, the slave clock calculates the master-slave clock deviation Calculating transmission delay Correct the local clock according to the offset and delay to achieve time synchronization with the master clock.

[0102] In step 401, the master clock obtains synchronization information by returning a sync message, and in step 403, the slave clock obtains synchronization information by returning a delay_req message. The PTP message return method described in Example 1 is adopted. The process of obtaining synchronization information by returning the delay_req message of the slave clock in step 403 will be presented in detail below.

[0103] like Figure 5 The schematic diagram of the architecture of the slave clock is shown. The slave clock may have multiple ports, and multiple ports may be used for time synchronization at the same time. This embodiment takes the time synchronization of port 501 as an example. Figure 5 Only one port 501 for time synchronization is shown, and the port 501 includes a sending module 504, a return processing module 505 and a receiving module 506. The slave clock also includes a business processing side, which is composed of a normalized sending module 503, a normalized receiving module 507 and a processor 502.

[0104] When using port 501 to send a message, the normal sending path of the message is that the processor 502 sends the message to be sent to the normalized sending module 503, and the normalized sending module 503 sends the message to be sent to the corresponding port. Here, the message to be sent is sent to port 501, and port 501 sends the message to be sent to the port under the main clock through the sending module 504.

[0105] When using port 501 to receive messages, the normal receiving path of the message is that the receiving module 506 receives the message to be received sent by the port under the main clock, sends the message to be received to the normalized receiving module 507, and the normalized receiving module 507 implements the scheduling of the receiving order of the message to be received, and sends the message to be received to the processor 502.

[0106] When the processor 502 of the slave clock generates a delay_req message, the processor 502 encapsulates the delay_req message into a custom message. In order to facilitate the processing of subsequent message return, the structure of the custom message is made the same as the structure of the subsequently generated return PTP message. The structure of the custom message and the return PTP message is as follows: Figure 6 As shown, it is composed of a custom message header FSL_Header and a structure of the original PTP message with a 4-byte FCS position reserved. The normalization processing module encapsulates the original PTP message excluding the FCS byte in the original message field of the return PTP message, adds the custom message header FSL_Header before the original message field, and adds the FCS byte of the return PTP message after assembly after the original message field. The custom message header FSL_Header is composed of a VLAN field, a pkts_side return tag, a message type, a message length, and a compensated sending timestamp. The sizes of each component are 4 bytes, 1 bit, 1 byte, 2 bytes, and 10 bytes, respectively. The size of the custom message header FSL_Header is 17 bytes + 1 bit. Among them, the VLAN field is used to store the virtual port ID, and the virtual port ID is used to distinguish the receiving port of the original PTP message.

[0107] It should be noted that the structure of the custom message and the return PTP message shown in this embodiment is only a preferred implementation of the present invention and is not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention. If a domain for storing other information is added to the custom message header FSL_Header, and the size of the domain for storing other information is n bytes, the size of the custom message header FSL_Header is (17+n) bytes+1 bit.

[0108] After encapsulating the delay_req message into the custom message, the processor 502 sets the pkts_side return flag in the custom message, specifically: setting the value of the pkts_side return flag to 0 is not set, and setting it to 1, setting the value of the pkts_side return flag to 1, and sending the custom message after the pkts_side return flag is set to port 501 through the normalized sending module 503, and the port 501 and the normalized receiving module 507 implement the sending and returning of the message.

[0109] The process of sending and returning the message by the port 501 and the normalized receiving module 507 is as follows: Figure 7 As shown, specifically including:

[0110] In step 601, the sending module 504 reads the pkts_side return tag of the custom message.

[0111] In step 602, determine whether the value of the pkts_side return flag is 1. If the value of the pkts_side return flag is 1, it is considered that the pkts_side return flag is set, and enter step 603 to return the message during the sending process. Otherwise, enter step 607 to directly complete the subsequent sending processing of the message.

[0112] In step 603, the sending module 504 reads the custom message, takes out the delay_req message therein, generates an original sending timestamp according to the local clock, latches the original sending timestamp, compensates the original sending timestamp to obtain a compensated sending timestamp, sends the delay_req message, the compensated sending timestamp and other synchronization information to the return processing module 505, and the sending module 504 waits for the time to send the delay_req message to arrive, and enters step 604, wherein the latching is to record the original sending timestamp so that the original sending timestamp does not change with the change of the local clock.

[0113] In step 604 , when the time to send the delay_req message arrives, the first byte of the delay_req message is sent, the sending module 504 sends a finish indication to the return processing module 505 , and continues to send the delay_req message to the master clock, and enters step 605 .

[0114] In step 605, the return processing module 505 receives the finish indication, and sends the delay_req message, the compensated sending timestamp and other synchronization information to the receiving module 506, which is then sent to the normalized receiving module 507 by the receiving module 506, i.e., enters the normalized receiving module 507 through the path originally used to receive the message, and enters step 606.

[0115] In step 606, the normalized receiving module 507 generates a return PTP message according to the delay_req message, the compensated sending timestamp and other synchronization information, and sends the return PTP message and the message received on the normal path to the processor 502 according to priority, and the processor 502 performs subsequent processing.

[0116] In step 607 , the sending module 504 reads the custom message, takes out the delay_req message therein, generates an original sending timestamp according to the local clock, latches the original sending timestamp, compensates the original sending timestamp, and enters step 608 .

[0117] In step 608, when the time to send the delay_req message arrives, the delay_req message is sent.

[0118] The above steps only show in detail the sending and returning of the delay_req message in the two-step clock mode. When the master clock sends a sync message in the single-step clock mode, it is usually necessary to carry the compensated sending timestamp in the sent sync message. The sending and returning process is roughly the same as the process from step 601 to step 608. The difference is that in step 604, in the process of continuing to send the sync message to the slave clock, when sending to the position for placing the timestamp in the sync message, the compensated sending timestamp is placed in the position, and the sync message is continued to be sent, so that the compensated sending timestamp is sent to the slave clock side through the sync message. This method does not limit the message type that carries the compensated sending timestamp in different modes. For example, in the two-step clock mode, if it is due to the design requirements of technical personnel in this field, the delay_req message still needs to carry the compensated sending timestamp, and this method can still support it.

[0119] In the above step 606, the normalized receiving module 507 generates a return PTP message according to the delay_req message, the compensated sending timestamp and other synchronization information by: splitting the delay_req message into a delay_req message without an FCS byte and an FCS byte, putting the delay_req message without an FCS byte into the original message field of the return PTP message, obtaining the type of the delay_req message from other synchronization information, and putting the type of the delay_req message into the return PTP message. The message type position in the PTP message, the length of the delay_req message is placed in the message length position of the returned PTP message, the compensated send timestamp is placed in the compensated send timestamp position of the returned PTP message, the value of the pkts_side return tag position of the PTP message is set to 1, the ID and Tag of the virtual port are obtained from other synchronization information, the ID and Tag of the virtual port are placed in the VLAN field of the returned PTP message, and the FCS byte is generated according to the returned PTP message and placed after the original message field.

[0120] In the above step 606, sending the returned PTP message and the message received on the normal path to the processor 502 according to the priority is specifically:

[0121] The normalized receiving module 507 schedules the return PTP message together with the message received on the normal path, and detects whether the message needs to be scheduled first based on the pkts_side return mark. If it is detected that the pkts_side return mark is set, the message carrying the set pkts_side return mark is sent to the processor first. If, after the normalized receiving module 507 generates a return PTP message based on the delay_req message, the compensated sending timestamp and other synchronization information, the normalized receiving module still has other messages waiting to be scheduled, such as received ordinary messages or other PTP messages, the return PTP message is first added to the scheduling queue, and then the ordinary messages and other PTP messages are added to the scheduling queue, waiting to be received by the processor 502.

[0122] When multiple return PTP messages are generated in the normalized receiving module 507, the return PTP messages are sent to the processor in ascending priority order according to the virtual port IDs they carry. Specifically, the VLAN field in the return PTP message is read to obtain the virtual port ID of each PTP message, and each return PTP message is sorted from small to large according to the virtual port IDs contained therein, and the sorted return PTP messages are added to the head of the scheduling queue, waiting for the processor 502 to receive them.

[0123] After the port 501 and the normalized receiving module 507 implement the message return, the processor 502 obtains the synchronization information in the FSL_Header field of the returned PTP message, and records the sending time of the delay_req message in the synchronization information as t3, which is used for the time synchronization processing from the above steps 404 to 405.

[0124] In step 603, step 604 and step 605, the message sending process and the message return process are carried out at the same time. The following will use a more detailed structural division method to show the internal workflow of port 501 for these processes, such as Figure 8 As shown, the sending module 504 is divided into a sending unit 701 and a 1588 protocol processing unit 702. The sending unit 701, the 1588 protocol processing unit 702 and the return processing module 505 implement the message sending and return process together. Fig. 9 As shown, specifically including:

[0125] In step 801, the 1588 protocol processing unit 702 reads the original message field and FCS in the custom message, obtains the delay_req message, and sends the delay_req message to the return processing module 505. The 1588 protocol processing unit 702 maps a unique virtual port according to the receiving port of the delay_req, and sends the ID and Tag of the virtual port, the type of the delay_req message, the length of the delay_req message and other synchronization information to the return processing module. At the same time, the 1588 protocol processing unit generates a sending timestamp return indication, and sends the sending timestamp return indication to the sending unit 701.

[0126] In step 802, the sending unit 701 generates an original sending timestamp when receiving a sending timestamp feedback indication and is sending a delay_req message, latches the original sending timestamp and completes timestamp compensation to generate a compensated sending timestamp, and sends the compensated sending timestamp to the 1588 protocol processing unit 702 and the feedback processing module 505 at the same time.

[0127] In step 803, the 1588 protocol processing unit 702 waits for the sending position of the delay_req message to arrive, sends the delay_req message, and sends a finish indication to the return processing module 505 when sending the first byte of the delay_req message; and continues to send the delay_req message.

[0128] In step 804, when the feedback processing module 505 receives the finish indication, it sends the delay_req message, the compensated sending timestamp, the ID and Tag of the virtual port, the type of the delay_req message, the length of the delay_req message and other synchronization information to the receiving module 506, and the receiving module 506 performs subsequent message feedback processing.

[0129] Embodiment 3:

[0130] like Fig.10 The figure shows an architecture diagram of a PTP message return system according to an embodiment of the present invention, wherein the system includes at least one port, wherein the port uses the PTP message return method described in Embodiment 1 and Embodiment 2 to return PTP messages.

[0131] It is worth noting that the information interaction, execution process, etc. between the modules and units within the above-mentioned system are based on the same concept as the processing method embodiment of the present invention. The specific contents can be found in the description of the method embodiment of the present invention and will not be repeated here.

[0132] Embodiment 4:

[0133] like Fig.11 , which is a schematic diagram of the architecture of the PTP message return device according to an embodiment of the present invention. The PTP message return device according to this embodiment includes one or more processors 21 and a memory 22. Fig.11 A processor 21 is taken as an example.

[0134] The processor 21 and the memory 22 may be connected via a bus or other means. Fig.11 The example of connecting through bus is taken in the following.

[0135] The memory 22 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs and non-volatile computer executable programs, such as the PTP message return method in Example 1. The processor 21 executes the PTP message return method by running the non-volatile software programs and instructions stored in the memory 22.

[0136] The memory 22 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 22 may optionally include a memory remotely arranged relative to the processor 21, and these remote memories may be connected to the processor 21 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0137] The program instructions / modules are stored in the memory 22, and when executed by the one or more processors 21, the PTP message return method in the above-mentioned embodiment 1 and embodiment 2 is executed, for example, the above-described Figure 1 , Figure 2 , Figure 4 , Figure 7 and Fig. 9 The steps shown.

[0138] It is worth noting that the information interaction, execution process, etc. between the modules and units within the above-mentioned devices and systems are based on the same concept as the processing method embodiment of the present invention. The specific contents can be found in the description of the method embodiment of the present invention and will not be repeated here.

[0139] A person skilled in the art may understand that all or part of the steps in the various methods of the embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0140] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A PTP message return method, characterized in that: include: When the sending module detects that the first identification word return flag has been set and the first byte of the original PTP message is being sent, it sends an indication of return completion to the return processing module, and continues to read the message to complete the subsequent sending processing of the original PTP message; The backhaul processing module also receives the compensated sending timestamp sent by the sending module, writes the compensated sending timestamp, the original PTP message and other synchronization information into the backhaul buffer and waits; When the backhaul processing module receives the backhaul completion indication sent by the sending module, the backhaul processing module sends the original PTP message, the compensated sending timestamp and other synchronization information to the processor so that the processor completes the corresponding synchronization operation.

2. The PTP message return method according to claim 1, characterized in that: The return processing module sends the original PTP message, the compensated sending timestamp and other synchronization information to the processor, specifically including: The return processing module sends the original PTP message, the compensated sending timestamp and other synchronization information to the normalized receiving module. The normalized receiving module generates a return PTP message according to the original PTP message, the compensated sending timestamp and other synchronization information, and sends the return PTP message and the message received on the normal path to the processor according to priority.

3. The PTP message return method according to claim 1, characterized in that: The sending module detects that the first identification word return flag has been set, specifically including: The processor encapsulates the original PTP message into the custom message, sets the first identification word return flag in the custom message, and sends the custom message to the sending module, wherein the sending module detects whether the custom message carries the set first identification word return flag; Or the processor sends the original PTP message to the sending module, and the sending module determines whether to record the set first identification word return mark corresponding to the original PTP message in the register according to the original PTP message to be sent.

4. The PTP message return method according to claim 2, characterized in that: The sending the returned PTP message and the message received by the normal path to the processor according to the priority specifically includes: The returned PTP message carries a set first identification word return mark, and the normalized receiving module preferentially sends the message carrying the set first identification word return mark to the processor; When there are multiple return PTP messages in the normalized receiving module at the same time, the normalized receiving module determines the priority order according to the size of the virtual port ID carried in the return PTP message, and sends the return PTP message to the processor according to the priority order.

5. The PTP message return method according to claim 1, characterized in that: The compensated sending timestamp is obtained by compensating the original sending timestamp obtained when the original PTP message is sent, and specifically includes: The sending module records the original sending timestamp when the original PTP message is sent, and then performs numerical correction on the original sending timestamp according to a first compensation value preset by a technician in this field or a second compensation value calculated according to a precise time synchronization protocol to obtain a compensated sending timestamp.

6. The PTP message return method according to claim 1, characterized in that: The method of enabling the processor to complete the corresponding synchronization operation specifically includes: When the processor is located at the master clock side, the processor generates a corresponding message according to the original PTP message, the compensated sending timestamp and other synchronization information, and sends the corresponding message to the slave clock so that the slave clock corrects the local clock to achieve time synchronization or frequency synchronization with the master clock; When the processor is located on the slave clock side, the processor obtains the master-slave clock deviation and transmission delay based on the original PTP message, the compensated transmission timestamp and other synchronization information, corrects the local clock based on the master-slave clock deviation and transmission delay, and achieves time synchronization or frequency synchronization with the master clock.

7. The PTP message return method according to claim 1, characterized in that: The method is applicable to various services in a 5G bearer network, and the various services include: one or more of flexible Ethernet FlexE, flexible optical transport network FlexO, OTN service, OTU25 service, OTU50 service, OTUCn service and OSU service.

8. The PTP message return method according to any one of claims 1 to 7, characterized in that: The method further includes: if the first identification word return flag is not detected to be set, the sending module does not perform return processing of the original PTP message, the compensated sending timestamp and other synchronization information, and directly completes subsequent sending processing of the message.

9. The PTP message return method according to claim 2, characterized in that: The normalized receiving module generates a return PTP message according to the original PTP message, the compensated sending timestamp and other synchronization information, specifically including: The return PTP message consists of a custom message header, an original PTP message and an FCS byte. The normalization processing module encapsulates the original PTP message excluding the FCS byte in the original message field of the return PTP message, and adds a custom message header before the original message field. The information contained in the custom message header includes a first identification word return tag, a VLAN field and a compensated sending timestamp, wherein the VLAN field is used to store a virtual port ID, and the virtual port ID is used to distinguish the receiving port of the original PTP message. The FCS byte of the assembled return PTP message is added after the original message field.

10. A PTP message return system, characterized in that: The system includes at least one port, wherein the port uses the PTP message return method described in any one of claims 1-9 to return the PTP message.

Citation Information

Patent Citations

  • IEEE1588 based accurate clock synchronization protocol system and synchronization method thereof

    CN101977104A

  • Clock synchronization device and method

    CN102104476A