A method, apparatus and electronic device for time synchronization based on an optical transport network
By introducing a splitter and an identifier set mechanism between the central office equipment and the user terminal equipment, the problem that the IEEE 1588 protocol cannot synchronize multiple user terminal equipment is solved, and efficient and accurate time synchronization is achieved.
Patent Information
- Application Number
- CN202311196894.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-15
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2043-09-15
AI Technical Summary
The existing IEEE 1588 protocol is only applicable to scenarios where one central office device synchronizes one user terminal device. It cannot be applied to synchronizing multiple user terminal devices with one central office device, resulting in low time synchronization efficiency and inability to accurately achieve time synchronization of multiple user terminal devices.
By introducing a splitter between the central office equipment and the user terminal equipment, and using an identifier set mechanism, the central office equipment assigns a unique identifier set to each user terminal equipment. The user terminal equipment adds the identifier to the delay request message, and the central office equipment determines the corresponding user terminal equipment based on the identifier and sends a delay request response message, thereby achieving time synchronization of multiple user terminal equipment.
It improves the efficiency of time synchronization between multiple user terminal devices and central office devices, reduces the packet loss rate of delayed request and response messages, avoids the time waste caused by resetting the entire synchronization process, and improves the accuracy and reliability of time synchronization.
Smart Images

