Data stream processing method and device and computer readable storage medium

By identifying the first D-block and T-block in the data stream, the starting position of the fine-grained unit is recovered, solving the identification problem caused by S-block errors and realizing accurate identification and data processing of fine-grained units.

CN121864252APending Publication Date: 2026-04-14ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In the event of a bit error in the S-code block, fine-grained units cannot be identified, resulting in the inability to extract and process payload data, which may lead to the loss of customer business.

Method used

By identifying at least one of the first D-block and T-block in the data stream, the starting position of the fine-grained unit can be recovered or the fine-grained unit can be framed, avoiding complete dependence on the S-block.

Benefits of technology

Even if S-code block errors cannot be identified, fine-grained units can still be accurately identified, ensuring the extraction and processing of payload data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121864252A_ABST
    Figure CN121864252A_ABST
Patent Text Reader

Abstract

The invention provides a data stream processing method and device and a computer readable storage medium, the data stream processing method comprises the following steps: identifying a first code block in a data stream, the first code block comprising at least one of a first D code block and a T code block; and recovering the initial position of the fine-grained unit or framing the fine-grained unit according to the first code block. Therefore, the fine-grained unit can be identified under the condition that the S code block cannot be identified due to error codes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and more specifically to a data stream processing method, apparatus, and computer-readable storage medium. Background Technology

[0002] Fine granularity unit (FGU) is a service transport technology that refines the granularity of hard slices from 5Gbps to 10Mbps, solving the problem of customer service transport at speeds lower than 5G. FGU technology employs time-division multiplexing (TDM) to periodically transmit FGU basic unit frames. A fine granularity unit includes a start code block (S block), multiple data code blocks (D blocks), and an end code block (T block). At the receiving end, the fine granularity unit needs to be identified, and its overhead and payload extracted for processing.

[0003] Typically, the receiver identifies fine-grained units (FLUs) by locating the correct S-code block in the data stream. Once the S-code block is found, the start of the FLU is considered identified, and further processing can proceed. However, if the S-code block is corrupted and cannot be found, the FLU cannot be identified. This results in the payload data within the FLU not being extracted and processed. Since FLUs usually contain multiple time slots, this can lead to service loss for multiple customers. Summary of the Invention

[0004] This application provides a data stream processing method, device, and computer-readable storage medium to solve the problem that fine-grained units cannot be identified when an S-code block encounters a bit error.

[0005] To solve the above-mentioned technical problems, the embodiments of this application are implemented as follows: Firstly, a data stream processing method is provided, the method comprising: Identify a first code block in the data stream, the first code block including at least one of a first D code block and a T code block; The starting position of the fine-grained unit is recovered based on the first code block, or the fine-grained unit is framed.

[0006] In a second aspect, an electronic device is provided, comprising: a processor and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method as described in the first aspect.

[0007] Thirdly, a computer-readable storage medium is provided, wherein when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method described in the first aspect.

[0008] Fourthly, a computer program product including instructions is provided, wherein when a computer executes the instructions of the computer program product, the computer performs the method as described in the first aspect.

[0009] In the embodiments of this application, since the starting position of the fine-grained unit or the frame of the fine-grained unit can be recovered by identifying at least one of the first D code block and T code block in the data stream, and not just by relying on the S code block, the fine-grained unit can still be accurately identified even if the S code block error cannot be identified. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a hardware structure block diagram of a computer terminal running a data stream processing method provided in an embodiment of this application.

[0012] Figure 2 This is a flowchart illustrating a data stream processing method provided in an embodiment of this application.

[0013] Figure 3 This is a schematic diagram of the data flow structure.

[0014] Figure 4A This is a schematic diagram of the structure of a fine-grained unit.

[0015] Figure 4B This is a detailed structural diagram of a fine-grained unit.

[0016] Figure 5 This is a schematic diagram of the 64B / 66B code block format.

[0017] Figure 6 This is a schematic diagram of the overhead region structure of a fine-grained unit.

[0018] Figure 7 This is a detailed flowchart illustrating a data stream processing method provided in an embodiment of this application.

[0019] Figure 8 This is a schematic diagram of the structure of a data stream processing device provided in an embodiment of this application.

[0020] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0021] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of this application.

