A data processing method and apparatus

By using Psync and SFC to verify the FEC codeword position in the data stream in a passive optical network, the problem of long time consumption in determining the ONU synchronization state is solved, and fast and efficient synchronization state entry is achieved.

CN120935479BActive Publication Date: 2026-07-31HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2020-03-09
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

In a passive optical network, the process of the ONU determining whether to enter the synchronization state requires searching for a specific synchronization sequence in the header of a data frame in a continuous data stream, which results in a relatively long time before entering the synchronization state.

Method used

By verifying the physical synchronization sequence (Psync) and superframe counter (SFC) in the data stream, and determining the position of the FEC codeword after entering the pre-synchronization state, the decoding verification of the FEC codeword is used to determine whether to enter the synchronization state.

Benefits of technology

It improves the efficiency of ONU entering synchronization state in a shorter time and reduces the probability of missynchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120935479B_ABST
    Figure CN120935479B_ABST
Patent Text Reader

Abstract

This application provides a data processing method and apparatus that can improve the efficiency of an optical network unit entering a synchronization state. The method provided in this embodiment includes: after the optical network unit enters a pre-synchronization state, the optical network unit determines the position of the forward error correction (FEC) codeword boundary in the data stream based on the position of the Psync field, and performs FEC codeword decoding verification; if there is an FEC codeword that passes the decoding verification among N consecutive FEC codewords in the data stream, then the optical network unit enters a synchronization state, where N is an integer greater than or equal to 1.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The original application has the application number 202010157877.7 and the original application date is March 9, 2020. The entire contents of the original application are incorporated herein by reference. Technical Field

[0002] This application relates to the field of data transmission technology, and in particular to a data processing method and apparatus. Background Technology

[0003] A passive optical network (PON) consists of an optical line terminal (OLT) at the central office, optical network units (ONUs) or optical network terminals (ONTs) at the user side, and an optical distribution network (ODN). The OLT provides the network-side interface for the PON system, connecting to one or more ODNs. The ONU or ONT provides the user-side interface for the PON system, connecting to the ODN. The ODN is a network composed of optical fibers and passive optical splitters, used to connect the OLT and ONUs (hereinafter, ONU will be used to represent both OLT and ONU), and to distribute or multiplex data signals between the OLT and ONUs. In PON, the data from the OLT to the ONU is called downlink; conversely, the data from the ONU to the OLT is called uplink.

[0004] In a PON system, when the OLT transmits downlink data to the ONU, the ONU often needs to determine whether to enter a synchronization state. After the ONU enters the synchronization state, it can parse the data within the data frame. Currently, in determining whether to enter the synchronization state, the ONU searches for a specific synchronization sequence in the header of the data frame within the continuous data stream. When it finds this synchronization sequence and continues searching for another synchronization sequence after a data frame interval, it can determine that it can enter the synchronization state.

[0005] However, since each data frame has only one specific sequence and each data frame lasts for a long time, it often takes a long time to find at least two synchronization sequences in a continuous data stream, which results in a long time to enter the synchronization state. Summary of the Invention

[0006] This application provides a data processing method and apparatus that determines whether to enter a pre-synchronization state by verifying the physical synchronization sequence (Psync) and superframe counter (SFC) in the data stream. After entering the pre-synchronization state, the position of forward error correction (FEC) codewords in the data stream is determined, and the synchronization state is entered when an FEC codeword decoding verification passes. Since there are multiple FEC codewords between any two Psyncs in the data stream, determining whether to enter the synchronization state by determining whether the FEC codeword has been decoded can enter the synchronization state in a shorter time, thus improving the efficiency of entering the synchronization state.

[0007] The first aspect of this application provides a data processing method applicable to an optical network unit (ONU) receiving downlink data frames. The method includes: after the ONU enters a pre-synchronization state, the ONU determines the position of the FEC codeword boundary in the data stream based on the position of the Psync field, and performs FEC codeword decoding verification; if there is an FEC codeword that passes the decoding verification among N consecutive FEC codewords in the data stream, the ONU enters a synchronization state, where N is an integer greater than or equal to 1. In other words, after the ONU enters the pre-synchronization state, since the position of Psync and the position of the FEC codeword are relatively fixed, the boundary position of the FEC codeword can be determined based on Psync, thereby determining the FEC codeword in the data stream; finally, by performing decoding verification on the FEC codeword, when there is an FEC codeword that passes the decoding verification among N consecutive FEC codewords in the data stream, the ONU transitions from the pre-synchronization state to the synchronization state, thereby achieving rapid entry into the synchronization state.

[0008] In this embodiment, the pre-synchronization state is determined by verifying Psync and SFC in the data stream. After entering the pre-synchronization state, the position of FEC codeword in the data stream is determined, and the synchronization state is entered when the FEC codeword decoding verification passes. Since there are multiple FEC codewords between any two Psyncs in the data stream, determining whether to enter the synchronization state by determining whether the FEC codeword has been decoded can enter the synchronization state in a shorter time, thus improving the efficiency of entering the synchronization state.

[0009] In one possible implementation, the method further includes: the optical network unit searching for a field matching a preset Psync in the received data stream; if the optical network unit finds a Psync field matching the preset Psync in the data stream, the optical network unit verifies whether a first field with a preset number of bits following the Psync field constitutes a valid SFC structure; if the first field constitutes a valid SFC structure, the optical network unit enters a pre-synchronization state.

[0010] In one possible implementation, after the optical network unit (ONU) enters the pre-synchronization state and before it enters the synchronization state, the method further includes: the ONU determining the SFC field located after the first field in the data stream based on the position of the first field; the ONU verifying the SFC field, and the verification result of the SFC field being SFC verification successful. That is, after the ONU enters the pre-synchronization state, in addition to performing FEC codeword verification in the data stream, the ONU also needs to perform SFC verification. When the FEC codeword verification passes and the SFC verification is successful, the ONU enters the synchronization state from the pre-synchronization state. Therefore, by further verifying the validity of the SFC field, the synchronization accuracy can be improved and the probability of missynchronization can be reduced.

[0011] In one possible implementation, the method further includes: if none of the N consecutive FEC codewords in the data stream have passed the decoding verification, the optical network unit returns from the pre-synchronization state to the search state, where N is an integer greater than or equal to 1. That is, if none of the N consecutive FEC codewords in the data stream have passed the decoding verification, it can be considered that the optical network unit has mistakenly entered pre-synchronization, and the optical network unit can return from the pre-synchronization state to the search state to re-search for matching Psync and SFC fields.

[0012] In one possible implementation, the method further includes: after the optical network unit enters the synchronization state, if M consecutive FEC codewords in the data stream fail the decoding verification, the optical network unit migrates from the synchronization state to the resynchronization state; if there is an FEC codeword that passes the decoding verification among the M consecutive FEC codewords in the data stream, the optical network unit remains in the synchronization state; where M is an integer greater than or equal to 1. That is, after the optical network unit enters the synchronization state, if none of the M consecutive FEC codewords in the data stream pass the decoding verification, the optical network unit may have mistakenly entered the synchronization state. Therefore, the optical network unit can enter the resynchronization state to resynchronize; if there is an FEC codeword that passes the decoding verification among the M consecutive FEC codewords in the data stream, the optical network unit can remain in the synchronization state.

[0013] In one possible implementation, the method further includes: after the optical network unit enters the resynchronization state, if there is an FEC codeword that has passed decoding verification among S consecutive FEC codewords in the data stream, then the optical network unit migrates from the resynchronization state to the synchronization state, where S is an integer greater than or equal to 1. That is, after the optical network unit enters the resynchronization state, it can determine whether to re-enter the synchronization state by decoding and verifying the FEC codewords in the data stream, thereby avoiding erroneous exit from the synchronization state due to bit errors in the data stream.