Figure CN119652454B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, and in particular to a time synchronization method and device based on an optical transmission network and electronic equipment. BACKGROUND
[0002] Currently, an Ethernet system implements time synchronization of a local device and a user device based on an IEEE 1588 PTP (Precision Timing Protocol) protocol, which is also referred to as an IEEE 1588 Precision Clock Synchronization Protocol.
[0003] A process of time synchronization of the local device and the user device based on the IEEE 1588 protocol is as follows: the local device sends a synchronization message to the user device, and after sending the synchronization message, sends a following message carrying a time stamp t1 (a time at which the local device sends the synchronization message); the user device receives the synchronization message, records a time stamp t2 of receiving the synchronization message, and receives the following message to obtain the time stamp t1; after obtaining the time stamp t1 and the time stamp t2, the user device sends a delay request message to the local device, and records a time stamp t3 of sending the delay request message; the local device records a time stamp t4 of receiving the delay request message when receiving the delay request message, and then sends a delay request response message carrying the time stamp t4 to the user device. After receiving the delay request response message, the user device obtains the time stamp t4, and determines a time deviation and a link delay by combining the time stamp t1, the time stamp t2 and the time stamp t3, and corrects a clock according to the time deviation and the link delay, so as to realize time synchronization with the local device. However, the existing IEEE 1588 protocol is only applicable to a scenario in which one local device synchronizes one user device, and is not applicable to a scenario in which one local device synchronizes multiple user devices. SUMMARY
[0004] The present application aims to provide a time synchronization method and device based on an optical transmission network, so as to realize time synchronization of one local device and multiple user devices connected to the local device.
[0005] In a first aspect, the present application provides a time synchronization method based on an optical transmission network, the method being applied to a first user device, the first user device being optically communicated with a local device through a splitter, and the method comprising:
[0006] According to a preset selection rule, a first identifier is selected from the first identifier set and added to the generated delay request message to obtain a first delay request message carrying the first identifier, wherein different identifier sets correspond to different user end devices, and identifiers in a same identifier set are used to distinguish delay request messages sent at different time instants by a same user end device;
[0007] The first delay request message is sent to the local end device via the optical splitter;
[0008] A first delay request response message carrying time synchronization information and the first identifier is received, wherein the time synchronization information is used to synchronize the time of the first user end device and the local end device.
[0009] Different user end devices add identifiers in their respective available identifier sets to their respective generated delay request messages, so that when the local end device receives multiple delay request messages, it can determine from the identifiers in the delay request messages which user end device each delay request message comes from, and then sends a delay request response message to the corresponding user end device, so that multiple user end devices can achieve time synchronization with the same local end device. In a possible embodiment, before the first identifier is selected from the first identifier set according to the preset selection rule and added to the generated delay request message, the method further includes: in response to the synchronization time deviation determined for a plurality of consecutive times being located within a set range, sending an identifier request message carrying a first address to the local end device, wherein the synchronization time deviation is a difference between a time at which the first user end device receives a synchronization message and a time at which the local end device sends the synchronization message, and the first address is used to identify the first user end device; and when an identifier request response message carrying the first identifier set is received, the identifier request response message is parsed to obtain the first identifier set.
[0010] After the synchronization time deviation is stabilized within the set range, the identifier request message is sent to the local end device again, which can reduce the packet loss rate of the identifier request message and the identifier request response message. The identifier request message is sent to the local end device to enable the local end device to allocate a respective identifier set to each user end device, so that the local end device can subsequently determine the identifier set to which an identifier in a delay request message belongs, and then determine the corresponding user end device according to the identifier set.
[0011] In a possible embodiment, the receiving the first delay request response message carrying the time synchronization information and the first identifier comprises: determining whether the first delay request response message carrying the time synchronization information and the first identifier is received; if yes, parsing the first delay request response message to obtain the time synchronization information, and determining the link delay according to the time synchronization information; and if no, re-sending a second delay request message carrying a second identifier to the local end device, where the second identifier belongs to the first identifier set.
[0012] In the current time synchronization scheme, when the delay request fails, the user end device stops sending the delay request message, waits for the local end device to start sending the synchronization message again, and resets the entire synchronization process. In the present application, when the user end device fails to send the delay request, i.e., does not receive the delay request response message, the entire synchronization process does not need to be reset, and the user end device only needs to continue to send the delay request message to the local end 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 local end device.
[0013] In a possible embodiment, after the link delay is determined according to the time synchronization information, the method further comprises: determining whether the link delays determined continuously are all less than a preset threshold; if no, re-sending the delay request message carrying the identifier in the first identifier set to the local end device at a first frequency; and if yes, re-sending the delay request message carrying the identifier in the first identifier set to the local end device at a second frequency, where the second frequency is lower than the first frequency.
[0014] 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 successfully receiving the delay request message is improved. When the link delays determined continuously are all less than the preset threshold, it indicates that the user end device is online. Therefore, the sending frequency of the delay request message can be reduced, thereby reducing the delay request message and the delay request response message in the optical transmission network, and preventing the optical transmission network from being blocked.
[0015] In a possible embodiment, before the identifier request message carrying the first address is sent to the local end device in response to the fact that the synchronization time deviations determined continuously are all within the set range, the method further comprises: receiving the synchronization message and the following message via the optical splitter; recording a receiving time of receiving the synchronization message, and obtaining a sending time of sending the synchronization message by the local end device from the following message; and determining the synchronization time deviation according to the sending time and the receiving time.
[0016] The application provides a method for time synchronization based on optical communication, which is applied to a local device, and the local device is in optical communication with a plurality of user devices through a splitter, and the method comprises the following steps of:
[0017] When a first delay request message carrying a first identifier is received from a first user device, a first identifier set to which the first identifier belongs is determined, wherein different identifier sets correspond to different user devices, and identifiers in the same identifier set are used to distinguish delay request messages sent at different time instants by the same user device.
[0018] According to the correspondence between the identifier set and the user device, the first user device corresponding to the first identifier set is determined.
[0019] A first delay request response message carrying time synchronization information and the first identifier is sent to the first user device through the splitter, wherein the first user device is any one of the plurality of user devices.
[0020] When the local device receives a delay request message, the identifier set to which the identifier belongs is determined according to the identifier in the delay request message, and then the corresponding user device is determined according to the identifier set, and then the corresponding delay request response message is sent to the corresponding user device, thereby avoiding the situation that when the local device is connected with a plurality of user devices, it is unable to confirm which user device the delay request message comes from, and thus the delay request response message cannot be accurately sent to the corresponding user device.
[0021] In a possible embodiment, before the first identifier set to which the first identifier belongs is determined, the following steps are further included: when an identifier request message sent by the first user device is received, a first address is parsed from the identifier request message, wherein the first address is used to identify the first user device; the first user device is determined according to the first address, and the first identifier set is allocated to the first user device; and according to the first address, an identifier request response message carrying the first identifier set is sent to the first user device.
[0022] In the original IEEE1588 protocol, a message type of identifier request is added, the identifier request message is sent to the local device by the user device, the identifier request response message carrying the identifier set is sent to the user device by the local device, and a dedicated identifier set is allocated to each user device, so that the identifier set to which the identifier belongs is determined according to the identifier in the delay request message by the local device, and then the corresponding user device is determined according to the identifier set.
[0023] In a possible embodiment, after the sending of the identity request response message carrying the first identity set to the first user terminal device, the method further comprises: determining whether the first address is parsed again from the identity request message received within a preset time period; if yes, sending the identity request response message carrying the first identity set to the first user terminal device corresponding to the first address; if no, and a second address is parsed from the identity request message received within the preset time period, sending the identity request response message carrying the first identity set to a 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 accessed user terminal device.
[0024] When the first user terminal device is offline, the allocation of the first identity set is suspended, and when the first user terminal device is replaced by a newly accessed user terminal device, the first identity set is directly allocated to the newly accessed user terminal device for use, so that waste of identity resources can be avoided.
[0025] In a possible embodiment, before the parsing of the first address from the identity request message sent by the first user terminal device, the method further comprises: obtaining, by the local terminal device, a port number in the header information of the synchronization message and the port number in the header information of the following message when the synchronization message and the following message are sent; and sending the synchronization message and the following message to the optical splitter corresponding to the port number.
[0026] When the PTP message is generated, the local terminal device fills the port that can use the IEEE 1588 standard protocol in the header information of the PTP message, so that the generated PTP message is sent to the optical splitter corresponding to the port.
[0027] In a second aspect, the application 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 the first user terminal device, the first user terminal device is in optical communication with a local terminal device through an optical splitter, and the device comprises:
[0028] A message generation unit selects a first identity from a first identity set according to a preset selection rule and adds the first identity to a generated delay request message to obtain a first delay request message carrying the first identity, wherein different identity sets correspond to different user terminal devices, and identities in a same identity set are used to distinguish delay request messages sent at different times by a same user terminal device.
[0029] A message sending unit sends the first delay request message to the local terminal device via the optical splitter.
[0030] a message receiving unit configured to receive 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-side device and the local-side device.
[0031] In a possible implementation, the apparatus is further configured to: in response to the determined synchronization time deviations being within the set range for a plurality of times, send an identifier request message carrying a first address to the local-side device, wherein the synchronization time deviation is a difference between a time at which the first user-side device receives a synchronization message and a time at which the local-side device sends the synchronization message, and the first address is used to identify the first user-side device; and when an identifier request response message carrying the first identifier set is received, parse the identifier request response message to obtain the first identifier set.
[0032] In a possible implementation, the message receiving unit is configured to: determine whether the first delay request response message carrying the time synchronization information and the first identifier is received; if yes, parse the first delay request response message to obtain the time synchronization information, and determine the link delay according to the time synchronization information; and if no, resend a second delay request message carrying a second identifier to the local-side device, wherein the second identifier belongs to the first identifier set.
[0033] In a possible implementation, the apparatus is further configured to: determine whether a plurality of link delays are all less than a preset threshold; if no, resend a delay request message carrying an identifier in the first identifier set to the local-side device at a first frequency; and if yes, resend a delay request message carrying an identifier in the first identifier set to the local-side device at a second frequency, wherein the second frequency is lower than the first frequency.
[0034] The application further provides an apparatus for time synchronization based on optical communication, which is a local-side device, or is applied to the local-side device, and the local-side device is in optical communication with a plurality of user-side devices through an optical splitter, and the apparatus comprises:
[0035] a first determining unit configured to, when a first delay request message carrying a first identifier sent by a first user-side device is received, determine a first identifier set to which the first identifier belongs, wherein different identifier sets correspond to different user-side devices, and identifiers in a same identifier set are used to distinguish delay request messages sent by a same user-side device at different times;
[0036] a second determining unit configured to determine, according to a correspondence between an identifier set and a user-side device, the first user-side device corresponding to the first identifier set;
[0037] The message sending unit sends a first delay request response message carrying 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 plurality of user terminal devices.
[0038] In a possible embodiment, the apparatus is further configured to: when receiving the identifier request message sent by the first user terminal device, parse the identifier request message to obtain a first address, wherein the first address is a physical address of the first user terminal device; determine the first user terminal device according to the first address, and assign the first identifier set to the first user terminal device; and send an identifier request response message carrying the first identifier set to the first user terminal device according to the first address.
[0039] In a possible embodiment, the apparatus is further configured to: determine whether the first address is parsed again from identifier request messages received within a preset time period; if yes, send an identifier request response message carrying the first identifier set to the first user terminal device corresponding to the first address; and if no, and a second address is parsed from the identifier request messages received within the preset time period, send an identifier request response message carrying the first identifier set to a 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 accessed user terminal device.
[0040] In a third aspect, the present application provides an electronic device, and the electronic device comprises:
[0041] a memory configured to store a computer program;
[0042] a processor configured to execute the computer program stored in the memory, so as to implement the method steps of the time synchronization based on optical communication.
[0043] In a fourth aspect, the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method steps of the time synchronization based on optical communication.
[0044] The technical effects of each of the above-mentioned second aspect to fourth aspect and each possible solution can be achieved are described above in the description of the first aspect or the various possible solutions in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0045] Figure 1 a possible EPON system provided by the present application is shown in the accompanying drawings;
[0046] Figure 2 A schematic diagram of a method for time synchronization based on an optical transport network provided in the present application;
[0047] Figure 3 A schematic diagram of a process for a local terminal device to allocate a set of identities provided in the present application;
[0048] Figure 4 A schematic diagram of a possible application scenario provided in the present application;
[0049] Figure 5 A schematic diagram of a possible application scenario provided in the present application;
[0050] Figure 6 A schematic diagram of a method for time synchronization based on an optical transport network provided in the present application;
[0051] Figure 7 A schematic diagram of a process for a user terminal device to request allocation of a set of identities provided in the present application;
[0052] Figure 8 A timing diagram for an OLT and an ONU to send a message provided in the present application;
[0053] Figure 9 A schematic diagram of an apparatus for time synchronization based on an optical transport network provided in the present application;
[0054] Figure 10 A schematic diagram of an apparatus for time synchronization based on an optical transport network provided in the present application;
[0055] Figure 11 A schematic diagram of the structure of an electronic device provided in the present application. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The specific operation method in the method embodiment can also be applied to the device embodiment or the system embodiment.
[0057] In the description of the present application, "multiple" is understood as "at least two". The association relationship of the associated objects is described, which means that there can be three relationships, for example, A and / or B, which can represent the three cases of A alone, A and B together, and B alone. A and B are connected, which means that A and B are directly connected and A and B are connected through C. In addition, in the description of the present application, "first", "second", etc. are used only for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can it be understood as indicating or implying order.
[0058] Currently, IEEE 1588 protocol is used in the market to realize time synchronization of a local terminal device and a connected user terminal device. The process of realizing time synchronization is as follows: the local terminal device uses IEEE 1588 protocol to send a synchronization message to the user terminal device, and after sending the synchronization message, sends a following message carrying a timestamp t1 (the time when the local terminal device sends the synchronization message); the user terminal device receives the synchronization message, records the timestamp t2 of receiving the synchronization message, and receives the following message to obtain the timestamp t1; after obtaining the timestamp t1 and the timestamp t2, the user terminal device sends a delay request message to the local terminal device, and records the timestamp t3 of sending the delay request message; the local terminal device records the timestamp t4 of receiving the delay request message when receiving the delay request message, and then sends a delay request response message carrying the timestamp t4 to the user terminal device. After receiving the delay request response message, the user terminal device obtains the timestamp t4, and determines the time deviation and the link delay by combining the timestamp t1, the timestamp t2 and the timestamp t3, and corrects the clock according to the time deviation and the link delay to realize time synchronization with the local terminal device. In the above process of realizing time synchronization of the user terminal device and the local terminal device based on IEEE 1588 protocol, when the user terminal device fails to send a delay request, that is, does not receive the delay request response message sent by the local terminal device, the whole synchronization process will be reset, and the local terminal device will start to send a synchronization message to the user terminal device again. When one local terminal device communicates with multiple user terminal devices, this processing method of resetting the whole synchronization process will seriously reduce the efficiency of time synchronization of the user terminal device and the local terminal device, and cause time waste.
[0059] In addition, the current IEEE 1588 protocol is only applicable to the scenario of synchronizing one user terminal device with one local terminal device, and cannot be applied to the scenario of synchronizing multiple user terminal devices with one local terminal device, because in the synchronization process, each user terminal device will periodically send a delay request message to the local terminal device, and the delay request message sent by the same user terminal device each time will carry an ID, and the ID is increased from 0, which leads to the existence of delay request messages with the same ID in the delay request messages received by the local terminal device, for example, Figure 1 The local terminal device receives the delay request message with ID 1 sent by the user terminal device 1 at t1, and receives the delay request message with ID 1 sent by the user terminal device 3 at t2, so the local terminal device cannot determine which user terminal device sends the delay request messages with the same ID, and thus cannot correctly send the delay request response message carrying the timestamp t4 to the corresponding user terminal device, and further causes the user terminal device to fail to realize time synchronization with the local terminal device.
[0060] In view of this, the embodiment of the present application provides a method for time synchronization based on an optical transmission network to solve the above problems, realizes time synchronization of one local terminal device and multiple user terminal devices, and improves the efficiency of time synchronization. The present application is described in further detail below with reference to the drawings.
[0061] Referring to Figure 2 Fig. 1 is a flowchart of a method for time synchronization based on optical communication provided by the embodiment of the present application, which is applied to a local terminal device. The local terminal device is in optical communication with multiple user terminal devices through an optical splitter. The specific implementation process of the method is as follows:
[0062] S201, when a first delay request message carrying a first identifier is received from a first user terminal device, determining a first identifier set to which the first identifier belongs;
[0063] S202, determining a first user terminal device corresponding to the first identifier set according to the correspondence between the identifier set and the user terminal device;
[0064] S203, sending a first delay request response message carrying time synchronization information and the first identifier to the first user terminal device via the optical splitter.
[0065] In the embodiment of the present application, the above method can be applied to Figure 1 Fig. 2 shows a network topology structure to which the above method is applied. The first delay request message is uploaded by a first user terminal device, which is any one of n user terminal devices, and n is an integer greater than 1. Before the first delay request message is uploaded by the first user terminal device, the local terminal device needs to allocate a first identifier set to the first user terminal device. The first identifier set contains multiple identifiers, which are used to be added to the delay request message sent by the first user terminal device, and are used to distinguish the delay request messages sent by the first user terminal device at different times. Different identifier sets are allocated 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 process of allocating the first identifier set to the first user terminal device by the local terminal device is described in detail below.
[0066] Referring to Figure 3 Fig. 3 shows the process of allocating the first identifier set to the first user terminal device by the local terminal device, and the specific process is as follows: Figure 3
[0067] S301, sending a synchronization message to n user terminal devices and recording a first time at which the synchronization message is sent;
[0068] Specifically, in the time synchronization process between the CO device and the n user-side devices connected thereto, the CO device first broadcasts a Sync message (synchronization message) and records the first time at which the Sync message is sent. The Sync message is a PTP message, and the Sync message can be sent at an indefinite time or periodically.
[0069] It should be noted that the portIdentity in the IEEE 1588 standard protocol header information is used to represent the port (interface) number under different network cards, indicating that the port uses the IEEE 1588 standard protocol, i.e., the PTP message can be sent through the port.
[0070] The portIdentity can only be applied to a scenario in which there is only one port under a network card, for example, port1 corresponds to OLT1 and port2 corresponds to OLT2 (OLT is an optical line terminal, which is a kind of CO device). When there are multiple ports under the network card of the CO device that use the IEEE 1588 standard protocol, for example, as shown in FIG. 3, there are three ports under the network card of an OLT that can use the IEEE 1588 standard protocol: port3, port4, and port5, it is not possible to determine from which port the PTP message is sent. Figure 4
[0071] Therefore, in the embodiment of the present application, when there are multiple ports under the network card of a CO device that can use the IEEE 1588 standard protocol, the serial numbers of the ports are filled in the reserved field of the PTP message standard header information, and after the reserved field is parsed, the PTP message can be sent to the corresponding port. For example, there are ports under the network card of a CO device that can use the IEEE 1588 standard protocol: port3, port4, and port5, when it is necessary to send a PTP message to the port3, the serial number of the port3 is filled in the reserved field of the PTP message standard header information, and when it is necessary to send a PTP message to the port3 and the port4, the serial numbers of the port3 and the port4 are filled in the reserved field of the PTP message standard header information.
[0072] S302: sending a Follow_up message carrying the first time to the n user-side devices;
[0073] Specifically, after the CO device records the first time at which the synchronization message is sent, the first time is packaged into a Follow_up message (follow-up message), and the Follow_up message is sent to the n user-side devices. The Follow_up message is a multicast PTP message. It should be understood that all the user-side devices connected to the same splitter are a group in the embodiment of the present application.
[0074] The first user-side device records the second time when the Sync message is received, obtains the first time from the Follow_up message when the Follow_up message is received, and then calculates the synchronization time deviation between the second time and the first time. Since the Sync message is periodically sent, the Follow_up message is also periodically sent, and a synchronization time deviation can be obtained each time the Sync message and the Follow_up message are sent. When the synchronization time deviations calculated for multiple times in succession are all within the set range, for example, the synchronization time deviations calculated for a preset number of times, such as 3 times, are all within sub-microseconds, the first user-side device starts to send an identification request message to the local-side device to request the local-side device to allocate an identification set for it, and the identification request message carries the first address, which is used to identify the first user-side device. Any information that can uniquely identify the user-side device can be used as the first address, for example, the first address can be the MAC address (physical address) of the first user-side device. Since the MAC address of each user-side device is unique, the local-side device can determine the user-side device requesting the allocation of the identification set according to the MAC address in the identification request message.
[0075] S303: When the identification request message is received, the first address is obtained by analyzing the identification request message;
[0076] In the embodiment of the present application, when the local-side device receives the identification request message, the first address used to identify the first user-side device is obtained by analyzing the identification request message, and the first address is the MAC address of the first user-side device.
[0077] It is worth noting that the message type of the identification request does not exist in the existing IEEE1588 standard protocol, and the method provided in the embodiment of the present application adds the message type of the identification request to the IEEE1588 standard protocol to request and allocate the identification. The message type of the identification request includes the identification request message and the identification request response message. The identification request message and the identification request response message can be two-layer MAC messages.
[0078] S304: The first user-side device is determined according to the first address, and the first identification set is allocated to the first user-side device;
[0079] Specifically, the local-side device determines the first user-side device according to the first address, and allocates the first identification set to the first user-side device. The process of allocating the identification set is as follows:
[0080] The total number of identifications in the identification set of each user-side device is calculated according to the set total range of the identification and the maximum splitting ratio of the optical splitter connected to the local-side device, so that Figure 5For example, if the total range of the set identifier is 0x00~0xffff, i.e. 0~65535 characters, Figure 5 If the splitter connected to the OLT has 32 ports, the maximum splitting ratio is 1:32, and the total number of identifiers available for each ONU connected to the splitter is 65536÷32=2048 characters.
[0081] In addition, the order of allocating the identifier set to each ONU can be according to the order in which the identifier request message sent by different ONUs is received, for example, Figure 5 When the identifier request message sent by ONU1 is received, the first identifier set is allocated to ONU1, and the identifier range of the first identifier set is 0~2047 characters, for example, the first identifier set is {0, 1, 2, 3, …, 2047}; when the identifier request message sent by ONU2 is received, the second identifier set {2048, 2049, 2050, …, 4095} is allocated to ONU2, and the identifier range of the second identifier set is 2048~4095 characters, and the identifier set is sequentially allocated to each ONU, which will not be described here.
[0082] S305: According to the first address, sending an identifier request response message carrying the first identifier set to the first user terminal device;
[0083] Specifically, after the OLT allocates the first identifier set to the first user terminal device, the first identifier set is packaged into the identifier request response message, and the identifier request response message is sent to the first user terminal device corresponding to the first address according to the parsed first address. Here, the way of sending the identifier request response message can be unicast, and the embodiment of the application does not limit the way of sending the identifier request response message.
[0084] When the first user terminal device receives the identifier request response message carrying the first identifier set, the first identifier set is parsed from the identifier request response message, and the first identifier is selected from the first identifier set and added to the generated delay request message to obtain the first delay request message carrying the first identifier, and then the first delay request message is sent to the OLT.
[0085] In the embodiment of the application, when the OLT receives the first delay request message sent by the first user terminal device, the operation of S201 is started.
[0086] S201, when receiving the first delay request message carrying the first identifier sent by the first user terminal device, determining the first identifier set to which the first identifier belongs;
[0087] Specifically, when the local end device receives the first delay request packet, the first identification is parsed from the first delay request packet, and the first identification set to which the first identification belongs is determined according to the first identification.
[0088] S202, determining the first user end device corresponding to the first identification set according to the correspondence between the identification set and the user end device.
[0089] It is worth noting that the identifications included in different identification sets are different, different identification sets are assigned to different user end devices, and the identifications in the same identification set are used to distinguish the delay request packets sent by the same user end device at different times.
[0090] Specifically, after the first identification set to which the first identification belongs is determined, the first user end device corresponding to the first identification set is determined according to the assignment relationship between each identification set and each user end device, so that it is determined that the first delay request packet comes from the first user end device. For example, the assignment relationship between each identification set and each user end device can be as shown in Table 1.
[0091]
[0092] Table 1
[0093] S203, sending the first delay request response packet carrying the time synchronization information and the first identification to the first user end device via the optical splitter.
[0094] Specifically, the time synchronization information is the receiving time when the local end device receives the first delay request packet. When the local end device receives the first delay request packet, the receiving time when the first delay request packet is received is recorded as the time synchronization information. After the first user end device corresponding to the first identification set to which the first identification belongs is determined, the time synchronization information is packaged into the first delay request response packet, and the first identification is also added to the first delay request response packet. Then, the first delay request response packet carrying the time synchronization information and the first identification is sent to the first user end device. The sending mode of the first delay request response packet can be unicast sending, and the embodiment of the application does not limit the sending mode of the delay request response packet.
[0095] The method, the local terminal device allocates different and non-overlapping identification set to each user terminal device, so that the local terminal device determines the identification set to which the identification in the received delay request message belongs, and then determines the corresponding user terminal device according to the identification set, and sends the delay request response message carrying the time synchronization information and the same identification to the corresponding user terminal device, avoiding the situation that the delay request response message carrying the time synchronization information cannot be accurately sent to the corresponding user terminal device because it cannot be determined which user terminal device sends the received delay request message.
[0096] In addition, the local terminal device also adds the identification in the received delay request message in the delay request response message carrying the time synchronization information sent by the local terminal device, so that the corresponding user terminal device can obtain the sending time when the delay request message carrying the identification is sent, that is, the third time, according to the identification. The third time corresponds to the time synchronization information, and then the time synchronization is performed according to the third time and the time synchronization information, and the precision of the time synchronization is improved.
[0097] Further, since there are situations that the user terminal device is offline or replaced by a new user terminal device, after the local terminal device sends the identification request response message carrying the first identification set to the first user terminal device, it also needs to determine whether the first address is parsed again in the identification request message received within the preset time period.
[0098] In a possible implementation, if the local terminal device parses the first address again in the identification request message received within the preset time period, it indicates that the first user terminal device is not offline, because the first user terminal device will periodically send the identification request message (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. The local terminal device sends the identification request response message carrying the first identification set to the first user terminal device corresponding to the first address.
[0099] In a possible implementation, if the local terminal device parses the first address again in the identification request message received within the preset time period, it indicates that the first user terminal device is not offline, and then sends the identification request response message not carrying the first identification set to the first user terminal device corresponding to the first address.
[0100] In a possible implementation, if the local terminal device does not parse the first address in the identification request message received within the preset time period, and parses the second address, the second address is the physical address of the newly accessed user terminal device, which indicates that the first user terminal device is replaced by the newly accessed second user terminal device, and then the local terminal device sends the identification request response message carrying the first identification set to the newly accessed user terminal device corresponding to the second address, that is, the local terminal device reassigns the first identification set to the newly accessed user terminal device.
[0101] In a possible implementation, if the CO device does not resolve the first address in the identification request message received within the preset time period and does not resolve the second address of the newly accessed user-side device, it indicates that the first user-side device has been offline and no new user-side device is currently accessed, and the CO device does not allocate the first identification set to the user-side device for use.
[0102] In the embodiment of the application, when the first user-side device is offline, the allocation of the first identification set is suspended, and when the first user-side device is replaced by a newly accessed user-side device, the first identification set is directly allocated to the newly accessed user-side device for use, so that the waste of identification resources can be avoided.
[0103] Referring to FIG. 6, which is a flowchart of a method for optical transmission provided in an embodiment of the application, the method is applied to a first user-side device, the first user-side device is in optical communication with a CO device through a splitter, the first user-side device is any one of n user-side devices, and the specific implementation process of the method is as follows: Figure 6
[0104] S601, selecting a first identification from a first identification set according to a preset selection rule and adding the first identification to a generated delay request message to obtain a first delay request message carrying the first identification;
[0105] S602, sending the first delay request message carrying the first identification to the CO device through the splitter;
[0106] S603, receiving a first delay request response message carrying time synchronization information and a first mark.
[0107] In the embodiment of the application, the first identification set is an identification set allocated to the first user-side device by the CO device. Different identification sets are allocated to different user-side devices, the identifications in different identification sets are different, and the identifications in the same identification set are used to distinguish the delay request messages sent by the same user-side device at different times. The user-side device sends the delay request message with the added mark to the CO device, so that the CO device determines the identification set to which the identification belongs and determines the user-side device that sends the delay request message through the identification set. The process in which the first user-side device requests the CO device to allocate the first identification set is specifically described below.
[0108] Referring to FIG. 7, which is a flowchart of the process in which the first user-side device requests the CO device to allocate the first identification set, the specific process is as follows: Figure 7
[0109] S701, when a synchronization message is received, recording a second time at which the synchronization message is received;
[0110] Specifically, in the process of synchronizing the first user-side device by the station-side device, the station-side device periodically broadcasts a synchronization message to each user-side device. When the first user-side device receives the Sync message, the second time of receiving the Sync message and the ID value of the Sync message are recorded, and the ID value of the Sync message is used to represent the number of times of sending the Sync message. It is worth mentioning that the second time of receiving the Sync message by each user-side device is random, for example, Table 2 is the second time of receiving the Sync message broadcasted by the station-side device by n user-side devices.
[0111]
[0112] Table 2
[0113] S702, when the Follow_up message is received, the first time is obtained by analyzing the Follow_up message;
[0114] In the embodiment of the present application, the station-side device sends a Follow_up message (Follow_up message) carrying the first time to each user-side device after sending the synchronization message. When each user-side device receives the Follow_up message, the Follow_up message is analyzed to obtain the first time of sending the Sync message by the station-side device.
[0115] S703, in response to the synchronization time deviation determined for a plurality of times being located in the set range, sending an identification request message carrying the first address to the station-side device;
[0116] Specifically, the synchronization time deviation is the difference between the second time of receiving the synchronization message by the first user-side device and the first time of sending the synchronization message by the station-side device. After the first user-side device obtains the first time and the second time, the synchronization time deviation is calculated. Since the station-side device periodically sends the synchronization message and the Follow_up message carrying the first time, the first user-side device can calculate a synchronization time deviation each time the synchronization message and the Follow_up message are received. Whether to start sending the identification request message to the station-side device is determined by judging whether the synchronization time deviation calculated for a plurality of times is located in the set range.
[0117] When the synchronization time deviation calculated for a plurality of times is located in the set range, for example, the synchronization time deviation calculated for 3 times is located in the sub-microsecond, it is indicated that the synchronization time deviation is stable at the sub-microsecond level, and then the identification request message carrying the first address is started to be sent to the station-side device. Specifically, the first address is packaged into the ID_Req message (identification request message), and the ID_Req message is sent to the station-side device, and the first address is used to identify the first user-side device, and the first address is the MAC address of the first user-side device. The method of sending the identification request message can be indefinite time sending or periodic sending.
[0118] When the calculated synchronization time deviations are not all within the set range for multiple times, for example, only one of the calculated synchronization time deviations is at the sub-microsecond level among the three calculated synchronization time deviations, the first user-side device adjusts the second time of receiving the Sync packet by calling the PHC clock through the PHC API (Physical Hardware Clock Application Programming Interface) until the calculated synchronization time deviations are all at the sub-microsecond level, i.e., the synchronization time deviation is less than 1 microsecond, indicating that the synchronization time deviation is stable at the sub-microsecond level, and then the first user-side device starts to send the identification request packet carrying the first address to the local-side device.
[0119] After the synchronization time deviation is stable within the set range, the identification request packet is sent to the local-side device again, which can reduce the packet loss rate of the identification request packet and the identification request response packet.
[0120] S704, when the identification request response packet carrying the first identification set is received, the identification request response packet is parsed to obtain the first identification set;
[0121] Specifically, after the local-side device receives the identification request packet carrying the first address, the local-side device determines the first user-side device according to the first address, allocates the first identification set to the first user-side device, and sends the ID_Resp packet (identification request response packet) carrying the first identification set to the first user-side device.
[0122] When the first user-side device receives the ID_Resp packet, the first identification set is obtained by parsing the ID_Resp packet, and the identification in the first identification set is added to the generated delay request packet to distinguish the delay request packets sent by the first user-side device at different times.
[0123] In the embodiment of the present application, when the first user-side device determines the first identification set, the operation of S601 is started.
[0124] S601, according to a preset selection rule, a first identification is selected from the first identification set and added to the generated delay request packet to obtain a first delay request packet carrying the first identification;
[0125] Specifically, the first user-side device generates a delay request message, selects a first identifier from the first set of identifiers and adds the first identifier to the generated delay request message to obtain a first delay request message carrying the first identifier. Here, the preset selection rule can be random selection, as long as the time interval of selecting the same identifier is greater than the preset time interval threshold. For example, the preset selection rule can be round-robin selection of the identifiers in the same identifier set, and one identifier is selected from the same identifier set each time. Further, according to the preset selection rule, the first identifier can be selected in ascending order of the size of the identifiers in the first set of identifiers, or in descending order. The embodiments of the present application do not limit this.
[0126] For example, assuming that the first set of identifiers is characters 1-20, the identifiers are selected in ascending order of the size of the identifiers, when the first Delay_Req message (delay request message) is generated, the first Delay_Req message is marked with character 1, and 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. When all 21 identifiers are used up, the identifiers in the first set of identifiers are used in a loop when the Delay_Req message is generated again.
[0127] S602, sending the first delay request message carrying the first identifier to the local-side device via the optical splitter;
[0128] Specifically, the first user-side device sends the first delay request message carrying the first identifier to the local-side device, and records the third time when the first delay request message is sent.
[0129] It should be noted that the time when the n user-side devices send the delay request message to the optical line terminal has randomness. The time when any two user-side devices send the delay request message can be the same or different, and the delay request message can be sent at an indefinite time or at a preset frequency, for example, the delay request message is sent every 2s.
[0130] S603, receiving the first delay request response message carrying the time synchronization information and the first identifier;
[0131] In the embodiment of the present application, the local terminal device determines the identification set to which the identification belongs according to the identification in the Delay_Req message (delay request message), and then determines the user terminal device corresponding to the identification set according to the correspondence between the identification set and the user terminal device. Then the Delay_Resq message (delay request response message) carrying the time synchronization information and the first identification is sent to the corresponding user terminal device, the time synchronization information being the receiving time when the local terminal device receives the Delay_Resq message sent by the corresponding user terminal device, and the receiving time is recorded as the fourth time, and the receiving time of the Delay_Resq message is described below.
[0132] Specifically, the first user terminal device determines whether the first delay request response message carrying the time synchronization information and the first identification is received. If the first delay request response message is received, the time synchronization information and the first identification are obtained by analyzing the first delay request response message, and the time synchronization information is the fourth time. According to the first identification, the third time when the first delay request message carrying the first identification is sent is obtained, and then the link delay delay and the time offset offset are calculated according to the obtained first time, second time, third time and fourth time. The specific calculation formula is: delay = ((t2-t1)+(t4-t3)) / 2, offset = ((t2-t1)-(t4-t3)) / 2.
[0133] If the first delay request response message is not received, the second delay request message carrying the second identification is re-sent to the local terminal device, and the second identification belongs to the first identification set, that is, a new delay request message is generated and sent to the optical line terminal.
[0134] In the current time synchronization scheme, when the delay request fails, the user terminal device stops sending the delay request message, waits for the local terminal device to start sending the synchronization message again, and resets the entire synchronization process. In the present application, when the user terminal device fails to send the delay request, that is, the delay request response message is not received, the entire synchronization process does not need to be reset, and the user terminal device only needs to continue to send the delay request message to the local terminal 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 terminal device and the local terminal device.
[0135] Further, after determining the link delay according to the time synchronization information, it is judged whether the link delays determined continuously for multiple times are all less than a preset threshold. Since the first user equipment continuously sends the delay request message to the local end equipment, the first user equipment can determine a link delay each time it receives the delay request response message carrying the time synchronization information sent by the local end equipment. It is judged whether the link delays determined continuously for multiple times, for example, for 3 times, are all less than a preset threshold. According to actual needs, the preset threshold can be 100 nanoseconds, or can be set according to the link delay value specified in the IEEE1588 protocol. If not, it indicates that the link delay is not stable, and the delay request message carrying the identifier in the first identifier set is re-sent to the local end equipment according to the first frequency. The first frequency can be the same as the frequency of sending the delay request message before. If yes, it indicates that the link delay is stable, and the delay request message carrying the identifier in the first identifier set is re-sent to the local end equipment according to the second frequency. The second frequency is lower than the first frequency.
[0136] It is worth noting that when the user end equipment 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 equipment is high, and therefore the calculated link delay is unstable. Therefore, the sending frequency of the delay request message can be increased to increase the probability of successful reception of the delay request message. When the link delays determined continuously for multiple times are all less than the preset threshold, it indicates that the ONU equipment is online, and therefore the sending frequency of the delay request message can be reduced, thereby reducing the delay request message and the delay request response message in the optical transmission network, and preventing the optical transmission network from being blocked.
[0137] In summary, the above method is applied by increasing the identifier set application action of each user end equipment, requesting the local end equipment to allocate its own identifier set, and marking the delay request message generated by itself with the identifier in the identifier set, so that the local end equipment can determine the identifier set to which the mark belongs when receiving different delay request messages according to the mark in the delay request message, determine the corresponding user end equipment according to the identifier set, and then send the delay request response message carrying the corresponding time synchronization information to the corresponding user end equipment, thereby avoiding the situation that the local end equipment cannot confirm the corresponding user end equipment.
[0138] In addition, the local end equipment also adds the identifier in the received delay request message in the delay request response message carrying the time synchronization information, so that the corresponding user end equipment can obtain the sending time, i.e., the third time, when the delay request message carrying the identifier is sent, according to the identifier. The third time corresponds to the time synchronization information, and then the time synchronization is performed according to the third time and the time synchronization information, thereby improving the accuracy of time synchronization.
[0139] The above method will be described in detail below. Figure 8The timing diagram is shown in the figure, and the Ethernet optical distribution network is taken as an example, in which the OLT device is an OLT device, the ONU device is an ONU device, and the optical splitter is used to make a complete description of the method for time synchronization based on the optical transmission network.
[0140] Referring to Figure 8 It can be seen that n ONUs are connected to an OLT.
[0141] In the embodiment of the application, the OLT periodically sends a Sync message to each ONU and records the time stamp t1 when the Sync message is sent. The Sync message is a PTP multicast message.
[0142] The ONU records the ID of the Sync message and the time stamp t2 when the Sync message is received when receiving the Sync message, as shown in Figure 8 The time stamp when the first ONU receives the Sync message is t21, and the time stamp when the nth ONU receives the Sync message is t2n. n And so on.
[0143] The OLT sends a Follow_up message to each ONU after sending the Sync message. The Follow_up message carries the time stamp t1 when the Sync message is sent, and the Follow_up message is also a PTP multicast message.
[0144] The ONU captures the Follow_up message and parses the Follow_up message to obtain the time stamp t1 when the Sync message is sent. When the ONU obtains the time stamp t1 and the time stamp t2, the synchronization time deviation is calculated, which is the difference between the time stamp t2 and the time stamp t1. It is judged whether the synchronization time deviations calculated for three times in succession are all within the sub-microsecond range. If yes, it is indicated that the synchronization time deviation is stable within the sub-microsecond range, and then the ONU starts to send an ID_Req message to the OLT. If no, it is indicated that the synchronization time deviation is not stable within the sub-microsecond range, and then the ONU adjusts the time stamp t2 when the ONU receives the Sync message by calling a PHC clock (Physical hardware clock) through a PHC API until the synchronization time deviations calculated for three times in succession are all within the sub-microsecond range, i.e., the synchronization time deviations calculated for three times in succession are all less than 1 microsecond, which indicates that the synchronization time deviation is stable within the sub-microsecond range.
[0145] When the synchronization time deviation is stable within the sub-microsecond range, the ONU starts to periodically send an ID_Req message to the OLT. The ID_Req message carries the MAC address of the ONU.
[0146] OLT receives the ID_Req message, parses the ID_Req message to obtain the MAC address, and further determines the ONU corresponding to the MAC address, and allocates an identification set, i.e., an ID range, to the ONU. The number of identifications in the identification set is calculated according to a preset total number of identifications and a maximum splitting ratio of the splitter. For example, the preset total number of identifications is 3200, and the maximum splitting ratio is 1:32, i.e., 32 ONUs can be connected to one OLT through the splitter, and thus the number of identifications in the identification set of each ONU is 3200÷32=100. The identification set can be allocated to the ONUs in turn according to the order of receiving the ID_Req message. Then, the OLT sends an ID_Resp message carrying the identification set to the corresponding ONU. For example Figure 8 In the example, the OLT sends an ID_Resp_1 message carrying a first identification set to the first ONU, and sends an ID_Resp_n message carrying an n-th identification set to the n-th ONU.
[0147] After receiving the ID_Resp message, the ONU parses the ID_Resp message to obtain the allocated identification set, and selects an identification from the identification set and adds the identification to the Delay_Req message each time the ONU sends the Delay_Req message to the OLT. The ONU also records a time stamp t3 of sending the Delay_Req message carrying the identification. For example Figure 8 In the example, the first ONU sends a Delay_Req_1 message carrying an identification 1 at a time stamp t31.
[0148] When receiving the Delay_Req message sent by each ONU, the OLT records a time stamp t4 of receiving the Delay_Req message, parses the Delay_Req message to obtain the identification carried in the Delay_Req message, determines the identification set to which the identification belongs, and further determines the ONU corresponding to the identification set. Then, the OLT sends a Delay_Resq message carrying the time stamp t4 of receiving the Delay_Req message and the parsed identification to the corresponding ONU. As shown in the example, Figure 8 The OLT receives the Delay_Req_1 message sent by the first ONU at a time stamp t41, parses the Delay_Req_1 message to obtain an identification 1, and thus sends a Delay_Resq_1(t41) message carrying the time stamp t41 and the identification 1 to the first ONU; the OLT receives the Delay_Req_n message sent by the n-th ONU at a time stamp t4 n , parses the Delay_Req_n message to obtain an identification n, and thus sends a Delay_Resq_n(t4 n , the identification n to the n-th ONU. nto the nth ONU.
[0149] After the ONU receives the Delay_Resq message, the ONU parses the Delay_Resq message to obtain the timestamp t4. Then, the ONU obtains the sending time, i.e., the timestamp t3, of the Delay_Req message carrying the identifier according to the identifier in the Delay_Resq message. The link delay delay and the time offset offset are calculated according to the timestamp t1, the timestamp t2, the timestamp t3 and the timestamp t4.
[0150] In the embodiment of the present application, the OLT is the master clock and the ONU is the slave clock. The difference between the slave clock and the master clock is the time offset 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. Referring to Figure 4 , the timestamps t1 and t2 satisfy the equation: t1+offset+delay1=t2, and the timestamps t3 and t4 satisfy the equation: t3-offset+delay2=t4. In the embodiment of the present application, since the messages are transmitted through the same physical link, the transmission delay of the physical link is fixed, and it can be considered that the bidirectional delay is the same, i.e., delay=delay1=delay2, thus it can be deduced that: delay=((t2-t1)+(t4-t3)) / 2, and offset=((t2-t1)-(t4-t3)) / 2.
[0151] After each ONU calculates the link delay delay and the time offset offset, the ONU can achieve time synchronization with the OLT according to the link delay delay and the time offset offset.
[0152] Based on the same inventive concept, the present application further provides a device for time synchronization based on an optical transmission network. The device is a first user-side equipment, or the device is applied to the first user-side equipment. The first user-side equipment is optically communicated with a local-side equipment through an optical splitter. Referring to Figure 9 , the device comprises:
[0153] A message generation unit 901 is configured to select a first identifier from a first identifier set according to a preset selection rule and add the first identifier to a generated delay request message to obtain a first delay request message carrying the first identifier. Different identifier sets correspond to different user-side equipments, and the identifiers in a same identifier set are used to distinguish the delay request messages sent at different time instants by a same user-side equipment.
[0154] A message sending unit 902 is configured to send the first delay request message to the local-side equipment through the optical splitter.
[0155] 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 the time of the first user-side device and the local-side device.
[0156] In a possible implementation, the apparatus is further configured to: when the identifier request message is received, parse the identifier request message to obtain a first address, wherein the first address is a physical address of the first optical network unit; determine the first optical network unit according to the first address, and assign the first identifier set to the first optical network unit; and according to the first address, send an identifier request response message carrying the first identifier set to the first optical network unit.
[0157] In a possible implementation, the apparatus is further configured to: in response to the synchronization time offset determined for a plurality of consecutive times being within a set range, send an identifier request message carrying a first address to the local-side device, wherein the synchronization time offset is a difference between a time at which the first user-side device receives a synchronization message and a time at which the local-side device sends the synchronization message, and the first address is a physical address of the first user-side device; and when an identifier request response message carrying the first identifier set is received, parse the identifier request response message to obtain the first identifier set.
[0158] In a possible implementation, the message receiving unit 903 is configured to: determine whether the first delay request response message carrying the time synchronization information and the first identifier is received; if yes, parse the first delay request response message to obtain the time synchronization information, and calculate the link delay according to the time synchronization information; and if no, resend a second delay request message carrying a second identifier to the local-side device, wherein the second identifier belongs to the first identifier set.
[0159] In a possible implementation, the apparatus is further configured to: determine whether the link delay determined for a plurality of consecutive times is less than a preset threshold; if no, resend a delay request message carrying an identifier in the first identifier set to the local-side device at a first frequency; and if yes, resend a delay request message carrying an identifier in the first identifier set to the local-side device at a second frequency, wherein the second frequency is lower than the first frequency.
[0160] The application further provides an apparatus for time synchronization based on optical communication, which is a local-side device or is applied to a local-side device, and the local-side device is in optical communication with a plurality of user-side devices through an optical splitter, as shown in Figure 10 The apparatus comprises:
[0161] 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;
[0162] 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;
[0163] 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.
[0164] In a possible 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.
[0165] In a possible 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.
[0166] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present application, which can realize the function of the aforementioned message sending device for time synchronization, referring to Figure 11 , the electronic device includes:
[0167] At least one processor 1101, and a memory 1102 connected to the at least one processor 1101. The specific connection medium between the processor 1101 and the memory 1102 is not limited in the embodiment of the present application. Figure 11 In the example, the processor 1101 and the memory 1102 are connected via the bus 1100.Figure 11 The connection between the other components is indicated by a thick line, which is only illustrative and not limited. The bus 1100 can be divided into an address bus, a data bus, a control bus, etc. For convenience of representation, Figure 11 In the figure, only one thick line is used, but it does not mean that there is only one bus or only one type of bus. Alternatively, the processor 1101 can also be referred to as a controller, and the name is not limited.
[0168] In the embodiment of the present application, the memory 1102 stores instructions executable by the at least one processor 1101, and the at least one processor 1101 can execute the packet sending method for time synchronization discussed above by executing the instructions stored in the memory 1102. The processor 1101 can realize the functions of each unit of the apparatus shown in the figure. Figure 9 、 Figure 10
[0169] The processor 1101 is the control center of the apparatus, and can connect each part of the control device through various interfaces and lines, and monitor the whole apparatus by running or executing the instructions stored in the memory 1102 and calling the data stored in the memory 1102, thereby processing data and realizing various functions of the apparatus.
[0170] In a possible embodiment, the processor 1101 can include one or more processing units, and the processor 1101 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, application program, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 1101. In some embodiments, the processor 1101 and the memory 1102 can be realized on the same chip, and in some embodiments, they can also be realized on independent chips respectively.
[0171] 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, a discrete hardware component, and can realize or execute the 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 packet sending method for time synchronization disclosed in the embodiments of the present application can be directly embodied as execution of a hardware processor, or execution of a combination of hardware and software modules in the processor.
[0172] The memory 1102, as a non-volatile computer readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 1102 can include at least one type of storage medium, for example, can include flash memory, hard disk, multimedia card, card type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic storage, magnetic disk, optical disk, etc. The memory 1102 is any other medium capable of carrying or storing desired program code in the form of instructions or data structures and capable of being accessed by a computer, but is not limited thereto. The memory 1102 in the embodiments of the present application can also be a circuit or any other device capable of realizing a storage function, used for storing program instructions and / or data.
[0173] By designing and programming the processor 1101, the code corresponding to the packet sending method for time synchronization introduced in the foregoing embodiments can be fixed into the chip, so that the chip can execute the steps of the packet sending method for time synchronization of the embodiments shown in the running time. Figure 2 How to design and program the processor 1101 is a technology known to those skilled in the art, and will not be described here.
[0174] Based on the same inventive concept, the embodiments of the present application also provide a storage medium storing computer instructions, when the computer instructions run on a computer, the computer instructions make the computer execute the packet sending method for time synchronization discussed above.
[0175] In some possible implementations, various aspects of the packet sending method for time synchronization provided by the present application can also be implemented in the form of a program product, which includes program code for making the control device execute the steps of the packet sending method for time synchronization according to various exemplary embodiments of the present application described above in the specification when the program product runs on the device.
[0176] Those skilled in the art will appreciate that embodiments of the present application can be devised for a variety of applications. FIG. 1 illustrates an example of a system 100 that can employ an embodiment of the present application. As shown in FIG. 1, system 100 can include a host computer 110 that is configured to communicate via one or more wired or wireless communication links 120 with one or more client devices 130. Host computer 110 can include a processor 112, a storage 114, and a communications interface 116. Processor 112 can include one or more processors, such as one or more general purpose processors (e.g., as described below in connection with FIG. 2). Storage 114 can include one or more non-transitory computer-readable storage medium, such as one or more hard disk drives, flash memories, or the like. Storage 114 can store a computer program 118 that is executable by processor 112. Communications interface 116 can include one or more interfaces to enable communications with a client device 130. For example, communications interface 116 can include a network interface controller (NIC) or the like. In some embodiments, host computer 110 can be a server computer that is configured to provide a service to a client device 130, such as a web server that provides web pages to a client device 130.
[0177] The present application is described below with reference to flowcharts and / or block diagrams that illustrate the operating efficiency of methods, devices (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and / or block in the flowcharts and / or block diagrams, and combinations of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processing device, or other programmable data processing device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, create means for implementing the functions specified in the flowcharts and / or block diagrams block or blocks. Figure 1 The flowcharts and / or block diagrams can also be implemented as computer program instructions. These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowcharts and / or block diagrams block or blocks. Figure 1 The flowcharts and / or block diagrams can also be implemented as computer program instructions. These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowcharts and / or block diagrams block or blocks.
[0178] The flowcharts and / or block diagrams can also be implemented as computer program instructions. These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowcharts and / or block diagrams block or blocks. Figure 1 The flowcharts and / or block diagrams can also be implemented as computer program instructions. These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowcharts and / or block diagrams block or blocks. Figure 1 The flowcharts and / or block diagrams can also be implemented as computer program instructions. These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowcharts and / or block diagrams block or blocks.
[0179] The flowcharts and / or block diagrams can also be implemented as computer program instructions. These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowcharts and / or block diagrams block or blocks. Figure 1 The flowcharts and / or block diagrams can also be implemented as computer program instructions. These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowcharts and / or block diagrams block or blocks. Figure 1 The flowcharts and / or block diagrams can also be implemented as computer program instructions. These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowcharts and / or block diagrams block or blocks.
[0180] It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application cover the modifications and variations of this application provided they come within the scope of the appended claims and their equivalents.
Claims
1. A method for time synchronization based on optical transport networks, characterized in that, The method is applied to a first user terminal device which is in optical communication with a local terminal device through a splitter, and the method comprises: selecting a first identifier from a first identifier set according to a preset selection rule and adding the first identifier 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 a same identifier set are used to distinguish delay request messages sent at different times by a same user terminal device; sending the first delay request message to the local terminal device via the splitter; receiving 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 and the local terminal device.
2. The method of claim 1, wherein, Before the step of selecting a first identifier from a first identifier set according to a preset selection rule and adding the first identifier to a generated delay request message, the method further comprises: in response to the synchronization time deviation determined for a plurality of times being located within a set range, sending an identifier request message carrying a first address to the local terminal device, wherein the synchronization time deviation is a difference between a time at which the first user terminal device receives a synchronization message and a time at which the local terminal device sends the synchronization message, and the first address is used to identify the first user terminal device; when receiving an identifier request response message carrying the first identifier set, analyzing the identifier request response message to obtain the first identifier set.
3. The method of claim 1, wherein, The step of receiving a first delay request response message carrying time synchronization information and the first identifier comprises: determining whether the first delay request response message carrying the time synchronization information and the first identifier is received; if yes, analyzing the first delay request response message to obtain the time synchronization information, and determining a link delay according to the time synchronization information; if no, re-sending a second delay request message carrying a second identifier to the local terminal device, wherein the second identifier belongs to the first identifier set.
4. The method of claim 3, wherein, After the step of determining a link delay according to the time synchronization information, the method further comprises: determining whether the link delay determined for a plurality of times is less than a preset threshold; if no, re-sending a delay request message carrying an identifier in the first identifier set to the local terminal device at a first frequency; if yes, re-sending a delay request message carrying an identifier in the first identifier set to the local terminal device at a second frequency, wherein the second frequency is lower than the first frequency.
5. A method of time synchronization based on optical communication, characterized in that, The method is applied to a local terminal device which is in optical communication with a plurality of user terminal devices through a splitter, and the method comprises: 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, wherein different identifier sets correspond to different user terminal devices, and identifiers in a same identifier set are used to distinguish delay request messages sent at different times by a same user terminal device; determining the first user terminal device corresponding to the first identifier set according to a correspondence between an identifier set and a user terminal device; sending, via the optical splitter, a first delay request response message carrying time synchronization information and the first identifier to the first user-side device, wherein the first user-side device is any one of the plurality of user-side devices.
6. The method of claim 5, wherein, Before the determining the first identifier set to which the first identifier belongs, further comprising: When receiving the identifier request message sent by the first user-side device, parsing the identifier request message to obtain a first address, wherein the first address is used to identify the first user-side device; According to the first address, determining the first user-side device and allocating the first identifier set to the first user-side device; According to the first address, sending an identifier request response message carrying the first identifier set to the first user-side device.
7. A time synchronization device based on an optical transmission network, characterized in that: The device is a first user-side device, or the device is applied to the first user-side device, the first user-side device is optically communicated with a local-side device through an optical splitter, and the device comprises: A message generation unit adds a first identifier selected from a first identifier set according to a preset selection rule 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-side devices, and identifiers in a same identifier set are used to distinguish delay request messages sent at different time instants by a same user-side device. A message sending unit sends the first delay request message to the local-side device via the optical splitter. A 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-side device and the local-side device.
8. A time synchronization device based on optical communication, characterized in that: The device is a local-side device, or the device is applied to the local-side device, the local-side device is optically communicated with a plurality of user-side devices through an optical splitter, and the device comprises: A first determination unit determines a first identifier set to which a first identifier belongs when receiving a first delay request message carrying the first identifier sent by a first user-side device, wherein different identifier sets correspond to different user-side devices, and identifiers in a same identifier set are used to distinguish delay request messages sent at different time instants by a same user-side device. A second determination unit determines the first user-side device corresponding to the first identifier set according to a correspondence between an identifier set and a user-side device. A message sending unit sends a first delay request response message carrying time synchronization information and the first identifier to the first user-side device via the optical splitter, wherein the first user-side device is any one of the plurality of user-side devices.
9. A system for time synchronization based on optical communication, characterized in that The system comprises a local-side device and a plurality of user-side devices, A first user-side device is configured to add a first identifier selected from a first identifier set according to a preset selection rule to a generated delay request message to obtain a first delay request message carrying the first identifier, and send the first delay request message carrying the first identifier to a local-side device, wherein the first user-side device is any one of the plurality of user-side devices. The local device is configured to determine a first identifier set to which the first identifier belongs when receiving a first delay request message carrying the first identifier sent by the first user device; determine the first user device corresponding to the first identifier set according to a corresponding relationship between an identifier set and a user device; and send a first delay request response message carrying time synchronization information and the first identifier to the first user device. The first user device is further configured to receive the first delay request response message carrying the time synchronization information and the first identifier sent by the local device.
10. An electronic device, comprising: The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method steps of any one of claims 1-6. The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method steps of any one of claims 1-6. 11. A computer readable storage medium characterized by,
Citation Information
Patent Citations
Time synchronization method, equipment and system
CN105323028A
Message processing method and system
CN107612650A