[0022] It should be noted that, in describing specific embodiments, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0023] It should also be noted that the terms "first," "second," etc., 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 of this application described herein can be implemented in orders other than those 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 apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0024] The methods and embodiments provided in this application can be executed on a computer terminal or similar computing device. Taking running on a computer terminal as an example, Figure 1 This is a hardware structure block diagram of a computer terminal running the data stream processing method of the embodiments of this application. For example... Figure 1 As shown, a computer terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. In one exemplary embodiment, the computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the computer terminal described above. For example, the computer terminal may also include components that are more complex than those described above. Figure 1 The more or fewer components shown, or having the same Figure 1 Equivalent functions or ratios shown Figure 1The functions shown have more different configurations.

[0025] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the data flow processing method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0026] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the computer terminal. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0027] To address the problem that fine-grained units cannot be identified when errors occur in S-code blocks, embodiments of this application propose a data stream processing method, device, and computer-readable storage medium, which are described below.

[0028] like Figure 2 As shown in the embodiments of this application, a data stream processing method may include: Step 201: Identify a first code block in the data stream, the first code block including at least one of a first D code block and a T code block.

[0029] The format of the data stream received by the receiving end is as follows: Figure 3 As shown, refer to Figure 3 The data stream includes multiple fine-grained units. Each fine-grained unit comprises multiple 64B / 66B code blocks. For the nth fine-grained unit, such as... Figure 4A and Figure 4B As shown ( Figure 4A This is a schematic diagram of a fine-grained unit structure. Figure 4B This is a detailed structural diagram of a fine-grained unit. These multiple 64B / 66B code blocks include a start code block indicating the beginning of a data packet. Figure 3 In the code, S represents the end block of the data packet. Figure 3 (represented by T in the text), and the data blocks between the start and end code blocks ( Figure 3 (Represented by D in Chinese). Additionally, there can be free code blocks between different fine-grained units ( Figure 3 (represented by I in Chinese). Figure 4B In this code block, a value of 01 for the synchronization header indicates that the code block is a data block, and a value of 10 for the synchronization header indicates that the code block is a control block.

[0030] Figure 5 This diagram illustrates an encoding structure for a 64B / 66B code block. The first two bits represent the synchronization header (sync), with a value of 01 indicating a data block and 10 indicating a control block. For the control block, the following 8 bits represent the block type field, such as 0x1E, 0x78, 0x4B, 0x87, 0x99, etc. Different block type field values ​​represent different control blocks.

[0031] S-blocks, T-blocks, O-blocks, Idle blocks (IDLE blocks, I blocks), and E-blocks are all control blocks. The first byte of an S-block is 0x78, indicating it's a control block. The first block in a data packet stream is an S-block. The last block in a data packet stream (the end of the data packet) is a T-block. Besides indicating the end of the data packet, a T-block can also carry client bytes (located in the last 7 bytes of the block). In the Ethernet standard, there are 8 types of T-blocks: T0, T1, T2, T3, T4, T5, T6, and T7. The T0 block (first byte is 0x87) does not carry client information; the T1 block (first byte is 0x99) carries 1 byte of client information; the T2 block (first byte is 0x99) carries 2 bytes of client information, and so on, with the T7 block (first byte is 0xFF) carrying 7 bytes of client information. The idle code block (IDLE block, I block) has a control word content of 0x1E. The O block is the maintenance and management code block, with a control word content of 0x4B.

[0032] In some embodiments, the data stream processing method provided in this application identifies fine-grained units by identifying at least one of a first D-code block and a T-code block.

[0033] Optionally, in some other embodiments, the first code block may also include an S code block. That is, in addition to at least one of the first D code block and T code block, the data stream processing method provided in this application can also identify fine-grained units by identifying the S code block. The following describes the situation in detail.

[0034] Case 1: The first code block includes the S code block.

[0035] In this case, identifying the first code block in the data stream in step 201 may include: S-code blocks are identified in the data stream based on their characteristics. It can be understood that if a code block in the data stream matches the characteristics of an S-code block, then that code block is considered an S-code block.

[0036] The S-code block has at least one of the following characteristics: The synchronization header is 0b10; The Block Type Field is 0x78; The 2nd to 7th bytes of the payload area are 0x55, and the 8th byte is 0xD5.

[0037] The second scenario: The first code block includes the first D code block.

[0038] The first D-block is a D-block with overhead. Typically, the first D-block is the first D-block in the fine-grained unit, or at least one of the two blocks preceding the first D-block is a control block.

[0039] In this case, identifying the first code block in the data stream in step 201 may include: The first D code block is identified in the data stream based on its characteristics. It can be understood that if a code block in the data stream matches the characteristics of the first D code block, then that code block is considered the first D code block.

[0040] The first D code block includes at least one of the following features: The synchronization header is 0b01; The cyclic redundancy check (CRC) value of the preset bits in the payload area is correct. The preset bits are bits 10 to 56, or the preset bits are bits 8 to 56.

[0041] Optionally, the features of the first D code block may also include at least one of the following: The value of the first position increases in consecutive fine-grained units. The first position is the position of the multiframe indicator value defined by the overhead region. The first position is usually the 1st to the 9th bit in the first D code block, or the first position is the 2nd to the 7th bit in the first D code block. The multiframe indicator value is usually an integer. The multiframe indicator value generally increases in consecutive fine-grained units and is within a numerical range, such as 0-19. If the multiframe indicator value is the previous multiframe indicator value plus 1 and is within the numerical range, it indicates that the multiframe indicator value increases in consecutive fine-grained units. The value of the second position is a preset value. The second position is a reserved position defined by the overhead area. The preset value is the set value of the reserved position. Normally, the reserved value in the overhead area is a preset fixed value. If the reserved value in the identified code block is a preset fixed value, it is considered that the value of the second position is the preset value.

[0042] It is understandable that even if the CRC check of the D code block is correct, the D code block carrying customer services may still be misidentified as the first D code block. Therefore, regular or fixed values ​​in the overhead area can be added as features to identify the first D code block containing overhead, such as multiframe indication values ​​and reserved values.

[0043] For example, for a given D-block in a data stream, the first D-block is considered identified if at least one of the following conditions is met: 1) If the CRC value is correct, it is considered that the first D code block has been identified, and the starting position of the fine-grained unit can be recovered from the first D code block; 2) If the multiframe indicator value increases in consecutive fine-grained units, it is considered that the first D code block has been identified, and the starting position of the fine-grained unit can be recovered from the first D code block. 3) If the value of the reserved position is a preset value, it is considered that the first D code block has been identified, and the starting position of the fine-grained unit can be recovered from the first D code block; 4) If the multiframe indicator value increases in consecutive fine-grained units and the value of the reserved position is a preset value, then the first D code block is considered to have been identified, and the starting position of the fine-grained unit can be recovered from the first D code block. 5) If the CRC check is correct and the multiframe indicator value increases in consecutive fine-grained units, then the first D code block is considered to have been identified, and the starting position of the fine-grained unit can be recovered from the first D code block. 6) If the CRC check is correct and the value of the reserved position is the preset value, then the first D code block is considered to have been identified, and the starting position of the fine-grained unit can be recovered from the first D code block. 7) If the CRC check is correct, the multiframe indicator value increases in consecutive fine-grained units, and the value of the reserved position is a preset value, then the first D code block is considered to have been identified, and the starting position of the fine-grained unit can be recovered based on the first D code block.