[0014] In one possible implementation, the method further includes: after the optical network unit enters the resynchronization state, if there is no FEC codeword that has passed the decoding verification among the S consecutive FEC codewords in the data stream, the optical network unit migrates from the resynchronization state to the search state.

[0015] In one possible implementation, the method further includes: the optical network unit (ONU) decoding the FEC codewords in the data stream to obtain a decoded codeword payload; the ONU obtaining a decoded Psync based on the decoded codeword payload, wherein the decoded Psync is located within the decoded codeword payload; if the decoded Psync matches a preset Psync, the ONU verifies whether a second field of a preset number of bits following the decoded Psync constitutes a valid SFC structure; if the second field constitutes a valid SFC structure, the ONU transitions from a pre-synchronization state to a synchronization state or remains in a synchronization state. In other words, when the Psync is located within the FEC codewords, after the ONU enters the pre-synchronization state, it can still determine whether to enter the synchronization state by verifying the decoded Psync and the SFC, thus improving the flexibility of the implementation.

[0016] In one possible implementation, the method further includes: after the optical network unit enters the synchronization state, if there is a decoded Psync that does not match the preset Psync or the SFC verification fails, the optical network unit migrates from the synchronization state to the resynchronization state; if there is a decoded Psync that matches the preset Psync and the SFC verification is successful, the optical network unit remains in the synchronization state.

[0017] In one possible implementation, the method further includes: after the optical network unit enters the resynchronization state, for P consecutive data frames in the data stream, if there exists a decoded Psync that matches the preset Psync and the SFC verification is successful, then the optical network unit transitions from the resynchronization state to the synchronization state; where P is an integer greater than 1. In other words, after the optical network unit enters the resynchronization state, if within multiple consecutive data frames in the data stream there exists a decoded Psync that matches and the SFC verification is successful, then the optical network unit can transition from the resynchronization state to the synchronization state.

[0018] In one possible implementation, the method further includes: after the optical network unit enters the resynchronization state, if for P consecutive data frames in the data stream, there are decoded synchronization sequences that do not match the preset Psync or SFC verification fails, then the optical network unit transitions from the resynchronization state to the search state. In other words, after the optical network unit enters the resynchronization state, if in multiple consecutive data frames in the data stream there is no decoded Psync match or SFC verification successful, then the optical network unit transitions from the resynchronization state to the search state.

[0019] A second aspect of this application provides an optical network unit, comprising: a processing unit, the processing unit being configured to: after entering a pre-synchronization state, determine the position of an FEC codeword boundary in the data stream based on the position of a Psync field, and perform FEC codeword decoding verification, wherein the Psync field is a field in the data stream that matches a preset Psync; if there is an FEC codeword that passes the decoding verification among N consecutive FEC codewords in the data stream, then enter a synchronization state, wherein N is an integer greater than or equal to 1.

[0020] In one possible implementation, the processing unit is further configured to: search for a field matching a preset Psync in the received data stream; if a Psync field matching the preset Psync is found in the data stream, verify whether a first field with a preset number of bits following the Psync field constitutes a valid SFC structure; if the first field constitutes a valid SFC structure, enter the pre-synchronization state.

[0021] In one possible implementation, the processing unit is further configured to: determine an SFC field in the data stream following the first field based on the position of the first field; verify the SFC field, and the verification result of the SFC field is that the SFC field constitutes a valid SFC structure.

[0022] In one possible implementation, the processing unit is further configured to: if there is no FEC codeword that has passed the decoding check among N consecutive FEC codewords in the data stream, then return from the pre-synchronization state to the search state, where N is an integer greater than or equal to 1.

[0023] In one possible implementation, the processing unit is further configured to: after entering the synchronization state, if M consecutive FEC codewords in the data stream fail the decoding verification, then transition from the synchronization state to the resynchronization state; if there is an FEC codeword that passes the decoding verification among the M consecutive FEC codewords in the data stream, then maintain the synchronization state; wherein M is an integer greater than or equal to 1.

[0024] In one possible implementation, the processing unit is further configured to: after entering the resynchronization state, if there is an FEC codeword that has passed the decoding verification among the S consecutive FEC codewords in the data stream, then transition from the resynchronization state to the synchronization state, where S is an integer greater than or equal to 1.

[0025] In one possible implementation, the processing unit is further configured to: after entering the resynchronization state, if there is no FEC codeword that has passed the decoding check among the S consecutive FEC codewords in the data stream, then transition from the resynchronization state to the search state.

[0026] In one possible implementation, the processing unit is further configured to: decode the FEC codewords in the data stream to obtain the decoded codeword payload; obtain the decoded Psync based on the decoded codeword payload, wherein the decoded Psync is located in the decoded codeword payload; if the decoded Psync matches the preset Psync, verify whether the second field located after the decoded Psync by a preset number of bits constitutes a valid SFC structure; if the second field constitutes a valid SFC structure, then enter the synchronization state from the pre-synchronization state or remain in the synchronization state.

[0027] In one possible implementation, the processing unit is further configured to: after entering the synchronization state, if there is a decoded Psync that does not match the preset Psync or the SFC verification fails, then transition from the synchronization state to the resynchronization state; if there is a decoded Psync that matches the preset Psync and the SFC verification is successful, then maintain the synchronization state.

[0028] In one possible implementation, the processing unit is further configured to: after entering the resynchronization state, for P consecutive data frames in the data stream, if there is a decoded Psync that matches the preset Psync and the SFC verification is successful, then transition from the resynchronization state to the synchronization state; where P is an integer greater than 1.

[0029] In one possible implementation, the processing unit is further configured to: after entering the resynchronization state, if for P consecutive data frames in the data stream, there are decoded synchronization sequences that do not match the preset Psync or SFC verification fails, then transition from the resynchronization state to the search state.

[0030] A third aspect of this application provides an optical network unit, comprising: a processor and a memory, wherein the memory stores the operation instructions, and the processor reads the operation instructions from the memory to implement the method described in any of the first aspects above.

[0031] The fourth aspect of this application provides an optical network system, including an optical line terminal, an optical distribution network, and an optical network unit as described in any of the second or third aspects.

[0032] The fifth aspect of this application provides a computer program product containing instructions that, when executed on a computer, cause the computer to perform a method as described in either the first or second aspect.

[0033] A sixth aspect of this application provides a computer-readable storage medium including computer program instructions that, when executed on a computer, cause the computer to perform a method as described in either the first or second aspect.

[0034] It is understood that the optical network unit of the second aspect, the optical network unit of the third aspect, the optical network system of the fourth aspect, the computer program product of the fifth aspect, and the computer-readable storage medium of the sixth aspect are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0035] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0036] In this embodiment, after entering the pre-synchronization state, the position of the FEC codeword in the data stream is determined, and the synchronization state is entered when the FEC codeword decoding verification passes. Since there are multiple FEC codewords between any two Psyncs in the data stream, determining whether to enter the synchronization state by determining whether the FEC codeword has been decoded can enter the synchronization state in a shorter time, thus improving the efficiency of entering the synchronization state. Attached Figure Description

[0037] Figure 1 An example diagram of the network architecture of the passive optical network provided in the embodiments of this application;

[0038] Figure 2A A schematic diagram illustrating an example of the structure of a downlink data frame provided in an embodiment of this application;

[0039] Figure 2B Another example schematic diagram illustrating the structure of a downlink data frame provided in the embodiments of this application;

[0040] Figure 3A This is a schematic diagram of a downlink data frame structure provided in an embodiment of this application;

