Time synchronization method and apparatus based on optical transmission network, electronic device, and storage medium
By adding the identifier in the identification set to the delay request message, the problem of time synchronization and failed reset of delay requests of multiple user devices in the prior art is solved, and an efficient time synchronization process is realized.
Patent Information
- Application Number
- PCT/CN2024/118639
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-15
- Filing Date
- 2024-09-12
- Publication Date
- 2025-03-20
AI Technical Summary
When the existing IEEE 1588 protocol realizes time synchronization between local devices and user devices, it cannot effectively handle time synchronization between multiple user devices, and when the delay request fails, the entire synchronization process needs to be reset, resulting in inefficiency.
By adding the identifier in the identification set to the delay request message, the local device can identify the delay request message of different user devices and send delay request response messages separately, realizing time synchronization between multiple user devices and the same local device. At the same time, when the delay request fails, the user device does not need to reset the entire synchronization process, but only needs to continue to send delay request messages.
Efficient time synchronization between multiple user-side devices and local devices is achieved, reducing the waste of time and resources, and improving the efficiency of time synchronization.
Smart Images

Figure CN2024118639_20032025_PF_FP_ABST
Abstract
Description
Method, device, electronic device and storage medium for time synchronization based on optical transmission network
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on September 15, 2023, with application number 202311196894.1 and application name “A method, device and electronic device for time synchronization based on optical transmission network”, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of communication technology, and in particular to a method, device, electronic device, and storage medium for time synchronization based on an optical transmission network. Background Art
[0004] Currently, Ethernet systems use the IEEE 1588 Precision Clock Synchronization Protocol (PCSP), also known as the Precision Timing Protocol (PTP), for network measurement and control systems to achieve time synchronization between central office equipment and user equipment.
[0005] The following describes the time synchronization process between a central office device and a user-end device based on the IEEE 1588 protocol. The central office device sends a synchronization message to the user-end device. Following this, it sends a follow-up message carrying timestamp t1 (the time the central office device sent the synchronization message). The user-end device receives the synchronization message, records timestamp t2 of the synchronization message, and receives the follow-up message to obtain timestamp t1. After obtaining timestamps t1 and t2, the user-end device sends a delay request message to the central office device and records timestamp t3 of the delay request message. Upon receiving the delay request message, the central office device records timestamp t4 of the delay request message and then sends a delay request response message carrying timestamp t4 to the user-end device. After receiving the delay request response message, the user-end device obtains timestamp t4 and combines timestamps t1, t2, and t3 to determine the time offset and link delay. Based on these timestamps, the user-end device corrects its clock to achieve time synchronization with the central office device.
[0006] Summary of the Invention
[0007] Each exemplary embodiment of the present application provides a method, apparatus, electronic device, and storage medium for time synchronization based on an optical transmission network. In a first aspect, each exemplary embodiment of the present application provides a method for time synchronization based on an optical transmission network, applied to a first user terminal device, the first user terminal device being optically connected to a central office device via an optical splitter. The method includes:
[0008] selecting, according to a preset selection rule, a first identifier from one or more identifiers in a first identifier set and adding it to a delay request message, to obtain a first delay request message carrying the first identifier, wherein the preset selection rule includes a rule for selecting the first identifier from the one or more identifiers, the first identifier set is used to identify the first user terminal device, and the one or more identifiers are used to indicate delay request messages sent by the first user terminal device at different times;
[0009] sending the first delay request message to the central office device via the optical splitter; and
[0010] In response to receiving the first delay request response message carrying the time synchronization information and the first identifier, the time of the first user terminal device and the central office device is synchronized based on the time synchronization information and the first identifier.
[0011] Different user-end devices add identifiers from their respective available identifier sets to their respective delay request messages to be sent, so that when the central office device receives multiple delay request messages, it can confirm which user-end device the multiple delay request messages come from based on the identifiers in the delay request messages, and then be able to send delay request response messages to the corresponding user-end devices respectively, so that multiple user-end devices can achieve time synchronization with the same central office device.
[0012] In one embodiment, before selecting the first identifier from one or more identifiers in the first identifier set according to the preset selection rule and adding the first identifier to the delay request message, the method further includes: receiving the first identifier set from the local end device.
[0013] In one embodiment, the receiving the first identifier set from the central office device includes:
[0014] In response to the received identification request response message carrying the first identification set, the first identification set is obtained by parsing the identification request response message.
[0015] In one embodiment, before receiving the first identification set sent from the central office device, the method further includes: in response to the number of times that the continuously acquired synchronization time deviations are within the set range is greater than or equal to a first preset number, sending an identification request message carrying the first address corresponding to the first user terminal device to the central office device; and / or in response to the number of times that the continuously acquired synchronization time deviations are within the set range is less than the first preset number, performing the time synchronization on the first user terminal device.
[0016] In one embodiment, the method further includes: obtaining a synchronization time deviation of the first user terminal device in response to the received single-step synchronization clock message.
[0017] In one embodiment, the obtaining of the synchronization time deviation of the first user terminal device in response to the received single-step synchronization clock message includes: obtaining the first moment when the central office device sends the single-step synchronization clock message and the second moment when the first user terminal receives the single-step synchronization clock message in response to the received single-step synchronization clock message; and determining the synchronization time deviation based on the first moment and the second moment.
[0018] In one embodiment, the single-step synchronization clock message includes a synchronization message and a follow-up message corresponding to the synchronization message, and the response to the received single-step synchronization clock message is to obtain the first moment when the local device sends the single-step synchronization clock message and the second moment when the first user terminal receives the single-step synchronization clock message, including: obtaining the first moment in response to receiving the follow-up message; and obtaining the second moment in response to receiving the synchronization message.
[0019] In one embodiment, the single-step synchronization clock message includes port information of the central office device, and the port information indicates a port used to send the single-step synchronization clock message.
[0020] In one embodiment, the number of the one or more identifiers is based on a storage space allocated by the central office device for identifiers and a maximum splitting ratio of the optical splitter.
[0021] In one embodiment, the preset selection rule includes at least one of the following rules: randomly selecting the first identifier from the one or more identifiers, wherein the time interval between the selection of the first identifier in two adjacent times is greater than or equal to a time interval threshold; or selecting the first identifier from the one or more identifiers in a polling manner.
[0022] In one embodiment, synchronizing the time of the first user terminal device and the central office device based on the time synchronization information and the first identifier includes: obtaining a third moment when the first user terminal device sends the first delay request message based on the first identifier.
[0023] In one embodiment, synchronizing the time of the first user terminal device and the central office device based on the time synchronization information includes: parsing the first delay request response message to obtain the time synchronization information; and determining the link delay according to the time synchronization information.
[0024] In one embodiment, after determining the link delay based on the time synchronization information, the method further includes: in response to the number of times the link delay is continuously determined to be greater than or equal to the preset threshold being greater than or equal to a second preset number of times, sending a delay request message to the central office device at a first frequency, wherein the first frequency is used to indicate the frequency at which the first user terminal device sends the delay request message to the central office device; and in response to the number of times the link delay is continuously determined to be less than the preset threshold being greater than or equal to a third preset number of times, sending the delay request message to the central office device at a second frequency, wherein the second frequency is used to indicate the frequency at which the first user terminal device sends the delay request message to the central office device, and the second frequency is lower than the first frequency.
[0025] In one embodiment, the method further includes: if a first delay request response message carrying the time synchronization information and the first identifier is not received within a preset time, sending a second delay request message carrying a second identifier to the local end device, wherein the second identifier is an identifier selected from the one or more identifiers according to the preset selection rule, and the second identifier is different from the first identifier.
[0026] In one embodiment, before selecting the first identifier from the first identifier set according to a preset selection rule and adding it to the generated delay request message, it also includes: in response to the synchronization time deviation determined multiple times in succession being within the set range, sending an identifier request message carrying a first address to the local end device, wherein the synchronization time deviation is the difference between the moment when the first user end device receives the synchronization message and the moment when the local end device sends the synchronization message, and the first address is used to identify the first user end device; when receiving an identifier request response message carrying the first identifier set, parsing the identifier request response message to obtain the first identifier set.
[0027] After the synchronization time deviation stabilizes within the set range, the identifier request message is sent to the central office device. This reduces the packet loss rate of the identifier request message and the identifier request response message. The purpose of sending the identifier request message to the central office device is to allow the central office device to assign a unique identifier set to each user-end device. This allows the central office device to determine the identifier set to which the identifier belongs based on the identifier in the delay request message, and then determine the corresponding user-end device based on the identifier set.
[0028] In one embodiment, the receiving of the first delay request response message carrying the time synchronization information and the first identifier includes: determining whether the first delay request response message carrying the time synchronization information and the first identifier is received; if so, parsing the first delay request response message to obtain the time synchronization information, and determining the link delay based on the time synchronization information; if not, resending the second delay request message carrying the second identifier to the local end device, wherein the second identifier belongs to the first identifier set.
[0029] In the current time synchronization scheme, when a delay request fails, the user-end device will stop sending delay request messages, wait for the central office device to start sending synchronization messages again, and reset the entire synchronization process. In this application, when the user-end device's delay request fails, that is, no delay request response message is received, there is no need to reset the entire synchronization process. The user-end device only needs to continue to resend the delay request message to the central office device. Compared with resetting the entire synchronization process, this processing method reduces the waste of time and resources, and improves the efficiency of time synchronization between the user-end device and the central office device.
[0030] In one embodiment, after determining the link delay based on the time synchronization information, it also includes: judging whether the link delays determined for multiple consecutive times are all less than a preset threshold; if not, resending the delay request message carrying the identifier in the first identifier set to the local end device at a first frequency; if so, resending the delay request message carrying the identifier in the first identifier set to the local end device at a second frequency, wherein the second frequency is lower than the first frequency.
[0031] When the user-end device is not online, the uplink bandwidth is low and the uplink traffic is unstable. At this time, the packet loss rate of the delay request message sent by the user-end device is high. By increasing the sending frequency of the delay request message, the probability of the delay request message being successfully received is increased. When the link delay determined for multiple consecutive times is less than the preset threshold, it means that the user-end device is online, so the sending frequency of the delay request message can be reduced, thereby reducing the delay request messages and delay request response messages in the optical transmission network and preventing congestion in the optical transmission network.
[0032] In one embodiment, in response to the synchronization time deviation determined multiple times in succession being within a set range, before sending an identification request message carrying the first address to the local end device, it also includes: receiving the synchronization message and the follow-up message via the optical splitter; recording the reception time of the synchronization message, and obtaining the sending time of the synchronization message sent by the local end device from the follow-up message; and determining the synchronization time deviation based on the sending time and the receiving time.
[0033] In a second aspect, each exemplary embodiment of the present application provides a method for time synchronization based on optical communication, the method being applied to a central office device, the central office device optically communicating with a plurality of user-end devices via an optical splitter, the method comprising:
[0034] Upon receiving a first delay request message carrying a first identifier sent by a first user terminal device, determining a first identifier set to which the first identifier belongs, wherein different identifier sets correspond to different user terminal devices, and identifiers in the same identifier set are used to distinguish delay request messages sent by the same user terminal device at different times;
[0035] Determining the first user terminal device corresponding to the first identifier set according to a correspondence between the identifier set and the user terminal device;
[0036] A first delay request response message carrying time synchronization information and the first identifier is sent to the first user terminal device via the optical splitter, wherein the first user terminal device is any one of a plurality of user terminal devices.
[0037] When the local device receives a delay request message, it determines the identifier set to which the identifier belongs based on the identifier in the delay request message, and then determines the corresponding user-end device based on the identifier set, and then sends the corresponding delay request response message to the corresponding user-end device. This avoids the situation where when multiple user-end devices are connected to the local device, it is impossible to confirm which user-end device the delay request message comes from, and thus the delay request response message cannot be accurately sent to the corresponding user-end device.
[0038] In one embodiment, before determining the first identifier set to which the first identifier belongs, it also includes: when receiving an identifier request message sent by the first user terminal device, parsing the identifier request message to obtain a first address, wherein the first address is used to identify the first user terminal device; determining the first user terminal device based on the first address, and assigning the first identifier set to the first user terminal device; and sending an identifier request response message carrying the first identifier set to the first user terminal device based on the first address.
[0039] An identification request message type is added to the original IEEE1588 protocol. The user end sends an identification request message to the central office device, and the central office device sends an identification request response message carrying an identification set to the user end device. Each user end device is assigned a unique identification set, which makes it easier for the subsequent central office device to determine the identification set to which the identification belongs based on the identification in the delay request message, and then determine the corresponding user end device based on the identification set.
[0040] In one embodiment, after sending the identification request response message carrying the first identification set to the first user terminal device, it also includes: determining whether the first address is resolved again in the identification request message received within a preset time period; if so, sending the identification request response message carrying the first identification set to the first user terminal device corresponding to the first address; if not, and a second address is resolved in the identification request message received within the preset time period, sending the identification request response message carrying the first identification set to the second user terminal device corresponding to the second address, wherein the second address is used to identify the second user terminal device, and the second user terminal device is a newly connected user terminal device.
[0041] When the first user terminal device goes offline, the allocation of the first identification set is suspended. When the first user terminal device is replaced by a new user terminal device, the first identification set is directly allocated to the new user terminal device for use, thereby avoiding waste of identification resources.
[0042] In one embodiment, when the identification request message sent by the first user terminal device is received, before parsing the identification request message to obtain the first address, it also includes: when the local terminal device sends the synchronization message and the follow-up message, obtaining the port number in the header information of the synchronization message and the port number in the header information of the follow-up message; and sending the synchronization message and the follow-up message to the splitter corresponding to the port number.
[0043] When generating a PTP message, the central office device fills the header information of the PTP message with the ports that can use the IEEE1588 standard protocol, thereby controlling the generated PTP message to be sent to the optical splitters corresponding to these ports.
[0044] In a third aspect, each exemplary embodiment of the present application provides a device for time synchronization based on an optical transmission network, wherein the device is a first user terminal device, or the device is applied to the first user terminal device, and the first user terminal device optically communicates with the central office device through an optical splitter, and the device includes:
[0045] a message generating unit, selecting a first identifier from a first identifier set according to a preset selection rule and adding it to the generated delay request message, thereby obtaining a first delay request message carrying the first identifier, wherein different identifier sets correspond to different user terminal devices, and identifiers in the same identifier set are used to distinguish delay request messages sent by the same user terminal device at different times;
[0046] a message sending unit, configured to send the first delay request message to the central office device via the optical splitter;
[0047] The message receiving unit receives a first delay request response message carrying time synchronization information and the first identifier, wherein the time synchronization information is used to synchronize the time of the first user terminal device with the central office device.
[0048] In one embodiment, the device is also used to: in response to the synchronization time deviation determined multiple times in succession being within a set range, send an identification request message carrying a first address to the local end device, wherein the synchronization time deviation is the difference between the moment when the first user end device receives the synchronization message and the moment when the local end device sends the synchronization message, and the first address is used to identify the first user end device; when receiving an identification request response message carrying the first identification set, parse the identification request response message to obtain the first identification set.
[0049] In one embodiment, the message receiving unit is used to: determine whether the first delay request response message carrying the time synchronization information and the first identifier is received; if so, parse the first delay request response message to obtain the time synchronization information, and determine the link delay based on the time synchronization information; if not, resend the second delay request message carrying the second identifier to the local end device, wherein the second identifier belongs to the first identifier set.
[0050] In one embodiment, the device is also used to: determine whether the delays of multiple consecutive links are all less than a preset threshold; if not, resend the delay request message carrying the identifier in the first identifier set to the local end device according to a first frequency; if so, resend the delay request message carrying the identifier in the first identifier set to the local end device according to a second frequency, wherein the second frequency is lower than the first frequency.
[0051] In a fourth aspect, each exemplary embodiment of the present application further provides a device for time synchronization based on optical communication, wherein the device is a central office device, or the device is applied to the central office device, and the central office device optically communicates with multiple user-end devices through an optical splitter, and the device includes:
[0052] a first determining unit, upon receiving a first delay request message carrying a first identifier sent by a first user terminal device, determining a first identifier set to which the first identifier belongs, wherein different identifier sets correspond to different user terminal devices, and identifiers in the same identifier set are used to distinguish delay request messages sent by the same user terminal device at different times;
[0053] a second determining unit, determining the first user terminal device corresponding to the first identification set according to a correspondence between the identification set and the user terminal device;
[0054] The message sending unit sends the first delay request response message carrying the time synchronization information and the first identifier to the first user terminal device via the optical splitter, wherein the first user terminal device is any one of the multiple user terminal devices.
[0055] In one embodiment, the device is also used to: when receiving an identification request message sent by the first user terminal device, parse the identification request message to obtain a first address, wherein the first address is the physical address of the first user terminal device; determine the first user terminal device based on the first address, and assign the first identification set to the first user terminal device; and send an identification request response message carrying the first identification set to the first user terminal device based on the first address.
[0056] In one embodiment, the device is also used to: determine whether the first address is resolved again in the identification request message received within a preset time period; if so, send an identification request response message carrying the first identification set to the first user terminal device corresponding to the first address; if not, and a second address is resolved in the identification request message received within the preset time period, send an identification request response message carrying the first identification set to the second user terminal device corresponding to the second address, wherein the second address is used to identify the second user terminal device, and the second user terminal device is a newly connected user terminal device.
[0057] In a fifth aspect, each exemplary embodiment of the present application provides an electronic device, the electronic device comprising:
[0058] Memory for storing computer programs;
[0059] The processor is configured to implement the above-mentioned method steps for time synchronization based on optical communication when executing the computer program stored in the memory.
[0060] In a sixth aspect, each exemplary embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements the above-mentioned method steps of time synchronization based on optical communication.
[0061] In a seventh aspect, each exemplary embodiment of the present application provides a computer program product, wherein the computer program product stores a computer program, and when the computer program is executed by a processor, the computer program implements the above-mentioned method steps of time synchronization based on optical communication.
[0062] For each of the above-mentioned aspects from the second to the seventh aspect and the technical effects that may be achieved by each aspect, please refer to the above-mentioned description of the technical effects that can be achieved by the first aspect or various possible solutions in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. Obviously, the drawings introduced below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0064] FIG1 is a schematic diagram of an Ethernet Passive Optical Network (EPON) system provided in an embodiment of the present application.
[0065] FIG2 is a schematic diagram of a time synchronization method based on an optical transmission network provided in an embodiment of the present application.
[0066] FIG3 is a schematic diagram of a process of allocating an identification set by a central office device according to an embodiment of the present application.
[0067] FIG4 is a schematic diagram of an application scenario of a time synchronization method based on an optical transmission network provided in an embodiment of the present application.
[0068] FIG5 is a schematic diagram of an application scenario of a time synchronization method based on an optical transmission network provided in an embodiment of the present application.
[0069] FIG6 is a schematic diagram of a time synchronization method based on an optical transmission network provided in an embodiment of the present application.
[0070] FIG7 is a schematic diagram of a process of requesting allocation of an identification set by a user terminal device according to an embodiment of the present application.
[0071] FIG8 is a timing diagram of messages sent between an optical line terminal (OLT) and an optical network unit (ONU) according to an embodiment of the present application.
[0072] FIG9 is a schematic diagram of a time synchronization device based on an optical transmission network provided in an embodiment of the present application.
[0073] FIG10 is a schematic diagram of a time synchronization device based on an optical transmission network provided in an embodiment of the present application.
[0074] FIG11 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0075] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of the technical solutions of this application, but not all of them. Based on the embodiments described in this application document, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the technical solutions of this application.
[0076] In addition, the terms "comprising" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, systems, products, or devices. "Multiple" in this application can mean at least two, for example, two, three, or more, and the embodiments of this application are not limited thereto.
[0077] In the description of this application, "multiple" is understood to mean "at least two." "And / or" describes the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. A and B are connected, which can mean: A and B are directly connected, and A and B are connected through C. In addition, in the description of this application, words such as "first" and "second" are used only for the purpose of distinguishing descriptions and should not be understood as indicating or implying relative importance or order.
[0078] Currently, the IEEE 1588 protocol is mostly used to achieve time synchronization between central office equipment and connected user-end devices. The process for achieving time synchronization is described as follows. The central office device uses the IEEE 1588 protocol to send a synchronization message to the user-end device. After sending the synchronization message, it sends a follow-up message carrying timestamp t1 (the time when the central office device sent the synchronization message). The user-end device receives the synchronization message, records timestamp t2 of receiving the synchronization message, and receives the follow-up message to obtain timestamp t1. After obtaining timestamps t1 and t2, the user-end device sends a delay request message to the central office device and records timestamp t3 of sending the delay request message. When the central office device receives the delay request message, it records timestamp t4 of receiving the delay request message and then sends a delay request response message carrying timestamp t4 to the user-end device. After receiving the delay request response message, the user-end device obtains timestamp t4 and combines timestamps t1, t2, and t3 to determine the time deviation and link delay. The clock is corrected based on the time deviation and link delay to achieve time synchronization with the central office device.
[0079] During the IEEE 1588-based time synchronization between client devices and central office devices, if a client device's delay request fails—that is, if it fails to receive a delay request response message from the central office—the entire synchronization process is reset, and the central office device restarts sending synchronization messages to the client device. This means that when a central office device communicates with multiple client devices, resetting the entire synchronization process can significantly reduce the efficiency of time synchronization between the client and central office devices, resulting in wasted time.
[0080] In addition, the current IEEE 1588 protocol is only applicable to the scenario where one central office device synchronizes one user-end device, and cannot be applied to the scenario where one central office device synchronizes multiple user-end devices. This is because during the synchronization process, each user-end device will periodically send a delay request message to the central office device. Each delay request message sent by the same user-end device will carry an ID, and the IDs all increase from 0. This results in the existence of delay request messages with the same ID among the delay request messages received by the central office device. For example, the central office device in Figure 1 receives a delay request message with ID 1 sent by user-end device 1 at time t1, and receives a delay request message with ID 1 sent by user-end device 3 at time t2. Therefore, the central office device cannot determine which user-end device sent the delay request messages with the same ID, and thus cannot correctly send a delay request response message carrying timestamp t4 to the corresponding user-end device, which in turn causes the user-end device to be unable to achieve time synchronization with the central office device.
[0081] Each exemplary embodiment of the present application provides a method for time synchronization based on an optical transmission network. The present application will be further described in detail below with reference to the accompanying drawings.
[0082] 2 is a flow chart of a method for time synchronization based on optical communication provided in an embodiment of the present application. The method is applied to a central office device, which optically communicates with multiple user-end devices via an optical splitter. The method includes the following steps:
[0083] S201, when receiving a first delay request message carrying a first identifier sent by a first user terminal device, determining a first identifier set to which the first identifier belongs;
[0084] S202, determining a first user terminal device corresponding to a first identification set based on a correspondence between identification sets and user terminal devices; and
[0085] S203: Send a first delay request response message carrying the time synchronization information and the first identifier to the first user terminal device via the optical splitter.
[0086] In an embodiment of the present application, the above method can be applied to the network topology shown in Figure 1. The first delay request message is uploaded by the first user terminal device, and the first user terminal device is any one of n user terminal devices, where n is an integer greater than 1. Before the first user terminal device uploads the first delay request message, the central office device is required to allocate a first identifier set to the first user terminal device. The first identifier set includes multiple identifiers, which are used to be added to the delay request message sent by the first user terminal device to distinguish the delay request messages sent by the first user terminal device at different times. Different identifier sets are assigned to different user terminal devices, and the identifiers in the same identifier set are used to distinguish the delay request messages sent by the same user terminal device at different times. The following specifically describes the process of the central office device allocating the first identifier set to the first user terminal device.
[0087] Referring to FIG. 3 , FIG. 3 is a schematic diagram of a process of allocating a first identification set by a central office device to a first user terminal device.
[0088] S301: Send a synchronization message to n user terminal devices, and record the first moment of sending the synchronization message.
[0089] Specifically, during the time synchronization process between a central office device and its n connected user-end devices, the central office device first broadcasts a Sync message and records the first moment the Sync message is sent. The Sync message can be a PTP message, and the Sync message can be sent either periodically or regularly.
[0090] It should be noted that there is a portIdentity in the IEEE1588 standard protocol header information, which is used to indicate the port (interface) number under different network cards, indicating that the port uses the IEEE1588 standard protocol, that is, PTP messages can be sent through this port.
[0091] PortIdentity only applies to scenarios where a network card has only one port, for example, port 1 corresponds to OLT 1, and port 2 corresponds to OLT 2 (OLT is an optical line terminal, a type of central office equipment). If the central office equipment's network card has multiple ports that use the IEEE 1588 standard, as shown in Figure 4, where an OLT's network card has three ports that use the IEEE 1588 standard: port 3, port 4, and port 5, then it is impossible to determine which port to send PTP messages from.
[0092] Therefore, in an embodiment of the present application, when a network card of a central office device has multiple ports that can use the IEEE1588 standard protocol, the reserved field of the PTP message standard header information is filled with the serial numbers of these ports. When sending a PTP message, after parsing the reserved field, the PTP message can be controlled to be sent to the corresponding port. For example, a central office device has ports that can use the IEEE1588 standard protocol: port3, port4, and port5. When a PTP message needs to be sent to port3, the reserved field of the PTP message standard header information is filled with the serial number of port3. When a PTP message needs to be sent to both port3 and port4, the reserved field of the PTP message standard header information is filled with the serial numbers of port3 and port4.
[0093] S302: Send a follow-up message carrying the first moment to n user terminal devices.
[0094] Specifically, after the central office device records the first moment of sending the synchronization message, it encapsulates the information indicating the first moment into, for example, a Follow_up message, and sends the Follow_up message to n user-end devices. The Follow_up message is a multicast PTP message. It should be understood that in an embodiment of the present invention, all user-end devices connected under the same optical splitter are a group.
[0095] When the first user terminal device receives a Sync message, it records the second moment of receipt of the Sync message. When it receives a Follow_up message, it obtains the first moment from the Follow_up message and then calculates the synchronization time offset between the second moment and the first moment. Since Sync messages are sent periodically, Follow_up messages are also sent periodically. A synchronization time offset is obtained each time a Sync message and a Follow_up message are sent. When the synchronization time offsets calculated multiple times are all within a set range, for example, when the synchronization time offsets calculated multiple times are all within a sub-microsecond range for a preset number of times, such as three times, the first user terminal device begins to send an identification request message to the central office device to request that the central office device assign it an identification set. The identification request message carries a first address, which is used to identify the first user terminal device. Any information that can uniquely identify a user terminal device can be used as the first address, such as the MAC address (physical address) of the first user terminal device. Because the MAC address of each user terminal device is unique, the central office device can determine the user terminal device requesting the assignment of the identification set based on the MAC address in the identification request message.
[0096] S303: When the identification request message is received, the identification request message is parsed to obtain the first address.
[0097] In an embodiment of the present application, when the client device receives an identification request message, it parses the identification request message to obtain a first address, which is used to identify the first user terminal device. The first address is the MAC address of the first user terminal device.
[0098] It is worth noting that the existing IEEE 1588 standard protocol does not contain an identification request message type. The method provided in the embodiment of the present application adds an identification request message type to the IEEE 1588 standard protocol for requesting and allocating identification. The identification request message type includes: an identification request message and an identification request response message. The identification request message and the identification request response message can be Layer 2 MAC messages.
[0099] S304: Determine a first user terminal device according to the first address, and assign a first identifier set to the first user terminal device.
[0100] Specifically, the central office device determines the first user terminal device according to the first address, and allocates a first identification set to the first user terminal device.
[0101] In one embodiment, the process of allocating an identifier set may be as follows: the total number of identifiers in the identifier set of each user-end device is calculated based on the set total identifier range and the maximum splitting ratio of the optical splitter connected to the central office device. Taking FIG5 as an example, if the set total identifier range is 0x00 to 0xffff, that is, 0 to 65535 characters, and there are 32 ports of the optical splitter connected to a central office device OLT in FIG5, then the maximum splitting ratio is 1:32, and the total number of identifiers available for each user-end device ONU connected to the optical splitter is 65536 ÷ 32 = 2048 characters.
[0102] In addition, the order of assigning identification sets to each user terminal device can be based on the order of receiving identification request messages sent by different user terminal devices. As shown in Figure 5, after receiving the identification request message sent by ONU1, a first identification set is assigned to ONU1, and the identification range of the first identification set is 0 to 2047 characters, for example, the first identification set is {0, 1, 2, 3, ..., 2047}; after receiving the identification request message sent by ONU2, a second identification set {2048, 2049, 2050, ..., 4095} is assigned to ONU2, and the identification range of the second identification set is 2048 to 4095 characters. Subsequently, an identification set is assigned to each ONU in turn, which will not be repeated here.
[0103] S305: Send an identification request response message carrying a first identification set to the first user terminal device according to the first address.
[0104] Specifically, after the local device assigns a first identification set to the first user terminal device, the first identification set is encapsulated into an identification request response message, and the identification request response message is sent to the first user terminal device corresponding to the first address according to the resolved first address. Here, the method of sending the identification request response message can be unicast sending, and the embodiment of the present application does not limit the method of sending the identification request response message.
[0105] When the first user terminal device receives the identification request response message carrying the first identification set, it parses the identification request response message to obtain the first identification set, selects the first identification from the first identification set, adds the first identification to the generated delay request message, obtains the first delay request message carrying the first identification, and then sends the first delay request message to the local terminal device.
[0106] In the embodiment of the present application, the central office device may execute the operation of S201 in response to receiving the first delay request message sent by the first user terminal device.
[0107] S201: When receiving a first delay request message carrying a first identifier sent by a first user terminal device, determine a first identifier set to which the first identifier belongs.
[0108] Specifically, after receiving the first delay request message, the local device parses the first delay request message to obtain the first identifier, and determines the first identifier set to which the first identifier belongs based on the first identifier.
[0109] S202: Determine a first user terminal device corresponding to a first identification set according to a correspondence between identification sets and user terminal devices.
[0110] It is worth noting that different identification sets contain different identifications, and different identification sets are allocated to different user terminal devices. The identifications in the same identification set are used to distinguish delay request messages sent by the same user terminal device at different times.
[0111] Specifically, after determining the first identifier set to which the first identifier belongs, the first user terminal device corresponding to the first identifier set is determined based on the assignment relationship between each identifier set and each user terminal device, thereby determining that the first delay request message originated from the first user terminal device. For example, the assignment relationship between each identifier set and each user terminal device can be shown in Table 1 below.
[0112] Table 1
[0113] S203: Send a first delay request response message carrying the time synchronization information and the first identifier to the first user terminal device via the optical splitter.
[0114] Specifically, the time synchronization information is the reception time when the local terminal device receives the first delay request message. When the local terminal device receives the first delay request message, it will record the reception time of the first delay request message as the time synchronization information. After determining that the first identifier set to which the first identifier belongs corresponds to the first user terminal device, the time synchronization information is packaged into the first delay request response message, and the first identifier is also added to the first delay request response message. Then, the first delay request response message carrying the time synchronization information and the first identifier is sent to the first user terminal device. The method of sending the first delay request response message can be unicast sending. The embodiment of the present application does not limit the method of sending the delay request response message.
[0115] In the above method, the central office device assigns a different and non-overlapping set of identifiers to each user-end device, so that the central office device determines the identifier set to which the identifier belongs based on the identifier in the received delay request message, and then determines the corresponding user-end device based on the identifier set, and sends the delay request response message carrying time synchronization information and the same identifier to the corresponding user-end device, avoiding the situation where it is impossible to determine which user-end device sent the received delay request message, and thus it is impossible to accurately send the delay request response message carrying time synchronization information to the corresponding user-end device.
[0116] In addition, the local end device also adds the identifier in the received delay request message to the delay request response message carrying the time synchronization information sent, so that the corresponding user end device can obtain the sending time when the delay request message carrying the identifier is sent according to the identifier, that is, the third moment. The third moment corresponds to the time synchronization information, and then time synchronization is performed according to the third moment and the time synchronization information, thereby improving the accuracy of time synchronization.
[0117] Since the user terminal device may be offline or replaced with a new user terminal device, after sending the identification request response message carrying the first identification set to the first user terminal device, the local terminal device can also determine whether the first address is resolved again in the identification request message received within the preset time period.
[0118] In one possible implementation, if the identification request message received by the local terminal device within a preset time period resolves the first address again, it indicates that the first user terminal device has not gone offline, because the first user terminal device will periodically send identification request messages (heartbeat packet function) to the local terminal device, and the local terminal device will receive the identification request message again within the preset time period, then the local terminal device sends an identification request response message carrying the first identification set to the first user terminal device corresponding to the first address.
[0119] In a possible implementation, if the local terminal device resolves the first address again in the identification request message received within a preset time period, indicating that the first user terminal device is not offline, then an identification request response message that does not carry the first identification set is sent to the first user terminal device corresponding to the first address.
[0120] In one possible implementation, if the identification request message received by the local terminal device within a preset time period does not resolve to the first address, but resolves to the second address, and the second address is the physical address of the newly connected user terminal device, indicating that the first user terminal device is replaced by the newly connected second user terminal device, the local terminal device will send an identification request response message carrying the first identification set to the newly connected user terminal device corresponding to the second address, that is, the local terminal device will reallocate the first identification set to the newly connected user terminal device.
[0121] In one possible implementation, if the identification request message received by the local terminal device within a preset time period does not resolve the first address, and does not resolve the second address of the newly connected user terminal device, indicating that the first user terminal device has gone offline and no new user terminal device is currently connected, the local terminal device will not temporarily allocate the first identification set to the user terminal device for use.
[0122] In an embodiment of the present application, when the first user terminal device goes offline, the allocation of the first identification set is suspended. When the first user terminal device is replaced by a newly connected user terminal device, the first identification set is directly allocated to the newly connected user terminal device for use, which can avoid wasting identification resources.
[0123] 6 is a flow chart of an optical transmission method according to an embodiment of the present application. The method is applied to a first user terminal device, which optically communicates with a central office device via an optical splitter. The first user terminal device is any one of n user terminal devices. The specific implementation process of the method is as follows:
[0124] S601, according to a preset selection rule, select a first identifier from a first identifier set and add it to a generated delay request message to obtain a first delay request message carrying the first identifier;
[0125] S602, sending a first delay request message carrying a first identifier to the central office device via an optical splitter; and
[0126] S603: Receive a first delay request response message carrying time synchronization information and a first tag.
[0127] The preset selection rule is used to represent a rule for selecting the first identifier from the one or more identifiers.
[0128] In an embodiment of the present application, the first identifier set is an identifier set assigned by the central office device to the first user-end device. Different identifier sets are assigned to different user-end devices, and the identifiers in different identifier sets are different. The identifiers in the same identifier set are used to distinguish delay request messages sent by the same user-end device at different times. The user-end device sends a delay request message with an identifier added to the central office device, so that the central office device determines the identifier set described by the identifier through the identifier, and determines the user-end device that sent the delay request message through the identifier set. The following specifically describes the process by which the first user-end device requests the central office device to assign the first identifier set.
[0129] 7 , which is a flow chart of a first user terminal device requesting a central office device to allocate a first identifier set, specifically includes the following steps.
[0130] S701: When a synchronization message is received, record the second time of receiving the synchronization message.
[0131] Specifically, during synchronization between the central office device and the first user-end device, the central office device periodically broadcasts synchronization messages to each user-end device. When the first user-end device receives a Sync message, it records the second time at which the Sync message was received and the ID value of the Sync message. The Sync message ID value indicates the number of times the Sync message was sent. It is worth noting that the second time at which each user-end device receives a Sync message is random. For example, Table 2 below shows the second time at which n user-end devices receive a Sync message broadcast by the central office device.
[0132] Table 2
[0133] S702: When a follow-up message is received, the follow-up message is parsed to obtain a first time.
[0134] In the embodiment of the present application, after sending the Sync message, the central office device sends a Follow_up message (follow message) carrying the first time to each user terminal device. When each user terminal device receives the Follow_up message, it parses the Follow_up message to obtain the first time when the central office device sends the Sync message.
[0135] S703 : In response to the synchronization time deviations determined multiple times in succession being within the set range, sending an identification request message carrying the first address to the central office device.
[0136] Specifically, the synchronization time deviation is the difference between the second moment the first user-end device receives the synchronization message and the first moment the central office device sends the synchronization message. After the first user-end device obtains the first and second moments, the synchronization time deviation is calculated. Because the central office device periodically sends synchronization messages and follow-up messages carrying the first moment, the first user-end device calculates a synchronization time deviation each time it receives a synchronization message or a follow-up message. Whether to initiate the transmission of an identification request message to the central office device is determined by determining whether the calculated synchronization time deviations are consistently within a set range.
[0137] It is understandable that in other embodiments, the synchronization message and the follow-up message may also be sent in one message, for example, a single-step synchronization clock message may be used to include the synchronization message and the first moment of sending the synchronization message.
[0138] In one embodiment, in response to the received single-step synchronization clock message, a first time when the central office device sends the single-step synchronization clock message and a second time when the first user terminal receives the single-step synchronization clock message are obtained, and the synchronization time offset is determined based on the first time and the second time.
[0139] Additionally, the single-step synchronization clock message includes a synchronization message and a follow-up message corresponding to the synchronization message. Upon receiving the follow-up message, the first user terminal device obtains the first time instant, and upon receiving the synchronization message, obtains the second time instant. In this case, the first user terminal device obtains a synchronization time offset based on the first time instant and the second time instant.
[0140] When the synchronization time deviation calculated for multiple consecutive times is within the set range, for example, the synchronization time deviation calculated for three consecutive times is within the sub-microsecond range, indicating that the synchronization time deviation is stable at the sub-microsecond level, an identification request message carrying the first address is sent to the local end device. Specifically, the first address is packaged into an ID_Req message (identification request message), and the ID_Req message is sent to the local end device. The first address is used to identify the first user end device, and the first address is the MAC address of the first user end device. The identification request message can be sent irregularly or periodically.
[0141] When the synchronization time deviations calculated for multiple consecutive times are not all within the set range, for example, among the synchronization time deviations calculated for three consecutive times, only one synchronization time deviation is at the sub-microsecond level, the first user-end device calls the PHC clock through the Physical Hardware Clock Application Programming Interface (PHC APIs) to adjust the second moment of receiving the Sync message, until the synchronization time deviations calculated for three consecutive times are all at the sub-microsecond level, that is, the synchronization time deviation is less than 1 microsecond, indicating that the synchronization time deviation is stable at the sub-microsecond level, and then starts to send an identification request message carrying the first address to the local-end device.
[0142] After the synchronization time deviation is stabilized within the set range, the identification request message is sent to the central office device, which can reduce the packet loss rate of the identification request message and the identification request response message.
[0143] S704: When receiving the identification request response message carrying the first identification set, parse the identification request response message to obtain the first identification set.
[0144] Specifically, after receiving the identification request message carrying the first address, the local terminal device will determine the first user terminal device based on the first address, allocate the first identification set to the first user terminal device for use, and send an ID_Resp message (identification request response message) carrying the first identification set to the first user terminal device.
[0145] When the first user terminal device receives the ID_Resp message, it parses the ID_Resp message to obtain a first identifier set. The identifiers in the first identifier set are added to the delay request message generated by the first user terminal device to distinguish the delay request messages sent by the first user terminal device at different times.
[0146] In the embodiment of the present application, after the first user terminal device determines the first identifier set, it can start executing the operation of S601.
[0147] S601, according to a preset selection rule, select a first identifier from a first identifier set and add it to a generated delay request message to obtain a first delay request message carrying the first identifier;
[0148] Specifically, the first user terminal device generates a delay request message, selects a first identifier from the first identifier set and adds it to the generated delay request message, thereby obtaining a first delay request message carrying the first identifier, wherein the preset selection rule here can be random selection, as long as the time interval between selections of the same identifier is greater than a preset time interval threshold; for example, the preset selection rule can be: polling and selecting identifiers in the same identifier set, selecting one identifier from the same identifier set each time. Furthermore, according to the preset selection rule, the method for selecting the first identifier can be selecting from small to large in the order of the size of the identifiers in the first identifier set, or selecting from large to small, which is not limited in this embodiment of the present application.
[0149] For example, assuming that the first identifier set is characters 1 to 20, the identifiers are selected in ascending order. When the first Delay_Req message (delay request message) is generated, the first Delay_Req message is marked with character 1, that is, the ID of the first Delay_Req message is 1; when the second Delay_Req message is generated, the ID of the second Delay_Req message is 2, and so on. Until all 20 identifiers are used up, when the next Delay_Req message is generated, the identifiers of the first identifier set are used cyclically.
[0150] S602: Send a first delay request message carrying a first identifier to a central office device via an optical splitter.
[0151] Specifically, the first user terminal device sends a first delay request message carrying a first identifier to the central office device, and records a third time when the first delay request message is sent.
[0152] It should be noted that the time at which n user-end devices send delay request messages to the optical line terminal is random. The time at which any two user-end devices send delay request messages may be the same or different, and the delay request messages may be sent irregularly (irregularly periodically) or at a preset frequency (regularly periodically), for example, a delay request message may be sent every 2 seconds.
[0153] S603: Receive a first delay request response message carrying time synchronization information and a first identifier.
[0154] In an embodiment of the present application, the central office device determines the identifier set to which the identifier belongs based on the identifier in the Delay_Req message (delay request message), and then determines the user-end device corresponding to the identifier set based on the correspondence between the identifier set and the user-end device. The central office device then sends a Delay_Resq message (delay request response message) carrying time synchronization information and a first identifier to the corresponding user-end device. The time synchronization information is the reception time when the central office device receives the Delay_Resq message sent by the corresponding user-end device. This reception time is recorded as the fourth time. The fourth time is used below to describe the reception time of the Delay_Resq message.
[0155] Specifically, the first user terminal device determines whether it has received a first delay request response message carrying time synchronization information and a first identifier. If the first delay request response message is received, the first delay request response message is parsed to obtain the time synchronization information and the first identifier, where the time synchronization information is the fourth moment. Based on the first identifier, the third moment when the first delay request message carrying the first identifier was sent is obtained, and then the link delay delay and time offset offset are calculated based on the obtained first moment, second moment, third moment, and fourth moment. The specific calculation formula is: delay = ((t2-t1) + (t4-t3)) / 2, offset = ((t2-t1) - (t4-t3)) / 2.
[0156] If the first delay request response message is not received, a second delay request message carrying a second identifier is resent to the central office device, where the second identifier belongs to the first identifier set, that is, a new delay request message is regenerated and sent to the optical line terminal.
[0157] In the current time synchronization scheme, when a delay request fails, the user-end device will stop sending delay request messages, wait for the central office device to start sending synchronization messages again, and reset the entire synchronization process. In this application, when the user-end device's delay request fails, that is, no delay request response message is received, there is no need to reset the entire synchronization process. The user-end device only needs to continue to resend the delay request message to the central office device. Compared with resetting the entire synchronization process, this processing method reduces the waste of time and resources, and improves the efficiency of time synchronization between the user-end device and the central office device.
[0158] Furthermore, after determining the link delay based on the time synchronization information, it is determined whether the link delays determined for multiple consecutive times are all less than a preset threshold. Since the first user device continuously sends delay request messages to the central office device, the first user device can determine a link delay each time it receives a delay request response message carrying the time synchronization information sent by the central office device. It is determined whether the link delays determined for multiple consecutive times, for example, three consecutive times, are all less than a preset threshold. For example, according to actual needs, the preset threshold can be 100 nanoseconds, or it can be set according to the link delay value specified in the IEEE1588 protocol. If not, it means that the link delay is still unstable, then the delay request message carrying the identifier in the first identifier set is continued to be resent to the central office device at the first frequency, and the first frequency can be the same as the frequency of the previous delay request message. If yes, it means that the link delay is stable, then the delay request message carrying the identifier in the first identifier set is resent to the central office device at the second frequency, and the second frequency is lower than the first frequency.
[0159] It is worth noting that when the user-end device is not online, the uplink bandwidth is low and the uplink traffic is unstable. At this time, the packet loss rate of the delay request message sent by the user-end device is high, so the calculated link delay is unstable. Therefore, the probability of the delay request message being successfully received can be increased by increasing the sending frequency of the delay request message. When the link delay determined for many consecutive times is less than the preset threshold, it means that the ONU device is online, so the sending frequency of the delay request message can be reduced, thereby reducing the delay request messages and delay request response messages in the optical transmission network and preventing congestion in the optical transmission network.
[0160] In summary, the above method is to add an identification set application action to each user terminal device, request the central office device to allocate its own identification set, and use the identification in its own identification set to mark the delay request message generated by each. As a result, when the central office device receives different delay request messages, it can determine the identification set to which the mark belongs based on the mark in the delay request message, determine the corresponding user terminal device based on the identification set, and then send a delay request response message carrying the corresponding time synchronization information to the corresponding user terminal device, thereby avoiding the situation where the central office device cannot confirm the corresponding user terminal device.
[0161] In addition, the local end device also adds the identifier in the received delay request message to the delay request response message carrying the time synchronization information sent, so that the corresponding user end device can obtain the sending time when the delay request message carrying the identifier is sent according to the identifier, that is, the third moment. The third moment corresponds to the time synchronization information, and then time synchronization is performed according to the third moment and the time synchronization information, thereby improving the accuracy of time synchronization.
[0162] 8, taking the Ethernet optical splitting network composed of the central office device as the OLT device, the user terminal device as the ONU device and the optical splitter as an example, a complete description of the time synchronization method based on the optical transmission network provided by the present application is given.
[0163] Referring to FIG8 , it can be seen that one OLT is connected to n ONUs.
[0164] In the embodiment of the present application, first, the OLT periodically sends a Sync message to each ONU and records the timestamp t1 when the Sync message is sent. The Sync message may be a PTP multicast message.
[0165] When receiving a Sync message, the ONU will record the ID of the Sync message and the timestamp t2 of receiving the Sync message. As shown in Figure 8, the timestamp of the first ONU receiving the Sync message is t21, and the timestamp of the nth ONU receiving the Sync message is t2. n , and so on.
[0166] After sending the Sync message, the OLT will immediately send a Follow_up message to each ONU. The Follow_up message carries the timestamp t1 when the Sync message was sent. The Follow_up message is also a PTP multicast message.
[0167] The ONU captures the Follow_up message, parses the Follow_up message, and obtains the timestamp t1 when the Sync message is sent. When the ONU obtains the timestamp t1 and the timestamp t2, it calculates the synchronization time deviation, which is the difference between the timestamp t2 and the timestamp t1. It determines whether the synchronization time deviations calculated for multiple times (for example, 3 times) are all within the expected time accuracy (for example, sub-microsecond level). If so, it means that the synchronization time deviation is stable within the expected time accuracy (for example, sub-microsecond level), and then it starts sending ID_Req messages to the OLT. If not, it means that the synchronization time deviation is not stable at the sub-microsecond level. The ONU calls the PHC clock (Physical hardware clock) through the PHC APIs to adjust the timestamp t2 of the ONU receiving the Sync message until the synchronization time deviations calculated for three consecutive times are all within the sub-microsecond level, that is, the synchronization time deviations calculated for three consecutive times are all less than 1 microsecond, indicating that the synchronization time deviation is stable at the sub-microsecond level.
[0168] When the synchronization time deviation stabilizes within sub-microseconds, the ONU begins to periodically send ID_Req messages to the OLT. The ID_Req messages carry the ONU's MAC address.
[0169] After receiving the ID_Req message, the OLT parses it to obtain the MAC address, then determines the ONU corresponding to the MAC address and assigns an identifier set (i.e., a usable ID range) to that ONU. The number of identifiers in the identifier set is calculated based on the preset total number of identifiers and the maximum splitting ratio of the optical splitter. For example, if the preset total number of identifiers is 3200 and the maximum splitting ratio is 1:32, meaning that one OLT can connect 32 ONUs via an optical splitter, the number of identifiers in each ONU's identifier set is 3200 ÷ 32 = 100. ONUs are assigned identifier sets in the order in which they receive ID_Req messages. The OLT then sends an ID_Resp message carrying the identifier set to the corresponding ONU. For example, in Figure 8, the OLT sends an ID_Resp_1 message carrying the first identifier set to the first ONU and an ID_Resp_n message carrying the nth identifier set to the nth ONU.
[0170] After receiving the ID_Resp message, the ONU parses it to obtain the assigned identifier set. Each time it sends a Delay_Req message to the OLT, it selects an identifier from the identifier set and adds it to the Delay_Req message. When the ONU sends a Delay_Req message carrying an identifier, it also records the timestamp t3 of the sending of the Delay_Req message. For example, in Figure 8, the timestamp of the first ONU sending the Delay_Req_1 message carrying identifier 1 is t31.
[0171] When the OLT receives the Delay_Req message sent by each ONU, it will record the timestamp t4 when the Delay_Req message is received, and parse the Delay_Req message to obtain the identifier carried in the Delay_Req message, determine the identifier set to which the identifier belongs, and then determine the ONU corresponding to the identifier set. Then, a Delay_Resq message carrying the timestamp t4 when the Delay_Req message was received and the parsed identifier is sent to the corresponding ONU. As shown in Figure 8, the timestamp of the Delay_Req_1 message received by the OLT from the first ONU is t41. The identifier obtained by parsing the Delay_Req_1 message is 1, so the Delay_Resq_1 (t41) message carrying the timestamp t41 and the identifier 1 is sent to the first ONU; the timestamp of the Delay_Req_n message received by the OLT from the nth ONU is t4. n , the Delay_Req_n message is parsed and the identifier is n, so it is sent with timestamp t4 n and Delay_Resq_n(t4 n ) message to the nth ONU.
[0172] After receiving the Delay_Resq message, the ONU parses it to obtain timestamp t4. It then uses the identifier in the Delay_Resq message to determine the time the Delay_Req message carrying the identifier was sent, i.e., timestamp t3. The link delay and offset are calculated based on timestamps t1, t2, t3, and t4.
[0173] In the embodiment of the present application, the OLT serves as the master clock and the ONU serves as the slave clock. The difference between the slave clock and the master clock is the time offset, the transmission delay from the master clock to the slave clock is delay1, and the transmission delay from the slave clock to the master clock is delay2, see Figure 4. Timestamp t1 and timestamp t2 satisfy the equation: t1+offset+delay1=t2, timestamp t3 and timestamp t4 satisfy the equation: t3-offset+delay2=t4. In the embodiment of the present application, since the messages are all transmitted using the same physical link and the transmission delay of the physical link is fixed, it can be considered that the two-way delay is the same, that is, delay=delay1=delay2, so it can be deduced that: delay=((t2-t1)+(t4-t3)) / 2, offset=((t2-t1)-(t4-t3)) / 2.
[0174] After calculating its own link delay and time offset, each ONU can achieve time synchronization with the OLT based on the link delay and time offset.
[0175] Based on the same inventive concept, the present application also provides a device for time synchronization based on an optical transmission network. The device is a first user terminal device, or the device is applied to a first user terminal device. The first user terminal device optically communicates with the central office device via an optical splitter. Referring to FIG. 9 , the device includes:
[0176] The message generating unit 901 selects a first identifier from a first identifier set according to a preset selection rule and adds it to a generated delay request message to obtain a first delay request message carrying the first identifier, wherein different identifier sets correspond to different user terminal devices, and identifiers in the same identifier set are used to distinguish delay request messages sent by the same user terminal device at different times;
[0177] The message sending unit 902 sends the first delay request message to the central office device via the optical splitter;
[0178] The message receiving unit 903 receives a first delay request response message carrying time synchronization information and the first identifier, wherein the time synchronization information is used to synchronize time between the first user terminal device and the central office device.
[0179] In one embodiment, the device is also used to: when receiving an identification request message, parse the identification request message to obtain a first address, wherein the first address is the physical address of the first optical network unit; determine the first optical network unit based on the first address, and assign the first identification set to the first optical network unit; and send an identification request response message carrying the first identification set to the first optical network unit based on the first address.
[0180] In one embodiment, the device is also used to: in response to the synchronization time deviation determined multiple times in succession being within a set range, send an identification request message carrying a first address to the local end device, wherein the synchronization time deviation is the difference between the moment when the first user end device receives the synchronization message and the moment when the local end device sends the synchronization message, and the first address is the physical address of the first user end device; when receiving an identification request response message carrying the first identification set, parse the identification request response message to obtain the first identification set.
[0181] In one embodiment, the message receiving unit 903 is used to: determine whether the first delay request response message carrying the time synchronization information and the first identifier is received; if so, parse the first delay request response message to obtain the time synchronization information, and calculate the link delay based on the time synchronization information; if not, resend the second delay request message carrying the second identifier to the local end device, wherein the second identifier belongs to the first identifier set.
[0182] In one embodiment, the device is also used to: determine whether the link delay determined for multiple consecutive times is less than a preset threshold; if not, resend the delay request message carrying the identifier in the first identifier set to the local end device according to the first frequency; if so, resend the delay request message carrying the identifier in the first identifier set to the local end device according to the second frequency, wherein the second frequency is lower than the first frequency.
[0183] The present application also provides a device for time synchronization based on optical communication. The device is a central office device, or the device is applied to a central office device. The central office device optically communicates with multiple user-end devices through an optical splitter. Referring to FIG. 10 , the device includes:
[0184] The first determining unit 1001, upon receiving a first delay request message carrying a first identifier sent by a first user terminal device, determines a first identifier set to which the first identifier belongs, wherein different identifier sets correspond to different user terminal devices, and identifiers in the same identifier set are used to distinguish delay request messages sent by the same user terminal device at different times;
[0185] The second determining unit 1002 determines the first user terminal device corresponding to the first identification set according to the correspondence between the identification set and the user terminal device;
[0186] The message sending unit 1003 sends the first delay request response message carrying the time synchronization information and the first identifier to the first user terminal device via the optical splitter, wherein the first user terminal device is any one of the multiple user terminal devices.
[0187] In one embodiment, the device is also used to: when receiving an identification request message sent by the first user terminal device, parse the identification request message to obtain a first address, wherein the first address is the physical address of the first user terminal device; determine the first user terminal device based on the first address, and assign the first identification set to the first user terminal device; and send an identification request response message carrying the first identification set to the first user terminal device based on the first address.
[0188] In one embodiment, the device is also used to: determine whether the first address is resolved again in the identification request message received within a preset time period; if so, send an identification request response message carrying the first identification set to the first user terminal device corresponding to the first address; if not, and a second address is resolved in the identification request message received within the preset time period, send an identification request response message carrying the first identification set to the second user terminal device corresponding to the second address, wherein the second address is used to identify the second user terminal device, and the second user terminal device is a newly connected user terminal device.
[0189] Based on the same inventive concept, an embodiment of the present application further provides an electronic device that can implement the functions of the aforementioned message sending device for time synchronization. Referring to FIG. 11 , the electronic device includes:
[0190] At least one processor 1101, and a memory 1102 connected to at least one processor 1101. In the embodiments of the present application, the specific connection medium between the processor 1101 and the memory 1102 is not limited. FIG11 takes the connection between the processor 1101 and the memory 1102 via the bus 1100 as an example. The bus 1100 is represented by a bold line in FIG11, and the connection between other components is only for schematic illustration and is not intended to be limiting. The bus 1100 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, FIG11 only uses a bold line to represent it, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 1101 can also be called a controller, and there is no restriction on the name.
[0191] In this embodiment of the present application, memory 1102 stores instructions executable by at least one processor 1101. At least one processor 1101 can execute the message sending method for time synchronization discussed above by executing the instructions stored in memory 1102. Processor 1101 can implement the functions of each unit in the apparatus shown in Figures 9 and 10.
[0192] Among them, the processor 1101 is the control center of the device, which can use various interfaces and lines to connect the various parts of the entire control device, and monitor the device as a whole by running or executing instructions stored in the memory 1102 and calling data stored in the memory 1102, the various functions of the device and processing data.
[0193] In one embodiment, processor 1101 may include one or more processing units. Processor 1101 may integrate an application processor and a modem processor. The application processor primarily processes the operating system, user interface, and application programs, while the modem processor primarily processes wireless communications. It is understood that the modem processor may not be integrated into processor 1101. In some embodiments, processor 1101 and memory 1102 may be implemented on the same chip. In some embodiments, they may also be implemented on separate chips.
[0194] The processor 1101 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the message sending method for time synchronization disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.
[0195] Memory 1102 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. Memory 1102 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. Memory 1102 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 1102 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0196] By designing and programming the processor 1101, the code corresponding to the message sending method for time synchronization described in the aforementioned embodiment can be embedded in the chip, thereby enabling the chip to execute the steps of the message sending method for time synchronization in the embodiment shown in FIG2 during operation. Designing and programming the processor 1101 is well known to those skilled in the art and will not be further described here.
[0197] Based on the same inventive concept, an embodiment of the present application further provides a storage medium storing computer instructions. When the computer instructions are executed on a computer, the computer executes the message sending method for time synchronization discussed above.
[0198] In some possible implementations, various aspects of the message sending method for time synchronization provided in the present application can also be implemented in the form of a program product, which includes program code. When the program product is run on the device, the program code is used to enable the control device to execute the steps of the message sending method for time synchronization according to various exemplary embodiments of the present application described above in this specification.
[0199] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0200] The present application is described with reference to the flow chart and / or block diagram of the method, device (system), and computer program product according to the embodiment of the present application. It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow process and / or box in the flow chart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processing machine or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one flow chart flow or multiple flows and / or one box or multiple boxes of the block diagram.
[0201] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0202] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0203] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A method for time synchronization based on an optical transmission network, applied to a first user terminal device, wherein the first user terminal device is optically connected to a central office device via an optical splitter, the method comprising: According to a preset selection rule, a first identifier is selected from one or more identifiers in a first identifier set and added to a delay request message, so as to obtain a first delay request message carrying the first identifier, wherein the preset selection rule includes a rule for selecting the first identifier from the one or more identifiers, the first identifier set is used to identify the first user terminal device, and the one or more identifiers are used to indicate delay request messages sent by the first user terminal device at different times; sending the first delay request message to the central office device via the optical splitter; and In response to receiving the first delay request response message carrying the time synchronization information and the first identifier, the time of the first user terminal device and the local terminal device are synchronized based on the time synchronization information and the first identifier.
2. The method of claim 1, wherein: Before selecting the first identifier from one or more identifiers in the first identifier set according to the preset selection rule and adding the first identifier to the delay request message, the method further includes: Receive the first identification set from the central office device.
3. The method of claim 2, wherein: The receiving the first identification set from the central office device includes: In response to a received identification request response message carrying the first identification set, the first identification set is acquired by parsing the identification request response message.
4. The method according to any one of claims 1 to 3, wherein: Before receiving the first identification set sent from the central office device, the method further includes: In response to the number of times that the continuously acquired synchronization time deviations are all within a set range being greater than or equal to a first preset number, sending an identification request message carrying a first address corresponding to the first user terminal device to the central office device; and / or In response to the number of times that the continuously acquired synchronization time deviations are all within the set range is less than a first preset number, the time synchronization is performed on the first user terminal device.
5. The method of claim 4, wherein: The method further comprises: In response to the received single-step synchronization clock message, the synchronization time deviation of the first user terminal device is obtained.
6. The method of claim 5, wherein: The acquiring, in response to the received single-step synchronization clock message, the synchronization time deviation of the first user terminal device comprises: In response to the received single-step synchronization clock message, acquiring a first time when the central office device sends the single-step synchronization clock message and a second time when the first user terminal receives the single-step synchronization clock message; and The synchronization time offset is determined based on the first time and the second time.
7. The method of claim 6, wherein: The single-step synchronization clock message includes a synchronization message and a follow-up message corresponding to the synchronization message, and the step of acquiring, in response to the received single-step synchronization clock message, the first moment when the central office device sends the single-step synchronization clock message and the second moment when the first user terminal receives the single-step synchronization clock message includes: In response to receiving the follow-up message, acquiring the first time; and In response to receiving the synchronization message, the second time is acquired.
8. The method according to any one of claims 5 to 7, wherein: The single-step synchronous clock message includes the port information of the local end device, and the port information indicates the port used to send the single-step synchronous clock message.
9. The method according to any one of claims 1 to 8, wherein: The number of the one or more identifiers is based on the storage space allocated by the central office device for the identifiers and the maximum splitting ratio of the optical splitter.
10. The method according to any one of claims 1 to 9, wherein: The preset selection rule includes at least one of the following rules: Randomly select the first identifier from the one or more identifiers, wherein the time interval between two consecutive times when the first identifier is selected is greater than or equal to a time interval threshold; or The first identifier is selected from the one or more identifiers in a polling manner.
11. The method according to any one of claims 1 to 10, wherein: The synchronizing the time of the first user terminal device and the central office device based on the time synchronization information and the first identifier includes: A third moment when the first user terminal device sends the first delay request message is obtained based on the first identifier.
12. The method according to any one of claims 1 to 11, wherein: The step of synchronizing the time of the first user terminal device and the central office device based on the time synchronization information includes: Parsing the first delay request response message to obtain the time synchronization information; A link delay is determined according to the time synchronization information.
13. The method of claim 12, wherein: After determining the link delay according to the time synchronization information, the method further includes: In response to the number of times that the link delay is continuously determined to be greater than or equal to the preset threshold being greater than or equal to a second preset number of times, sending a delay request message to the central office device at a first frequency, wherein the first frequency is used to instruct the first user terminal device to send a delay request message to the central office device. The frequency at which the delay request message is sent by the device; and In response to the number of times the link delay is continuously determined to be less than the preset threshold being greater than or equal to the third preset number of times, the delay request message is sent to the local end device at a second frequency, wherein the second frequency is used to indicate the frequency at which the first user end device sends the delay request message to the local end device, and the second frequency is lower than the first frequency.
14. The method according to any one of claims 1 to 13, wherein: The method further comprises: If the first delay request response message carrying the time synchronization information and the first identifier is not received within the preset time, a second delay request message carrying a second identifier is sent to the local end device, wherein the second identifier is an identifier selected from the one or more identifiers according to the preset selection rule, and the second identifier is different from the first identifier.
15. A method for time synchronization based on optical communication, the method being applied to a central office device, the central office device being optically connected to a first user terminal device via an optical splitter, the method comprising: In response to a received first delay request message carrying a first identifier, determining a first identifier set to which the first identifier belongs, wherein the first identifier set is used to identify the first user terminal device, and one or more identifiers in the first identifier set are used to indicate delay request messages sent by the first user terminal device at different times; Determining the first user terminal device corresponding to the first identification set according to the correspondence between the first identification set and the first user terminal device; and A first delay request response message carrying time synchronization information and the first identifier is sent to the first user terminal device via the optical splitter, wherein the time synchronization information and the first identifier are used by the first user terminal device to synchronize the time of the first user terminal device with the central office device based on the time synchronization information and the first identifier.
16. The method of claim 15, wherein: Before determining the first identifier set to which the first identifier belongs, the method further includes: In response to receiving an identification request message sent by the first user terminal device, parsing the identification request message to obtain a first address, wherein the first address is used to identify the first user terminal device; determining the first user terminal device according to the first address, and assigning the first identification set to the first user terminal device; and According to the first address, an identification request response message carrying the first identification set is sent to the first user terminal device.
17. A device for time synchronization based on an optical transmission network, the device being applied to the first user end device, the first user end device optically communicating with the central office device via an optical splitter, the device comprising: a message generating unit, configured to select a first identifier from one or more identifiers in a first identifier set according to a preset selection rule, add the first identifier to a delay request message, and obtain a first delay request message carrying the first identifier, wherein the preset selection rule includes a rule for selecting the first identifier from the one or more identifiers, the first identifier set is used to identify the first user terminal device, and the one or more identifiers are used to indicate delay request messages sent by the first user terminal device at different times; a message sending unit, configured to send the first delay request message to the central office device via the optical splitter; and The message receiving unit is configured to, in response to receiving a first delay request response message carrying time synchronization information and the first identifier, synchronize the time of the first user terminal device with the local terminal device based on the time synchronization information and the first identifier.
18. A time synchronization system based on optical communication, the system comprising a central office device and a plurality of user-end devices connected to the central office device via an optical splitter, wherein the plurality of user-end devices comprises a first user-end device, in, The first user terminal device is configured to select a first identifier from one or more identifiers in the first identifier set according to a preset selection rule, add it to the delay request message, obtain a first delay request message carrying the first identifier, and send the first delay request message carrying the first identifier to the local terminal device; The central office device is configured to, in response to receiving the first delay request message carrying the first identifier, determine a first identifier set to which the first identifier belongs; and determine the first user terminal device corresponding to the first identifier set according to a correspondence between the first identifier set and the first user terminal device; Sending the first delay request response message carrying the time synchronization information and the first identifier to the first user terminal device; as well as The first user terminal device is further configured to synchronize the time of the first user terminal device with the central office device based on the time synchronization information and the first identifier in response to receiving a first delay request response message sent by the central office device and carrying the time synchronization information and the first identifier; Among them, the preset selection rule is used to represent the rule for selecting the first identifier from the one or more identifiers, the first identifier set is used to identify the first user terminal device, and the one or more identifiers are used to indicate the delay request message sent by the first user terminal device at different times.
19. An electronic device comprising: Memory, used to store computer programs; as well as A processor, configured to implement the method steps of any one of claims 1 to 16 when executing the computer program.
20. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method steps according to any one of claims 1 to 16 are implemented.
Citation Information
Patent Citations
Multicast control method in ether passive optical network
CN101051923A
Clock synchronization method for a passive optical network (PON) system
CN106301642A
Time synchronization method in PON system, OLT, ONU and PON system
CN110324104A
Communication control system and method of passive optical network
CN110708135A
System and method for network synchronization and frequency dissemination
US20140199072A1