[0044] The third scenario: The first code block includes a T code block.

[0045] In this case, identifying the first code block in the data stream in step 201 may include: T-blocks are identified in the data stream based on their characteristics. It can be understood that if a block in the data stream matches the characteristics of a T-block, then that block is considered a T-block.

[0046] The T-code block has at least one of the following characteristics: The synchronization header is 0b10; The type field is one of 0x87, 0x99, 0xAA, 0XB4, 0xCC, 0XD2, 0XE1 and 0XFF.

[0047] Step 202: Recover the starting position of the fine-grained unit or frame the fine-grained unit according to the first code block.

[0048] In some embodiments, step 202 may include: identifying a first D code block before identifying an S code block, and then taking the first code block before the first D code block as the starting position of the fine-grained unit.

[0049] In some embodiments, step 202 may include: if a T code block is identified before the S code block is identified, then the (L-1)th code block preceding the T code block is taken as the starting position of the fine-grained unit, where L is the length of the fine-grained unit. The length of the fine-grained unit refers to the number of all code blocks (including S code blocks, D code blocks, and T code blocks) within the fine-grained unit.

[0050] Here, the i-th code block preceding a code block refers to the i-th code block located before the code block and counted in the direction from closest to farthest from the code block. For example, the first code block before the first D code block refers to the code block located before the first D code block and closest to the first D code block; as another example, the (L-1)-th code block before the T code block refers to the code block located before the T code block and at a distance of L-1 from the T code block.

[0051] Alternatively, in some other embodiments, step 202 may include: when an S-code block is not identified but a first D-code block is identified, restoring the starting position of the fine-grained unit or framing the fine-grained unit based on the first D-code block; or, when an S-code block is not identified but a T-code block is identified, restoring the starting position of the fine-grained unit or framing the fine-grained unit based on the T-code block; or, when both an S-code block and a first D-code block are not identified but a T-code block is identified, restoring the starting position of the fine-grained unit or framing the fine-grained unit based on the T-code block.