[0041] Figure 3B A schematic diagram of another downlink data frame structure provided in an embodiment of this application;

[0042] Figure 4 A schematic flowchart of the data processing method 400 provided in an embodiment of this application;

[0043] Figure 5 A schematic diagram illustrating the state transition process of an optical network unit provided in this application embodiment;

[0044] Figure 6 A flowchart illustrating the data processing method 600 provided in an embodiment of this application;

[0045] Figure 7 A schematic diagram illustrating the state transition process of an optical network unit provided in this application embodiment;

[0046] Figure 8 This is a schematic diagram of the structure of an optical network unit 800 provided in an embodiment of this application. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application are described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Those skilled in the art will understand that with the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0048] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or modules is not necessarily limited to those explicitly listed, but may include other steps or modules not explicitly listed or inherent to such processes, methods, products, or devices. The naming or numbering of steps appearing in this application does not imply that the steps in the method flow must be performed in the chronological / logical order indicated by the naming or numbering. The execution order of named or numbered process steps can be changed according to the desired technical purpose, as long as the same or similar technical effect is achieved. The division of units in this application is a logical division. In practical applications, there may be other division methods. For example, multiple units may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the shown or discussed mutual coupling, direct coupling, or communication connection may be through some interface, and the indirect coupling or communication connection between units may be electrical or other similar forms, none of which are limited in this application. Furthermore, the units or sub-units described as separate components may or may not be physically separated, may or may not be physical units, or may be distributed among multiple circuit units. Some or all of the units can be selected to achieve the purpose of the solution in this application according to actual needs.

[0049] The following first combines Figure 1 The following is an exemplary illustration of the network architecture of the passive optical network used in the data processing method shown in this application:

[0050] like Figure 1As shown, the passive optical network 100 in this embodiment includes one or more optical line terminals (OLTs) 110, optical distribution networks (ODNs) 120, and multiple optical network units (ONUs).

[0051] In this embodiment, OLT110 is connected to multiple ONUs in a point-to-multipoint manner via ODN120. This embodiment uses a passive optical network 100 including one OLT101 as an example for illustrative purposes. This embodiment does not limit the specific number of ONUs, as long as there are multiple ONUs. For example, the passive optical network shown in this embodiment includes n ONUs, namely ONU1301, ONU1302, ..., ONU130n.

[0052] To better illustrate the communication process of uplink and downlink service data shown in this application, the direction from OLT110 to ONU is defined as the downlink direction, and the direction from ONU to OLT101 is defined as the uplink direction.

[0053] A passive optical network can be a communication network that does not require any active devices to achieve communication between OLT110 and ONU1301, ONU1302... ONU130n. Specifically, the communication between OLT110 and ONU1301, ONU1302... ONU130n can be achieved through passive optical devices in ODN120, including but not limited to optical splitters or multiplexers.

[0054] The OLT110 is typically located in the central office (CO), where it manages ONUs 1301, 1302, ..., 130n. The OLT110 acts as an intermediary between ONUs 1301, 1302, ..., 130n and the upper-layer network. For example, in the downlink direction, the OLT110 forwards data received from the upper-layer network as downlink service data to ONUs 1301, 1302, ..., 130n via the downlink wavelength channel. Similarly, in the uplink direction, the OLT110 forwards uplink service data received from ONUs 1301, 1302, ..., 130n to the upper-layer network via the uplink wavelength channel.

[0055] ODN120 can be a data distribution system, which may include optical fibers, optical couplers, optical splitters, optical multiplexers, and / or other devices. In one embodiment, the optical fibers, optical couplers, optical splitters, optical multiplexers, and / or other devices may be passive optical devices. Specifically, these devices may be power-free devices that distribute data signals between OLT110 and ONU1301, ONU1302...ONU130n. In other embodiments, ODN120 may also include one or more processing devices, such as optical amplifiers or relay devices. ODN120 can specifically extend from OLT110 to multiple ONU1301, ONU1302...ONU130n, but can also be configured in any other point-to-multipoint structure; this embodiment is not limited to any specific configuration.

[0056] ONU1301, ONU1302...ONU130n can be distributed and deployed at user-side locations (such as user premises). ONU1301, ONU1302...ONU130n can serve as network devices for communication between the OLT110 and the user. Specifically, ONU1301, ONU1302...ONU130n can act as a medium between the OLT110 and the user. For example, ONU1301, ONU1302...ONU130n can forward downlink service data received from the OLT110 to the user, and forward data received from the user as uplink service data to the OLT110.

[0057] Currently, in PON systems, when the OLT transmits downlink data to the ONU, the ONU often needs to perform downlink data frame delimitation. After the ONU completes downlink data frame delimitation, it can parse the data within the data frame. Taking a 10G PON system with a downlink rate of 10Gbit / s and an uplink rate of 2.5Gbit / s or 10Gbit / s as an example... Figure 2A As shown, in a 10G PON system, downlink data is typically transmitted in 125-microsecond units, with each 125-microsecond unit constituting a complete downlink data frame. The header of each downlink data frame contains a 24-byte physical layer synchronization block (PSBd). Figure 2B As shown, PSBd includes Psync, SFC structure and Passive Optical Network Identifier (PON-id) structure.

[0058] During downlink data frame delimitation, the ONU needs to search for Psync in the continuous data stream. After finding Psync, it verifies the correctness of SFC. Once both Psync and SFC are successfully verified, the ONU enters a pre-synchronization state. If the ONU finds repeated Psync and SFC within a data stream at intervals of one or more downlink data frames, it transitions from the pre-synchronization state to the synchronization state. In other words, the ONU needs to find at least two PSBds in the continuous data stream, and both Psync and SFC in the two PSBds must be successfully verified before it can enter the synchronization state. Clearly, since each data frame has only one PSBd and the duration of each data frame is fixed (e.g., 125 microseconds), the current frame delimitation method is inefficient and takes a long time to enter the synchronization state.

[0059] In addition, in some PON systems with high bit error rates (such as high-speed PON systems), the bit error rates of Psync and SFC are relatively high. Once there are certain bit errors in Psync or SFC, the ONU may have difficulty finding a matching Psync and SFC in a short period of time, thus prolonging the time to enter the synchronization state.

[0060] In view of this, embodiments of this application provide a data processing method that determines whether to enter a pre-synchronization state by verifying Psync and SFC in the data stream. After entering the pre-synchronization state, the position of FEC codewords in the data stream is determined, and the synchronization state is entered when the decoding verification of an FEC codeword passes. Since there are multiple FEC codewords between any two Psyncs in the data stream, determining whether to enter the synchronization state by determining whether the FEC codeword has passed the decoding can enter the synchronization state in a shorter time, thus improving the efficiency of entering the synchronization state.

[0061] It should be noted that the data processing method provided in this application embodiment can be applied to PON systems at various rates, such as 10G PON systems or high-speed PON systems. High-speed PON systems can refer to 50G PON systems or PON systems with even higher rates, and are not specifically limited here.

[0062] The data processing method provided in this application can be applied to downlink data frame delimitation, i.e., the ONU determines the boundary position in the downlink data frame; the data processing method can also be applied to uplink data frame delimitation, i.e., the OLT determines the boundary position in the uplink data frame. For ease of description, the following will take the application of the data processing method to downlink data frame delimitation as an example to describe the data processing method provided in this application in detail.

[0063] Furthermore, the data processing method provided in this application embodiment can be applied to processing downlink data with different frame structures. Specifically, the frame structure of the downlink data can include the following two cases:

[0064] 1. PSBd is not within the FEC codeword.

[0065] In the downlink data stream, the downlink data stream consists of consecutive downlink data frames, and each downlink data frame consists of multiple FEC codewords. At the frame header of each downlink data frame, there is a PSBd, which is located outside the FEC codewords.

