Time synchronization method in passive optical network system, and system, device and storage medium
By setting the master-to-slave service forwarding time slot in the PON network before the slave-to-master forwarding time slot, and combining dynamic bandwidth allocation, the offset is determined to achieve time synchronization between the master clock terminal and the slave clock terminal. This solves the problem of mismatch between the time synchronization mechanism and the PON network forwarding mechanism, and improves the synchronization accuracy of industrial control networks.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-09-29
- Publication Date
- 2026-04-02
AI Technical Summary
The time synchronization mechanism in current industrial control networks is incompatible with the forwarding mechanism of Passive Optical Networks (PON), resulting in time synchronization errors that affect the accuracy and efficiency of industrial control.
In a PON network, a mechanism is introduced where the master-to-slave service forwarding time slot is placed before the slave-to-master forwarding time slot. Through the interaction between the master clock terminal and the slave clock terminal, combined with a dynamic bandwidth allocation mechanism, the offset is determined to achieve time synchronization.
It improves the time accuracy of devices in the PON network, solves the problem of mismatch between the time synchronization mechanism and the PON network forwarding mechanism, and improves the synchronization accuracy of industrial control networks.
Smart Images

Figure CN2025125337_02042026_PF_FP_ABST
Abstract
Description
Time synchronization method, system, device and storage medium in passive optical network system
[0001] Related applications
[0002] The present application claims priority to the Chinese patent application No. 202411368006.4, filed on September 29, 2024, and entitled "Time synchronization method, system, device and storage medium in passive optical network", the contents of which are hereby incorporated by reference in their entirety. TECHNICAL FIELD
[0003] The present application relates to the field of communication technology, in particular to a time synchronization method in a passive optical network system, a passive optical network system, a communication device and a computer readable storage medium. BACKGROUND
[0004] In the control network of industrial automation, it is essential to ensure the time synchronization of all devices for real-time control applications. The 1588 protocol (PTP) is widely used at present, which measures and compensates the network delay through the nodes in the control network to achieve time synchronization.
[0005] With the continuous upgrading of the industrial manufacturing industry, manufacturing equipment is evolving towards higher precision and higher execution efficiency, and the synchronization precision of industrial communication directly affects the control precision and execution efficiency. For example, the numerical control machine tool industry involves multi-axis synchronous linkage, and the refresh frequency is fast, and the synchronization precision and jitter index of each axis directly affect the machining precision.
[0006] Passive optical network (PON) transmits data through optical fiber, and is very suitable for use in industrial environments that require high reliability and real-time performance due to its high bandwidth, long-distance transmission capability and good anti-interference characteristics. At present, the industry is vigorously promoting PON-based industrial control networks.
[0007] The current industrial equipment adopts PTP time synchronization mechanism based on industrial Ethernet. When PON network carries industrial control from east to west, time division multiplexing mechanism is adopted, which introduces service waiting delay in both directions of transmission, and the waiting delay is different in both directions, resulting in asymmetric transmission in both directions. The time synchronization mechanism in the current industrial control network does not match the forwarding mechanism of the PON network. Therefore, it is necessary to provide a time synchronization method to realize clock synchronization based on PON network carrying services. SUMMARY
[0008] Therefore, it is necessary to provide a time synchronization method in a passive optical network system, a passive optical network system, a communication device and a computer readable storage medium, which can ensure precise clock synchronization of devices in a passive optical network system.
[0009] The application provides a time synchronization method in a passive optical network system in a first aspect. The passive optical network system comprises an optical line terminal, a master clock terminal and a slave clock terminal. The time synchronization method is applied to the master clock terminal. The method comprises the following steps: obtaining a first forwarding time slot distributed by the optical line terminal; wherein the optical line terminal distributes the first forwarding time slot for the master clock terminal and a second forwarding time slot for the slave clock terminal; in the same period, the first forwarding time slot distributed by the optical line terminal is earlier than the second forwarding time slot; sending a synchronization message to the slave clock terminal based on the first forwarding time slot; the synchronization message comprises a service arrival time; receiving a feedback message sent by the slave clock terminal and determining a receiving time of the feedback message; the feedback message comprises a receiving time of the synchronization message and a sending time of the feedback message; the sending time of the feedback message is determined by the slave clock terminal according to the service arrival time and a preset time length; the preset time length is consistent with a period length; querying a bidirectional time slot difference value from the optical line terminal; the bidirectional time slot difference value is a difference value between a starting time of the first forwarding time slot and a starting time of the second forwarding time slot in the same period; determining an offset based on the service arrival time, the receiving time of the synchronization message, the sending time of the feedback message, the receiving time of the feedback message, the bidirectional time slot difference value and the preset time length; and sending the offset to the slave clock terminal to instruct the slave clock terminal to perform time synchronization based on the offset.
[0010] In one of the embodiments, when the preset time length is inconsistent with the period length, the method further comprises: determining the offset based on the service arrival time, the receiving time of the synchronization message, the sending time of the feedback message, the receiving time of the feedback message, the bidirectional time slot difference value, the preset time length and the period length.
[0011] In one of the embodiments, the determination of the offset based on the service arrival time, the receiving time of the synchronization message, the sending time of the feedback message, the receiving time of the feedback message, the bidirectional time slot difference value and the preset time length comprises: determining a difference value between the receiving time of the synchronization message and the service arrival time to obtain a synchronization message transmission time length; determining a difference value between the receiving time of the feedback message and the sending time of the feedback message to obtain a feedback message transmission time length; if the feedback message transmission time length is less than the synchronization message transmission time length, determining the offset based on a difference value between the synchronization message transmission time length and the feedback message transmission time length, the preset time length and the bidirectional time slot difference value.
[0012] In one of the embodiments, the method further comprises: if the feedback message transmission time length is greater than the synchronization message transmission time length, determining the offset based on a difference value between the synchronization message transmission time length and the feedback message transmission time length and the bidirectional time slot difference value.
[0013] In one of the embodiments, after receiving the feedback message sent by the slave clock terminal and determining the receiving time of the feedback message, the method further comprises: sending the receiving time of the feedback message to the slave clock terminal, so as to instruct the slave clock terminal to determine the offset based on the service arrival time, the receiving time of the synchronization message, the sending time of the feedback message, the receiving time of the feedback message, the bidirectional time slot difference and the preset time length, and to perform time synchronization based on the offset.
[0014] In one of the embodiments, after receiving the feedback message sent by the slave clock terminal and determining the receiving time of the feedback message, the method further comprises: querying the bidirectional time slot difference from the optical line terminal, and sending the bidirectional time slot difference and the receiving time of the feedback message to the slave clock terminal.
[0015] The application also provides, in a second aspect, a time synchronization method in a passive optical network system, the passive optical network system comprising an optical line terminal, a master clock terminal and a slave clock terminal; the time synchronization method is applied to the slave clock terminal; the method comprises: obtaining a second forwarding time slot allocated by the optical line terminal; wherein the optical line terminal allocates a first forwarding time slot for the master clock terminal and a second forwarding time slot for the slave clock terminal; in the same period, the first forwarding time slot allocated by the optical line terminal is earlier than the second forwarding time slot; receiving a synchronization message sent by the master clock terminal and determining the receiving time of the synchronization message; the synchronization message comprises a service arrival time; determining the sending time of a feedback message based on the service arrival time and a preset time length; sending the feedback message to the master clock terminal based on the second forwarding time slot; the feedback message comprises the receiving time of the synchronization message and the sending time of the feedback message; and receiving an offset sent by the master clock terminal and performing time synchronization based on the offset.
[0016] In one of the embodiments, after sending the feedback message to the master clock terminal based on the second forwarding time slot, the method comprises: receiving the receiving time of the feedback message sent by the master clock terminal; determining the offset based on the service arrival time, the receiving time of the synchronization message, the sending time of the feedback message, the receiving time of the feedback message, the bidirectional time slot difference and the preset time length; the bidirectional time slot difference is the difference between the start time of the first forwarding time slot and the start time of the second forwarding time slot in the same period; and performing time synchronization based on the offset.
[0017] The application also provides, in a third aspect, a passive optical network system, the passive optical network system comprising an optical line terminal, a master clock terminal and a slave clock terminal; the master clock terminal is configured to perform the steps of the method according to the first aspect; and the slave clock terminal is configured to perform the steps of the method according to the second aspect.
[0018] The application further provides a communication device in the fourth aspect, comprising a memory and a processor, the memory stores a computer program, and the processor implements the steps of the method in the first aspect or the second aspect when executing the computer program.
[0019] The application further provides a computer readable storage medium in the fifth aspect, which stores a computer program, and the computer program makes the processor implement the steps of the method in the first aspect or the second aspect when the processor executes the computer program.
[0020] The time synchronization method in the passive optical network system, the passive optical network system, the communication device and the computer readable storage medium, in view of the characteristics of the asymmetric bidirectional transmission in the PON network, combining the dynamic bandwidth allocation (DBA) mechanism of the PON network, setting that the master-to-slave service forwarding time slot is arranged before the slave-to-master forwarding time slot in the same period, and introducing the determination time sending mechanism of the slave clock terminal, that is, the slave clock terminal determines the sending time of the feedback message according to the service arrival time and the preset time length, can avoid the influence of the different bidirectional waiting time delays in the PON network on the time synchronization; the master clock terminal determines the offset value according to the information obtained in the interaction process with the slave clock terminal, combining the bidirectional time slot difference value and the preset time length, and provides the offset value to the slave clock terminal, so as to realize the time synchronization between the master clock terminal and the slave clock terminal, improve the time accuracy of each device in the PON network, and solve the problem that the time synchronization mechanism in the current industrial control network does not match the forwarding mechanism of the PON network. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the application or the related art, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the application or the related art. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0022] Fig. 1 is an interaction schematic diagram of the existing time synchronization method.
[0023] Fig. 2 is an interaction schematic diagram of an optical network unit in a passive optical network system.
[0024] Fig. 3 is an application environment diagram of the time synchronization method in the passive optical network system in an embodiment of the application.
[0025] Fig. 4 is a flowchart of the time synchronization method in the passive optical network system in an embodiment of the application.
[0026] Fig. 5 is a communication process schematic diagram of a master clock terminal and a slave clock terminal in an embodiment of the application.
[0027] Figure 6 is a schematic diagram of the arrangement of the time of arrival of a service t1 and the time of sending of a feedback message t3 in an embodiment of the application.
[0028] Figure 7 is a schematic diagram of the interaction of master and slave clocks in an example of the application.
[0029] Figure 8 is a schematic diagram of the flow of a time synchronisation method in a passive optical network system in another embodiment of the application.
[0030] Figure 9 is a schematic diagram of the communication process between a master clock terminal and a slave clock terminal in another embodiment of the application.
[0031] Figure 10 is a schematic diagram of the communication process between a master clock terminal and a slave clock terminal in yet another embodiment of the application.
[0032] Figure 11 is a schematic diagram of the internal structure of a communication device in an embodiment of the application. DETAILED DESCRIPTION
[0033] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely intended to explain the present application and should not be used to limit the present application.
[0034] It can be understood that in a control network for industrial automation, the 1588 protocol (a master-slave synchronisation system, referred to as PTP) is widely used at present to measure and compensate for network delay by means of nodes in the control network, thereby achieving time synchronisation. Referring to Figure 1, which is a schematic diagram of the interaction of a time synchronisation method, t1 is the precise sending time of a synchronisation message leaving a master clock, t2 is the precise arrival time recorded by a slave clock of the arrival of the synchronisation message at the slave clock, the slave clock sends a feedback message and records the precise sending time t3, the master clock records the precise arrival time t4 of the arrival of the feedback message at the master clock, and the master clock sends a message carrying t4 to the slave clock. In the 1588 protocol, it is assumed that the round-trip time from one node to another node is equal, i.e. the two nodes constitute a symmetrical link, and therefore t2-t1=D+offset and t4-t3=D-offset, where D represents the link forwarding delay and offset represents the compensation deviation value of the delay. It is further determined that D=[(t4-t3)-(t2-t1)] / 2 and offset=t2-t1-D. In this way, the slave clock can calculate the offset between it and the master clock and the link delay (D) and adjust the slave clock to achieve time synchronisation.
[0035] When PON networks carry industrial control signals in the east-west direction, they employ a time-division multiplexing mechanism. This introduces service waiting delays in both directions, and these delays differ between the two sides, leading to asymmetric bidirectional transmission. Referring to Figure 2, which illustrates the interaction of optical network units (ONUs) in a passive optical network system, during the processing of periodic services, the ONUs in the PON network need to wait for appropriate transmission opportunities based on the forwarding time slots allocated by the PON link. The transmission of synchronization and feedback messages also follows this mechanism, resulting in service waiting delays (D) in both directions. 等待 1 and D 等待2 Therefore, t2-t1=D+D 等待1 +offset, t4-t3=D+D 等待2 -offset. Due to D 等待1 and D 等待2 Unlike other methods, the calculation method using the aforementioned 1588 protocol will lead to errors in time synchronization. Therefore, the time synchronization mechanism in current industrial control networks is incompatible with the forwarding mechanism of PON networks.
[0036] Based on this, this application provides a time synchronization method in a passive optical network system, which can solve the problem of mismatch between the time synchronization mechanism and the forwarding mechanism of the PON network in the current industrial control network.
[0037] The time synchronization method in a passive optical network system provided in this application embodiment can be applied to the application environment shown in Figure 3. The passive optical network system includes an optical line terminal (OLT) 102 and optical network units (ONUs) 104. The OLT 102 is communicatively connected to at least one ONU 104. It is understood that the OLT can connect to more or fewer ONUs. Figure 3 is merely an example and does not constitute a limitation on the passive optical network system to which this application solution is applied. The OLT 102 allocates forwarding time slots to each ONU 104 based on the DBA mechanism. The ONUs 104 synchronize their clocks using the time synchronization method provided in this application embodiment.
[0038] In an exemplary embodiment, as shown in FIG4, a time synchronization method is provided in a passive optical network system. The passive optical network system includes an optical line terminal, a master clock terminal, and a slave clock terminal. The time synchronization method is applied to the master clock terminal. The method may include the following steps S402 to S412.
[0039] Step S402: Obtain the first forwarding time slot allocated by the optical line terminal; wherein, the optical line terminal allocates the first forwarding time slot to the master clock terminal and allocates the second forwarding time slot to the slave clock terminal; within the same cycle, the first forwarding time slot allocated by the optical line terminal is earlier than the second forwarding time slot.
[0040] Specifically, the master clock terminal and the slave clock terminal can be the optical network unit 104 as shown in FIG. 3. In order to realize the bandwidth resource allocation, the optical line terminal allocates the forwarding time slots for each optical network unit, so that each optical network unit transmits data at a suitable transmission opportunity. In the embodiment, in the same cycle, the optical line terminal allocates a first forwarding time slot for the master clock terminal earlier than a second forwarding time slot for the slave clock terminal, that is, the master-to-slave service forwarding time slot is arranged before the slave-to-master forwarding time slot.
[0041] Step S404: based on the first forwarding time slot, transmitting a synchronization message to the slave clock terminal; the synchronization message includes a service arrival time.
[0042] Specifically, the service arrival time is the transmission time of the synchronization message recorded by the master clock terminal, denoted as t1. After encapsulating the synchronization message, the master clock terminal needs to wait for a certain time, and then transmits the synchronization message carrying t1 to the slave clock terminal at a suitable transmission opportunity based on the first forwarding time slot.
[0043] Step S406: receiving a feedback message transmitted by the slave clock terminal, and determining a receiving time of the feedback message; the feedback message includes a receiving time of the synchronization message and a transmission time of the feedback message; the transmission time of the feedback message is determined by the slave clock terminal according to the service arrival time and a preset time length; the preset time length is consistent with the cycle length.
[0044] Specifically, when the synchronization message arrives at the slave clock terminal, the slave clock terminal records the receiving time of the synchronization message, denoted as t2. In response to the synchronization message, the slave clock terminal generates a feedback message, and records the transmission time of the feedback message, denoted as t3. Similarly, after encapsulating the feedback message, the slave clock terminal needs to wait for a certain time, and then transmits the feedback message carrying t2 and t3 to the master clock terminal at a suitable transmission opportunity based on the second forwarding time slot. When the feedback message arrives at the master clock terminal, the master clock terminal records the receiving time of the feedback message, denoted as t4.
[0045] The preset time length is a parameter set in advance, and in the embodiment, the preset time length is consistent with the cycle length, that is, the length of the DBA scheduling cycle, for example, 125us. The slave clock terminal adopts a determination time transmission mechanism, that is, the slave clock terminal transmits the feedback message after the preset time length of the service arrival time. For the slave clock terminal, t3-t1=T, T is the cycle length; considering the offset between the master clock terminal and the slave clock terminal, the difference between t3 and t1 on the PON link is T-offset.
[0046] Step S408: querying the bidirectional time slot difference value from the optical line terminal; the bidirectional time slot difference value is a difference value between a start time of the first forwarding time slot and a start time of the second forwarding time slot in a same period.
[0047] Step S410: determining the offset according to the service arrival time, the receiving time of the synchronization message, the sending time of the feedback message, the receiving time of the feedback message, the bidirectional time slot difference value, and a preset time length.
[0048] Specifically, by setting that the master-to-slave service forwarding time slot is arranged before the slave-to-master forwarding time slot in a same period, and introducing a sending mechanism of the determined time of the slave clock terminal, the master clock terminal sends the synchronization message in the n th period, and the slave clock terminal sends the feedback message in the n+1 th period, so that the relationship between the bidirectional waiting time delays can be determined. According to the characteristics of the bidirectional transmission in the PON network: t2-t1=D+D 等待1 -offset, t4-t3=D+D 等待2 -offset; in combination with the relationship between the bidirectional waiting time delays, t1, t2, t3, t4, the bidirectional time slot difference value C 差 and the preset time length T determined in this interaction are substituted, the offset between the master clock terminal and the slave clock terminal is solved.
[0049] Step S412: sending the offset to the slave clock terminal, so that the slave clock terminal performs time synchronization based on the offset.
[0050] Specifically, referring to FIG. 5, which is a communication process diagram of the master clock terminal and the slave clock terminal in one embodiment, the communication process includes: 1, the PON link queries the master clock, sends the service information to the master clock terminal, and matches the corresponding forwarding time slot; 2, the PON link queries the slave clock, sends the service information to the slave clock terminal, and matches the corresponding forwarding time slot; 3, the PON link arranges the master-to-slave service forwarding time slot before the slave-to-master forwarding time slot in a period through the DBA configuration mechanism of the PON network; 4, the master clock terminal sends the synchronization message to the slave clock terminal, containing t1 information; 5, the slave clock terminal sends the feedback message to the master clock terminal at t1+T, containing t2 and t3 information; 6, the master clock terminal queries the bidirectional time slot difference value C 差 from the PON link; 7, the master clock terminal calculates the offset offset according to the time synchronization algorithm consistent with the characteristics of the PON; 8, the master clock terminal sends the offset offset to the slave clock terminal; 9, the slave clock terminal updates the time of the slave clock according to the offset offset.
[0051] The time synchronization method in the passive optical network system, in view of the asymmetric characteristics of bidirectional transmission in the PON network, combines the DBA mechanism of the PON network, sets that in the same period, the master-to-slave service forwarding time slot is arranged before the slave-to-master forwarding time slot, and introduces the mechanism that the slave clock terminal sends at a determined time, that is, the slave clock terminal determines the sending time of the feedback message according to the service arrival time and the preset time length, which can avoid the influence of different bidirectional waiting delays in the PON network on time synchronization; the master clock terminal determines the offset value according to the information obtained in the interaction with the slave clock terminal, combines the bidirectional time slot difference value and the preset time length, and provides the offset value to the slave clock terminal, so as to realize the time synchronization between the master clock terminal and the slave clock terminal, improve the time accuracy of each device in the PON network, and solve the problem that the time synchronization mechanism in the current industrial control network does not match the forwarding mechanism of the PON network.
[0052] In an exemplary embodiment, step S410 can further include: determining the difference between the receiving time of the synchronization message and the service arrival time to obtain the synchronization message transmission time length; determining the difference between the receiving time of the feedback message and the sending time of the feedback message to obtain the feedback message transmission time length; and if the feedback message transmission time length is less than the synchronization message transmission time length, determining the offset value according to the difference between the synchronization message transmission time length and the feedback message transmission time length, the preset time length, and the bidirectional time slot difference value.
[0053] Specifically, for the nth period, if the service arrival time is before the first forwarding time slot, the master clock terminal can send the synchronization message in the first forwarding time slot of the nth period, and in the n+1th period, since the first forwarding time slot is earlier than the second forwarding time slot, the slave clock terminal needs to wait for a long time to send the feedback message. In this case, the master-to-slave waiting delay is less than the slave-to-master waiting delay, and the synchronization message transmission time length is less than the feedback message transmission time length. For the nth period, if the service arrival time is between the first forwarding time slot and the second forwarding time slot, the master clock terminal needs to wait for the first forwarding time slot of the n+1th period, and sends the synchronization message in the first forwarding time slot of the n+1th period. The slave clock terminal sends the feedback message in the second forwarding time slot of the n+1th period. In this case, the master-to-slave waiting delay is greater than the slave-to-master waiting delay, and the synchronization message transmission time length is greater than the feedback message transmission time length.
[0054] In an optional implementation, the feedback message transmission time length is less than the synchronization message transmission time length, and the offset value is calculated according to the formula: offset = (t2-t1)-(t4-t3)-T+C 差 ; the synchronization message transmission time length (t2-t1) and the feedback message transmission time length (t4-t3) determined in this interaction, the preset time length T, and the bidirectional time slot difference value C 差Substitute the formula, the offset can be determined.
[0055] It can be understood that, referring to Figure 6, Figure 6 is a layout diagram of the time t1 when the service arrives and the time t3 when the feedback message is sent in an embodiment; referring to subgraph (1) in Figure 6, the preset time length and the period length are consistent, both are T, the interval between t3 and t1 is T-offset, and the difference between the start time of the first forwarding time slot and the start time of the second forwarding time slot is C 差 , the time when the service arrives is between the first forwarding time slot (i.e. the master-to-slave time slot) and the second forwarding time slot (i.e. the slave-to-master time slot) in the nth period, t4-t3 等待2 等待1 差 According to the characteristics of bidirectional transmission in the PON network: t2-t1=D+D 等待1 +offset; t4-t3=D+D 等待2 -offset; combined with D 等待2 -D 等待1 =C 差 -T+offset, offset=(t2-t1)-(t4-t3)-T+C 差 can be determined. Based on the same idea, the calculation of the link transmission delay D can be realized, which is not described here.
[0056] In an exemplary embodiment, the above method can further include: if the transmission time length of the feedback message is greater than the transmission time length of the synchronization message, determining the offset according to the difference between the transmission time length of the synchronization message and the transmission time length of the feedback message, and the bidirectional time slot difference.
[0057] Specifically, in the case where the transmission time length of the feedback message is greater than the transmission time length of the synchronization message is preset, the formula for calculating the offset is: offset=(t2-t1)-(t4-t3)+C 差 ; Substitute the synchronization message transmission time length (t2-t1) determined in this interaction, the feedback message transmission time length (t4-t3), and the bidirectional time slot difference C 差 into the formula, the offset can be determined.
[0058] Referring to subgraph (2) in Figure 6, the time when the service arrives is before the first forwarding time slot (i.e. the master-to-slave time slot) in the nth period, t4-t3>t2-t1; analyzing the relationship between the bidirectional waiting delays is: D 等待2 -D 等待1 =C 差 +offset. According to the characteristics of bidirectional transmission in the PON network: t2-t1=D+D 等待1 offset, t4-t3=D+D 等待2 -offset; combined with D 等待2 -D 等待1 =C 差 +offset, i.e. offset=(t2-t1)-(t4-t3)+C 差 Based on the same idea, the calculation of the link transmission delay D can be realized, which is not described herein.
[0059] In an alternative implementation, if the feedback message transmission duration is equal to the synchronization message transmission duration, offset=C 差 , or offset=C 差 -T.
[0060] Exemplarily, referring to FIG. 7, the period T (i.e. the preset duration) is 125us, the service arrival time t1 recorded by the master clock is 5us, the reception time t2 of the synchronization message recorded by the slave clock is 38us, the slave clock sends the feedback message at t1+125=130us, records t3 as 130us, the reception time t4 of the feedback message recorded by the master clock is 175us, since t4-t3>t2-t1, indicating that the service arrival time is before the corresponding period master-to-slave time slot, the bidirectional time slot difference C 差 is 15us, based on the foregoing formula, offset=(t2-t1)-(t4-t3)+C 差 = (38-5)-(175-130)+15=3us.
[0061] In an exemplary embodiment, in the case where the preset duration is inconsistent with the period duration, the foregoing method can further include determining the offset according to the service arrival time, the reception time of the synchronization message, the sending time of the feedback message, the reception time of the feedback message, the bidirectional time slot difference, the preset duration and the period duration.
[0062] Specifically, it is assumed that the preset duration is T1 and the period duration is T2. It can be understood that the preset duration and the period duration are relatively small, which can ensure that the master clock terminal sends the synchronization message in the nth period and the slave clock terminal sends the feedback message in the n+1th period. In the case where the feedback message transmission duration is less than the transmission duration of the synchronization message, the formula for calculating the offset is offset=(t2-t1)-(t4-t3)-T1+C 差 ; the synchronization message transmission duration (t2-t1) and the feedback message transmission duration (t4-t3) determined in this interaction, the preset duration T1, and the bidirectional time slot difference C 差 are substituted into the formula, and the offset can be determined.
[0063] Referring to sub-figure (1) in Figure 6, the service arrival time is between the first forwarding time slot (i.e., master to slave time slot) and the second forwarding time slot (i.e., slave to master time slot) in the nth cycle, t4-t3 < t2-t1; the relationship between the bidirectional waiting delays is analyzed as follows: D 等待2 -D 等待1 =C 差 -T1+offset. Based on the bidirectional transmission characteristics of a PON network: t2-t1=D+D 等待1 +offset, t4-t3=D+D 等待2 -offset; combined with D 等待2 -D 等待1 =C 差 -T1+offset, we can determine offset = (t2-t1)-(t4-t3)-T1+C 差 Based on the same approach, the calculation of the link transmission delay D can be achieved, which will not be elaborated here.
[0064] When the transmission duration of the feedback message is preset to be greater than that of the synchronization message, the formula for calculating the offset is: offset = (t2 - t1) - (t4 - t3) - T2 + T1 + C 差 The transmission duration of the synchronization message (t2-t1), the transmission duration of the feedback message (t4-t3), and the bidirectional timeslot difference C determined in this interaction are included. 差 The offset can be determined by substituting the preset duration T1 and the cycle duration T2 into the formula.
[0065] Referring to sub-figure (2) in Figure 6, the service arrival time is before the first forwarding time slot (i.e., the master-to-slave time slot) of the nth cycle, t4-t3>t2-t1; the relationship between the bidirectional waiting delays is analyzed as follows: D 等待2 -D 等待1 =T2-T1+C 差 +offset. Based on the bidirectional transmission characteristics of a PON network: t2 - t1 = D + D 等待1 +offset, t4-t3=D+D 等待2 -offset; combined with D 等待2 -D 等 待1 =T2-T1+C 差 By adding offset, we can determine offset = (t2-t1)-(t4-t3)-T2+T1+C 差 Based on the same approach, the calculation of the link transmission delay D can be achieved, which will not be elaborated here.
[0066] In one alternative implementation, if the transmission duration of the feedback message is equal to the transmission duration of the synchronization message, then offset = C is determined.差 T2+T, or offset = C 差 T1.
[0067] In one of the embodiments, after step S406, the above method can further include:
[0068] sending the receiving time of the feedback message to the slave clock terminal, so as to instruct the slave clock terminal to determine the offset based on the service arrival time, the receiving time of the synchronization message, the sending time of the feedback message, the receiving time of the feedback message, the bidirectional slot difference value and the preset time length, and to perform time synchronization based on the offset.
[0069] Specifically, the offset is determined by the slave clock terminal based on the information obtained in the interaction process, in combination with the bidirectional slot difference value and the preset time length, so as to realize the time synchronization between the master clock terminal and the slave clock terminal, and also to improve the time accuracy of each device in the PON network, and to solve the problem that the time synchronization mechanism in the current industrial control network does not match the PON network forwarding mechanism.
[0070] In an optional embodiment, after step S406, the above method can further include: querying the bidirectional slot difference value from the optical line terminal; and sending the bidirectional slot difference value and the receiving time of the feedback message to the slave clock terminal. It can be understood that the step of querying the bidirectional slot difference value can be performed by the master clock terminal or by the slave clock terminal.
[0071] In an exemplary embodiment, as shown in FIG. 8, a time synchronization method in a passive optical network system is provided, the passive optical network system including an optical line terminal, a master clock terminal and a slave clock terminal; the above time synchronization method is applied to the slave clock terminal; and the above method can include the following steps S802 to S810.
[0072] Step S802: obtaining a second forwarding time slot allocated by the optical line terminal; wherein the optical line terminal allocates a first forwarding time slot for the master clock terminal and a second forwarding time slot for the slave clock terminal; and in the same period, the first forwarding time slot allocated by the optical line terminal is earlier than the second forwarding time slot.
[0073] Step S804: receiving a synchronization message sent by the master clock terminal and determining the receiving time of the synchronization message; the synchronization message includes a service arrival time.
[0074] Step S806: determining the sending time of the feedback message based on the service arrival time and a preset time length.
[0075] Step S808: sending the feedback message to the master clock terminal based on the second forwarding time slot; the feedback message includes the receiving time of the synchronization message and the sending time of the feedback message.
[0076] Step S810: receiving the offset sent by the master clock terminal, and performing time synchronization based on the offset.
[0077] The master clock terminal performs the foregoing steps S402 to S412. For details, refer to the description of the foregoing steps S402 to S412, which will not be described here again. It can be understood that the preset time length in this embodiment can be consistent with the cycle time length or inconsistent with the cycle time length.
[0078] In this embodiment, in view of the asymmetric characteristics of bidirectional transmission in the PON network, in combination with the DBA mechanism of the PON network, it is provided that, in the same cycle, the master-to-slave service forwarding time slot is arranged before the slave-to-master forwarding time slot, and the mechanism of sending by the slave clock terminal at a determined time is introduced, that is, the slave clock terminal determines the sending time of the feedback message according to the service arrival time and the preset time length, which can avoid the influence of different bidirectional waiting delays in the PON network on time synchronization; the master clock terminal determines the offset in combination with the bidirectional time slot difference and the preset time length according to the information obtained in the interaction with the slave clock terminal, and provides the offset to the slave clock terminal, thereby realizing time synchronization between the master clock terminal and the slave clock terminal, improving the time accuracy of devices in the PON network, and solving the problem that the time synchronization mechanism in the current industrial control network does not match the forwarding mechanism of the PON network.
[0079] In an exemplary embodiment, after step S808, the method further includes: receiving the receiving time of the feedback message sent by the master clock terminal; determining the offset according to the service arrival time, the receiving time of the synchronization message, the sending time of the feedback message, the receiving time of the feedback message, the bidirectional time slot difference, and the preset time length; the bidirectional time slot difference is the difference between the start time of the first forwarding time slot and the start time of the second forwarding time slot in the same cycle; and performing time synchronization based on the offset.
[0080] In this embodiment, the offset can be determined by the master clock terminal, or can be determined by the slave clock terminal according to the information obtained in the interaction, in combination with the bidirectional time slot difference and the preset time length, to realize time synchronization between the master clock terminal and the slave clock terminal, which can also improve the time accuracy of devices in the PON network and solve the problem that the time synchronization mechanism in the current industrial control network does not match the forwarding mechanism of the PON network.
[0081] In the case where the preset time length is consistent with the cycle time length, if t4-t3 差 .
[0082] In the case that the preset time length is consistent with the cycle time length, if t4-t3>t2-t1, the offset is determined according to the following formula: offset=(t2-t1)-(t4-t3)+C 差 .
[0083] In the case that the preset time length is inconsistent with the cycle time length, if t4-t3 差 .
[0084] In the case that the preset time length is inconsistent with the cycle time length, if t4-t3>t2-t1, the offset is determined according to the following formula: offset=(t2-t1)-(t4-t3)-T2+T1+C 差 .
[0085] Wherein, t1 is the time of service arrival, t2 is the time of receiving the synchronization message, t3 is the time of sending the feedback message, t4 is the time of receiving the feedback message, C 差 is the bidirectional time slot difference, and T is the preset time length. For specific description, refer to the foregoing embodiments.
[0086] Referring to FIG. 9, FIG. 9 shows a communication process of a master clock terminal and a slave clock terminal, which includes: 1, the PON link inquires the master clock, sends service information to the master clock terminal, and matches the corresponding forwarding time slot; 2, the PON link inquires the slave clock, sends service information to the slave clock terminal, and matches the corresponding forwarding time slot; 3, the PON link configures the DBA mechanism of the PON network, and in a cycle, the master-to-slave service forwarding time slot is arranged before the slave-to-master forwarding time slot; 4, the master clock terminal sends a synchronization message to the slave clock terminal, containing t1 information; 5, the slave clock terminal sends a feedback message to the master clock terminal at t1+T, containing t2 and t3 information; 6, the master clock terminal inquires the bidirectional time slot difference C 差 of the PON link; 7, the master clock terminal sends t4 information and the bidirectional time slot difference C 差 to the slave clock terminal; 8, the slave clock terminal calculates the offset offset according to the time synchronization algorithm consistent with the characteristics of the PON; 9, the slave clock terminal updates the time of the slave clock according to the offset offset.
[0087] Referring to FIG. 10, FIG. 10 shows another communication process between a master clock terminal and a slave clock terminal, which includes: 1, the PON link queries the master clock, sends service information to the master clock terminal, and matches the corresponding forwarding time slot; 2, the PON link queries the slave clock, sends service information to the slave clock terminal, and matches the corresponding forwarding time slot; 3, the PON link configures the DBA mechanism of the PON network, and in a period, the master-to-slave service forwarding time slot is arranged before the slave-to-master forwarding time slot; 4, the master clock terminal sends a synchronization message to the slave clock terminal, containing t1 information; 5, the slave clock terminal sends a feedback message to the master clock terminal at t1+T, containing t2 and t3 information; 6, the master clock terminal sends t4 information to the slave clock terminal; 7, the slave clock terminal queries the PON link for the bidirectional time slot difference C 差 ; 8, the slave clock terminal calculates the offset according to the time synchronization algorithm that fits the characteristics of the PON; 9, the slave clock terminal updates the time of the slave clock according to the offset.
[0088] It should be understood that although each step in the flowchart involved in each embodiment as described above is shown in sequence according to the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least part of other steps or steps or stages in other steps.
[0089] In an exemplary embodiment, a communication device, which can be a server, has an internal structure diagram as shown in FIG. 11. The communication device includes a processor, a memory, an input / output interface (I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through the system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the communication device is used to provide computing and control capabilities. The memory of the communication device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The input / output interface of the communication device is used to exchange information between the processor and external devices. The communication interface of the communication device is used to communicate with external terminals through network connection. The computer program is executed by the processor to implement a time synchronization method in a passive optical network system.
[0090] Those skilled in the art can understand that the structure shown in FIG. 11 is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the communication device to which the scheme of the present application is applied. The specific communication device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0091] In an exemplary embodiment, a passive optical network system is provided, comprising an optical line terminal, a master clock terminal and a slave clock terminal; wherein the master clock terminal is configured to perform the steps of the time synchronization method applied to the master clock terminal as described above, and the slave clock terminal is configured to perform the steps of the time synchronization method applied to the slave clock terminal as described above.
[0092] In an exemplary embodiment, a communication device is provided, comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program: obtaining a first forwarding time slot allocated by an optical line terminal; wherein the optical line terminal allocates the first forwarding time slot to a master clock terminal and a second forwarding time slot to a slave clock terminal; the first forwarding time slot is earlier than the second forwarding time slot in the same period; sending a synchronization message to the slave clock terminal based on the first forwarding time slot; the synchronization message comprises a service arrival time; receiving a feedback message sent by the slave clock terminal, and determining a receiving time of the feedback message; the feedback message comprises a receiving time of the synchronization message and a sending time of the feedback message; the sending time of the feedback message is determined by the slave clock terminal according to the service arrival time and a preset time length; the preset time length is consistent with a period length; querying a bidirectional time slot difference value from the optical line terminal; the bidirectional time slot difference value is a difference between a start time of the first forwarding time slot and a start time of the second forwarding time slot in the same period; determining an offset based on the service arrival time, the receiving time of the synchronization message, the sending time of the feedback message, the receiving time of the feedback message, the bidirectional time slot difference value and the preset time length; and sending the offset to the slave clock terminal to instruct the slave clock terminal to perform time synchronization based on the offset.
[0093] In an embodiment, the processor further implements the following steps when executing the computer program: determining the offset based on the service arrival time, the receiving time of the synchronization message, the sending time of the feedback message, the receiving time of the feedback message, the bidirectional time slot difference value, the preset time length and the period length.
[0094] In one embodiment, the processor, when executing the computer program, further implements the following steps: determining a difference between the receiving time of the synchronization message and the arrival time of the service, to obtain a transmission duration of the synchronization message; determining a difference between the receiving time of the feedback message and the sending time of the feedback message, to obtain a transmission duration of the feedback message; if the transmission duration of the feedback message is less than the transmission duration of the synchronization message, determining the offset according to a difference between the transmission duration of the synchronization message and the transmission duration of the feedback message, the preset duration, and the bidirectional time slot difference.
[0095] In one embodiment, the processor, when executing the computer program, further implements the following steps: if the transmission duration of the feedback message is greater than the transmission duration of the synchronization message, determining the offset according to a difference between the transmission duration of the synchronization message and the transmission duration of the feedback message, and the bidirectional time slot difference.
[0096] In one embodiment, the processor, when executing the computer program, further implements the following steps: sending the receiving time of the feedback message to the slave clock terminal, to instruct the slave clock terminal to determine the offset according to the arrival time of the service, the receiving time of the synchronization message, the sending time of the feedback message, the receiving time of the feedback message, the bidirectional time slot difference, and the preset duration, and to perform time synchronization based on the offset.
[0097] In one embodiment, the processor, when executing the computer program, further implements the following steps: querying the bidirectional time slot difference from the optical line terminal, and sending the bidirectional time slot difference and the receiving time of the feedback message to the slave clock terminal.
[0098] In one embodiment, the processor, when executing the computer program, further implements the following steps: obtaining a second forwarding time slot allocated by the optical line terminal; the optical line terminal allocates a first forwarding time slot to the master clock terminal and a second forwarding time slot to the slave clock terminal; the first forwarding time slot allocated by the optical line terminal is earlier than the second forwarding time slot in the same period; receiving the synchronization message sent by the master clock terminal and determining the receiving time of the synchronization message; the synchronization message includes the arrival time of the service; determining the sending time of the feedback message according to the arrival time of the service and the preset duration; sending the feedback message to the master clock terminal based on the second forwarding time slot; the feedback message includes the receiving time of the synchronization message and the sending time of the feedback message; receiving the offset sent by the master clock terminal and performing time synchronization based on the offset.
[0099] In one embodiment, the processor, when executing the computer program, further implements the following steps: receiving the receiving time of the feedback message sent by the master clock terminal; determining the offset according to the arrival time of the service, the receiving time of the synchronization message, the sending time of the feedback message, the receiving time of the feedback message, the bidirectional time slot difference, and the preset duration; the bidirectional time slot difference is a difference between the start time of the first forwarding time slot and the start time of the second forwarding time slot in the same period; performing time synchronization based on the offset.
[0100] In one embodiment, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the following steps: obtaining a first forwarding time slot allocated by an optical line terminal; wherein the optical line terminal allocates a first forwarding time slot for a master clock terminal and a second forwarding time slot for a slave clock terminal; the first forwarding time slot is earlier than the second forwarding time slot in a same period; sending a synchronization message to the slave clock terminal based on the first forwarding time slot; the synchronization message includes a service arrival time; receiving a feedback message sent by the slave clock terminal, and determining a receiving time of the feedback message; the feedback message includes a receiving time of the synchronization message and a sending time of the feedback message; the sending time of the feedback message is determined by the slave clock terminal according to the service arrival time and a preset time length; the preset time length is consistent with a period length; querying a bidirectional time slot difference value from the optical line terminal; the bidirectional time slot difference value is a difference between a start time of the first forwarding time slot and a start time of the second forwarding time slot in the same period; determining an offset based on the service arrival time, the receiving time of the synchronization message, the sending time of the feedback message, the receiving time of the feedback message, the bidirectional time slot difference value, and the preset time length; and sending the offset to the slave clock terminal to instruct the slave clock terminal to perform time synchronization based on the offset.
[0101] In one embodiment, the computer program is executed by the processor to further implement the following steps: determining the offset based on the service arrival time, the receiving time of the synchronization message, the sending time of the feedback message, the receiving time of the feedback message, the bidirectional time slot difference value, the preset time length, and the period length.
[0102] In one embodiment, the computer program is executed by the processor to further implement the following steps: determining a difference between the receiving time of the synchronization message and the service arrival time to obtain a synchronization message transmission time length; determining a difference between the receiving time of the feedback message and the sending time of the feedback message to obtain a feedback message transmission time length; if the feedback message transmission time length is less than the synchronization message transmission time length, determining the offset based on a difference between the synchronization message transmission time length and the feedback message transmission time length, the preset time length, and the bidirectional time slot difference value.
[0103] In one embodiment, the computer program is executed by the processor to further implement the following steps: if the feedback message transmission time length is greater than the synchronization message transmission time length, determining the offset based on a difference between the synchronization message transmission time length and the feedback message transmission time length, and the bidirectional time slot difference value.
[0104] In one embodiment, the computer program, when executed by the processor, further implements the following steps: sending the receiving time of the feedback packet to the slave clock terminal, so as to instruct the slave clock terminal to determine the offset according to the service arrival time, the receiving time of the synchronization packet, the sending time of the feedback packet, the receiving time of the feedback packet, the two-way time slot difference, and the preset time length, and perform time synchronization based on the offset.
[0105] In one embodiment, the computer program, when executed by the processor, further implements the following steps: obtaining a second forwarding time slot allocated by the optical line terminal; wherein the optical line terminal allocates a first forwarding time slot for the master clock terminal and a second forwarding time slot for the slave clock terminal; the first forwarding time slot allocated by the optical line terminal is earlier than the second forwarding time slot in the same period; receiving the synchronization packet sent by the master clock terminal and determining the receiving time of the synchronization packet; the service arrival time is included in the synchronization packet; determining the sending time of the feedback packet according to the service arrival time and the preset time length; sending the feedback packet to the master clock terminal based on the second forwarding time slot; the receiving time of the synchronization packet and the sending time of the feedback packet are included in the feedback packet; receiving the offset sent by the master clock terminal and performing time synchronization based on the offset.
[0106] In one embodiment, the computer program, when executed by the processor, further implements the following steps: receiving the receiving time of the feedback packet sent by the master clock terminal; determining the offset according to the service arrival time, the receiving time of the synchronization packet, the sending time of the feedback packet, the receiving time of the feedback packet, the two-way time slot difference, and the preset time length; the two-way time slot difference is the difference between the start time of the first forwarding time slot and the start time of the second forwarding time slot in the same period; performing time synchronization based on the offset.
[0107] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.
[0108] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.
[0109] The technical features of the above embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present application.
[0110] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A method for time synchronization in a passive optical network system, the passive optical network system comprising an optical line terminal, a master clock terminal and a slave clock terminal, the method being applied in the master clock terminal, and the method comprising: obtaining a first forwarding time slot allocated by the optical line terminal, wherein the optical line terminal allocates a first forwarding time slot for the master clock terminal and a second forwarding time slot for the slave clock terminal, and the first forwarding time slot is earlier than the second forwarding time slot in a same period; sending a synchronization message to the slave clock terminal based on the first forwarding time slot, wherein the synchronization message comprises a service arrival time; receiving a feedback message sent by the slave clock terminal, wherein the feedback message comprises a receiving time of the synchronization message and a sending time of the feedback message, and the sending time of the feedback message is determined by the slave clock terminal according to the service arrival time and a preset time length, and the preset time length is consistent with a period length; querying a bidirectional time slot difference value from the optical line terminal, wherein the bidirectional time slot difference value is a difference between a start time of the first forwarding time slot and a start time of the second forwarding time slot in a same period; determining an offset based on the service arrival time, the receiving time of the synchronization message, the sending time of the feedback message, the receiving time of the feedback message, the bidirectional time slot difference value and the preset time length; and sending the offset to the slave clock terminal to instruct the slave clock terminal to perform time synchronization based on the offset. 2.The method of claim 1, wherein when the preset time length is inconsistent with the period length, the method further comprises: determining an offset based on the service arrival time, the receiving time of the synchronization message, the sending time of the feedback message, the receiving time of the feedback message, the bidirectional time slot difference value, the preset time length and the period length. 3.The method of claim 1, wherein the determining an offset based on the service arrival time, the receiving time of the synchronization message, the sending time of the feedback message, the receiving time of the feedback message, the bidirectional time slot difference value and the preset time length comprises: determining a difference between the receiving time of the synchronization message and the service arrival time to obtain a synchronization message transmission time length; determining a difference between the receiving time of the feedback message and the sending time of the feedback message to obtain a feedback message transmission time length; and determining the offset based on a difference between the synchronization message transmission time length and the feedback message transmission time length, the preset time length and the bidirectional time slot difference value, if the feedback message transmission time length is less than the synchronization message transmission time length. 4.The method of claim 3, further comprising: determining the offset based on a difference between the synchronization message transmission time length and the feedback message transmission time length and the bidirectional time slot difference value, if the feedback message transmission time length is greater than the synchronization message transmission time length. 5. The method of claim 1, after the receiving the feedback message sent by the slave clock terminal and determining the receiving time of the feedback message, the method further comprises: sending the receiving time of the feedback message to the slave clock terminal, so as to instruct the slave clock terminal to determine an offset based on the arrival time of the service, the receiving time of the synchronization message, the sending time of the feedback message, the receiving time of the feedback message, the preset time length and the two-way time slot difference, and to perform time synchronization based on the offset.
6. The method of claim 1, after the receiving the feedback message sent by the slave clock terminal and determining the receiving time of the feedback message, the method further comprises: querying the two-way time slot difference from the optical line terminal, and sending the two-way time slot difference and the receiving time of the feedback message to the slave clock terminal.
7. A time synchronization method in a passive optical network system, the passive optical network system comprising an optical line terminal, a master clock terminal and a slave clock terminal; the time synchronization method is applied to the slave clock terminal; the method comprises: obtaining a second forwarding time slot allocated by the optical line terminal; wherein the optical line terminal allocates a first forwarding time slot for the master clock terminal and a second forwarding time slot for the slave clock terminal; in a same period, the first forwarding time slot allocated by the optical line terminal is earlier than the second forwarding time slot; receiving a synchronization message sent by the master clock terminal and determining a receiving time of the synchronization message; the synchronization message comprises an arrival time of a service; determining a sending time of a feedback message based on the arrival time of the service and a preset time length; sending the feedback message to the master clock terminal based on the second forwarding time slot; the feedback message comprises the receiving time of the synchronization message and the sending time of the feedback message; and receiving an offset sent by the master clock terminal and performing time synchronization based on the offset.
8. The method of claim 7, after the sending the feedback message to the master clock terminal based on the second forwarding time slot, the method comprises: receiving a receiving time of the feedback message sent by the master clock terminal; determining an offset based on the arrival time of the service, the receiving time of the synchronization message, the sending time of the feedback message, the receiving time of the feedback message, a two-way time slot difference and the preset time length; the two-way time slot difference is a difference between a start time of the first forwarding time slot and a start time of the second forwarding time slot in a same period; and performing time synchronization based on the offset.
9. A passive optical network system, the passive optical network system comprising an optical line terminal, a master clock terminal and a slave clock terminal; wherein the master clock terminal is configured to perform the steps of the method of any one of claims 1 to 6.
10. A passive optical network system, the passive optical network system comprising an optical line terminal, a master clock terminal and a slave clock terminal; wherein the slave clock terminal is configured to perform the steps of the method of claim 7 or 8. 11.A communication device, comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the method in any one of claims 1 to 8 when executing the computer program. 12.A computer readable storage medium, having stored thereon a computer program, wherein the computer program, when executed by a processor, causes the processor to implement the steps of the method in any one of claims 1 to 8.
Citation Information
Patent Citations
Time synchronization method, apparatus and system
CN113439397A
Time synchronization method, system and device in passive optical network and storage medium
CN119299032A
Clock synchronization method, and related apparatus and device
US20240031049A1
Method for time synchronization and device and system thereof
WO2012055360A1
Method and apparatus for transmitting clock synchronization packet in e1 link
WO2014161206A1