[0052] Here are some specific examples: 1) Step 202 may include: if the S code block is identified, restoring the starting position of the fine-grained unit or framing the fine-grained unit according to the S code block; if the T code block is identified before the S code block is identified, restoring the starting position of the fine-grained unit or framing the fine-grained unit according to the T code block.

[0053] 2) Step 202 may include: if the S code block is identified, restoring the starting position of the fine-grained unit or framing the fine-grained unit according to the S code block; if the first D code block is identified before the S code block is identified, restoring the starting position of the fine-grained unit or framing the fine-grained unit according to the first D code block.

[0054] 3) Step 202 may include: if the first D code block is identified, recovering the starting position of the fine-grained unit or framing the fine-grained unit according to the first D code block; if the T code block is identified before the first D code block is identified, recovering the starting position of the fine-grained unit or framing the fine-grained unit according to the T code block.

[0055] 4) Step 202 may include: if a T code block is identified, recovering the starting position of the fine-grained unit or framing the fine-grained unit based on the T code block; if a T code block is not identified but a first D code block is identified, recovering the starting position of the fine-grained unit or framing the fine-grained unit based on the first D code block.

[0056] 5) Step 202 may include: if the S code block is identified, restoring the starting position of the fine-grained unit or framing the fine-grained unit according to the S code block; then, if the first D code block is identified, restoring the starting position of the fine-grained unit or framing the fine-grained unit again according to the first D code block; then, if the T code block is identified, restoring the starting position of the fine-grained unit or framing the fine-grained unit again according to the T code block.

[0057] 6) Step 202 may include: if the S code block is identified, recovering the starting position of the fine-grained unit or framing the fine-grained unit according to the S code block; then if the T code block is identified, recovering the starting position of the fine-grained unit or framing the fine-grained unit according to the T code block; then if the first D code block is identified, recovering the starting position of the fine-grained unit or framing the fine-grained unit according to the first D code block.

[0058] 7) Step 202 may include: when the S code block is not identified but the first D code block is identified, the starting position of the fine-grained unit is restored or the fine-grained unit is framed according to the first D code block; or, when the S code block is not identified but the T code block is identified, the starting position of the fine-grained unit is restored or the fine-grained unit is framed according to the T code block; or, when the S code block and the first D code block are not identified but the T code block is identified, the starting position of the fine-grained unit is restored or the fine-grained unit is framed according to the T code block.

[0059] Optionally, after step 201, Figure 2 The method shown may also include: When the 64B / 66B code block in the received data stream is not an S code block, the 64B / 66B code block is buffered to facilitate subsequent extraction and processing of fine-grained units.

[0060] Furthermore, after step 202, Figure 2 The method shown may also include: Based on the starting position and length of the fine-grained unit, extract or process the fine-grained unit; or, After the fine-grained unit is framed, the fine-grained unit is extracted or processed.

[0061] Fine-grained units are extracted based on their starting position and / or length, as shown in the following example: 1) If the S code block is identified in step 201, the location of the S code block is the starting position of the fine-grained unit. Based on the length of the fine-grained unit, L code blocks can be extracted from the S code block to obtain the fine-grained unit.

[0062] 2) If the first D code block is identified in step 201, the position of the first code block before the first D code block is the starting position of the fine-grained unit. L code blocks are extracted from the first code block before the first D code block to obtain the fine-grained unit.

[0063] 3) If a T-block is identified in step 201, the position of the L-1th code block before the T-block is the starting position of the fine-grained unit. The fine-grained unit is obtained by extracting the T-block and the L-1 code blocks before it.

[0064] The processing of the fine-grained unit may include processing at least one of the overhead and payload of the fine-grained unit.

[0065] Optionally, Figure 2 The data stream processing method shown may further include: after extracting a fine-grained unit, performing an identification step on the next code block according to the position of the T code block in the fine-grained unit, for example, performing step 201 on the next code block.

[0066] like Figure 3As shown, if the current processing unit is the nth fine-grained unit in the data stream, the positions of its S-block, first D-block, and T-block can all be determined. Even if one or two of the S-block, first D-block, and T-block in the nth fine-grained unit are erroneous and cannot be identified, as long as one of them is identified, the starting position of the entire fine-grained unit can be determined based on its structure and length. Therefore, the position of the T-block could be the correct T-block location, or it could be the location of another block. That is, because the T-block is erroneous, it cannot be identified as a T-block based on its characteristics, but because the S-block or first D-block is identified, the correct T-block location can be inferred.