[0066] like Figure 3A As shown, Figure 3A This is a schematic diagram of a downlink data frame structure provided in an embodiment of this application, wherein downlink data frame 1 and downlink data frame 2 are two consecutive downlink data frames. Both downlink data frame 1 and downlink data frame 2 include 300 FEC codewords (i.e., FEC codeword 1 to FEC codeword 300), and there is a PSBd at the frame header position of the downlink data frame, meaning that the PSBd is located before the first FEC codeword and is not within the FEC codeword.

[0067] 2. PSBd is within the FEC codeword.

[0068] In the downlink data stream, the downlink data stream consists of consecutive downlink data frames, and each downlink data frame consists of multiple FEC codewords. At the frame header of each downlink data frame, there is a PSBd, which is located within the first FEC codeword of the downlink data frame.

[0069] like Figure 3B As shown, Figure 3B This is a schematic diagram of another downlink data frame structure provided in an embodiment of this application, wherein downlink data frame 1 and downlink data frame 2 are two consecutive downlink data frames. Both downlink data frame 1 and downlink data frame 2 include 300 FEC codewords (i.e., FEC codeword 1 to FEC codeword 300), and the first FEC codeword of the downlink data frame includes a PSBd, that is, the PSBd is located within the first FEC codeword.

[0070] Please refer to Figure 4 , Figure 4 This is a flowchart illustrating the data processing method 400 provided in an embodiment of this application. Figure 4 As shown, the data processing method 400 provided in this application embodiment includes:

[0071] 401. The optical network unit searches for a field in the received data stream that matches the preset Psync.

[0072] After the optical network unit (ONU) is started, it enters a search state, meaning it searches for a field in the received downlink data stream that matches a preset Psync. This preset Psync can be pre-defined and is a specific sequence in the data stream used to achieve downlink data frame synchronization.

[0073] 402. If the optical network unit finds a Psync field that matches the preset Psync in the data stream, the optical network unit verifies whether the first field located after the preset number of bits after the Psync field constitutes a valid SFC structure.

[0074] If the optical network unit (ONU) finds a field in the data stream that matches the preset Psync field, it can be considered that the ONU has found a Psync field matching the preset Psync field in the data stream. The ONU can then verify whether the first field following the Psync field can form a valid SFC structure. The first field can be a field of a preset number of bits following the Psync field. For example, in the case of a 64-bit SFC, the first field could be a 64-bit field following the Psync field. Simply put, the number of bits in the first field is the same as the number of bits in the SFC.

[0075] 403. If the first field constitutes a valid SFC structure, the optical network unit enters the pre-synchronization state.

[0076] If the first field following the Psync field constitutes a valid SFC structure, then the optical network unit (ONU) can be considered to have found the PSBd located at the frame header position of the downlink data frame, and the ONU can enter the pre-synchronization state. The pre-synchronization state is the state the ONU enters before entering the synchronization state. In the pre-synchronization state, the ONU can continue to further detect the data stream, allowing it to transition from the pre-synchronization state to the synchronization state, or return from the pre-synchronization state to the search state.

[0077] Conversely, if the first field following the Psync field does not constitute a valid SFC structure, it can be assumed that the Psync field searched by the optical network unit that matches the preset Psync is not the Psync in PSBd, but may be caused by other data errors in the downlink data stream. That is, some data bits in the downlink data stream become the Psync field that matches the preset Psync due to bit errors. Therefore, the optical network unit continues to execute step 401, that is, continues to search for the field that matches the preset Psync.

[0078] 404. After the optical network unit enters the pre-synchronization state, the optical network unit determines the position of the FEC codeword boundary in the data stream based on the position of the Psync field, and performs FEC codeword decoding verification.

[0079] In this embodiment, since PSBd is located at the frame header of the downlink data stream, and the FEC codeword is located after PSBd, the position of the FEC codeword boundary in the downlink data stream can be determined based on the position of the Psync field in PSBd after determining the Psync field. For example, corresponding to... Figure 3A In the downlink data frame structure, after determining the Psync field in PSBd, since the number of bits in PSBd is fixed, the end position of PSBd can be determined, and this end position is the start position of the first FEC codeword. Since the length (number of data bits) of each FEC codeword in the downlink data frame is also fixed, the boundary position of each FEC codeword in the downlink data frame can also be determined based on the start position of the first FEC codeword.

[0080] After determining the boundary positions of the FEC codewords in the downlink data frame, the FEC codewords following PSBd can be decoded and verified. This involves decoding the FEC codewords using a decoder and determining whether the decoding was successful based on the decoder's instructions. In the downlink data frame, only when the boundaries of the FEC codewords are correctly determined can the correct FEC codeword be obtained, resulting in successful decoding. If the boundaries are incorrectly determined, the correct FEC codeword cannot be obtained, and incorrect FEC codewords typically lead to decoding failure. Therefore, by determining whether the FEC codewords can be successfully decoded, we can determine whether the determined boundary positions of the FEC codewords are correct. Since the boundary positions of the FEC codewords are determined based on PSBd, by determining whether the FEC codewords can be successfully decoded, we can determine whether the searched PSBd is correct.

[0081] 405. If there is an FEC codeword that has passed the decoding verification among N consecutive FEC codewords in the data stream, then the optical network unit enters the synchronization state, where N is an integer greater than or equal to 1.

[0082] It should be understood that, due to the possibility of errors in FEC codewords within downlink data frames, some FEC codewords may fail the decoding check. For example, if multiple data bits in the first FEC codeword after PSBd have errors, the first FEC codeword may fail the decoding check; however, if no data bits or only a very few data bits in the second FEC codeword after PSBd have errors, the second FEC codeword may pass the decoding check.

[0083] Therefore, to avoid incorrectly determining that the correct PSBd was not found due to FEC codeword errors, in this embodiment, the synchronization state can be determined by checking whether there is an FEC codeword that has passed decoding verification among N consecutive FEC codewords in the downlink data stream. If there is an FEC codeword that has passed decoding verification among N consecutive FEC codewords in the downlink data stream, the optical network unit enters the synchronization state. For example, when N is 3, if there is an FEC codeword that has passed decoding verification among the three consecutive FEC codewords after PSBd in the downlink data stream, the optical network unit enters the synchronization state; that is, as long as any one of the first, second, or third FEC codewords after PSBd in the downlink data stream can pass decoding verification, the optical network unit can enter the synchronization state. Specifically, the optical network unit can enter the synchronization state immediately after discovering that an FEC codeword has passed the decoding verification, without waiting for all three FEC codewords to be decoded and verified and for any FEC codeword to pass the decoding verification before entering the synchronization state. The synchronization state is the state in which the optical network unit performs normal data processing; that is, after entering the synchronization state, the optical network unit can parse the downlink data frame to obtain the valid data transmitted in the downlink data frame.

[0084] It should be understood that the downlink data stream is scrambled, meaning it is obtained by performing certain operations on the original signal (e.g., by performing operations on the original signal using a polynomial). Therefore, the optical network unit (ONU) needs to descramble the data before performing FEC decoding. During descrambling, the ONU needs to use the data content in the SFC (Side Frame Correction). Since the SFC field itself has a certain error correction capability, as long as the number of bit errors in the SFC field is less than 2 bits, the SFC can be correctly recovered and used for descrambling the downlink data frame. Therefore, before performing FEC decoding, the ONU can descramble the downlink data stream according to the first field mentioned above, and then perform FEC decoding.

