Data processing method, electronic equipment and storage medium
By differentiating data types in the buffer and dynamically adjusting the number of blocks, the problem that a fixed number of blocks cannot simultaneously account for non-uniform packet loss and latency is solved, thus improving the communication reliability of FEC.
Patent Information
- Application Number
- CN202511145399.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-15
- Publication Date
- 2025-11-18
AI Technical Summary
In existing technologies, setting a fixed preset number of blocks for grouping and recoding cannot simultaneously address non-uniform packet loss and latency issues, resulting in poor FEC performance and reduced communication reliability.
By distinguishing data packets of different data types in a preset buffer, dynamically adjusting the overflow rules according to the data type, flexibly adjusting the number of original blocks and recovery blocks in each data packet, generating data packets and sending them.
It improves the performance of FEC processing, takes into account both non-uniform packet loss and latency issues, and enhances communication reliability.
Smart Images

Figure CN120979607A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a data processing method, electronic device, and storage medium. Background Technology
[0002] Forward error correction (FEC) is a technique that improves the reliability of communication networks by combating data loss during transmission. Among these, the Reed-Solomon (RS) coding algorithm has become one of the mainstream algorithms in FEC due to its excellent error correction performance.
[0003] RS encoding is a block encoding algorithm, with commonly used methods based on byte-level data segmentation. It divides the original data into original blocks of a predetermined number of bytes each, resulting in multiple original blocks. Each predetermined number of original blocks forms a group, resulting in multiple groups of original blocks. RS encoding is performed on each group of original blocks to generate corresponding recovery blocks. A group of original blocks and its corresponding recovery block form a FEC (Framework Error Correction) group, resulting in multiple FEC groups, thus completing the encoding of the original data. Each FEC group is then sent to the target device. When the target device receives any predetermined number of blocks within an FEC group, it can fully recover the original data corresponding to that FEC group, thus mitigating packet loss.
[0004] However, real-world network packet loss is often sudden and non-uniform. Increasing the preset number of blocks can improve resilience against sudden packet loss. However, the more blocks in each group, the larger the amount of data that needs to be buffered in each group; the larger the amount of data to buffer, the longer the buffering time, thus increasing data latency and negatively impacting latency-sensitive data. Therefore, setting a fixed preset number of blocks for grouping and recoding cannot simultaneously address latency and non-uniform packet loss issues, resulting in poor FEC performance and reduced communication reliability. Summary of the Invention
[0005] This application provides a data processing method, electronic device, and storage medium to solve the problems that setting a fixed preset number of blocks for grouping and recoding cannot simultaneously address latency issues and non-uniform packet loss, thereby improving FEC performance and enhancing communication reliability.
[0006] Firstly, this application provides a data processing method, including:
[0007] When a data packet in the preset buffer satisfies the overflow rule corresponding to the preset buffer, all currently cached data packets are retrieved from the preset buffer and forward error correction is performed to generate a data packet. The data packets are cached in the preset buffer according to their corresponding data types. The data type indicates the data packet's sensitivity to latency. The data packet includes original blocks and recovered blocks. The overflow rule is determined based on the data type of the data packets in the preset buffer and is used to dynamically adjust the number of original blocks and recovered blocks in the data packet.
[0008] Send data packets to the target device.
[0009] In one possible design, the data types include latency-sensitive and non-latency-sensitive types.
[0010] In one possible design, when a data packet in a preset buffer satisfies the overflow rule corresponding to the preset buffer, all currently cached data packets are retrieved from the preset buffer and forward error correction is performed. Before generating data packets, the method further includes:
[0011] When caching each data packet, count the number of the first data packet and the number of the second data packet; wherein, the first data packet is a latency-sensitive data packet in the preset buffer, and the second data packet is a non-latency-sensitive data packet in the preset buffer;
[0012] Based on the number of the first data packet and the number of the second data packet, adjust the overflow rule to reduce the number of the original chunks when the number of the first data packet is greater than the number of the second data packet, or to increase the number of the original chunks when the number of the first data packet is less than the number of the second data packet.
[0013] In one possible design, the overflow rule corresponding to the preset buffer includes at least one of the following:
[0014] The total number of data packets in the preset buffer is greater than or equal to the first quantity threshold;
[0015] The total data length of data packets in the preset buffer is greater than or equal to the first length threshold;
[0016] The first data packet is cached starting from the preset cache area, and then the first time threshold is elapsed.
[0017] In one possible design, the preset buffer includes a first buffer and a second buffer. The first buffer is used to cache latency-sensitive data packets, and the second buffer is used to cache non-latency-sensitive data packets.
[0018] In one possible design, the overflow rule corresponding to the target cache includes at least one of the following:
[0019] The number of data packets in the target buffer is greater than or equal to the second quantity threshold;
[0020] The total data length of the data packets in the target buffer is greater than or equal to the second length threshold;
[0021] The first data packet is cached starting from the target cache, and the second time threshold is elapsed after that.
[0022] The target buffer is either the first buffer or the second buffer; the second quantity threshold, the second length threshold, and the second duration threshold are inversely proportional to the latency sensitivity of the data packets in the target buffer.
[0023] In one possible design, data packets are sent to the target device, including:
[0024] Each block in the data group is encapsulated to obtain multiple block encapsulation packages. Each block encapsulation package includes an original block or a recovered block, as well as encapsulation parameters, including the data group sequence number, the number of original blocks in the data group, the block type, and the block number.
[0025] Multiple segmented encapsulation packets are sent to the target device so that the target device can decode the multiple segmented encapsulation packets to obtain all the original segments.
[0026] Using the method provided in the first aspect, when the data packets in the preset buffer meet the overflow rules corresponding to the preset buffer, all currently cached data packets are retrieved from the preset buffer and subjected to FEC processing to generate data packets. These data packets are then sent to the target device. This allows for flexible adjustment of the number of original blocks in each data packet based on the data type of the data packets according to the overflow rules. This balances the issues of non-uniform packet loss and latency, improving the effectiveness of FEC processing. The target device can receive the corresponding data packets in a timely manner when there are many data packets with low latency requirements, and can also receive more original blocks and recovered blocks when there are many data packets with low latency requirements. In the event of a sudden increase in packet loss, the original data packets can also be recovered, thereby improving communication reliability.
[0027] In a second aspect, this application provides a data processing apparatus, comprising: a module for performing the data processing method in the first aspect and any possible design of the first aspect.
[0028] Thirdly, this application provides an electronic device including a first processor, which executes a computer-executable program or instructions in a memory to implement a data processing method as described in the first aspect and any possible design of the first aspect.
[0029] Fourthly, this application provides an electronic device, including a memory and a second processor. The memory stores a computer-executable program or instructions, and the second processor executes the computer-executable program or instructions to implement the data processing method as described in the first aspect and any possible design of the first aspect.
[0030] Fifthly, this application provides a computer-readable storage medium storing a computer-executable program or instructions, which, when executed by a processor, implement the data processing method as described in the first aspect and any possible design of the first aspect.
[0031] Sixthly, this application provides a computer program product comprising: execution instructions stored in a readable storage medium, at least one processor of an electronic device being able to read the execution instructions from the readable storage medium, and the at least one processor executing the execution instructions causing the electronic device to implement the data processing method as described in the first aspect and any possible design of the first aspect.
[0032] The above description is merely an overview of the technical solutions of the embodiments of this application. In order to better understand the technical means of the embodiments of this application and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of this application more obvious and understandable, specific implementation methods of this application are described below. Attached Figure Description
[0033] Figure 1 This is a flowchart of a data processing method provided in an embodiment of this application.
[0034] Figure 2 This is a flowchart of a data processing method provided in an embodiment of this application.
[0035] Figure 3 This is a flowchart illustrating a method for sending data packets according to an embodiment of this application.
[0036] Figure 4 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application.
[0037] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0038] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0039] In this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c alone can mean: a alone, b alone, c alone, a combination of a and b, a combination of a and c, a combination of b and c, or a, b, and c, where a, b, and c can be single or multiple. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0040] The terms “center,” “longitudinal,” “lateral,” “up,” “down,” “left,” “right,” “front,” and “rear,” etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.
[0041] The terms "connected" and "connected" should be interpreted broadly. For example, in circuit structures, "connected" or "connected" can refer not only to physical connections but also to electrical or signal connections. This could be a direct connection (physical connection) or an indirect connection via at least one intermediate component, as long as the circuit is connected. It could also refer to the internal connection between two components. Similarly, a signal connection can refer to a connection via a circuit or a medium, such as radio waves. Those skilled in the art will understand the specific meaning of these terms in this application based on the specific circumstances.
[0042] In related technologies, the RS encoding algorithm has two commonly used encoding methods.
[0043] 1. Bit encoding method.
[0044] The original data is divided into groups of a predetermined number of bits, resulting in multiple groups of original bit data. Each group of original bit data is then encoded using RS encoding to generate redundant bit data. Each group of original bit data and its corresponding redundant bit data forms a FEC group, resulting in multiple FEC groups, thus completing the encoding of the original data. Bit-based encoding is often used in dedicated hardware chips or modules.
[0045] 2. Byte data block encoding method.
[0046] The original data is divided into original blocks, with each preset number of bytes divided into a block. Multiple original blocks are then grouped together, resulting in multiple groups of original blocks. Each group of original blocks is then RS-encoded to generate a corresponding recovery block. A group of original blocks and its corresponding recovery block form a FEC group, resulting in multiple FEC groups, thus completing the encoding of the original data. Byte-block encoding is commonly used in software FEC functions; for example, FEC processing in Linux operating systems frequently employs byte-block encoding.
[0047] The number of bits of the generated redundant bit data or the number of recovery blocks are determined by the sum of the original bit data or original blocks and the redundancy ratio.
[0048] Taking recovery blocks as an example, the number of recovery blocks = the number of original blocks × redundancy ratio. For example, with a redundancy ratio of 20%, a group of original blocks includes 10 original blocks, generating 10 × 20% = 2 recovery blocks, meaning 10 original blocks and 2 recovery blocks form an FEC packet with 12 blocks. As another example, with a redundancy ratio of 20%, a group of original blocks contains 20 original blocks, generating 20 × 20% = 4 recovery blocks, meaning 20 original blocks and 4 recovery blocks form an FEC packet with 24 blocks. Yet another example, with a redundancy ratio of 20%, a group of original blocks contains 30 original blocks, generating 30 × 20% = 6 recovery blocks, meaning 30 original blocks and 6 recovery blocks form an FEC packet with 36 blocks.
[0049] An FEC packet consists of n original blocks and m recovery blocks. When an FEC packet is sent to a target device, the target device only needs to receive any j blocks (j greater than or equal to n) from that FEC packet. There is no need to distinguish between original and recovery blocks among these j blocks; the target device can then recover the n original blocks from the FEC packet based on these j blocks. Therefore, the loss of any k blocks (k less than or equal to m) in this FEC packet will not affect the target device's reception of the original data corresponding to that FEC packet. Based on this, the RS coding algorithm can withstand packet loss rates as low as m / n.
[0050] For example, a set of original blocks includes 30 original blocks with a redundancy ratio of 20%. The number of recovered blocks generated is 30 × 20% = 6. The 30 original blocks and 6 recovered blocks form an FEC packet with 36 blocks. Sending these 36 blocks to the target device, the target device receives 27 original blocks and 3 recovered blocks, thus recovering the original data corresponding to the 30 original blocks in the FEC packet. In other words, the target device loses 6 blocks (16.7%) when receiving the FEC packet, but can still recover the original data corresponding to the 30 original blocks in the FEC packet.
[0051] Based on this, it can be seen that for an FEC packet, if the number of lost packets increases, it is necessary to increase the redundancy ratio, increase the number of recovery blocks, and increase the total number of blocks in the FEC packet; or, without increasing the redundancy ratio, increasing the number of original blocks contained in the FEC packet will also increase the number of recovery blocks, thereby increasing the total number of blocks in the FEC packet.
[0052] In the Linux operating system, each raw block and recovery block exists in the form of a data packet. A block is a data packet, and a data packet is a whole. If even one byte is lost, the entire data packet will be lost. Packet loss in FEC refers to the loss of a block.
[0053] However, in practical application, there are two problems.
[0054] On the one hand, packet loss is not uniform; it exhibits non-uniformity. For example, a packet loss rate of 20% does not mean that 2 out of every 10 packets are lost. In reality, it might mean that 10 consecutive packets are not lost, and then 4 out of the next 10 packets are lost. In total, 4 out of these 20 packets are lost, resulting in an overall packet loss rate of 20%.
[0055] For example, with a packet loss rate of 20%, an FEC packet consists of 10 original blocks and 2 recovery blocks. If the FEC packet is sent during a period of continuous packet loss (i.e., 4 blocks are lost consecutively), the target device will only receive 8 blocks, making it impossible to recover the original data and causing FEC to fail. However, if the packet loss rate remains at 20%, and an FEC packet has 20 original blocks and 4 recovery blocks, and the FEC packet is sent during a period of continuous packet loss (losing 4 blocks), the target device can receive 20 blocks and recover the original data corresponding to the 20 original blocks in the FEC packet, achieving the expected effect of FEC. It can be seen that, under the same packet loss rate, the more blocks in an FEC packet, the stronger its ability to resist sudden, non-uniform packet loss, and the better the FEC processing effect.
[0056] On the other hand, the raw chunks of an FEC packet are generated from the raw data and need to be cached in advance. The more raw chunks there are, the greater the latency caused by caching will be. For latency-sensitive raw data, excessive caching latency will negatively impact communication.
[0057] Conventional FEC applications, such as kcptun and UDPspeeder, require setting a fixed FEC parameter during the FEC implementation process: Preset number of chunks and Recovery number of chunks. The Preset number of chunks specifies the number of original chunks included in each FEC packet, and the Recovery number of chunks specifies the number of recovery chunks included in each FEC packet. For example, an FEC parameter of 10:2 means that 2 recovery chunks are generated for every 10 original chunks, and an FEC packet always includes 10 original chunks and 2 recovery chunks.
[0058] However, setting a fixed FEC parameter has two drawbacks based on the two issues mentioned above. First, setting a larger number of blocks, such as an FEC parameter of 30:6, increases the number of blocks in each FEC packet, improving the ability to combat non-uniform packet loss and enhancing the effectiveness of FEC processing. However, this increases latency, negatively impacting communication of latency-sensitive data. Second, setting a smaller number of blocks, such as an FEC parameter of 10:2, reduces the number of blocks in each FEC packet, decreasing latency. However, this reduces the ability to combat non-uniform packet loss and diminishes the effectiveness of FEC processing. Therefore, setting a fixed FEC parameter cannot simultaneously address both non-uniform packet loss and latency issues, resulting in poor FEC processing performance and reduced communication reliability.
[0059] For example, this application provides a data processing method, apparatus, electronic device, computer-readable storage medium, and computer program product that, when caching data packets, distinguishes data packets of different data types, sets different overflow rules for data packets of different data types, and adjusts the number of original blocks in the generated FEC packets through the overflow rules, so that the number of blocks in the FEC packets can take into account the non-uniform packet loss problem and the latency problem, thereby improving the effect of FEC processing and improving communication reliability.
[0060] The data processing method can be executed by an electronic device, or by a data processing unit within an electronic device. The data processing unit can be implemented through a combination of software and / or hardware. For example, the data processing unit can be an application (APP), a webpage, or a mini-program. Alternatively, the data processing unit can be a control chip, a processor, etc. The electronic device in this application can also be referred to as a transmitting device.
[0061] The electronic devices can be customer premises equipment (CPE), user equipment (UE), routers, base stations, servers, desktop computers, mobile phones, tablets, laptops, wearable devices, in-vehicle equipment, or augmented reality (AR) / virtual reality (VR) devices, etc. For simplicity, this application embodiment uses execution by a data processing device as an example.
[0062] Below, in conjunction with Figures 1 to 3 The data processing method provided in the embodiments of this application will be described.
[0063] Please see Figure 1 , Figure 1 This is a flowchart illustrating a data processing method provided in one embodiment of this application. Figure 1 As shown, the method includes:
[0064] S101. When the data packets in the preset buffer meet the overflow rules corresponding to the preset buffer, the data processing device retrieves all currently cached data packets from the preset buffer and performs FEC processing to generate data packets.
[0065] The data packets are cached in a preset cache area according to the data type they correspond to.
[0066] A data packet refers to a data packet generated by a sending device and intended to be sent to a receiving device (i.e., the target device). The sending device can obtain data packets from other devices or generate them itself. A preset buffer can be provided by a data processing device to cache data packets. Before sending a data packet to the target device, the data processing device receives the data packet to be sent and caches it in the preset buffer, awaiting FEC processing. Alternatively, the preset buffer can also be provided by the sending device itself, where the data is cached.
[0067] The preset cache can be implemented in various forms, such as an array, queue, memory area, or linked list.
[0068] The preset buffer can store a preset number of data packets, or it can store data of a preset byte length. The preset number is greater than or equal to the maximum number of data packets that can be included in a data packet. The preset byte length is greater than or equal to the maximum length of bytes that can be included in a data packet, thus ensuring that the preset buffer has sufficient space to cache data that needs to be processed by FEC.
[0069] For example, if a data packet contains a maximum of 100 data packets, then the storage space of the preset buffer is greater than or equal to the space required to cache 100 data packets. As another example, if a data packet contains a maximum of 60KB of data, then the storage space of the preset buffer is greater than or equal to the space required to cache 60KB of data.
[0070] The data processing device caches the data packets to be sent into a preset buffer according to the data type of the data packets.
[0071] The data type of a data packet indicates its sensitivity to latency. For example, data types can be latency-sensitive or non-latency-sensitive. Latency-sensitive data requires low latency and must be transmitted from the sending device to the destination device within a very short time; examples include Transmission Control Protocol (TCP) data, real-time voice data, and real-time video data. Non-latency-sensitive data has low latency requirements; examples include User Datagram Protocol (UDP) data, email data, and document data. When caching data packets, the data type can be flexibly configured based on the packet's latency requirements to meet transmission needs.
[0072] In addition, data types can be divided into multiple levels according to the sensitivity of data packets to latency, and this application does not impose any restrictions on this.
[0073] Based on different data types, the data processing device identifies the data type of the data packet and caches it in a preset buffer according to the data type.
[0074] In some examples, the data processing device can cache data packets by dividing a preset buffer into multiple buffers according to data type and caching data packets in the corresponding buffers. This distinguishes data packets of different data types by caching them in different areas of the preset buffer. For example, the preset buffer may include a latency-sensitive buffer and a non-latency-sensitive buffer. The data processing device can cache latency-sensitive data packets in the latency-sensitive buffer and non-latency-sensitive data packets in the non-latency-sensitive buffer.
[0075] In other examples, the data processing device can add a data type tag to each data packet according to its corresponding data type when caching each data packet, and then cache the data packet in a preset buffer, thereby distinguishing different types of data packets by the data type tag. For example, a data type tag "1" indicates latency-sensitive data, and a data type tag "0" indicates non-latency-sensitive data. When caching latency-sensitive data packets, the data processing device records the data type tag of the data packet as "1", and when caching non-latency-sensitive data packets, the data processing device records the data type tag of the data packet as "0".
[0076] During the process of caching data packets, the data processing device determines whether the data packets in the preset buffer meet the overflow rules corresponding to the preset buffer. The overflow rules are determined based on the data types of the data packets in the preset buffer and are used to dynamically adjust the number of original blocks and recovery blocks in the data packets.
[0077] The overflow rule is the rule used to determine whether data packets cached in the preset buffer need to be retrieved for FEC processing. The threshold in the overflow rule can be data length, number of data packets, or delay time, etc. For example, the overflow rule can be: the data length of the data packets in the preset buffer is greater than or equal to the data length threshold. When the data processing device determines that the data packets in the preset buffer meet the overflow rule, it retrieves all data packets in the preset buffer and performs FEC processing.
[0078] The data processing device can determine the overflow rules based on the data type corresponding to the data packets in the preset buffer.
[0079] Taking the data packet data type as latency-sensitive and non-latency-sensitive as an example, the data processing device can determine the overflow rule based on the latency-sensitive data packets and non-latency-sensitive data packets in the preset buffer.
[0080] For example, when the number of latency-sensitive data packets or the corresponding data volume is large, the data processing device can reduce the threshold in the overflow rule to ensure that the data packets cached in the preset buffer can be retrieved in time for FEC processing. At this time, the data volume of the data packets processed by FEC is smaller, the buffering time is shortened, the number of blocks in each data packet can be reduced, thereby improving the FEC processing speed and helping to send the data packets to the target device in time, thereby reducing the impact of latency on latency-sensitive data.
[0081] For example, when the number of non-delay-sensitive data packets or the corresponding data volume is large, the data processing device can increase the threshold in the overflow rule. This way, the data processing device will trigger FEC processing only when enough data packets are cached in the preset buffer, thereby increasing the number of blocks in each data packet and improving the ability to resist sudden non-uniform packet loss.
[0082] The data processing device can count the data packets of different data types in the data packets cached in the preset buffer area, obtain the number of data packets of different data types, and then adjust the overflow rules according to the number of data packets of different data types.
[0083] For example, if 10 non-delay-sensitive data packets and 2 delay-sensitive data packets are cached in the preset buffer, the data processing device can appropriately increase the threshold in the overflow rule because there are more non-delay-sensitive data packets. The overflow rule can be: the number of data packets in the preset buffer is greater than or equal to 40, so as to ensure that enough data packets are cached in the preset buffer before triggering FEC processing, increasing the number of blocks in each data packet, and improving the ability to resist sudden packet loss.
[0084] In addition, when the preset buffer includes multiple buffers, the data processing device can also set fixed but different overflow rules for each buffer according to the data types corresponding to different buffers. For each buffer, when the overflow rule corresponding to the buffer is triggered, the data processing device performs FEC processing on the data packets in the buffer.
[0085] For example, the preset buffer includes a latency-sensitive buffer and a non-latency-sensitive buffer. For the latency-sensitive buffer, a low-threshold overflow rule can be set, such as: the number of data packets in the latency-sensitive buffer is greater than or equal to 10. This reduces the number of blocks in each data packet, thereby improving FEC processing speed and helping to send data packets to the target device in a timely manner, thus reducing the impact of latency on latency-sensitive data. For the non-latency-sensitive buffer, a high-threshold overflow rule can be set, such as: the number of data packets in the preset buffer is greater than or equal to 40. This increases the number of blocks in each data packet, thereby improving the ability to resist bursty, non-uniform packet loss.
[0086] Based on this, the data processing device can flexibly select different overflow rules according to the data type corresponding to the data packets in the preset buffer, thereby taking into account both the non-uniform packet loss problem and the latency problem, and improving the effect of FEC processing.
[0087] When a data packet in a preset buffer meets the overflow rule corresponding to the preset buffer, the data processing device retrieves all currently cached data packets from the preset buffer and performs FEC processing to generate data packets.
[0088] The data groups include original blocks and recovery blocks.
[0089] Specifically, the data processing device can divide all currently cached data packets into multiple raw blocks according to a preset number of bytes, and perform FEC processing on these raw blocks according to a preset FEC redundancy ratio parameter to generate one or more recovery blocks. The raw blocks and recovery blocks are then defined as a data packet. A larger number of currently cached data packets results in more raw blocks and, under the same preset FEC redundancy ratio parameter, more recovery blocks are generated, which helps improve the ability to withstand sudden, non-uniform packet loss. Conversely, a smaller number of currently cached data packets results in fewer raw blocks, which helps improve FEC processing speed and enables timely delivery of data packets to the target device, thus reducing latency impact.
[0090] The preset number of bytes can be set to, for example, 1000 bytes.
[0091] The preset FEC redundancy ratio parameter can be flexibly set according to needs. For example, the FEC redundancy ratio parameter can be 20%, that is, 2 recovery blocks are generated for every 10 original blocks. If the number of original blocks is 40, then 8 recovery blocks are generated.
[0092] Based on this, the data processing device completes FEC processing on the data packets cached in the preset buffer area under the condition of satisfying the overflow rules. Thus, by flexibly adjusting the number of original blocks in each data packet according to the data type corresponding to the data packet through the overflow rules, it can perform FEC processing on data packets with low latency requirements in a timely manner and send them to the target device in a timely manner, reducing the impact of latency. For data packets with low latency requirements, the number of original blocks can be increased to improve the ability to resist sudden non-uniform packet loss. In this way, both packet loss and latency issues are taken into account, and the effect of FEC is improved.
[0093] S102, The data processing device sends data packets to the target device.
[0094] Specifically, the data processing device can encapsulate data packets and send the encapsulated data packets to the target device. The target device receives the encapsulated data packets and decodes them to recover the original blocks, thereby obtaining the original data packets.
[0095] Based on this, the target device can receive the corresponding data packets in a timely manner when there are many data packets with low latency requirements, and can also receive more original and recovered packets when there are many data packets with low latency requirements. In the event of sudden non-uniform packet loss, it can also recover the original data packets, thereby improving communication reliability.
[0096] After processing a data packet, the data processing device can execute S101 to S102 again when the data packet in the preset buffer meets the overflow rule corresponding to the preset buffer next time, so as to realize continuous FEC processing.
[0097] In this embodiment, when the data packets in the preset buffer meet the overflow rules corresponding to the preset buffer, the data processing device retrieves all currently cached data packets from the preset buffer and performs FEC processing to generate data packets. The data packets are then sent to the target device. This allows the overflow rules to flexibly adjust the number of original blocks in each data packet according to the data type of the data packets, thus balancing non-uniform packet loss and latency issues and improving the effectiveness of FEC processing. The target device can receive the corresponding data packets in a timely manner when there are many data packets with low latency requirements, and can also receive more original blocks and recovered blocks when there are many data packets with low latency requirements. In the event of sudden non-uniform packet loss, the original data packets can also be recovered, thereby improving communication reliability.
[0098] Based on the above exemplary description, when the data packets in the preset buffer meet the overflow rules corresponding to the preset buffer, the data processing device retrieves all currently cached data packets from the preset buffer and performs forward error correction processing. Before generating data packets, the overflow rules can also be adjusted.
[0099] Please see Figure 2 , Figure 2 This is a flowchart illustrating a data processing method provided in one embodiment of this application. Figure 2 As shown, prior to S101, the method further includes:
[0100] Sa1, the data processing device counts the number of the first data packet and the number of the second data packet when buffering each data packet.
[0101] The first data packet is a latency-sensitive data packet in the preset buffer, and the second data packet is a non-latency-sensitive data packet in the preset buffer.
[0102] Based on this, the data processing device can know the number of latency-sensitive data packets and non-latency-sensitive data packets currently cached in the preset buffer, so as to adjust the overflow rules.
[0103] Sa2. The data processing device adjusts the overflow rule according to the number of the first data packet and the number of the second data packet, so as to reduce the number of the original blocks when the number of the first data packet is greater than the number of the second data packet, or increase the number of the original blocks when the number of the first data packet is less than the number of the second data packet.
[0104] When the number of the first data packet is greater than the number of the second data packet, it indicates that there are more latency-sensitive data packets in the preset buffer. In general, the data packets in the preset buffer have higher low-latency requirements. Therefore, the data processing device can adjust the overflow rules to trigger FEC processing in a timely manner when the number of data packets or the amount of data in the preset buffer is small, thereby reducing the number of original blocks and reducing the impact of latency.
[0105] When the number of the second data packet is greater than the number of the first data packet, it indicates that there are more non-latency-sensitive data packets in the preset buffer. Generally speaking, the data packets in the preset buffer have lower latency requirements. Therefore, the data processing device can adjust the overflow rules so that FEC processing is triggered only when the number of data packets or the amount of data in the preset buffer is large, thereby increasing the number of original blocks and improving the ability to resist sudden non-uniform packet loss.
[0106] In some examples, the overflow rules corresponding to the preset buffer include at least one of the following:
[0107] The total number of data packets in the preset buffer is greater than or equal to the first quantity threshold;
[0108] The total data length of data packets in the preset buffer is greater than or equal to the first length threshold;
[0109] The first data packet is cached starting from the preset cache area, and then the first time threshold is elapsed.
[0110] For example, the data processing device can adjust the target threshold in the overflow rule using the following formula, where the target threshold is any one of the first quantity threshold, the first length threshold, and the first duration threshold.
[0111] Formula 1 is as follows:
[0112]
[0113] Where Th is the target threshold, r is the baseline threshold, C1 is the number of the first data packet, and C2 is the number of the second data packet.
[0114] Based on this, the data processing device can adjust the overflow rules in a timely manner according to the changes in the data packets in the preset buffer based on the number of non-latency-sensitive data packets and the number of latency-sensitive data packets. It has strong adaptability and realizes dynamic adjustment of the overflow rules, which more accurately achieves FEC processing that takes into account both latency issues and non-uniform packet loss issues, thereby improving the effectiveness of FEC processing.
[0115] Based on the above exemplary description, the preset buffer includes a first buffer and a second buffer. The first buffer is used to cache latency-sensitive data packets, and the second buffer is used to cache non-latency-sensitive data packets.
[0116] Based on this, by using two buffers to separate and cache latency-sensitive data packets and non-latency-sensitive data packets, and with each buffer having its own corresponding overflow rules, the FEC processing of the two types of data packets will not affect each other, further reducing the impact of latency and improving the ability to resist sudden non-uniform packet loss.
[0117] Furthermore, when data types are divided into multiple levels based on the sensitivity of data packets to latency, the preset buffer can also include multiple buffers, with each level corresponding to one buffer. Data packets of different data types at different levels are cached in different buffers, thereby further separating data packets with different sensitivities to latency. Different overflow rules can be set for each level of data type to more accurately reduce the impact of latency and improve the ability to resist sudden non-uniform packet loss.
[0118] In some examples, the overflow rule corresponding to the target buffer includes at least one of the following:
[0119] The number of data packets in the target buffer is greater than or equal to the second quantity threshold;
[0120] The total data length of the data packets in the target buffer is greater than or equal to the second length threshold;
[0121] The first data packet is cached starting from the target cache, and the second time threshold is elapsed after that.
[0122] The target buffer is either the first buffer or the second buffer; the second quantity threshold, the second length threshold, and the second duration threshold are inversely proportional to the latency sensitivity of the data packets in the target buffer.
[0123] Based on this, the data processing device sets different overflow rules for latency-sensitive data packets and non-latency-sensitive data packets. The FEC processing of the two types of data packets will not affect each other, further reducing the impact of latency and improving the ability to resist sudden non-uniform packet loss.
[0124] Based on the above exemplary description, the data processing apparatus can be configured as follows: Figure 3 As shown, data packets are sent to the target device.
[0125] Please see Figure 3 , Figure 3 This is a flowchart illustrating a method for sending data packets according to an embodiment of this application. Figure 3 As shown, the method includes:
[0126] S201. The data processing device encapsulates each block in the data group to obtain multiple block encapsulation packets.
[0127] Before sending data packets, the data processing device needs to encapsulate each block in the data packet to obtain multiple block encapsulation packets, ensuring that the data packets can be transmitted in the network. The encapsulation method can be, for example, UDP protocol encapsulation or TCP protocol encapsulation.
[0128] The block encapsulation package includes an original block or a restored block, as well as encapsulation parameters.
[0129] The encapsulation parameters include the data group sequence number, the number of original blocks in the data group, the block type, and the block number.
[0130] The data packet sequence number is used to distinguish the block encapsulation packets corresponding to different data packets, so that the target device can determine whether the block encapsulation packet of a data packet has been received. The number of original blocks is used to indicate how many original blocks are included in the data packet corresponding to the block encapsulation packet, so that the target device can start decoding processing after receiving a block encapsulation packet with a number greater than or equal to the number of original blocks. The block type is used to indicate whether the block in the block encapsulation packet is an original block or a recovery block. For example, the block type "O" represents an original block and "R" represents a recovery block.
[0131] The chunked packet also includes a source Internet Protocol (IP) address and a destination IP address. The source IP address indicates the origin of the chunked packet, and the destination IP address indicates its destination.
[0132] For example, the data group includes original block 1, original block 2, original block 3, original block 4, original block 5, original block 6, recovered block 1, and recovered block 2. The block encapsulation packet corresponding to original block 1 can be shown in Table 1 below:
[0133] Table 1
[0134] IP header XXXXX UDP header XXXXX Data group sequence number 1 Number of original blocks 6 Content in blocks Original block 1 Block type O Block numbering Block 1
[0135] The block encapsulation packet corresponding to block 1 can be restored as shown in Table 2 below:
[0136] Table 2
[0137] IP header XXXXX UDP header XXXXX Data group sequence number 1 Number of original blocks 6 Content in blocks Restore block 1 Block type R Block numbering Block 7
[0138] S202, The data processing device sends multiple segmented encapsulation packets to the target device so that the target device can decode the multiple segmented encapsulation packets to obtain all the original segments.
[0139] Based on this, after receiving all the segmented encapsulation packets corresponding to a data packet, the target device can perform decoding processing to obtain the original segment.
[0140] Since the target device can only perform decoding processing after receiving at least the number of block encapsulation packets corresponding to the original block of a data packet, the block encapsulation packets can be cached in the target device first. The encapsulation packets can be cached in the form of queues, linked lists, memory areas, etc., and this application does not impose any restrictions on this.
[0141] For a given data packet, the target device receives a segmented encapsulation packet each time. It reads the encapsulation parameters from the segmented encapsulation packet, checks the data packet to which the segmented encapsulation packet belongs, checks the segment type, and checks if the data volume of the received segmented encapsulation packet is greater than or equal to the number of original segments. If it receives a segmented encapsulation packet greater than or equal to the number of original segments, it retrieves all the cached segmented encapsulation packets for decoding, recovers all the original segments, and completes the reception of the original segments.
[0142] Based on this, the data processing device can transmit data in packets to the target device, and the target device can accurately recover the original packets.
[0143] Below, two examples are given to illustrate the data processing method of this application.
[0144] Example 1: On the sending device, a buffer queue is used as a preset buffer to cache data packets to be sent. The buffer queue is 64KB in length and can store a maximum of 64KB of data packets. The baseline threshold in the overflow rule corresponding to the buffer queue is set to 30KB. The preset byte count is set to 1000 bytes. The preset FEC redundancy ratio parameter is set to 20%, meaning that 2 recovery blocks are generated for every 10 original blocks.
[0145] Assuming all data packets in the preset buffer are of latency-sensitive data type, the data processing device calculates the first length threshold according to Formula 1 above, obtaining the overflow rule: the total data length of the data packets in the preset buffer is greater than or equal to 30KB. When the data packets in the preset buffer meet the overflow rule, the data processing device retrieves all the cached data packets for FEC processing, generating 30 original blocks and 6 recovery blocks, resulting in a data packet consisting of 36 blocks. The target device only needs to receive any 30 blocks to obtain all the original blocks and thus the corresponding data packets. Based on this, FEC processing can be performed in a timely manner and the data can be sent to the target device promptly, reducing the impact of latency.
[0146] Assuming that all data packets cached in the preset buffer are of non-latency-sensitive data type, the data processing device calculates the first length threshold according to Formula 1 above, obtaining the overflow rule: the total data length of the data packets in the preset buffer is greater than or equal to 60KB. When the data packets in the preset buffer meet the overflow rule, the data processing device retrieves all cached data packets and performs FEC processing, generating 60 original blocks and 12 recovery blocks, resulting in a data packet containing 72 blocks. The target device only needs to receive any 60 blocks to obtain all the original blocks and thus the corresponding data packets. Based on this, the number of original blocks can be increased, improving the ability to resist sudden non-uniform packet loss.
[0147] Assume that some of the data packets cached in the preset buffer are latency-sensitive data packets and the other part are non-latency-sensitive data packets. For example, the preset buffer has already cached 8K bytes of latency-sensitive data packets and 8K bytes of non-latency-sensitive data packets. According to the formula above, the first length threshold is calculated to be 45K. The data packets cached in the preset buffer are 16K, which does not meet the overflow rule. Continue to wait for cached data packets, and adjust the overflow rule in real time when caching data packets until the overflow rule is met.
[0148] Therefore, the overflow rules are not fixed, but change in real time according to the actual situation of the cached data packets. As a result, the amount of data contained in each data group may be different, that is, the number of original blocks may also be different, which has a stronger ability to resist non-uniform packet loss.
[0149] Because TCP communication throughput is highly sensitive to latency, TCP packets can be defined as latency-sensitive packets. In UDP communication, latency has a smaller impact on throughput, so UDP packets can be defined as non-latency-sensitive packets. Furthermore, TCP packets have a retransmission capability; a small amount of packet loss can be automatically retransmitted by the TCP protocol, allowing TCP to tolerate a certain percentage of packet loss. Therefore, even if the number of original chunks in a TCP packet is small, the probability of packet loss is higher, but this can be compensated for by the retransmission capability. For UDP packets, the number of original chunks in the packet improves the ability to withstand sudden, uneven packet loss. Based on this, this method can be applied to both TCP and UDP communication. If the preset buffer contains many TCP packets, which are latency-sensitive but have a retransmission capability, the number of original chunks should be reduced to decrease latency. If the preset buffer contains many UDP packets, which are not latency-sensitive and do not have a retransmission capability, the number of original chunks should be increased to improve the ability to withstand sudden, uneven packet loss, thereby improving communication performance.
[0150] Assume the preset buffer contains 22KB of TCP packets and 24KB of UDP packets. The overflow rule calculated by the data processing device according to Formula 1 above is: the total data length of the packets in the preset buffer must be greater than or equal to 45.7KB. The current total data length in the preset buffer is 22KB + 24KB = 46KB, which meets the overflow rule. The data processing device performs FEC processing on these 46KB packets, generating 46 raw blocks and 9 recovered blocks, resulting in a data packet comprising 55 blocks.
[0151] The data processing device encapsulates data packets. A header for a segmented encapsulation packet is defined, with the following format: 4-byte data packet sequence number + 1-byte number of original segments + 1-byte segment type + 1-byte segment number, totaling 7 bytes. The data packet sequence number is stored in network byte order. Segment types are distinguished by O / R, where "O" indicates an original segment and "R" indicates a recovered segment. Segment numbers start from the first original segment: the first original segment is numbered 1, the second is numbered 2, and so on, up to 46 for the 46th segment; the first recovered segment is numbered 47, the second 48, and so on, up to 55 for the 9th recovered segment. Assuming 1000 data packets have already been sent, the sequence number of the current data packet is 1001.
[0152] Assume each chunk is encapsulated using the UDP protocol. Assume the destination IP address is 192.168.100.1, the destination device's receive port is 1088, the source IP address is 192.168.100.25, and the sender's send port is 20088. Each chunk is encapsulated into a chunked packet, and the format of each chunked packet is: 20-byte IP header + 8-byte UDP header + 7-byte encapsulation parameters + 1000 bytes of original chunk or recovered chunk data. The length of each chunked packet is 1035 bytes. Each chunk is encapsulated sequentially, resulting in 55 chunked packets. The data processing device then sends these 55 chunked packets sequentially to the destination device.
[0153] The target device receives segmented encapsulated packets and uses a linked list to cache them. Upon receiving a segmented encapsulated packet, it reads the data packet sequence number, the number of original segments, the segment type, and the segment number, and counts the number of segmented encapsulated packets corresponding to the data packet received. If it has received more than or equal to the number of original segments, the target device retrieves all segmented encapsulated packets corresponding to that data packet from the linked list, performs decoding, and recovers the original segments.
[0154] Based on this, the process of data packet caching, FEC processing, encapsulation, sending, receiving, and decoding is completed.
[0155] Example 2: At the sending device, two buffer queues are used as preset buffers to cache data packets to be sent. One queue is a latency-sensitive queue for buffering latency-sensitive data packets. The other queue is a non-latency-sensitive queue for buffering non-latency-sensitive data packets. Both buffer queues are 64KB in length and can hold a maximum of 64KB of data packets. The preset byte count is set to 1000 bytes. The preset FEC redundancy ratio parameter is set to 20%, meaning 2 recovery blocks are generated for every 10 raw blocks. The overflow rule for the latency-sensitive queue is set as follows: the total data length of the data packets in the latency-sensitive queue is greater than or equal to 30KB. The overflow rule for the non-latency-sensitive queue is set as follows: the total data length of the data packets in the latency-sensitive queue is greater than or equal to 60KB.
[0156] Because TCP communication throughput is highly sensitive to latency, TCP packets can be defined as latency-sensitive packets. In UDP communication, latency has a smaller impact on throughput, so UDP packets can be defined as non-latency-sensitive packets. Furthermore, TCP packets have a packet loss retransmission function; a small amount of packet loss can be automatically retransmitted by the TCP communication protocol, allowing TCP communication to tolerate a certain percentage of packet loss. The latency-sensitive queue buffers TCP packets to reduce latency and mitigate its impact, while the packet loss retransmission function compensates for the lost packets. The non-latency-sensitive queue buffers UDP packets to generate more raw data chunks, increasing the probability of handling non-uniform packet loss and thus improving communication performance. Based on this, this method can be applied to both TCP and UDP communication.
[0157] Assuming the buffered data packets in the latency-sensitive queue have reached 30KB, satisfying the overflow rule, the data processing unit retrieves all buffered data packets, performs FEC processing, generates 30 raw blocks and 6 recovered blocks, resulting in a data packet comprising 36 blocks. The non-latency-sensitive queue follows the same procedure.
[0158] The encapsulation method is similar to that in Example 1, and will not be repeated here.
[0159] Following the methods described in the above embodiments, the FEC function of the actual product was developed. After actual testing, under the same average packet loss rate and FEC redundancy ratio parameters, the maximum TCP communication traffic throughput speed can be obtained while the packet loss rate of UDP communication traffic can be reduced to the minimum, achieving the best FEC effect that balances the two.
[0160] Figure 4 This is a schematic diagram of the structure of a data processing apparatus provided in one embodiment of this application. Figure 4 As shown, the device includes: a processing module 101 and a sending module 102.
[0161] The processing module 101 is used to retrieve all currently cached data packets from the preset buffer and perform forward error correction processing to generate data packets when the data packets in the preset buffer satisfy the overflow rule corresponding to the preset buffer. The data packets are cached in the preset buffer according to their corresponding data types. The data type indicates the sensitivity of the data packets to latency. The data packets include original blocks and recovered blocks. The overflow rule is determined based on the data types of the data packets in the preset buffer and is used to dynamically adjust the number of original blocks and recovered blocks in the data packets.
[0162] The sending module 102 is used to send data packets to the target device.
[0163] It should be noted that the data processing device in this application embodiment can be used to execute the technical solutions of the above method embodiments, and its implementation principle and technical effect are similar, so it will not be described again here.
[0164] In some examples, the data types include latency-sensitive and non-latency-sensitive types.
[0165] In some examples, the device also includes an adjustment module, which is used for:
[0166] When a data packet in the preset buffer meets the overflow rule corresponding to the preset buffer, all currently cached data packets are retrieved from the preset buffer and forward error correction is performed. Before generating a data packet, the number of the first data packet and the number of the second data packet are counted when each data packet is cached. The first data packet is a latency-sensitive data packet in the preset buffer, and the second data packet is a non-latency-sensitive data packet in the preset buffer.
[0167] Based on the number of the first data packet and the number of the second data packet, adjust the overflow rule to reduce the number of the original chunks when the number of the first data packet is greater than the number of the second data packet, or to increase the number of the original chunks when the number of the first data packet is less than the number of the second data packet.
[0168] In some examples, the overflow rules corresponding to the preset buffer include at least one of the following:
[0169] The total number of data packets in the preset buffer is greater than or equal to the first quantity threshold;
[0170] The total data length of data packets in the preset buffer is greater than or equal to the first length threshold;
[0171] The first data packet is cached starting from the preset cache area, and then the first time threshold is elapsed.
[0172] In some examples, the preset buffer includes a first buffer and a second buffer, where the first buffer is used to cache latency-sensitive packets and the second buffer is used to cache non-latency-sensitive packets.
[0173] In some examples, the overflow rule corresponding to the target buffer includes at least one of the following:
[0174] The number of data packets in the target buffer is greater than or equal to the second quantity threshold;
[0175] The total data length of the data packets in the target buffer is greater than or equal to the second length threshold;
[0176] The first data packet is cached starting from the target cache, and the second time threshold is elapsed after that.
[0177] The target buffer is either the first buffer or the second buffer; the second quantity threshold, the second length threshold, and the second duration threshold are inversely proportional to the latency sensitivity of the data packets in the target buffer.
[0178] In some examples, the sending module 102 is specifically used for:
[0179] Each block in the data group is encapsulated to obtain multiple block encapsulation packages. Each block encapsulation package includes an original block or a recovered block, as well as encapsulation parameters, including the data group sequence number, the number of original blocks in the data group, the block type, and the block number.
[0180] Multiple segmented encapsulation packets are sent to the target device so that the target device can decode the multiple segmented encapsulation packets to obtain all the original segments.
[0181] Figure 5 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Figure 5 As shown, the electronic device may include a first processor 201, which, when executing a computer-executable program or instruction stored in a memory, implements the embodiments of this application. Figures 1 to 3 The data processing method shown.
[0182] The electronic device can be used to perform the various steps and / or processes corresponding to the electronic devices in the above method embodiments.
[0183] Figure 6 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Figure 6 As shown, the electronic device may include a second processor 301 and a memory 302. The memory 302 stores a computer program. When the second processor 301 executes the computer program, it implements the embodiments of this application. Figures 1 to 3 The data processing method shown.
[0184] The electronic device can be used to perform the various steps and / or processes corresponding to the electronic devices in the above method embodiments.
[0185] The electronic device of this application can be used to execute the technical solutions of the method embodiments described above. Its implementation principle and technical effects are similar. The operations implemented by each module can be further referred to the relevant descriptions of the method embodiments, which will not be repeated here. The modules here can also be replaced by components or circuits.
[0186] This application can divide electronic devices into functional modules based on the above method examples. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in the embodiments of this application is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0187] Another embodiment of this application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement the embodiments of this application. Figures 1 to 3 The data processing method shown.
[0188] This application also provides a program product including executable instructions stored in a computer-readable storage medium. At least one processor of an electronic device can read the executable instructions from the computer-readable storage medium, and the at least one processor executes the executable instructions to cause the electronic device to implement embodiments of this application. Figures 1 to 3 The data processing method shown.
[0189] This application also provides a chip that is connected to a memory, or a chip that integrates a memory. When a software program stored in the memory is executed, it implements the embodiments of this application. Figures 1 to 3 The data processing method shown.
[0190] In the 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 modules or 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 modules may be electrical, mechanical, or other forms.
[0191] Those skilled in the art will understand that although some embodiments herein include certain features included in other embodiments, combinations of features from different embodiments are intended to be within the scope of this application and form different embodiments. For example, in the claims, any of the claimed embodiments can be used in any combination.
[0192] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A data processing method, characterized in that, The method includes: When a data packet in a preset buffer satisfies the overflow rule corresponding to the preset buffer, all currently cached data packets are retrieved from the preset buffer and forward error correction is performed to generate a data packet. The data packets are cached in the preset buffer according to their corresponding data types. The data type indicates the data packet's sensitivity to latency. The data packet includes original blocks and recovered blocks. The overflow rule is determined based on the data type of the data packets in the preset buffer, and the overflow rule is used to dynamically adjust the number of original blocks and recovered blocks in the data packet. The data packet is sent to the target device.
2. The method according to claim 1, characterized in that, The data types include latency-sensitive and non-latency-sensitive types.
3. The method according to claim 2, characterized in that, Before retrieving all currently cached data packets from the preset buffer and performing forward error correction processing to generate data packets, the method further includes: When caching each data packet, the number of the first data packet and the number of the second data packet are counted; wherein, the first data packet is a latency-sensitive data packet in the preset buffer, and the second data packet is a non-latency-sensitive data packet in the preset buffer; The overflow rule is adjusted based on the number of the first data packet and the number of the second data packet to reduce the number of the original chunks when the number of the first data packet is greater than the number of the second data packet, or to increase the number of the original chunks when the number of the first data packet is less than the number of the second data packet.
4. The method according to claim 3, characterized in that, The overflow rule corresponding to the preset buffer includes at least one of the following: The total number of data packets in the preset buffer is greater than or equal to a first quantity threshold. The total data length of the data packets in the preset buffer is greater than or equal to a first length threshold. After the first data packet is cached from the preset cache area, a first time threshold is elapsed.
5. The method according to claim 2, characterized in that, The preset buffer includes a first buffer and a second buffer. The first buffer is used to cache latency-sensitive data packets, and the second buffer is used to cache non-latency-sensitive data packets.
6. The method according to claim 5, characterized in that, The overflow rules corresponding to the target buffer include at least one of the following: The number of data packets in the target buffer is greater than or equal to the second quantity threshold; The total data length of the data packets in the target buffer is greater than or equal to the second length threshold; After the first data packet is cached in the target cache area, a second time threshold is elapsed; The target buffer is either the first buffer or the second buffer; the second quantity threshold, the second length threshold, and the second duration threshold are inversely proportional to the latency sensitivity of the data packets in the target buffer.
7. The method according to any one of claims 1 to 6, characterized in that, Sending the data packet to the target device includes: Each block in the data group is encapsulated to obtain multiple block encapsulation packages. Each block encapsulation package includes one original block or one recovered block, as well as encapsulation parameters, including the data group sequence number, the number of original blocks in the data group, the block type, and the block number. The multiple segmented encapsulation packets are sent to the target device so that the target device can decode the multiple segmented encapsulation packets to obtain all the original segments.
8. An electronic device, characterized in that, include: First processor; The first processor is configured to execute a computer-executable program or instructions in the memory, causing the electronic device to perform the data processing method according to any one of claims 1-7.
9. An electronic device, characterized in that, include: Memory and second processor; The memory is used to store computer-executable programs or instructions; The second processor is used to invoke a computer-executable program or instruction in the memory, causing the electronic device to perform the data processing method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer-executable program or instructions configured to perform the data processing method according to any one of claims 1-7.