[0067] The data stream processing method proposed in this application can identify fine-grained units by recognizing at least one of the first D code block and T code block in the data stream, rather than relying solely on the S code block. Therefore, even if S code block errors cannot be identified, fine-grained units can still be accurately identified.

[0068] The following is combined Figure 7 The data stream processing method proposed in the embodiments of this application will be described again.

[0069] like Figure 7 As shown in the embodiments of this application, a data stream processing method may include: Step 701: Identify the 64B / 66B code blocks in the received data stream.

[0070] Specifically, it identifies which type of 64B / 66B code block (also called 64B / 66B block) the received 64B / 66B code block is: S code block, D code block, or T code block.

[0071] More specifically, if the received 64B / 66B code block conforms to the characteristics of an S code block, then the 64B / 66B code block is identified as an S code block; if the received 64B / 66B code block conforms to the characteristics of a D code block, then the 64B / 66B code block is identified as a D code block; if the received 64B / 66B code block conforms to the characteristics of a T code block, then the 64B / 66B code block is identified as a T code block.

[0072] Further, if the received 64B / 66B code block is an S code block or a T code block, proceed to step 703; if the received 64B / 66B code block is a D code block, proceed to step 702.

[0073] Step 702: Verify whether the features of the D code block match the features of the first D code block. If they do not match, return to step 701. If they match, proceed to step 703.

[0074] The first D code block is characterized by at least one of the following: The CRC value of the preset bits in the payload area is correct; The value of the first position is incremented in consecutive fine-grained units, and the first position is the position of the multiframe indicator value defined by the overhead region; The value of the second position is a preset value. The second position is a reserved position defined by the overhead area, and the preset value is the setting value of the reserved position.

[0075] Step 703: Restore the starting position of the fine-grained unit or fix the frame of the fine-grained unit.

[0076] Step 704: Extract fine-grained units or process fine-grained units.

[0077] It is not difficult to see that Figure 7 The data stream processing method shown can extract fine-grained units by identifying at least one of the first D-code block and T-code block in the data stream, rather than relying solely on the S-code block. Therefore, even if errors in the S-code block cannot be identified, fine-grained units can still be accurately identified.

[0078] The following describes a data stream processing method proposed in this application through several specific embodiments.

[0079] Example 1 For a received 64B / 66B code block, if the 64B / 66B code block is identified as an S code block, then starting from the S code block position, L code blocks are extracted forward according to the length of the fine-grained unit to obtain the fine-grained unit, and the extracted fine-grained unit is processed. This processing includes processing the multiframe indication value, CRC, customer service ID, etc., in the overhead area of ​​the fine-grained unit, as well as processing the payload area of ​​the fine-grained unit.

[0080] Example 2 For a received 64B / 66B code block, if the 64B / 66B code block is identified as a D code block, a CRC check is performed on a preset bit. If the CRC check is correct, the D code block is the first D code block. Starting from the position of the first D code block, L-2 code blocks are continuously extracted according to the length of the fine-grained unit to obtain the fine-grained unit, and the extracted fine-grained unit is processed.

[0081] Alternatively, if the received 64B / 66B code block is a D code block, a CRC check is first performed on the preset bits, and the CRC check is correct. Then, the multiframe indicator value defined in the overhead area is checked. If the multiframe indicator value is the multiframe indicator value of the previous fine-grained unit plus one, or is flipped (for example, the range of the multiframe indicator value is 0 to 479, the previous multiframe indicator value is 479, and the current multiframe indicator value is 0), and the multiframe indicator value is within the range, then this D code block is the first D code block. Starting from the position of this first D block, L-2 code blocks are continuously extracted according to the length of the fine-grained unit to obtain the fine-grained unit, and the extracted fine-grained unit is processed.

[0082] Alternatively, for a received 64B / 66B code block, if the 64B / 66B code block is identified as a D code block, a CRC check is first performed on the preset bits, and the CRC check is correct; then, it is checked whether the reserved value defined in the overhead area is the preset value. If so, the D code block is the first D code block. Starting from the position of the first D code block, L-2 code blocks are continuously extracted according to the length of the fine-grained unit to obtain the fine-grained unit, and the extracted fine-grained unit is processed.

[0083] Example 3 For a received 64B / 66B code block, if the 64B / 66B code block is identified as a T code block, then starting from the T code block position, extract the T code block and the L-1 code blocks preceding it to obtain fine-grained units, and process the extracted fine-grained units.