[0085] In one possible implementation, method 400 further includes: if none of the N consecutive FEC codewords in the data stream have passed the decoding verification, the optical network unit returns from the pre-synchronization state to the search state, where N is an integer greater than or equal to 1. That is, if none of the N consecutive FEC codewords in the data stream have passed the decoding verification, it can be considered that the optical network unit has mistakenly entered the pre-synchronization state, and the optical network unit can return from the pre-synchronization state to the search state to re-search for matching Psync and SFC fields.

[0086] Where N is a preset value, specifically an integer greater than or equal to 1, such as 3 or 4. The specific value of N can be set according to the actual situation, and there is no specific limitation here.

[0087] In this embodiment, the pre-synchronization state is determined by verifying Psync and SFC in the data stream. After entering the pre-synchronization state, the position of FEC codeword in the data stream is determined, and the synchronization state is entered when the FEC codeword decoding verification passes. Since there are multiple FEC codewords between any two Psyncs in the data stream, determining whether to enter the synchronization state by determining whether the FEC codeword has been decoded can enter the synchronization state in a shorter time, thus improving the efficiency of entering the synchronization state.

[0088] In one possible implementation, after the optical network unit (ONU) discovers a decoded and verified FEC codeword among N consecutive FEC codewords in the data stream, method 400 further includes: the ONU determining the SFC field following the first field in the data stream based on the position of the first field; the ONU verifying the SFC field, and if the verification result of the SFC field is successful, the ONU enters a synchronization state. Since the length of each data frame in the downlink data stream is fixed, and the position of the SFC structure in each downlink data frame is also fixed, after determining the first field, the position of the SFC field following the first field can be determined based on the position of the first field and the length of the downlink data frame, i.e., the position of the next SFC structure can be determined.

[0089] It should be noted that after the optical network unit (ONU) verifies that the first field constitutes a valid SFC structure, the ONU stores the SFC value of the first field locally and enters a pre-synchronization state. Before verifying the SFC field, the ONU increments the locally stored SFC value by 1. Therefore, the ONU's verification of the SFC field specifically includes: verifying whether the SFC field constitutes a valid SFC structure and verifying whether the corresponding SFC value is equal to the locally stored SFC value. If the SFC field constitutes a valid SFC structure and the corresponding SFC value is equal to the locally stored SFC value, then the verification result of the SFC field is determined to be that the SFC field constitutes a valid SFC structure.

[0090] In simple terms, after the optical network unit (ONU) enters the pre-synchronization state, it needs to perform both FEC codeword verification and SFC verification in the data stream. When both the FEC codeword verification and SFC verification are successful, the ONU transitions from the pre-synchronization state to the synchronization state. Therefore, by further verifying the SFC field on top of the FEC codeword verification, the accuracy of synchronization can be improved, and the probability of missynchronization can be reduced.

[0091] In one possible implementation, method 400 further includes: after the optical network unit enters the synchronization state, if M consecutive FEC codewords in the data stream fail the decoding verification, the optical network unit transitions from the synchronization state to the resynchronization state, where M is an integer greater than or equal to 1. That is, after the optical network unit enters the synchronization state, if none of the M consecutive FEC codewords in the data stream pass the decoding verification, the optical network unit may have mistakenly entered the synchronization state. Therefore, the optical network unit can enter the resynchronization state to resynchronize; in other words, the resynchronization state is a state used for resynchronization.

[0092] Conversely, after an optical network unit enters the synchronization state, if any M consecutive FEC codewords in the data stream contain an FEC codeword that has passed the decoding verification, the optical network unit remains in the synchronization state.

[0093] Where M is a preset value, specifically an integer greater than or equal to 1, such as 3 or 4. The specific value of M can be set according to the actual situation and is not specifically limited here. In one possible implementation, M can be equal to N mentioned above.

[0094] It should be noted that in existing technologies, optical network units (ONUs) determine whether to maintain synchronization by verifying Psync and SFC in the downlink data stream. Under high bit error rates, Psync and SFC verification are prone to failure due to bit errors, easily causing the ONU to erroneously exit the synchronization state. In this embodiment, however, the determination of whether to maintain synchronization is based on verifying whether multiple consecutive FEC codewords in the downlink data stream contain a successfully decoded FEC codeword. This reduces the probability of erroneous exits from the synchronization state and prevents the ONU from frequently exiting synchronization.

[0095] In one possible implementation, if an optical network unit enters a resynchronization state, the optical network unit can determine whether to return to the synchronization state by continuing to decode and verify the FEC codewords in the downlink data stream.

[0096] Specifically, method 400 further includes: after the optical network unit enters the resynchronization state, the optical network unit decodes and verifies the FEC codewords in the downlink data stream. If there is an FEC codeword that passes the decoding verification among S consecutive FEC codewords in the downlink data stream, the optical network unit transitions from the resynchronization state to the synchronization state, where S is an integer greater than or equal to 1. In other words, after the optical network unit enters the resynchronization state, it can determine whether to re-enter the synchronization state by decoding and verifying the FEC codewords in the data stream, thereby avoiding erroneous exit from the synchronization state due to bit errors in the data stream.

[0097] Wherein, S is a preset value, specifically an integer greater than or equal to 1, such as 3 or 4. The specific value of S can be set according to actual conditions and is not specifically limited here. In one possible implementation, S can be equal to N and / or M mentioned above.

[0098] In one possible implementation, the method further includes: after the optical network unit enters the resynchronization state, if there is no FEC codeword that has passed the decoding verification among the S consecutive FEC codewords in the data stream, the optical network unit transitions from the resynchronization state to the search state.

[0099] In other words, after an optical network unit enters the resynchronization state, it can decide whether to return to the synchronization state or migrate to the search state by continuing to decode and verify the FEC codeword.

[0100] Understandably, after an optical network unit (ONU) enters the synchronization state, if M consecutive FEC codewords in the downlink data stream experience errors, the ONU may enter the resynchronization state. In the resynchronization state, the ONU can continue to decode and verify multiple consecutive FEC codewords. If the FEC codeword decoding verification passes, it can be assumed that the ONU mistakenly entered the resynchronization state, and therefore the ONU returns to the synchronization state. If the FEC codeword verification fails, it can be assumed that the ONU mistakenly entered the synchronization state, and therefore the ONU transitions from the resynchronization state to the search state.

[0101] For ease of understanding, the following will combine Figure 5 The data processing method provided in this embodiment will be described in detail. For example... Figure 5 As shown, Figure 5 This is a schematic diagram illustrating the state transition process of an optical network unit provided in an embodiment of this application.

[0102] 501, Psync matching, and SFC are valid.

[0103] When the optical network unit is in the hunt state, it searches for a Psync field in the downlink data stream that matches the preset Psync. After the optical network unit finds a Psync field that matches the preset Psync, it verifies whether the field following the Psync can form a valid SFC structure. If the field following the Psync field can form a valid SFC structure, it means that the Psync in the downlink data stream matches and the SFC structure is valid. The optical network unit then transitions from the hunt state to the pre-sync state.

[0104] 502. Among N consecutive FEC codewords, there is an FEC codeword that passes the decoding verification, that is, at least one FEC codeword among N consecutive FEC codewords has passed the decoding verification.

[0105] When the optical network unit (ONU) is in the pre-synchronization state, it determines the boundary position of the FEC codeword in the downlink data stream based on the Psync field mentioned above, and then performs decoding verification on the FEC codeword. If there is an FEC codeword that passes the decoding verification among N consecutive FEC codewords in the downlink data stream, the ONU transitions from the pre-synchronization state to the synchronization state. Here, N is an integer greater than or equal to 1.

[0106] 503. There are no FEC codewords that pass the decoding test among N consecutive FEC codewords, that is, all N consecutive FEC codewords fail the decoding test.

