Method, device and storage medium for improving PHY layer time accuracy synchronization at multiple rates
By obtaining the status of the reconciliation sublayer and the physical layer coding sublayer in the timestamp processing module, checking the consistency when identifying the frame start delimiter SFD, and using different calculations to determine the target timestamp, it solves the problem of the one-step method in the existing technology. The problem of low time synchronization accuracy is achieved by achieving high-precision time synchronization at multiple rates.
Patent Information
- Application Number
- CN202111054219.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-09
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-09-09
AI Technical Summary
When implementing time synchronization in the existing technology, the one-step method needs to reduce network bandwidth usage and reduce the accuracy of the timestamp, making it difficult to maintain high accuracy in the one-step method.
Obtain the status of the reconciliation sublayer and physical layer coding sublayer through the timestamp processing module, check the status consistency when identifying the frame start delimiter SFD, and use different calculations to determine the target timestamp to ensure time accuracy synchronization at multiple rates. .
The one-step method reduces network bandwidth usage while maintaining the accuracy of time synchronization. It can quickly calculate accurate timestamps at different rates and improve the accuracy of time synchronization.
Smart Images

Figure CN115801159B
Abstract
Description
Technical Field
[0001] The present invention relates to network communication technology, and in particular to a method, a device and a storage medium for improving the time accuracy synchronization of a PHY layer at multiple rates. Background Art
[0002] As the application of real-time networks in Ethernet communication systems gradually deepens, the requirements for time synchronization accuracy are becoming higher and higher. The Precision Time Protocol (PTP) in the IEEE1588 protocol is currently a more common time synchronization method with nanosecond accuracy. The basic working principle of PTP synchronization between network time devices is as follows: Figure 1 As shown, the specific steps include:
[0003] The master device sends a synchronization message to the slave device at time T1, and the slave device records the time T2 when the synchronization message is received. The master device transmits T1 to the slave device in the subsequent follow-up message;
[0004] The slave device sends a delay request message to the master device at time T3. The master device records the time T4 when the delay request message is received, and sends T4 to the slave device through a delay response message. At this time, the slave device can calculate the time delay from the message being sent from the master device to the message being received by the slave device based on T1-T4, as well as the deviation between the master device clock and the slave device clock, and synchronize the clock with the master device accordingly.
[0005] The above time synchronization process is called the two-step method.
[0006] In addition, there is a one-step method. Compared with the two-step method, the master device omits the follow-up message and directly puts T1 in the synchronization message to send to the slave device. The one-step method can reduce the network bandwidth required for time synchronization, but because the message content needs to be modified when the synchronization message is about to be sent, the accuracy of T1 is lower than that of the two-step method. Therefore, it is necessary to provide a method that can reduce network bandwidth usage while maintaining accuracy. Summary of the invention
[0007] In order to solve the existing technical problems, the embodiments of the present invention provide a method, device and storage medium for improving the time accuracy synchronization of the PHY layer at multiple rates.
[0008] The technical solution of the present invention is achieved in this way:
[0009] An embodiment of the present invention provides a method for improving PHY layer time accuracy synchronization at multiple rates, the method comprising:
[0010] The timestamp processing module obtains the state of the reconciliation sublayer (RS) and the state of the physical layer coding sublayer (PCS); the RS state flips each time PM_RS is received, and the PCS state flips each time PM_PCS is received;
[0011] When the RS module recognizes the SFD, it checks the RS state and the PCS state;
[0012] Corresponding to the RS state being consistent with the PCS state, a first formula is used to determine a target timestamp of a message sent from the PCS module;
[0013] Corresponding to the RS state and the PCS state being inconsistent, using a second formula to determine the target timestamp;
[0014] The first formula is to determine the target timestamp based on each received PM_PCS timestamp (Tpcs) and the time interval (Trs_sfd) between the SFD being sent from the RS module and the PM_RS being sent from the RS module;
[0015] The second formula determines the target timestamp based on each received PM_PCS timestamp (Tpcs), the PM interval (Tpm), and the time interval (Trs_sfd) between SFD being sent from the RS module and PM_RS being sent from the RS module.
[0016] In the above scheme, the method further comprises:
[0017] The RS module periodically sends the time precision protocol PTP marker PM_RS to the PCS module and the timestamp processing module respectively;
[0018] The RS module continuously sends a code group count (CNT) to the timestamp processing module; the CNT is incremented by one every time eight 64-bit data are sent, and is cleared when PM_RS is sent;
[0019] The RS module identifies the frame start delimiter SFD of the PTP message, and notifies the timestamp processing module each time the SFD is identified, so that the timestamp processing module obtains the RS state and the PCS state and determines the timestamp.
[0020] In the above scheme, the method further comprises:
[0021] The PCS module receives the PM data block, and converts the PM data block to obtain a 66-bit data block; the PM data block is the first group of data blocks in the combination of 8 groups of control codes and data codes when the PCS module receives PM_RS;
[0022] When the PM data block is sent to the PMA, the PCS sends a PTP marker (PM_PCS) to the timestamp processing module.
[0023] In the above solution, the first formula is Tpcs_sfd=Tpcs+Trs_sfd.
[0024] In the above solution, the second formula is Tpcs_sfd=Tpcs+Tpm+Trs_sfd.
[0025] An embodiment of the present invention provides a device for synchronizing a PHY layer at multiple rates with improved time accuracy, including:
[0026] A timestamp processing module, used to obtain the RS state of the reconciliation sublayer and the PCS state of the physical layer coding sublayer; the RS state flips each time PM_RS is received, and the PCS state flips each time PM_PCS is received;
[0027] The reconciliation sublayer RS module is used to check the RS state and the PCS state when the SFD is identified;
[0028] Corresponding to the RS state being consistent with the PCS state, a first formula is used to determine a target timestamp of a message sent from the PCS module;
[0029] Corresponding to the RS state and the PCS state being inconsistent, using a second formula to determine the target timestamp;
[0030] The first formula is to determine the target timestamp based on each received PM_PCS timestamp (Tpcs) and the time interval (Trs_sfd) between the SFD being sent from the RS module and the PM_RS being sent from the RS module;
[0031] The second formula determines the target timestamp based on each received PM_PCS timestamp (Tpcs), the PM interval (Tpm), and the time interval (Trs_sfd) between SFD being sent from the RS module and PM_RS being sent from the RS module.
[0032] In the above solution, the first formula is Tpcs_sfd=Tpcs+Trs_sfd.
[0033] In the above solution, the second formula is Tpcs_sfd=Tpcs+Tpm+Trs_sfd.
[0034] An embodiment of the present invention further provides an electronic device, comprising: a processor and a memory for storing a computer program that can be run on the processor,
[0035] Wherein, the processor is used to execute the steps of the above method when running the computer program.
[0036] An embodiment of the present invention further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.
[0037] The embodiments of the present invention provide a method, device, and storage medium for improving the time accuracy synchronization of the PHY layer at multiple rates. The method includes: a timestamp processing module obtains an RS state and a PCS state; the RS state flips each time a PM_RS is received, and the PCS state flips each time a PM_PCS is received; when the RS module identifies an SFD, the RS state and the PCS state are checked; corresponding to the consistency of the RS state and the PCS state, a first formula is used to determine the target timestamp of the message sent from the PCS module; corresponding to the inconsistency of the RS state and the PCS state, a second formula is used to determine the target timestamp; the first formula is based on each time a PM_PCS timestamp Tpcs is received, and the SFD is sent from the RS module to the target timestamp The target timestamp is determined by the time interval Trs_sfd sent by the PM_RS from the RS module; the second formula is based on each time the PM_PCS timestamp Tpcs is received, the interval Tpm of PM, and the time interval Trs_sfd between the SFD sent from the RS module and the PM_RS sent from the RS module to determine the target timestamp; wherein, the RS state indicates whether the PM_RS is received; the PCS state indicates whether the PM_PCS is received; the PM_RS is the time accuracy protocol mark (PM) periodically sent by the RS module to the PCS module and the timestamp processing module; the PM_PCS is the mark sent by the PCS module to the timestamp processing module, and the mark is used to identify the PM data block to be sent to the physical medium adaptation layer (PMA). In this way, the network bandwidth occupation can be reduced while maintaining accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is a schematic diagram of the basic working principle of PTP to synchronize network time between devices;
[0039] Figure 2 A schematic diagram of the state of a PTP message when it is sent from a medium access control layer (MAC) to a physical medium adaptation layer (PMA);
[0040] Figure 3 A schematic diagram of an implementation scheme of a one-step method in the related art;
[0041] Figure 4 It is a working principle diagram of a timestamp processing module in the related technology;
[0042] Figure 5 A schematic diagram of a flow chart of a PHY layer time accuracy synchronization method provided by an embodiment of the present invention;
[0043] Figure 6A schematic diagram of a timestamp recorded by a timestamp processing module provided in an embodiment of the present invention;
[0044] Figure 7 A schematic diagram of a timestamp recorded by another timestamp processing module provided in an embodiment of the present invention;
[0045] Figure 8 A schematic diagram of the structure of another PHY layer time accuracy synchronization device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0046] The present invention will be further described in detail below in conjunction with the embodiments.
[0047] Combination Figure 1 The method shown shows that the more accurate the time (called timestamp) of sending the message is, the higher the accuracy of time synchronization will be. In order to reduce the impact of jitter inside the device, the timestamp should be obtained as close to the physical layer (PHY) as possible.
[0048] Figure 2 The PTP message is sent from the Media Access Control layer (MAC) to the Physical Media Adaptation layer (PMA), where the reconciliation sublayer and below belong to PHY; specifically,
[0049] 1. At the MAC layer, the type field of the message can be used to identify whether the message to be sent or received is a Precision Time Protocol (PTP) message;
[0050] 2. In the reconciliation sublayer (RS), a preamble is added to the front of the message and ends with an 8-bit start frame delimiter (SFD). An interframe gap (IPG) is added between the message and the next message. The preamble, message, and interframe gap are all a combination of a continuous 8-bit control code and a 64-bit data code. Since the SFD is followed by the message, it is appropriate to choose the time point of sending or receiving the SFD as the timestamp of sending or receiving the message;
[0051] 3. In the physical coding sublayer (PCS), the combination of the 8-bit control code and the 64-bit data code will be encoded into a 66-bit data code, which then needs to be scrambled. The scrambled data is still a 66-bit data code but is no longer recognizable. After that, depending on the Ethernet rate mode and forward error correction mode, there may also be operations such as inserting alignment marks, 257-bit transcoding, codeword insertion, and forward error correction coding;
[0052] 4. Finally, at the PMA layer, all preambles, messages, frame gaps, etc. are converted into binary sequences and sent out.
[0053] Figure 3 The implementation scheme of the one-step method in the related technology is given; the implementation scheme of the one-step method is implemented by the RS module, the PCS module, and the timestamp processing module. Among them,
[0054] The data sent in parallel by the RS module to the PCS module is a combination of 8 groups of 8-bit control codes and 64-bit data codes to increase the bandwidth.
[0055] The RS module periodically sends the Time Precision Protocol Marker (PTP Marker, recorded as PM_RS) to the PCS module and the timestamp processing module through a separate signal line. In addition to PM_RS, the RS module will continue to send the code group count (CNT) to the timestamp processing module. The CNT increases by one every time 8 64-bit data are sent, and the CNT is cleared when PM_RS is sent. The RS module also identifies the frame start delimiter (SFD) of the message, and notifies the timestamp processing module every time the SFD is identified.
[0056] The PCS module will mark the first group of the eight control codes and data codes when receiving PM_RS as a time precision protocol marker (PM, PTP Marker) data block. After a series of encoding, scrambling and other operations, it is converted into a continuous 66-bit data block. During this process, there is always an independent signal to record whether the data block is a PM data block. Finally, when the PM data block is sent to the physical media adaptation layer (PMA, Physical Mediem Attachment), the PCS will send a PTP marker (PM_PCS) to the timestamp processing module.
[0057] The following combination Figure 4 The working principle of the timestamp processing module is further introduced, such as Figure 4 As shown, the timestamp processing module records each time a PM_PCS timestamp is received: Tpcs1, Tpcs2...Tpcs4...;
[0058] When the timestamp processing module receives the SFD signal, CNT represents that there is CNT*8*64 bits of data between SFD and PM_RS. Therefore, the time interval Trs_sfd between SFD being sent from the RS module and PM_RS being sent from the RS module can be calculated. Taking 50 Gigabit Ethernet as an example, 50 bits of data are transmitted per nanosecond (ns). Therefore, the transmission time required for 8*64-bit data code is Tp=10.24ns, and Trs_sfd=CNT*Tp.
[0059] With the interval time of SFD and PM_RS in RS, plus the timestamp Tpcs sent by PM_PCS from PCS, we can get Tpcs_sfd=Tpcs+Trs_sfd, which is the precise timestamp of the message sent from the PCS module.
[0060] However, if the interval between SFD and PM_RS is very small, it is possible that when the RS module recognizes SFD, the PCS module has not yet sent out the PM data block. At this time, if the one-step method is used for time synchronization, the accurate timestamp cannot be calculated according to the above method and put into the synchronization message.
[0061] Based on this, the method provided by the embodiment of the present invention records the RS state and the PCS state in the timestamp processing module, and the RS state flips each time PM_RS is received, and the PCS state flips each time PM_PCS is received; when the RS module recognizes SFD, it first checks these two states. If they are consistent, it means that the PM_PCS corresponding to the current PM_RS has been received, that is, the timestamp can be calculated using Tpcs_sfd=Tpcs+Trs_sfd. If they are inconsistent, it means that the PM_PCS corresponding to the current M_RS has not been received, and the timestamp should be calculated using Tpcs_sfd=Tpcs+Tpm+Trs_sfd.
[0062] The embodiment of the present invention provides a method for improving the PHY layer time synchronization accuracy at multiple rates, such as Figure 5 As shown, the multiple rates include: 1G-800G; the method includes:
[0063] Step 501, the timestamp processing module obtains the reconciliation sublayer (RS state) and the physical layer coding sublayer (PCS) state;
[0064] The RS state flips every time PM_RS is received, and the PCS state flips every time PM_PCS is received;
[0065] Step 502: When the RS module identifies the SFD, the RS module checks the RS state and the PCS state;
[0066] Corresponding to the RS state being consistent with the PCS state, a first formula is used to determine a target timestamp of a message sent from the PCS module;
[0067] Corresponding to the RS state and the PCS state being inconsistent, using a second formula to determine the target timestamp;
[0068] The first formula is to determine the target timestamp based on each received PM_PCS timestamp Tpcs and the time interval Trs_sfd between the SFD being sent from the RS module and the PM_RS being sent from the RS module;
[0069] The second formula is to determine the target timestamp based on each received PM_PCS timestamp Tpcs, the PM interval Tpm, and the time interval Trs_sfd between the SFD sent from the RS module and the PM_RS sent from the RS module;
[0070] Among them, the RS state represents whether PM_RS is received;
[0071] The PCS status indicates whether PM_PCS is received;
[0072] The PM_RS is a time precision protocol marker (PM) periodically sent by the RS module to the PCS module and the timestamp processing module;
[0073] The PM_PCS is a tag sent by the PCS module to the timestamp processing module, and the tag is used to identify that the PM data block is sent to the physical medium adaptation layer (PMA).
[0074] Among them, the PCS module is as mentioned above Figure 3 As shown in the figure, the first group of the eight groups of control codes and data codes received when PM_RS is received will be marked as a time precision protocol marker (PM, PTP Marker) data block. After a series of encoding, scrambling and other operations, it is converted into a continuous 66-bit data block. During this process, there is always an independent signal recording whether the data block is a PM data block. Finally, when the PM data block is sent to the physical media adaptation layer (PMA, Physical Mediem Attachment), the PCS will send a PTP marker (PM_PCS) to the timestamp processing module.
[0075] The above-mentioned timestamp processing module, RS module and PCS module are arranged on any electronic device, and the electronic device is a switch. The above-mentioned modules can respectively realize the functions described in the above-mentioned method.
[0076] In one embodiment, the method further comprises:
[0077] The RS module periodically sends the time precision protocol PTP marker PM_RS to the PCS module and the timestamp processing module respectively;
[0078] The RS module continuously sends a code group count CNT to the timestamp processing module; the CNT is incremented by one every time 8 64-bit data are sent, and is cleared when PM_RS is sent;
[0079] The RS module identifies the frame start delimiter SFD of the PTP message, and notifies the timestamp processing module each time the SFD is identified, so that the timestamp processing module obtains the RS state and the PCS state and determines the timestamp.
[0080] In one embodiment, the method further comprises:
[0081] The PCS module receives the PM data block, and converts the PM data block to obtain a 66-bit data block; the PM data block is the first group of data blocks in the combination of 8 groups of control codes and data codes when the PCS module receives PM_RS;
[0082] When the PM data block is sent to the PMA, the PCS sends a PTP marker (PM_PCS) to the timestamp processing module.
[0083] like Figure 4 The explanation is that when the timestamp processing module receives the SFD signal, CNT represents the interval between SFD and PM_RS of CNT*8*64 bits of data, so the time interval Trs_sfd between SFD and PM_RS from the RS module can be calculated. Taking 50 Gigabit Ethernet as an example, 50 bits of data are transmitted per nanosecond (ns), so the transmission time required for 8*64 bits of data code is Tp=10.24ns, then Trs_sfd=CNT*Tp. With the interval time between SFD and PM_RS in RS, plus the timestamp Tpcs sent by PM_PCS from PCS, it can be obtained that Tpcs_sfd=Tpcs+Trs_sfd, which is the precise timestamp of the message sent from the PCS module.
[0084] In one embodiment, the first formula is Tpcs_sfd=Tpcs+Trs_sfd.
[0085] In one embodiment, the second formula is Tpcs_sfd=Tpcs+Tpm+Trs_sfd.
[0086] The effects of the technology of the present invention are further explained below in conjunction with detailed drawings.
[0087] Figure 6The situation shown is that when the timestamp processing module receives SFD, PM has not yet been sent from the PCS module. At this time, it is obviously unreasonable to use the above formula to calculate Tpcs_sfd=Tpcs1+Trs_sfd, which is one PM interval Tpm ahead of the correct timestamp.
[0088] The solution provided by the embodiment of the present invention records the RS state and PCS state in the timestamp processing module, and the RS state flips each time a PM_RS is received, and the PCS state flips each time a PM_PCS is received. Figure 7 As shown;
[0089] When the RS module recognizes SFD, it first checks these two states. If they are consistent, it means that the PM_PCS corresponding to the current PM_RS has been received, and the timestamp can be calculated using Tpcs_sfd=Tpcs+Trs_sfd. If they are inconsistent, it means that the PM_PCS corresponding to the current M_RS has not been received, and the timestamp should be calculated using Tpcs_sfd=Tpcs+Tpm+Trs_sfd.
[0090] Thus, through the method provided by the real-time example of the present invention, when using the one-step method for time synchronization, regardless of whether the PCS module has sent out the PM_PCS corresponding to the current PM_RS, the accurate timestamp can be quickly calculated and put into the message after the RS module identifies the SFD of the message.
[0091] Figure 8 A schematic diagram of the structure of another PHY layer time accuracy synchronization device provided by an embodiment of the present invention; Figure 8 As shown, the device comprises:
[0092] A timestamp processing module, used to obtain the RS state of the reconciliation sublayer and the PCS state of the physical layer coding sublayer; the RS state flips each time PM_RS is received, and the PCS state flips each time PM_PCS is received;
[0093] The reconciliation sublayer RS module is used to check the RS state and the PCS state when the SFD is identified;
[0094] Corresponding to the RS state being consistent with the PCS state, a first formula is used to determine a target timestamp of a message sent from the PCS module;
[0095] Corresponding to the RS state and the PCS state being inconsistent, using a second formula to determine the target timestamp;
[0096] The first formula is to determine the target timestamp based on each received PM_PCS timestamp Tpcs and the time interval Trs_sfd between the SFD being sent from the RS module and the PM_RS being sent from the RS module;
[0097] The second formula determines the target timestamp based on each received PM_PCS timestamp Tpcs, the PM interval Tpm, and the time interval Trs_sfd between SFD sent from the RS module and PM_RS sent from the RS module.
[0098] Among them, the first formula is Tpcs_sfd=Tpcs+Trs_sfd.
[0099] The second calculation formula is Tpcs_sfd=Tpcs+Tpm+Trs_sfd.
[0100] Figure 8 The device shown can also realize Figure 1 The other steps in the method shown are not described in detail here.
[0101] An embodiment of the present invention also provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor; when the processor of the electronic device executes the program, the method provided by one or more of the above technical solutions is implemented.
[0102] The method disclosed in the above embodiment of the present application can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capability.
[0103] The embodiment of the present application also provides a storage medium, specifically a computer storage medium, more specifically a computer readable storage medium, on which computer instructions, namely computer programs, are stored; when the computer instructions are executed by a processor, the method provided by one or more of the above technical solutions is implemented.
[0104] In the several embodiments provided in the present application, it should be understood that the disclosed methods and intelligent devices can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0105] In addition, the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.
[0106] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of 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 method for improving PHY layer time accuracy synchronization at multiple rates, characterized in that: The method comprises: The timestamp processing module obtains the RS state of the reconciliation sublayer and the PCS state of the physical layer coding sublayer; the RS state flips each time PM_RS is received, and the PCS state flips each time PM_PCS is received; When the RS module recognizes the SFD, it checks the RS state and the PCS state; Corresponding to the RS state being consistent with the PCS state, a first formula is used to determine a target timestamp of a message sent from the PCS module; Corresponding to the RS state and the PCS state being inconsistent, using a second formula to determine the target timestamp; The first formula is to determine the target timestamp based on each received PM_PCS timestamp Tpcs and the time interval Trs_sfd between the SFD being sent from the RS module and the PM_RS being sent from the RS module; The second formula is to determine the target timestamp based on each received PM_PCS timestamp Tpcs, the interval Tpm of the time precision protocol marker PM, and the time interval Trs_sfd between the SFD being sent from the RS module and the PM_RS being sent from the RS module; Among them, the RS state represents whether PM_RS is received; The PCS status indicates whether PM_PCS is received; The PM_RS is a time precision protocol mark PM periodically sent by the RS module to the PCS module and the timestamp processing module; The PM_PCS is a tag sent by the PCS module to the timestamp processing module, and the tag is used to identify that the PM data block is sent to the physical medium adaptation layer PMA.
2. The method according to claim 1, characterized in that: The method further comprises: The RS module periodically sends the time precision protocol PTP marker PM_RS to the PCS module and the timestamp processing module respectively; The RS module continuously sends a code group count CNT to the timestamp processing module; the CNT is incremented by one every time 8 64-bit data are sent, and is cleared when PM_RS is sent; The RS module identifies the frame start delimiter SFD of the PTP message, and notifies the timestamp processing module each time the SFD is identified, so that the timestamp processing module obtains the RS state and the PCS state and determines the timestamp.
3. The method according to claim 1, characterized in that The method further comprises: The PCS module receives the PM data block, and converts the PM data block to obtain a 66-bit data block; the PM data block is the first group of data blocks in the combination of 8 groups of control codes and data codes when the PCS module receives PM_RS; When the PM data block is sent to the PMA, the PCS sends a PTP marker PM_PCS to the timestamp processing module.
4. The method according to any one of claims 1 to 3, characterized in that: The first calculation formula is Tpcs_sfd=Tpcs+Trs_sfd.
5. The method according to any one of claims 1 to 3, characterized in that: The second calculation formula is Tpcs_sfd=Tpcs+Tpm+Trs_sfd.
6. A device for improving the time accuracy of the PHY layer at multiple rates, characterized in that: include: A timestamp processing module is used to obtain the RS state of the reconciliation sublayer and the PCS state of the physical layer coding sublayer; The RS state flips every time PM_RS is received, and the PCS state flips every time PM_PCS is received; The reconciliation sublayer RS module is used to check the RS state and the PCS state when the SFD is identified; Corresponding to the RS state being consistent with the PCS state, a first formula is used to determine a target timestamp of a message sent from the PCS module; Corresponding to the RS state and the PCS state being inconsistent, using a second formula to determine the target timestamp; The first formula is to determine the target timestamp based on each received PM_PCS timestamp Tpcs and the time interval Trs_sfd between the SFD being sent from the RS module and the PM_RS being sent from the RS module; The second formula is to determine the target timestamp based on each received PM_PCS timestamp Tpcs, the PM interval Tpm, and the time interval Trs_sfd between the SFD sent from the RS module and the PM_RS sent from the RS module; Among them, the RS state represents whether PM_RS is received; The PCS status indicates whether PM_PCS is received; The PM_RS is a time precision protocol mark PM periodically sent by the RS module to the PCS module and the timestamp processing module; The PM_PCS is a tag sent by the PCS module to the timestamp processing module, and the tag is used to identify that the PM data block is sent to the physical medium adaptation layer PMA.
7. The device according to claim 6, characterized in that The first calculation formula is Tpcs_sfd=Tpcs+Trs_sfd.
8. The device according to claim 6, characterized in that The second calculation formula is Tpcs_sfd=Tpcs+Tpm+Trs_sfd.
9. An electronic device, characterized in that: include: a processor and a memory for storing a computer program capable of being executed on the processor, Wherein, when the processor is used to run the computer program, the steps of the method described in any one of claims 1 to 5 are executed.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Method for obtaining timestamp and time synchronization system
CN111245542A
Method and apparatus for sending and receiving clock synchronization packet
US20200244383A1
Adaptive network speed matching method and device, and data storage medium
WO2018090644A1
Timestamp acquisition method and time synchronization system
WO2020108202A1
Ethernet time synchronization method and apparatus
WO2021098733A1