[0084] Example 4 For a received 64B / 66B code block, if the 64B / 66B code block is identified as an S code block, then starting from the position of the S code block, extract L-1 code blocks consecutively according to the length of the fine-grained unit to obtain the fine-grained unit, and process the extracted fine-grained unit.

[0085] For a received 64B / 66B code block, if the 64B / 66B code block is identified as the first D code block, then starting from the position of the first D code block, extract L-2 code blocks consecutively according to the length of the fine-grained unit to obtain the fine-grained unit, and process the extracted fine-grained unit.

[0086] Example 5 For a received 64B / 66B code block, if the 64B / 66B code block is identified as an S code block, then starting from the position of the S code block, extract L-1 code blocks consecutively according to the length of the fine-grained unit to obtain the fine-grained unit, and process the extracted fine-grained unit.

[0087] For a received 64B / 66B code block, if the 64B / 66B code block is identified as the first D code block, then starting from the position of the first D code block, extract L-2 code blocks consecutively according to the length of the fine-grained unit to obtain the fine-grained unit, and process the extracted fine-grained unit.

[0088] For a received 64B / 66B code block, if the 64B / 66B code block is identified as a T code block, then starting from the T code block position, extract L-1 code blocks consecutively forward according to the length of the fine-grained unit to obtain the fine-grained unit, and process the extracted fine-grained unit.

[0089] As can be seen from the above embodiments, the data stream processing method proposed in this application can identify fine-grained units by recognizing at least one of the first D code block and T code block in the data stream, in addition to the S code block, rather than relying solely on the S code block. Therefore, even if the S code block error cannot be identified, the fine-grained unit can still be accurately identified.

[0090] The above describes a data stream processing method proposed in this application. Corresponding to the above data processing method, this application also proposes a data processing apparatus, which will be described below.

[0091] Figure 8 A schematic diagram of the structure of a data stream processing apparatus 800 provided in an embodiment of this application is shown. Figure 8 As shown, the device 800 may include an identification module 801 and a processing module 802.

[0092] The identification module 801 is used to identify a first code block in a data stream, the first code block including at least one of a first D code block and a T code block.

[0093] In some embodiments, the identification module 801 can identify fine-grained units by identifying at least one of the first D code block and T code block.

[0094] Optionally, in some other embodiments, the first code block may also include an S code block. That is, in addition to at least one of the first D code block and T code block, the identification module 801 may also identify fine-grained units by identifying the S code block. The following describes the situation in detail.

[0095] Case 1: The first code block includes the S code block.

[0096] In this case, the identification module 801 can be used to: identify S-code blocks in the data stream based on the characteristics of the S-code blocks. It can be understood that if a code block in the data stream matches the characteristics of an S-code block, then that code block is considered an S-code block.

[0097] The S-code block has at least one of the following characteristics: The synchronization header is 0b10; The Block Type Field is 0x78; The 2nd to 7th bytes of the payload area are 0x55, and the 8th byte is 0xD5.

[0098] The second scenario: The first code block includes the first D code block.

[0099] The first D-block is a D-block with overhead. Typically, the first D-block is the first D-block in the fine-grained unit, or at least one of the two blocks preceding the first D-block is a control block.

[0100] In this case, the identification module 801 can be used to: identify the first D code block in the data stream based on the characteristics of the first D code block. It can be understood that if a code block in the data stream matches the characteristics of the first D code block, then that code block is considered the first D code block.

[0101] The first D code block includes at least one of the following features: The synchronization header is 0b01; The cyclic redundancy check (CRC) value of the preset bits in the payload area is correct. The preset bits are bits 10 to 56, or the preset bits are bits 8 to 56.

[0102] Optionally, the features of the first D code block may also include at least one of the following: The value of the first position increases in consecutive fine-grained units. The first position is the position of the multiframe indicator value defined by the overhead region. The first position is usually the 1st to the 9th bit in the first D code block, or the first position is the 2nd to the 7th bit in the first D code block. The multiframe indicator value is usually an integer. The multiframe indicator value generally increases in consecutive fine-grained units and is within a numerical range, such as 0-19. If the multiframe indicator value is the previous multiframe indicator value plus 1 and is within the numerical range, it indicates that the multiframe indicator value increases in consecutive fine-grained units. The value of the second position is a preset value. The second position is a reserved position defined by the overhead area. The preset value is the set value of the reserved position. Normally, the reserved value in the overhead area is a preset fixed value. If the reserved value in the identified code block is a preset fixed value, it is considered that the value of the second position is the preset value.