[0107] When the optical network unit (ONU) is in the pre-synchronization state, it determines the boundary position of the FEC codeword in the downlink data stream based on the Psync field mentioned above, and then performs decoding verification on the FEC codeword. If there is no FEC codeword that passes the decoding verification among N consecutive FEC codewords in the downlink data stream, the ONU returns from the pre-synchronization state to the search state.

[0108] 504. Among M consecutive FEC codewords, there is an FEC codeword that passes the decoding verification, that is, at least one FEC codeword among M consecutive FEC codewords has passed the decoding verification.

[0109] When the optical network unit (ONU) is in synchronization, it continuously decodes and verifies the FEC codewords in the downlink data stream. If there is a decoded and verified FEC codeword among M consecutive FEC codewords in the downlink data stream, the ONU remains in synchronization. Here, M is an integer greater than or equal to 1.

[0110] 505. There are no FEC codewords that pass the decoding test among M consecutive FEC codewords, that is, all M consecutive FEC codewords fail the decoding test.

[0111] When the optical network unit (ONU) is in the synchronization state, it continuously decodes and verifies the FEC codewords in the downlink data stream. If none of the M consecutive FEC codewords in the downlink data stream pass the decoding verification, the ONU transitions from the synchronization state to the re-sync state.

[0112] 506. Among S consecutive FEC codewords, there is an FEC codeword that passes the decoding verification, that is, at least one FEC codeword among S consecutive FEC codewords has passed the decoding verification.

[0113] When an optical network unit (ONU) is in resynchronization state, it continuously decodes and verifies the FEC codewords in the downlink data stream. If there is a decoded and verified FEC codeword among S consecutive FEC codewords in the downlink data stream, the ONU transitions from resynchronization state to synchronization state. Here, M is an integer greater than or equal to 1.

[0114] 507. FEC codeword decoding verification failed.

[0115] When the optical network unit (ONU) is in resynchronization state, it continuously decodes and verifies the FEC codewords in the downlink data stream. If the ONU detects a FEC codeword failure in the downlink data stream and the number of FEC codewords detected by the ONU has not reached S, the ONU remains in resynchronization state and continues to decode and verify the next FEC codeword in the downlink data stream.

[0116] 508. There are no FEC codewords that pass the decoding verification among the S consecutive FEC codewords, that is, no FEC codeword among the S consecutive FEC codewords has been successfully decoded.

[0117] When the optical network unit (ONU) is in the resynchronization state, it continuously decodes and verifies the FEC codewords in the downlink data stream. If none of the S consecutive FEC codewords in the downlink data stream pass the decoding verification, the ONU transitions from the resynchronization state to the search state.

[0118] The above embodiments can all be applied to Figure 3A as well as Figure 3B In the downlink data frame structure shown, the following text will focus on Figure 3B The downlink data frame structure shown provides an embodiment of another data processing method.

[0119] Please refer to Figure 6 , Figure 6 This is a flowchart illustrating the data processing method 600 provided in an embodiment of this application. Figure 6 As shown, the data processing method 600 provided in this application embodiment includes:

[0120] 601. The optical network unit searches for a field in the received data stream that matches the preset Psync.

[0121] In this embodiment, step 601 is similar to step 401 described above. For details, please refer to the description of step 401, which will not be repeated here.

[0122] 602. If the optical network unit finds a Psync field that matches the preset Psync in the data stream, the optical network unit verifies whether the first field located at the preset number of bits after the Psync field constitutes a valid SFC structure.

[0123] In this embodiment, step 602 is similar to step 402 described above. For details, please refer to the description of step 402, which will not be repeated here.

[0124] 603. If the first field constitutes a valid SFC structure, the optical network unit enters the pre-synchronization state.

[0125] In this embodiment, step 603 is similar to step 403 described above. For details, please refer to the description of step 403, which will not be repeated here.

[0126] 604. After the optical network unit enters the pre-synchronization state, the optical network unit decodes the FEC codewords in the data stream to obtain the decoded codeword payload.

[0127] The decoded codeword payload refers to the valid data portion of the FEC codeword obtained after decoding. It should be noted that, thanks to the error correction capability of the FEC codeword itself, when errors occur in individual data bits of the FEC codeword—for example, 1 or 2 bits of data in the FEC codeword are erroneous—the erroneous data bits can be corrected during the decoding process, thus achieving error correction in the FEC codeword.

[0128] 605. The optical network unit obtains the decoded Psync based on the decoded codeword payload, and the decoded Psync is located in the decoded codeword payload.

[0129] Since PSBd is located in the first FEC codeword of the downlink data frame, after decoding the FEC codeword to obtain the decoded codeword payload, the decoded Psync can be found based on this decoded codeword payload. Because the decoded Psync has already undergone decoding processing, any data bits in the Psync field that might have previously contained errors have been corrected by the FEC decoder during the decoding process. Therefore, performing a match check on Psync at this point can improve the success rate of the match.

[0130] 606. If the decoded Psync matches the preset Psync, the optical network unit verifies whether the second field located after the preset number of bits after the decoded Psync constitutes a valid SFC structure.

[0131] After obtaining the decoded Psync, the optical network unit (ONU) determines whether the decoded Psync matches a preset Psync. If the decoded Psync matches the preset Psync, the ONU continues to verify whether the second field, located at a preset number of bits after the decoded Psync, constitutes a valid SFC structure. The second field can be a field located at a preset number of bits after the decoded Psync field. For example, in the case of a 64-bit SFC, the second field could be a 64-bit field following the decoded Psync field. Simply put, the number of bits in the second field is the same as the number of bits in the SFC.

[0132] 607. If the second field constitutes a valid SFC structure, the optical network unit enters the synchronization state from the pre-synchronization state.

[0133] If the second field can form a valid SFC structure, the optical network unit will enter the synchronization state from the pre-synchronization state.

[0134] In this embodiment, the pre-synchronization state is determined by verifying Psync and SFC in the data stream. After entering the pre-synchronization state, the synchronous state is determined by verifying the decoded Psync and SFC. Since the decoded Psync can correct errors during the decoding process, the matching success rate of Psync can be improved, thereby increasing the probability of the optical network unit entering the synchronous state from the pre-synchronization state and avoiding the difficulty of the optical network unit entering the synchronous state due to Psync errors.

[0135] In one possible implementation, method 600 further includes: after the optical network unit enters the synchronization state, if there is a mismatch between the decoded Psync and the preset Psync or the SFC verification fails, the optical network unit migrates from the synchronization state to the resynchronization state; if there is a match between the decoded Psync and the preset Psync and the SFC verification is successful, the optical network unit remains in the synchronization state.

[0136] In other words, after the optical network unit (ONU) enters the synchronization state, it continuously verifies the decoded Psync and SFC in the downlink data stream. If the decoded Psync does not match the preset Psync or the SFC verification fails, the ONU transitions from the synchronization state to the resynchronization state. If the decoded Psync does not match the preset Psync but the SFC verification is successful, the ONU remains in the synchronization state.

[0137] In one possible implementation, method 600 further includes: after the optical network unit enters the resynchronization state, for P consecutive data frames in the data stream, if there is a decoded Psync that matches the preset Psync and the SFC verification is successful, the optical network unit migrates from the resynchronization state to the synchronization state; P is an integer greater than 1.

[0138] In other words, after the optical network unit enters the resynchronization state, the optical network unit verifies the decoded Psync and SFC in the downlink data stream. If, in multiple consecutive downlink data frames in the downlink data stream, there is a downlink data frame where the decoded Psync matches and the SFC verification is successful, the optical network unit can transition from the resynchronization state to the synchronization state.

[0139] In one possible implementation, method 600 further includes: after the optical network unit enters the resynchronization state, if for P consecutive data frames in the data stream, there are decoded synchronization sequences that do not match the preset Psync or SFC verification fails, then the optical network unit migrates from the resynchronization state to the search state.

[0140] In other words, after the optical network unit enters the resynchronization state, the optical network unit verifies the decoded Psync and SFC in the downlink data stream. If in multiple consecutive downlink data frames in the downlink data stream, there is a case of decoded Psync mismatch or SFC verification failure in each downlink data frame, the optical network unit will transition from the resynchronization state to the search state.

[0141] For ease of understanding, the following will combine Figure 7 The data processing method provided in this embodiment will be described in detail. For example... Figure 7 As shown, Figure 7 This is a schematic diagram illustrating the state transition process of an optical network unit according to an embodiment of this application. Figure 7 The state transition process of the optical network unit shown can be applied to downlink data frames. Figure 3B In the scenario shown, the data frame structure is as follows.

[0142] 701, Psync matching, and SFC are valid.

[0143] When the optical network unit is in the hunt state, it searches for a Psync field in the downlink data stream that matches the preset Psync. After the optical network unit finds a Psync field that matches the preset Psync, it verifies whether the field following the Psync can form a valid SFC structure. If the field following the Psync field can form a valid SFC structure, it means that the Psync in the downlink data stream matches and the SFC structure is valid. The optical network unit then transitions from the hunt state to the pre-sync state.

[0144] 702. Decoded Psync matching and SFC validity.

[0145] When the optical network unit (ONU) is in the pre-synchronization state, it decodes the FEC codewords in the downlink data stream to obtain the decoded codeword payload, and then obtains the decoded Psync based on the decoded codeword payload. After obtaining the decoded Psync, the ONU determines whether the decoded Psync matches a preset Psync. If the decoded Psync matches the preset Psync, the ONU continues to verify whether the SFC structure following the decoded Psync is valid. If the decoded Psync matches the preset Psync and the SFC structure is valid, the ONU transitions from the pre-synchronization state to the synchronization state.

[0146] 703. Decoded Psync and / or SFC verification failed.

[0147] When the optical network unit (ONU) is in the pre-synchronization state, it decodes the FEC codewords in the downlink data stream to obtain the decoded codeword payload and derives the decoded Psync based on the decoded codeword payload. After obtaining the decoded Psync, the ONU determines whether it matches a preset Psync. If the decoded Psync matches the preset Psync, the ONU continues to verify whether the SFC structure following the decoded Psync is valid. If the decoded Psync does not match the preset Psync, or if the SFC structure is invalid (i.e., the decoded Psync and / or SFC verification fails), the ONU returns from the pre-synchronization state to the search state.

[0148] 704, decoded Psync match and SFC valid.

[0149] When the optical network unit is in the synchronization state, the optical network unit continuously verifies the decoded Psync and SFC in the downlink data stream. If the decoded Psync in the downlink data stream matches the preset Psync and the SFC structure is valid, the optical network unit remains in the synchronization state.

[0150] 705. Decoded Psync and / or SFC verification failed.

[0151] When the optical network unit is in the synchronization state, the optical network unit continuously verifies the decoded Psync and SFC in the downlink data stream. If the decoded Psync in the downlink data stream does not match the preset Psync, and / or the SFC structure is invalid, the optical network unit will migrate from the synchronization state to the resynchronization state.

[0152] 706. The decoded Psync and SFC verifications were successful in P consecutive data frames.

[0153] When an optical network unit (ONU) is in resynchronization state, it continuously verifies the decoded Psync and SFC in the downlink data stream. If, among P consecutive downlink data frames in the downlink data stream, there exists a downlink data frame where the decoded Psync matches and the SFC verification is successful, the ONU can transition from the resynchronization state to the synchronization state. Here, P is an integer greater than or equal to 1.

[0154] 707. Decoded Psync and / or SFC verification failed.

[0155] When the optical network unit (ONU) is in resynchronization state, it verifies the decoded Psync and SFC in the downlink data stream. If the ONU detects that the decoded Psync and / or SFC verification fails in a downlink data frame, and the number of downlink data frames detected by the ONU has not reached P, the ONU remains in resynchronization state and continues to verify the decoded Psync and SFC of the next downlink data frame in the downlink data stream.

[0156] 708. In P consecutive data frames, the decoded Psync and / or SFC verification fails.

[0157] When the optical network unit is in the resynchronization state, the optical network unit verifies the decoded Psync and SFC in the downlink data stream. If there is a case of decoded Psync mismatch or SFC verification failure in each of multiple consecutive downlink data frames in the downlink data stream, the optical network unit will transition from the resynchronization state to the search state.

[0158] Please refer to Figure 8 , Figure 8 This is a schematic diagram of the structure of an optical network unit 800 provided in an embodiment of this application. The optical network unit 800 is used to execute the process performed by the data receiving end in the above method embodiments. For example, the optical network unit can be applied in an optical network unit that receives downlink data frames, or it can be applied in an optical line terminal that receives uplink data frames. For a detailed explanation of the execution process and beneficial effects, please refer to the above method embodiments.

[0159] An optical network unit 800 provided in this application includes a processing unit 801, which is configured to: search for a field matching a preset Psync in a received data stream; if a Psync field matching the preset Psync is found in the data stream, verify whether a first field with a preset number of bits following the Psync field constitutes a valid SFC structure; if the first field constitutes a valid SFC structure, enter a pre-synchronization state; after entering the pre-synchronization state, determine the position of the forward error correction (FEC) codeword boundary in the data stream based on the position of the Psync field, and perform FEC codeword decoding verification; if there is an FEC codeword that passes the decoding verification among N consecutive FEC codewords in the data stream, enter a synchronization state, where N is an integer greater than or equal to 1.

[0160] In one possible implementation, the processing unit 801 is further configured to: determine the SFC field located after the first field in the data stream based on the position of the first field; verify the SFC field, and the verification result of the SFC field is that the SFC field constitutes a valid SFC structure.

[0161] In one possible implementation, the processing unit 801 is further configured to: if there is no FEC codeword that has passed the decoding check among N consecutive FEC codewords in the data stream, return from the pre-synchronization state to the search state, where N is an integer greater than or equal to 1.

[0162] In one possible implementation, the processing unit 801 is further configured to: after entering the synchronization state, if M consecutive FEC codewords in the data stream fail the decoding test, then transition from the synchronization state to the resynchronization state; if there is an FEC codeword that passes the decoding test among the M consecutive FEC codewords in the data stream, then maintain the synchronization state; M is an integer greater than or equal to 1.

[0163] In one possible implementation, the processing unit 801 is further configured to: after entering the resynchronization state, if there is an FEC codeword that has passed the decoding verification among the S consecutive FEC codewords in the data stream, then transition from the resynchronization state to the synchronization state, where S is an integer greater than or equal to 1.

[0164] In one possible implementation, the processing unit 801 is further configured to: after entering the resynchronization state, if there is no FEC codeword that has passed the decoding check among the S consecutive FEC codewords in the data stream, then transition from the resynchronization state to the search state.

[0165] In one possible implementation, the processing unit 801 is further configured to: decode the FEC codewords in the data stream to obtain the decoded codeword payload; obtain the decoded Psync based on the decoded codeword payload, wherein the decoded Psync is located in the decoded codeword payload; if the decoded Psync matches the preset Psync, verify whether the second field located after the preset number of bits after the decoded Psync constitutes a valid SFC structure; if the second field constitutes a valid SFC structure, then enter the synchronization state from the pre-synchronization state or remain in the synchronization state.