[0103] It is understandable that even if the CRC check of the overhead area of ​​the D code block is correct, it is still possible that the D code block carrying customer services is misidentified as the first D code block. Therefore, regular or fixed values ​​in the overhead area can be added as features to identify the first D code block containing overhead, such as multiframe indication values ​​and reserved values.

[0104] The third scenario: The first code block includes a T code block. In this case, the identification module 801 can be used to: identify T-code blocks in the data stream based on the characteristics of the T-code blocks. It can be understood that if a code block in the data stream matches the characteristics of a T-code block, then that code block is considered a T-code block.

[0105] The T-code block has at least one of the following characteristics: The synchronization header is 0b10; The type field is one of 0x87, 0x99, 0xAA, 0XB4, 0xCC, 0XD2, 0XE1 and 0XFF.

[0106] The processing module 802 is used to recover the starting position of the fine-grained unit or to frame the fine-grained unit according to the first code block.

[0107] In some embodiments, the processing module 802 may be used to: identify a first D code block before identifying an S code block, and then take the first code block before the first D code block as the starting position of the fine-grained unit.

[0108] In other embodiments, the processing module 802 may be used to: if a T code block is identified before an S code block is identified, then take the (L-1)th code block preceding the T code block as the starting position of the fine-grained unit, where L is the length of the fine-grained unit. The length of the fine-grained unit refers to the number of all code blocks (including S code blocks, D code blocks, and T code blocks) within the fine-grained unit.

[0109] Here, the i-th code block preceding a code block refers to the i-th code block located before the code block and counted in the direction from closest to farthest from the code block. For example, the first code block before the first D code block refers to the code block located before the first D code block and closest to the first D code block; as another example, the (L-1)-th code block before the T code block refers to the code block located before the T code block and at a distance of L-1 from the T code block.

[0110] Alternatively, in other embodiments, the processing module 802 may be used to: when an S-code block is not identified but a first D-code block is identified, restore the starting position of the fine-grained unit or frame the fine-grained unit according to the first D-code block; or when an S-code block is not identified but a T-code block is identified, restore the starting position of the fine-grained unit or frame the fine-grained unit according to the T-code block; or when both an S-code block and a first D-code block are not identified but a T-code block is identified, restore the starting position of the fine-grained unit or frame the fine-grained unit according to the T-code block.

[0111] Optionally, Figure 8 The apparatus shown may further include a storage module for caching the 64B / 66B code block when the 64B / 66B code block in the received data stream is not an S code block, so as to facilitate subsequent extraction and processing of fine-grained units.

[0112] Furthermore, the processing module 802 can also be used for: Based on the starting position and length of the fine-grained unit, extract or process the fine-grained unit; or, After the fine-grained unit is framed, the fine-grained unit is extracted or processed.

[0113] Fine-grained units are extracted based on their starting position and / or length, as shown in the following example: 1) If the recognition module 801 recognizes the S code block, the location of the S code block is the starting position of the fine-grained unit. Based on the length of the fine-grained unit, L code blocks can be extracted from the S code block to obtain the fine-grained unit.

[0114] 2) If the recognition module 801 recognizes the first D code block, the position of the first code block before the first D code block is the starting position of the fine-grained unit. Based on the length of the fine-grained unit, L code blocks can be extracted from the first code block before the first D code block to obtain the fine-grained unit.

[0115] 3) If the recognition module 801 recognizes the T code block, the position of the L-1 code block before the T code block is the starting position of the fine-grained unit. Based on the length of the fine-grained unit, the T code block and the L-1 code blocks before it can be extracted to obtain the fine-grained unit.

[0116] In some embodiments, the processing module 802 may specifically be used to process at least one of the overhead and payload in the fine-grained unit.

[0117] Optionally, after extracting the fine-grained unit, the device 800 may also perform an identification step for the next code block based on the position of the T code block in the fine-grained unit, for example, returning to the trigger identification module 801.

[0118] The data stream processing apparatus proposed in this application can extract fine-grained units by identifying at least one of the first D code block and T code block in the data stream, rather than relying solely on the S code block. Therefore, even if errors in the S code block cannot be identified, fine-grained units can still be accurately identified.

[0119] This application provides a data stream processing device 800 that can be used to implement the above. Figure 2 The various embodiments of the data stream processing method shown above are relevant to the above method embodiments.

[0120] Figure 9 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Please refer to it. Figure 9 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.

[0121] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 9 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0122] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.