[0166] In one possible implementation, the processing unit 801 is further configured to: after entering the synchronization state, if there is a mismatch between the decoded Psync and the preset Psync or the SFC verification fails, then transition from the synchronization state to the resynchronization state; if there is a match between the decoded Psync and the preset Psync and the SFC verification is successful, then remain in the synchronization state.

[0167] In one possible implementation, the processing unit 801 is further configured to: after entering the resynchronization state, for P consecutive data frames in the data stream, if there is a decoded Psync that matches the preset Psync and the SFC verification is successful, then transition from the resynchronization state to the synchronization state; P is an integer greater than 1.

[0168] In one possible implementation, the processing unit 801 is further configured to: after entering the resynchronization state, if for P consecutive data frames in the data stream, there are decoded synchronization sequences that do not match the preset Psync or SFC verification fails, then transition from the resynchronization state to the search state.

[0169] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0170] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.

[0171] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0172] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0173] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.

Claims

1. A data processing method, characterized in that, include: After the optical network unit enters the pre-synchronization state, the optical network unit determines the position of the forward error correction (FEC) codeword boundary in the received data stream based on the position of the physical synchronization sequence (Psync) field, and performs FEC codeword decoding verification. If the FEC codeword decoding verification in the data stream passes, the optical network unit enters the synchronization state.

2. The data processing method according to claim 1, characterized in that, The method further includes: The optical network unit searches for a field in the received data stream that matches a preset Psync; If the optical network unit finds a Psync field in the data stream that matches the preset Psync, the optical network unit verifies whether the first field located at a preset number of bits after the Psync field constitutes a valid superframe counter (SFC) structure. If the first field constitutes a valid SFC structure, the optical network unit enters the pre-synchronization state.

3. The data processing method according to claim 2, characterized in that, If the FEC codeword decoding verification in the data stream passes, the optical network unit enters a synchronization state, specifically including: If the FEC codeword decoding verification in the data stream passes and the SFC structure verification after the first field is successful, the optical network unit enters the synchronization state.

4. The data processing method according to any one of claims 1 to 3, characterized in that, The method further includes: After the optical network unit enters the pre-synchronization state, if there is no FEC codeword that has passed the decoding verification among N consecutive FEC codewords in the data stream, the optical network unit returns to the search state from the pre-synchronization state, where N is an integer greater than or equal to 1.

5. The data processing method according to any one of claims 1 to 4, characterized in that, The method further includes: After the optical network unit enters the synchronization state, if M consecutive FEC codewords in the data stream fail the decoding verification, the optical network unit will migrate from the synchronization state to the resynchronization state. If there is an FEC codeword that passes the decoding verification among M consecutive FEC codewords in the data stream, the optical network unit maintains the synchronization state, where M is an integer greater than or equal to 1.

6. The data processing method according to claim 5, characterized in that, The method further includes: After the optical network unit enters the resynchronization state, if there is an FEC codeword that has passed the decoding verification among S consecutive FEC codewords in the data stream, the optical network unit will migrate from the resynchronization state to the synchronization state, where S is an integer greater than or equal to 1.

7. The data processing method according to claim 5 or 6, characterized in that, The method further includes: After the optical network unit enters the resynchronization state, if there is no FEC codeword that has passed the decoding verification among the S consecutive FEC codewords in the data stream, the optical network unit will transition from the resynchronization state to the search state, where S is an integer greater than or equal to 1.

8. The data processing method according to any one of claims 1 to 4, characterized in that, The method further includes: After the optical network unit enters the synchronization state, if the decoded Psync does not match the preset Psync or the SFC verification fails, the optical network unit will migrate from the synchronization state to the resynchronization state. If the decoded Psync matches the preset Psync and the SFC verification is successful, the optical network unit will remain in the synchronization state.

9. The data processing method according to claim 8, characterized in that, The method further includes: After the optical network unit enters the resynchronization state, for P consecutive data frames in the data stream, if there is a decoded Psync that matches the preset Psync and the SFC verification is successful, the optical network unit will migrate from the resynchronization state to the synchronization state, where P is an integer greater than 1.

10. The data processing method according to claim 8 or 9, characterized in that, The method further includes: After the optical network unit enters the resynchronization state, if for each of the P consecutive data frames in the data stream, there is a decoded synchronization sequence that does not match the preset Psync or the SFC verification fails, then the optical network unit transitions from the resynchronization state to the search state, where P is an integer greater than 1.

11. An optical network unit, characterized in that, include: Processing unit, the processing unit is used for: After entering the pre-synchronization state, the position of the forward error correction FEC codeword boundary in the data stream is determined according to the position of the Psync field, and the FEC codeword decoding verification is performed. If the FEC codeword decoding verification in the data stream passes, the system enters the synchronization state.

12. The optical network unit according to claim 11, characterized in that, The processing unit is also used for: Search the received data stream for fields that match the preset Psync; If a Psync field matching the preset Psync is found in the data stream, then verify whether the first field with a preset number of positions following the Psync field constitutes a valid SFC structure. If the first field constitutes a valid SFC structure, then the pre-synchronization state is entered.

13. The optical network unit according to claim 12, characterized in that, The processing unit is also used for: If the FEC codeword decoding verification in the data stream passes and the SFC structure following the first field is successfully verified, then the synchronization state is entered.

14. The optical network unit according to any one of claims 11 to 13, characterized in that, The processing unit is also used for: After entering the pre-synchronization state, if there is no FEC codeword that has passed the decoding verification among N consecutive FEC codewords in the data stream, then the search state is returned from the pre-synchronization state, where N is an integer greater than or equal to 1.

15. The optical network unit according to any one of claims 11 to 14, characterized in that, The processing unit is also used for: After entering the synchronization state, if M consecutive FEC codewords in the data stream fail the decoding verification, the system will transition from the synchronization state to the resynchronization state. If there is an FEC codeword that passes the decoding verification among M consecutive FEC codewords in the data stream, then the synchronization state is maintained, where M is an integer greater than or equal to 1.

16. The optical network unit according to claim 15, characterized in that, The processing unit is also used for: After entering the resynchronization state, if there is an FEC codeword that has passed the decoding verification among the S consecutive FEC codewords in the data stream, then the system will transition from the resynchronization state to the synchronization state, where S is an integer greater than or equal to 1.

17. The optical network unit according to claim 15 or 16, characterized in that, The processing unit is also used for: After entering the resynchronization state, if there is no FEC codeword that has passed the decoding verification among the S consecutive FEC codewords in the data stream, then the process transitions from the resynchronization state to the search state, where S is an integer greater than or equal to 1.

18. The optical network unit according to any one of claims 11 to 14, characterized in that, The processing unit is also used for: After entering the synchronization state, if the decoded Psync does not match the preset Psync or the SFC verification fails, the system will transition from the synchronization state to the resynchronization state. If the decoded Psync matches the preset Psync and the SFC verification is successful, then the synchronization state is maintained.

19. The optical network unit according to claim 18, characterized in that, The processing unit is also used for: After entering the resynchronization state, for P consecutive data frames in the data stream, if there is a decoded Psync that matches the preset Psync and the SFC verification is successful, then the process transitions from the resynchronization state to the synchronization state, where P is an integer greater than 1.

20. The optical network unit according to claim 18 or 19, characterized in that, The processing unit is also used for: After entering the resynchronization state, if for each of the P consecutive data frames in the data stream, there is a decoded synchronization sequence that does not match the preset Psync or the SFC verification fails, then the process transitions from the resynchronization state to the search state, where P is an integer greater than 1.

21. An optical network system, characterized in that, include: Optical line terminal and optical network unit as described in any one of claims 11 to 20.