[0123] The processor reads the corresponding computer program from non-volatile memory into main memory and then executes it, forming a data stream processing device at the logical level. The processor executes the program stored in memory and specifically performs the following operations: Identify a first code block in the data stream, the first code block including at least one of a first D code block and a T code block; The starting position of the fine-grained unit is recovered based on the first code block, or the fine-grained unit is framed.

[0124] The above is as stated in this application. Figure 8 The methods executed by the data stream processing apparatus disclosed in the illustrated embodiments can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0125] The electronic device can also perform Figure 2 The method, and implement the data stream processing device in Figure 2 The functions described in the illustrated embodiments will not be repeated here.

[0126] Alternatively, embodiments of this application also provide an electronic device, including: a processor and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement a data stream processing method provided in embodiments of this application.

[0127] Of course, in addition to software implementation, the electronic device of this application does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0128] This application also provides a computer-readable storage medium storing a computer program. When executed by a processor, this computer program implements the various processes of the above-described data stream processing method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may include, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or optical disk, an electrically erasable programmable read-only memory (EEPROM), or flash memory. An I / O interface (read / write interface) is connected between the processor and the memory. The processor is a device with data processing capabilities, including but not limited to a central processing unit (CPU).

[0129] This application also provides a computer program product including instructions. When a computer executes the instructions of the computer program product, the computer performs the aforementioned data stream processing method. Specifically, the computer program product can run on the aforementioned computer terminal.

[0130] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0131] Those skilled in the art will 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.

[0132] 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 through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0133] 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.

[0134] In addition, 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.

[0135] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they 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 a portion 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 (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0136] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data stream processing method, characterized in that, The method includes: Identify a first code block in the data stream, the first code block including at least one of a first D code block and a T code block; The starting position of the fine-grained unit is recovered based on the first code block, or the fine-grained unit is framed.

2. The method according to claim 1, characterized in that, The first code block further includes an S code block, wherein identifying the first code block in the data stream includes: S-code blocks are identified in the data stream based on their characteristics, wherein the characteristics of the S-code blocks include at least one of the following: The synchronization header is 0b10; The type field is 0x78; The 2nd to 7th bytes of the payload area are 0x55, and the 8th byte is 0xD5.

3. The method according to claim 1, characterized in that, The first code block includes a first D code block, which is a D code block with overhead. Identifying the first code block in the data stream includes: The first D-code block is identified in the data stream based on its characteristics, wherein the characteristics of the first D-code block include at least one of the following: The synchronization header is 0b01; The cyclic redundancy check value of the preset bits in the payload area is correct. The preset bits are bits 10 to 56, or the preset bits are bits 8 to 56.

4. The method according to claim 3, wherein the first D code block further comprises at least one of the following: The value of the first position is incremented in consecutive fine-grained units, and the first position is the position of the multiframe indicator value defined by the overhead region; The value of the second position is a preset value. The second position is a reserved position defined by the overhead area, and the preset value is the setting value of the reserved position.

5. The method according to claim 3 or 4, characterized in that, At least one of the two code blocks preceding the first D code block is a control block.

6. The method according to claim 1, characterized in that, The first code block includes a T code block, wherein identifying the first code block in the data stream includes: T-blocks are identified in the data stream based on their characteristics, wherein the characteristics of the T-blocks include at least one of the following: The synchronization header is 0b10; The type field is one of 0x87, 0x99, 0xAA, 0XB4, 0xCC, 0XD2, 0XE1 and 0XFF.

7. The method according to claim 1, characterized in that, The step of recovering the starting position of the fine-grained unit based on the first code block includes: Once the first D code block is identified, the first code block preceding the first D code block is taken as the starting position of the fine-grained unit.

8. The method according to claim 1, characterized in that, The step of recovering the starting position of the fine-grained unit based on the first code block includes: If a T-block is identified, the (L-1)th block preceding the T-block is taken as the starting position of the fine-grained unit, where L is the length of the fine-grained unit.

9. The method according to claim 1, characterized in that, The first code block further includes an S code block, and the method further includes: When the 64B / 66B code block in the received data stream is not an S code block, the 64B / 66B code block is buffered.

10. The method according to any one of claims 1-9, characterized in that, The method further includes: Extract or process fine-grained units based on their starting position and / or length. or, After the fine-grained unit is framed, the fine-grained unit is extracted or processed.

11. An electronic device, comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the method as described in any one of claims 1 to 10.

12. A computer-readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method as described in any one of claims 1 to 10.

13. A computer program product comprising instructions, wherein when a computer executes the instructions of the computer program product, the computer performs the method as described in any one of claims 1 to 10.