Message Processing Method, Device, and Computer-Readable Storage Medium
By splicing and filling multiple original messages, forming equal-length data blocks, and FEC encoding of the largest message and equal-length data blocks, the network bandwidth waste caused by filling invalid data in the prior art is solved, and more efficient network resource utilization is achieved.
Patent Information
- Application Number
- CN201911207236.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-09-10
- Filing Date
- 2019-11-29
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2039-11-29
AI Technical Summary
When existing network devices encode multiple original messages, they need to fill in invalid data to make all messages equal in size, resulting in a large amount of network bandwidth and waste of resources.
By obtaining the size of the maximum message among multiple original messages, other original messages are spliced. Only when the size of the spliced message is smaller than the maximum message size, will the filling process be performed to form equal-length data blocks, and then forward error correction FEC encoding is performed on the maximum message and equal-length data blocks.
The amount of data filled in the filled equal length data block is reduced, the network bandwidth occupied by FEC-encoded packets is reduced, and the waste of network resources is avoided.
Smart Images

Figure CN112564856B_ABST
Abstract
Description
[0001] This application claims the priority of a Chinese patent application with the application number 201910854179.X and the invention title "Equal-Length Coding Block Generation Method, Apparatus and System" filed on September 10, 2019, the entire content of which is incorporated herein by reference. Technical Field
[0002] This application relates to the technical field of data encoding, and particularly to a message processing method, apparatus, and computer-readable storage medium. Background Art
[0003] With the development of encoding and decoding technologies, network devices can first perform forward error correction (FEC) encoding on multiple original messages in a data stream to obtain redundant messages, and send the original messages and redundant messages to a decoding end during the process of transmitting the data stream.
[0004] Currently, the process of a network device encoding multiple original messages can be as follows: The network device fills invalid data in other original messages except the largest message among the multiple original messages, so that the sizes of the filled messages are all the size of the largest message among the multiple original messages. The network device performs FEC encoding based on the filled messages and the largest message to obtain redundant messages.
[0005] In the above encoding process, since the network device fills invalid data in each original message smaller than the largest message, a large amount of invalid data is filled in the filled original messages, and the data volume of the filled original messages is large. When the network device sends the filled original messages to the decoding end, it causes the filled original messages to occupy a large amount of network bandwidth, resulting in waste of network resources. Summary of the Invention
[0006] This application provides a message processing method, apparatus, and computer-readable storage medium, which can reduce the network bandwidth occupied during message sending and avoid waste of network resources. The technical solution is as follows:
[0007] In a first aspect, a message processing method is provided, and the method includes:
[0008] Obtain multiple original messages;
[0009] According to the size of a first message among the multiple original messages, splice other original messages among the multiple original messages except the first message to obtain at least one spliced message, where the first message is the largest message among the multiple original messages;
[0010] When the size of any one of the at least one spliced packet is smaller than the size of the first packet, padding processing is performed on the at least one spliced packet to obtain equal-length data blocks, and the size of each data block in the equal-length data blocks is the size of the first packet;
[0011] Perform forward error correction (FEC) encoding processing on the first packet and the equal-length data blocks to obtain at least one redundant packet.
[0012] In this method, other original packets among multiple original packets except the largest first packet are spliced. Only when the size of the spliced packet is smaller than the size of the largest packet, padding processing is performed on the spliced packet, and there is no need to perform padding processing on each other original packet. Therefore, less data is filled in the filled equal-length data blocks, reducing the network bandwidth occupied during the transmission of FEC-encoded packets and avoiding waste of network resources.
[0013] In a possible implementation manner, the step of splicing other original packets among the multiple original packets except the first packet according to the size of the first packet among the multiple original packets to obtain at least one spliced packet includes:
[0014] Group other original packets among the multiple original packets except the first packet according to the size of the first packet among the multiple original packets to obtain at least one packet group, where each packet group includes at least one original packet, and the sum of the sizes of all original packets in each packet group is less than or equal to the size of the first packet;
[0015] Perform splicing processing on each packet group to obtain the at least one spliced packet, and each spliced packet corresponds to one packet group.
[0016] In a possible implementation manner, the step of splicing packets among the multiple original packets except the first packet according to the size of the first packet among the multiple original packets to obtain at least one spliced packet includes:
[0017] The processor groups other original packets among the multiple original packets except the first packet according to the size of the first packet among the multiple original packets to obtain at least one packet group, and generates an encoding task according to the at least one packet group, where the encoding task includes the address information of each packet group;
[0018] The target hardware engine performs splicing processing on each packet group according to the encoding task to obtain the at least one spliced packet.
[0019] In a possible implementation, grouping the other original messages in the multiple original messages except the first message according to the size of the first message in the multiple original messages to obtain at least one message group includes:
[0020] Sorting the multiple original messages according to the size of each original message in the multiple original messages to obtain the order i of each original message, where i is an integer greater than or equal to zero. The original message with the order of 0 is the first message;
[0021] When i = 1, dividing the original message with the order of 1 into the 1st target message group, and the order of the 1st target message group is 1;
[0022] When i > 1, if the sum of the size of the jth target message group and the size of the original message with the order of i is less than or equal to the target size, then merging the jth target message group and the original message with the order of i into the ith target message group. The target size is the size of the first message. The jth target message group is the message group with the smallest order among at least one target message group, and the order of the jth target message group is j. The sum of the size of each message group in the at least one target message group and the size of the original message with the order of i is less than or equal to the target size, 0 < j < i;
[0023] When i > 1, if there is no such jth target message group, then adding one ith target message group and dividing the original message with the order of i into the ith target message group;
[0024] After grouping the last original message in the multiple original messages, taking each remaining target message group as one of the at least one message group.
[0025] In a possible implementation, performing splicing processing on each message group to obtain the at least one spliced message includes:
[0026] When the sum of the number of the at least one message group and the number of the first messages in the multiple original messages reaches the first target number, and no other original messages other than the multiple original messages can be added to the at least one message group, performing splicing processing on each message group. The first target number is the dimension of the matrix to be encoded when performing one FEC encoding; or,
[0027] When the number of the multiple original messages is equal to the second target number, and the second target number of original messages is divided into at least one message group, performing splicing processing on each message group. The second target number is the preset number of original messages for performing one FEC encoding.
[0028] In a possible implementation, the method further includes:
[0029] When the size of each of the at least one spliced message is equal to the size of the first message, perform FEC encoding on the first message and the at least one spliced message to obtain at least one redundant message.
[0030] In a second aspect, a message processing apparatus is provided, including a plurality of functional modules, which interact with each other to implement the methods in the first aspect and its various embodiments. The plurality of functional modules can be implemented based on software, hardware, or a combination of software and hardware, and the plurality of functional modules can be arbitrarily combined or divided based on specific implementations.
[0031] In a third aspect, a computer-readable storage medium is provided, in which instructions are stored, and the instructions are loaded and executed by a processor to implement the message processing method as described above. Description of the Drawings
[0032] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. The following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0033] Figure 1 is a schematic diagram of a message transmission system provided by an embodiment of the present application;
[0034] Figure 2 is a flowchart of a message processing method provided by an embodiment of the present application;
[0035] Figure 3 is a flowchart of implementing a message processing method within a network device provided by an embodiment of the present application;
[0036] Figure 4 is a schematic diagram of a message group determination process provided by an embodiment of the present application;
[0037] Figure 5 is a flowchart of message grouping provided by an embodiment of the present application;
[0038] Figure 6 is a schematic diagram of a raw message grouping process provided by an embodiment of the present application;
[0039] Figure 7 is a schematic diagram of an encoding task provided by an embodiment of the present application;
[0040] Figure 8 is a schematic diagram of an FEC message provided by an embodiment of the present application;
[0041] Figure 9 It is a schematic flowchart of internal interaction of a network device provided by an embodiment of the present application;
[0042] Figure 10 It is a flowchart of encoding and decoding provided by an embodiment of the present application;
[0043] Figure 11 It is a schematic structural diagram of a message processing device provided by an embodiment of the present application. Detailed implementation manners
[0044] To make the objectives, technical solutions, and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.
[0045] Figure 1 It is a schematic diagram of a message transmission system provided by an embodiment of the present application. Refer to Figure 2 , the first terminal 101, the first network device 102, the second network device 103, and the second terminal 104. Among them, the first terminal 101 is used to generate a data stream and send the data stream to the first network device 102. The first network device 102 splices multiple original messages in the data stream into an equal-length data block, where the size of each data block in the equal-length data block is equal. Perform FEC encoding processing on the equal-length data block to obtain redundant messages of multiple original messages, and add the same FEC header to each data block and each redundant message in the equal-length data block, encapsulate them into multiple FEC messages, and then send an encoded stream composed of FEC messages to the second network device 103. The second network device 303 decodes the lost original FEC messages in the encoded stream to recover the lost original FEC messages, where the original FEC message is any FEC message. The second network device 103 restores the data stream based on the recovered original FEC messages and the non-lost FEC messages, and sends the data stream to the second terminal 104. The first terminal 101 and the second terminal 104 may be mobile phones, laptop computers, etc., and the first network device 102 and the second network device 103 may be devices such as routers and switches. The data stream may be a video stream, an audio stream, or a text stream composed of text data. The embodiments of the present application do not make specific limitations on the data stream type.
[0046] Figure 1The following is a schematic diagram taking a video stream as an example. When the first user and the second user are having a video session, the first user can use the camera on the first terminal 302 to record the video of the first user, and send the original packets used to form the video to the first network device 102, forming a video stream (data stream). The first network device 102 performs FEC encoding on the original packets in the video stream to obtain redundant packets, adds an FEC packet header to each original packet and each redundant packet to obtain the corresponding FEC packets. The first network device 102 can send the encoded stream composed of FEC packets to the second network device 103 through a wide area network (WAN); after the second network device 103 obtains the FEC packets in the encoded stream, it determines which original packets are lost according to the FEC packet headers, and restores the lost original packets according to the received FEC packets (including original packets and redundant packets). The second network device 103 forms a data stream by combining the restored original packets and the non-lost original packets, and sends the data stream to the second terminals 104 in local area networks A and B respectively. When multiple second terminals 104 receive the video stream, they play the video, so that the second user can view the video of the first user on the second terminal 304, thereby realizing a cross-local area network video session between the first user and the second user. In a possible implementation, the first terminal 101, the first network device 102, the second network device 103, and the second terminal 104 can be distributed in the same local area network or in different local area networks. The embodiments of the present application do not make specific limitations on the distribution manners of the first terminal 101, the first network device 102, the second network device 103, and the second terminal 104.
[0047] In some possible implementations, the first network device can directly splice the original packets in the data stream through the processor to obtain equal-length data blocks, and then the processor performs FEC encoding on the equal-length data blocks. In some possible implementations, the processor in the first network device can determine a splicing scheme according to the sizes of the respective original packets, and send the splicing scheme to the target hardware engine. The target hardware engine splices the original packets in the data stream according to the splicing scheme provided by the processor to obtain equal-length data blocks, and performs FEC encoding on the equal-length data blocks. Among them, the processor can be a network processor (NP), a central processing unit (CPU), or a combination of NP and CPU. The processor can also include a hardware chip, and the above-mentioned hardware chip can be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The above PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0048] Optionally, the embodiment of the present application further provides a computer-readable storage medium, such as a memory including instructions, and the above instructions can be executed by the processor in the network device to complete the methods provided in the following embodiments. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0049] To further illustrate the process of the first network device encoding the original packets in the data stream, refer to Figure 2 the flowchart of a packet processing method provided by the embodiment of the present application shown in the figure. The method flow specifically can include the following steps 201-208. In one possible implementation, when the present application describes the Figure 2 process shown in the figure, it first describes the steps included in the entire process of Figure 2 and then elaborates on each step.
[0050] 201. The first network device obtains multiple original packets.
[0051] The first network device may obtain multiple data streams. The multiple original packets are the packets within the first data stream among the multiple data streams, and are the packets used by the first network device for one FEC encoding. The first data stream is any one of the multiple data streams. The first data stream may include multiple original packets, and each original packet is used to carry data. The data carried by the original packet may be video data, audio data, text data, etc. The embodiments of the present application do not specifically limit the type of data within the first data stream.
[0052] 202. The processor groups the other original packets in the multiple original packets except the first packet according to the size of the first packet in the multiple original packets, to obtain at least one packet group. Each packet group includes at least one original packet, and the sum of the sizes of all the original packets in each packet group is less than or equal to the size of the first packet.
[0053] 203. The processor generates an encoding task according to the at least one packet group. The encoding task includes the address information of each packet group.
[0054] 204. The processor sends the encoding task to the target hardware engine.
[0055] In some possible implementations, the processor may also send the encoding task to the memory, and the target hardware engine reads the encoding task from the memory. In some possible implementations, the processor may also send the encoding task to the memory or the target hardware engine according to the priority of the data stream. The processor may first send the encoding task of the data stream with a higher priority, and then send the encoding task of the data stream with a lower priority. The embodiments of the present application do not specifically limit the manner in which the processor sends the encoding task.
[0056] 205. The target hardware engine performs splicing processing on each packet group according to the encoding task, to obtain at least one spliced packet.
[0057] 206. When the size of any one of the at least one spliced packets is less than the size of the first packet, the target hardware engine performs padding processing on the at least one spliced packet, to obtain equal-length data blocks. The size of each data block in the equal-length data blocks is the size of the first packet.
[0058] The target hardware engine may fill the target data in the any one spliced packet to obtain a data block with the size of the first packet. The target data may be data such as 0 or 1. When the target hardware engine finishes padding the at least one spliced packet, an equal-length data block is obtained, and each data block in the equal-length data block corresponds to a spliced packet, and the size of each data block is the size of the first packet.
[0059] In a possible implementation, when the first network device encodes multiple original packets through a processor, this step 206 can be executed by the processor.
[0060] 207. The target hardware engine performs forward error correction (FEC) encoding on the first packet and the equal-length data blocks to obtain at least one redundant packet.
[0061] 208. When the size of each spliced packet in the at least one spliced packet is equal to the size of the first packet, the target hardware engine performs FEC encoding on the first packet and the at least one spliced packet to obtain at least one redundant packet.
[0062] The following begins the detailed description of the Figure 2 steps.
[0063] In step 201, the first network device can perform FEC encoding on multiple original packets in the data stream. After one FEC encoding is completed, it performs FEC encoding on another multiple original packets in the data stream. In a possible implementation manner, step 201 can be implemented through the process shown in the following steps 2011 - 2012.
[0064] Step 2011. The first network device stores the original packets in the data stream received into the memory of the first network device.
[0065] For example, Figure 3 As shown in the flowchart of a method for implementing packet processing within a network device provided by an embodiment of the present invention, after the network interface of the first network device receives each original packet in the data stream, it sends the original packet to a packet parse engine (PPE). Whenever the PPE receives the original packet, it stores the original packet in the memory and records the storage address of the original packet, so that the PPE can collect the original packets in the data stream received by the network interface. Among them, the network interface can be a gigabit ethernet (GE) network port or a ten-gigabit ethernet (GXE) network port.
[0066] Step 2012. If the number of unencoded original packets of the data stream in the memory is equal to or greater than a second target number, the processor obtains a second target number of original packets from the unencoded original packets of the data stream. The second target number is the number of original packets preset for one FEC encoding.
[0067] Since the first network device performs FEC encoding on the original packets for each second target number once and then encodes the unencoded original packets of the next group of the second target number, for this data stream, when the first network device newly caches the original packets of the second target number in its memory, the newly cached original packets of the second target number can be used as the multiple original packets to be encoded next time.
[0068] The processor includes at least one of an NP and a CPU. Still taking Figure 3 as an example, when the PPE collects each first original packet, it stores the first original packet in the memory and sends a storage completion message of the first original packet to the NP. The storage completion message of the first original packet can carry the stream identifier of the first data stream to which the first original packet belongs and the storage address of the first original packet. The stream identifier can be the name or number of the first data stream, and is used to indicate that the first original packet belongs to the first data stream. The first original packet is any original packet in the first data stream.
[0069] In a possible implementation manner, the first network device sets corresponding priorities for each received data stream according to service requirements. The first network device can preferentially process the data streams with higher priorities. Correspondingly, the storage completion message can also carry the priority of the data stream so that each module in the first network device can process the original packets in the data stream according to the priority. A priority information table can be configured on the first network device. The priority information table includes multiple priorities from high to low, and each priority corresponds to a service type. When the first network device receives a data stream, it can determine the service type of the data stream according to the data carried by the original packets in the data stream, and determine the priority corresponding to the service type of the data stream from the priority information table, so that the first network device can set the corresponding priority for the data stream.
[0070] Still taking Figure 3For example, when the NP receives the storage completion message of the first original packet, it parses the first original packet in the memory according to the storage address of the first original packet carried in the storage completion message, and obtains whether the first original packet needs to be encoded. If the first original packet needs to be encoded, the NP generates an encoding notification message, which may carry at least one of the storage address of the first original packet, the size of the first original packet, the stream identifier of the first data stream, and the priority, and sends the encoding notification message to the protocol stack; the User Datagram Protocol (UDP) proxy can collect the encoding notification messages from the protocol stack. Whenever the number of newly collected encoding notification messages by the UPD proxy is the second target number, the newly collected second target number of encoding notification messages can indicate that the second target number of original packets to be encoded have been newly stored in the memory. Therefore, the UDP proxy can send the second target number of encoding notification messages to the FEC software module (this process is also the process by which the FEC software module obtains the notification messages from the NP), and the FEC software module determines the splicing scheme for the second target number of original packets.
[0071] In some possible implementations, the first network device does not limit the number of original packets for each FEC encoding, but limits the number of original packets to be encoded for each FEC encoding. The number of original packets to be encoded is the dimension of the matrix to be encoded during FEC encoding, that is, the first network device does not preset the second target number, but presets a first target number. For this case, every time the UPD proxy receives an encoding notification message, it will send the encoding notification message to the FEC software module, so that the FEC software module can obtain multiple encoding notification messages. When the FEC software module can obtain the sizes of multiple original packets from multiple encoding notification messages, the FEC software module can determine the largest first packet from the multiple original packets, and determine the splicing scheme for the third target number according to the size of the largest packet (denoted as the target size) and the sizes of the packets other than the first packet in the multiple original packets (that is, Figure 3 the process in which the FEC software module in determines the splicing scheme of the original packets). Each splicing scheme is a splicing scheme for splicing at least two original packets into a spliced packet, and the size of each spliced packet is less than or equal to the target size. The sum of the third target number and the number of first packets in the multiple original packets is equal to the first target number. For the specific determination process of the splicing scheme, see step 202; subsequently, the FEC software module sends the splicing scheme to the target hardware engine, and the target hardware engine splices the original packets according to the splicing scheme.
[0072] The following describes step 202:
[0073] In step 202, the first message is the largest among the multiple original messages. Each message group can be regarded as a splicing scheme, and the process of determining the message group is also the process of determining the splicing scheme. To make the size of each message group less than or equal to the size of the first message, where the size of each message group is also the size of all the original messages in each message group. The processor can first sort the multiple original messages according to their sizes, and then determine at least one message group based on the sorting of the multiple original messages and the size of the first message. In a possible implementation, this step 202 can be implemented by the process shown in 2021 - 2025 below. In a possible implementation, this step can be executed by the FEC software module in the processor.
[0074] Step 2021: The processor sorts the multiple original messages according to the size of each original message among the multiple original messages, and obtains the order i of each original message, where i is an integer greater than or equal to zero. Among them, the original message with order 0 is the first message.
[0075] When the processor sorts the multiple original messages, the larger the original message, the smaller its order, and the smaller the original message, the larger its order. Since the first message is the largest among the multiple original messages, the order of the first message is the smallest and is 0, and the order of the smallest original message among the multiple original messages is the largest. For example Figure 4 A schematic diagram of a message group determination process provided by an embodiment of the present application is shown Figure 4 including the left figure, the middle figure, and the right figure. The left figure includes an original message sequence, and there are 5 original messages in this original message sequence, namely messages P1 - P5. Message P1 is the first message. The processor sorts messages P1 - P5 according to their sizes and obtains the sorting of the 5 messages shown in the middle figure: messages P1, P4, P3, P5, and P2, and the orders are 0 - 4 respectively.
[0076] Step 2022: When i = 1, the processor divides the original message with order 1 into the first target message group, and the order of the first target message group is 1.
[0077] Since the size of the first message is the target size, the processor does not need to group the first message, or can directly regard each first message as a message group. The processor can group the other original messages except the first message in ascending order of the multiple original messages. Still taking Figure 4 the middle figure in it as an example, the order of message P4 is 1, and the processor can directly divide message P4 into the first target message group.
[0078] Step 2023: When i > 1, if the sum of the size of the j-th target message group and the size of the original message with order i is less than or equal to the target size, the processor combines the j-th target message group and the original message with order i into the i-th target message group. The target size is the size of the first message. The j-th target message group is the message group with the smallest order among at least one target message group, and the order of the j-th target message group is j. The sum of the size of any message group among at least one target message group and the size of the original message with order i is less than or equal to the target size, where 0 < j < i.
[0079] The size of the target message group, that is, the sum of the sizes of each message within the target message group. The j-th target message group is the message group where the original message with order j is located. The i-th target message group is the message group where the original message with order i is located. That is, after grouping j original messages, the j-th target message group is obtained. After grouping i original messages, the i-th target message group is obtained. Since the processor groups multiple original messages, there may be multiple target message groups during the grouping process. For the convenience of description, an order is assigned to each target message group. The order of the j-th target message group is j, and the order of the i-th target message group is i. That is, the order of the n-th target message group is n.
[0080] Still taking Figure 4 the middle figure in
[0081] as an example. When i = 2, the processor groups the message P3 with order 2. At this time, the first target message group only includes the message P4. Then, the sum of the size of the first target message group and the size of the message P3 with order 2, that is, the sum of the sizes of the messages P4 and P3. If the sum of the sizes of the messages P4 and P3 is less than or equal to the size of the first message P1 (that is, the target size), the processor combines the messages P4 and P3 into the second target message group. Since the first target message group is combined into the second target message group, only the second target message group remains currently.
[0082] Step 2024: When i > 1, if there is no j-th target message group, the processor adds a new i-th target message group and divides the original message with order i into this i-th target message group.
[0083] If the sum of the sizes of each of the remaining multiple target message groups and the size of the original message with order i is greater than the target size, it indicates that there is no j-th target message group among the multiple target message groups. Then, the processor can add another target message group as the i-th target message group and divide the original message with order i into the i-th target message group.
[0084] Still taking Figure 4 the middle figure in
[0085] Step 2025: After the last original message in the multiple original messages is grouped, the processor takes each of the remaining target message groups as one of the at least one message group.
[0086] When the processor finishes grouping the last original message, the remaining target message groups are the finally determined message groups. Therefore, the processor can take each of the remaining target message groups as one of the at least one message group.
[0087] Taking Figure 4 the right figure in
[0088] When the processor does not set the number of original packets to the second target number but sets it to the first target number, the processor can group the original packets cached by the first network device within the preset time at intervals of the preset time. The grouping process can be the process shown in steps 21-25. At this time, the target size can be the size of the largest packet among the original packets cached by the first network device within the preset time, or it can be a preset packet size, and the preset packet size can be the packet of the largest packet in the first data stream to which the multiple original packets belong. When the original packets cached by the first network device within the preset time are exactly divided into packet groups with the third target number, and none of the packet groups with the third target number can accommodate other packets, then this grouping ends. When the original packets cached by the first network device within the preset time are exactly divided into at least one packet group, if the number of the at least one packet group is equal to the third target number, but the at least one packet group can still accommodate other packets, then the processor can continuously collect new original packets until the at least one packet group can no longer accommodate new original packets, and then this grouping ends. If the number of at least one packet group is less than the third target number, then the processor continuously collects new original packets and groups the collected new original packets until packet groups with the third target number are obtained and none of the packet groups with the third target number can accommodate new original packets, then this grouping ends.
[0089] For ease of understanding the process shown in steps 2021-2025, refer to Figure 5 The flowchart of a packet grouping provided by the embodiment of the present application shown in
[0090] Step 501: The processor sets the number of original packets for one sorting to the second target number M, where M is a positive integer.
[0091] Step 502: The network interface accumulatively receives M original packets.
[0092] Step 503: The processor sorts the M original packets in descending order according to the sizes of the M original packets to obtain an original packet sequence including M original packets. In the original packet sequence, the larger the original packet among the M original packets, the smaller the sorting, and the smaller the original packet, the larger the sorting.
[0093] Step 504: The processor constructs a virtual packet according to the size of the largest packet among the M original packets and inserts the virtual packet into the virtual packet sequence. The size of the virtual packet is the size of the largest packet among the M original packets, and the virtual packet sequence is used to place virtual packets.
[0094] Each virtual message can be regarded as a virtual storage space, and the virtual storage size of this virtual storage space is the size of the largest message among M original messages. That is to say, a virtual message can be regarded as a message group.
[0095] Step 505: The processor traverses the message Pk with the order of k in the original message sequence, where 0 ≤ k < M.
[0096] Step 506: The processor queries whether there is a virtual message in the virtual message sequence that can accommodate the message Pk. If so, the processor stores the message Pk into the first virtual message in the virtual message sequence that can accommodate the message Pk.
[0097] Step 507: If not, the processor creates a new virtual message, inserts the newly created virtual message into the virtual message sequence, and places the message Pk in the newly created virtual message.
[0098] Step 508: After placing the message Pk in the virtual message, the processor queries whether there are still un-traversed original messages in the original messages. If so, it jumps to execute Step 505; otherwise, it executes Step 509.
[0099] Step 509: When all the original messages in the original message sequence have been traversed, the processor regards each virtual message in the virtual message sequence as a final message group.
[0100] In some possible implementations, when the processor groups multiple original packets, it may divide some data in an original packet into one packet group and other data in the original packet into other packet groups. In a possible implementation, during a grouping process, if the processor divides the first received original packet into the first packet group and the size of the first packet group is the target size, where the target size can be any preset size at this time. If the size of an original packet is less than or equal to the target size, the processor divides the first original packet into the first packet group. If the size of the first original packet is greater than the target size, the processor virtually splits the first original packet into at least two data blocks, where the size of the last data block among the at least two data blocks is less than or equal to the target size, and the sizes of the other data blocks except the last data block among the at least two data blocks are all equal to the target size. The processor divides each data block into a packet group respectively; when the processor subsequently receives each new original packet, if the sum of the size of the new original packet and the size of the last packet group among all current packet groups is less than or equal to the target size, the new original packet is divided into the last packet group; if the sum of the size of the new original packet and the size of the last packet group among all current packet groups is greater than the target size, the new original packet is virtually divided into a first target data block and at least one second target data block, where the size of the first target data block is the difference between the last target size and the current size of the last packet, and the size of the last data block among the at least one second target data blocks is less than or equal to the target size, and the sizes of the data blocks except the last data block among the at least one second target data blocks are all equal to the target size. The processor divides the first target data block into the last packet group and adds at least one new packet group, and divides each second target data block into a newly added packet group respectively; when the processor finishes dividing the second target number of original packets, or when the first target number of packet groups is determined and the first target number of packet groups can no longer accommodate other original packets, this grouping ends. For example, Figure 6 As shown in the schematic diagram of a process for grouping original packets provided by an embodiment of the present application, in this grouping of original packets 1-8, the size of each packet group is fixed as the target size. The processor divides original packets 1-2 and the front part of original packet 4 into packet group 1, divides the rear part of original packet 4, original packet 5, and the front part of original packet 6 into packet group 2, divides the rear part of original packet 6 and original packets 7-8 into packet group 2. The size of packet group 3 is less than the target size, and data can be filled in the spliced packet spliced from the packets in packet 3 later so that the size of the filled packet is the target size.
[0101] In a possible implementation, when the first network device directly performs FEC encoding on multiple original packets through the processor, the processor directly executes the following step 205, that is, performs splicing processing on each packet group to obtain at least one spliced packet, and each spliced packet corresponds to a packet group. Without interacting with the target hardware engine, if the first network device performs FEC encoding on multiple original packets through the target hardware engine, the processor executes the following step 203.
[0102] The following is a description of step 203:
[0103] In step 203, the encoding task is used to indicate splicing the original packets within each packet group into a spliced packet, and encoding the multiple spliced packets obtained. The address information of each packet group includes the storage addresses of all the original packets in a packet group. In some possible implementations, the address information of each packet group further includes a splicing identifier. For example, Figure 7 A schematic diagram of an encoding task provided by an embodiment of the present application as shown. Figure 7 The encoding task in [the figure] includes multiple address information, and each address information includes a splicing identifier and the storage addresses of each original packet. The splicing identifier can be used to indicate splicing all the original packets within a packet group into a spliced packet, and can also be used to indicate that all the storage addresses within the address information of a packet group are a group. The present application does not make specific limitations on the representation method of the splicing identifier.
[0104] The address information of each packet group can be represented in the form of a set. For example, packet group 2 includes original packets 3 and 4. If set 1 includes the storage addresses of original packets 3 and 4 and the splicing identifier, then this set 1 is the address information of this packet group 2. In some possible implementations, the address information of each packet group can be represented in the form of a string. Still taking packet group 2 as an example, if string 1 is "storage address of original packet 3; storage address of original packet 4; splicing identifier", then this string 1 is also the address information of packet group 2. In some possible implementations, the address information of each packet group can be represented in the form of a table. Still taking packet group 2 as an example, see Table 1 below. The storage addresses of original packets 3 and 4 in Table 1 both correspond to the same splicing identifier, then Table 1 is also the address information of packet group 2.
[0105] Table 1
[0106]
[0107] The encoding task may also carry the storage address of the first message, so that the subsequent target hardware engine can obtain the first message according to the storage address of the first message. The encoding task may also carry at least one of encoding parameters, an identifier of a data stream, and a priority identifier of a first data stream, where the first data stream is the data stream where multiple original messages are located, and the encoding parameters may include the number of messages to be encoded (i.e., the first target number), the number of redundant messages, and the target size. The number of messages to be encoded is the sum of the number of the first message among multiple original messages and the number of at least one message group, so that the subsequent target hardware engine can encode multiple original messages according to the encoding parameters.
[0108] The following describes step 205:
[0109] In step 205, the target hardware engine can obtain at least one message group from the memory according to the address information in the encoding task. The original message in each message group is the message in a storage address within one address information; the target hardware engine splices the original messages within each message group into a spliced message, so that the target hardware engine can obtain at least one spliced message.
[0110] When the first network device encodes multiple original messages through a processor, if the sum of the number of at least one message group and the number of the first message among multiple original messages reaches the first target number, and the last message group among the at least one message group cannot add other original messages outside the multiple original messages, the processor performs splicing processing on each message group. The first target number is the dimension of the matrix to be encoded during one FEC encoding.
[0111] Alternatively, when the number of multiple original messages is equal to the second target number, and the second target number of original messages is divided into at least one message group, the processor performs splicing processing on each message group. The second target number is the preset number of original messages for one FEC encoding. Among them, the process of the processor performing splicing processing on each message group is the same as that of the target hardware engine performing splicing processing on each message group. Here, the embodiments of the present application do not elaborate on the process of the processor performing splicing processing on each message group.
[0112] The following describes step 207:
[0113] In step 207, the target hardware engine can obtain encoding parameters from the encoding task. Let the quantity of packets to be encoded in the encoding parameters be Q, the quantity of redundant packets be R, and the target size be L, where both Q and R are positive integers, L is a value greater than 0, and the quantity of redundant packets R is the number of redundant packets obtained after performing FEC encoding on Q packets to be encoded. The Q original packets to be encoded include the first packet among multiple original packets and equal-length data blocks. The target hardware engine can obtain the first packet from the memory according to the storage address of the first packet carried in the encoding task, and use the obtained first packet and the equal-length data blocks obtained in step 206 as the packets to be encoded. The target hardware engine can first form a Q*L matrix to be encoded with the Q packets to be encoded, where each row of the matrix to be encoded is an equal-length data block or a first packet; the target hardware engine constructs a (Q+R)*Q generating matrix according to the quantity of packets to be encoded Q and the quantity of redundant packets R. The generating matrix consists of a first sub-matrix and a second sub-matrix. Among them, the first sub-matrix is a Q*Q identity matrix, and the second sub-matrix is an R*Q Cauchy matrix.
[0114] Among them, the element in the i-th row and j-th column of the second sub-matrix is
[0115] x i-1 with y i-1 and both being elements in the Galois field (GF)(2 w ), where both i and j are integers greater than or equal to 0, and w can be 8; the target hardware engine performs a multiplication calculation on the generating matrix and the matrix to be encoded to obtain a (Q+R)*L encoded matrix, where the encoded matrix includes the matrix to be encoded and an R*L parity-check matrix, and each row of the parity-check matrix is a redundant packet.
[0116] In a possible implementation, the process shown in steps 205 - 207 is also the process by which the target hardware engine performs splicing processing on each packet group according to the encoding task. When the first network device encodes multiple original packets through a processor, this step 207 can be executed by the processor.
[0117] The following describes step 208:
[0118] In step 208, when the size of each spliced packet in the at least one spliced packet is equal to the size of the first packet, the at least one packet can be regarded as an equal-length data block. Therefore, the target hardware engine can directly execute this step 208. In a possible implementation manner, when the first network device encodes multiple original packets through a processor, this step 207 can be executed by the processor.
[0119] After the target hardware engine obtains the at least one redundant message, it stores the at least one redundant message in the memory and sends an encoding completion message to the processor. The encoding completion message may carry the storage address of the at least one redundant message, so that the processor can obtain the at least one redundant message from the memory. Alternatively, the target engine directly sends the at least one redundant message to the processor. The embodiments of the present application do not specifically limit the manner in which the processor obtains the at least one redundant message.
[0120] The processor can obtain the original messages in each message group from the memory, perform splicing processing on each message group to obtain at least one spliced message. When the size of any one of the at least one spliced messages is smaller than the size of the first message, perform padding processing on the at least one spliced message to obtain an equal-length data block, and obtain the first message from the multiple original messages in the memory. Of course, the target hardware engine can also directly send the equal-length data block and the first message to the processor. The embodiments of the present application do not specifically limit the manner in which the processor obtains the equal-length data block and the first message.
[0121] After the processor obtains the equal-length data block, the first message, and the at least one redundant message, add an FEC message header to each data block in the equal-length data block and the first message to obtain multiple original FEC messages, and add an FEC message header to each redundant message to obtain at least one redundant FEC message. The FEC message header carries encoding parameters. For example, Figure 8 the FEC message in the schematic diagram of an FEC message provided by the embodiments of the present application shown. The FEC message includes an FEC message and a payload message. When the payload message is a data block in the first message or the equal-length data block, the FEC message is an original FEC message. When the payload message of the FEC message is a redundant message, the FEC message is a redundant FEC message.
[0122] The FEC message header is used to indicate the encoding situation of the multiple original messages. The FEC message header carries the encoding parameters of the multiple original messages. For example, Figure 8 the FEC message header in carries the number of messages to be encoded, the number of redundant messages, and the target size. The FEC message header can also carry the target identifier of the multiple original messages. The target identifier is used to indicate the number of times of encoding the data stream to which the multiple original messages belong. The FEC message header can also carry the sequence number of the multiple original messages in the data stream (i.e., the original sequence number of the original message before splicing), the size of the original message, the sequence number of each first message and each data block in the equal-length data block in the matrix to be encoded, the sequence number of each redundant message in the encoding matrix, and the target splicing identifier corresponding to each data block. The target splicing identifier is used to indicate that the data block is a spliced data block.
[0123] After the processor obtains the original FEC packet and the redundant FEC packet, it can send the original FEC packet and the redundant FEC packet to the second network device. Of course, in some possible implementations, the target hardware engine can directly encapsulate the first packet and the equal-length data block into the original FEC packet, encapsulate the redundant packet into the redundant FEC packet, and send the original FEC packet and the redundant FEC packet to the second network device.
[0124] See Figure 9 The flowchart of the internal interaction of the network device provided by the embodiment of the present application shown in the figure specifically includes steps 901-907. Figure 9 It shows the switching situation of each internal module when the first network device performs FEC encoding on multiple original packets.
[0125] Step 901: Every time the network interface receives 1 original packet from the network, it sends the original packet to the PPE.
[0126] Step 902: The PPE writes the received original packet into the memory.
[0127] Step 903: The PPE sends the storage completion message of the original packet to the NP to notify the NP to process the original packet in the memory.
[0128] Step 904: After receiving the storage completion message, the NP parses the original packet to determine whether the original packet needs to be encoded. If encoding is required, the NP sends an encoding notification message of the original packet to the CPU.
[0129] The CPU can send the encoding completion message to the FEC software module through the protocol stack and the UDP proxy. The specific process is described in the above step 2012 and will not be elaborated here.
[0130] Step 905: When the FEC software module in the CPU collects the second target number of encoding notification messages, it is equivalent to that the FEC software module has collected the second target number of original packets that need to be encoded. The FEC software module sends an encoding task for the second target number of original packets to the target hardware engine based on the second target number of original packets.
[0131] This encoding task is equivalent to a notification message to notify the target hardware processor to perform FEC encoding according to the encoding task.
[0132] Step 906: The target hardware engine obtains the second target number of original packets from the memory according to the encoding task, and performs FEC encoding on the second target number of original packets to obtain at least one redundant packet.
[0133] The process shown in this step 906 is the same as the process shown in steps 205-207. Here, the embodiments of the present application will not elaborate on the process shown in this step 906.
[0134] Step 907: The target hardware engine writes at least one redundant packet into the memory and sends the storage address of at least one redundant packet to the FEC software module, so that the FEC software module can obtain at least one redundant packet and send the second target number of original packets and at least one redundant packet to the second network device.
[0135] In a possible implementation manner, the FEC software module can be deployed in the NP or in the CPU. The embodiments of the present application do not specifically limit the deployment manner of the FEC software module.
[0136] The method provided by the embodiments of the present application splices other original packets except the largest first packet among multiple original packets. Only when the size of the spliced packet is smaller than the size of the largest packet, will the spliced packet be filled, rather than filling each other original packet. Therefore, the filled data in the equal-length data block after filling is less, reducing the network bandwidth occupied during the transmission of the FEC encoded packet and avoiding waste of network resources.
[0137] When the second network device receives the FEC packet sent by the first network device, if the original FEC packet is lost during transmission, the second network device decodes the non-lost FEC packet to recover the lost packet. To further illustrate the encoding and decoding process of multiple original packets, see Figure 10 , which is a flowchart of an encoding and decoding provided by the embodiments of the present application. This process includes the following steps 1001-1006.
[0138] Step 1001: When the FEC software module in the first network device collects the second target number of original packets, it determines the first packet and at least one packet group in the second target number of original packets according to the second target number of original packets, and sends an encoding task to the target hardware engine.
[0139] Before step 1001, the UDP proxy collects the original messages in the data stream sent by the first terminal, and sends the storage addresses of the collected original messages and the sizes of the original messages to the FEC software module. When the FEC software module receives the storage addresses and sizes of the second target number of original messages, step 1001 is performed. Taking the second target number of 6 as an example, when the FEC software module collects the storage addresses and sizes of the original messages 1-6 from the UDP proxy, it means that the FEC software module has collected 6 original messages. The FEC software module takes the original messages 1 and 6 as the first message, divides the original messages 2 and 4 into message group 1, and divides the original messages 3 and 5 into message group 2. The FEC software module can also splice the original messages 2 and 4 into spliced message 1, and the FEC software module can also splice the original messages 3 and 5 into spliced message 2. When the size of any spliced message is smaller than the size of the original message 3, any spliced message is padded to obtain a padded message, otherwise any spliced message is not padded. exist Figure 10 In the example, the size of any concatenated message is the size of the original message 3. The FEC software module uses the original messages 1 and 6 and the concatenated messages 1-2 as a matrix to be encoded. Figure 10 The original message is recorded as message 1 in the matrix to be encoded, the concatenated messages 1-2 are recorded as messages 2-3 in the matrix to be encoded respectively, and the original message 6 is recorded as message 4 in the matrix to be encoded.
[0140] Step 1002: The target hardware engine obtains the matrix to be encoded formed by the original messages 1 and 6 and the concatenated messages 1-2 according to the address set in the encoding task, constructs the corresponding generation matrix according to the encoding parameters in the encoding task, and performs FEC encoding according to the matrix to be encoded and the generation matrix to obtain redundant messages a, b and c, and stores the redundant messages a, b and c in the memory, and sends the storage addresses of the redundant messages a, b and c to the FEC software module.
[0141] Step 1003, the FEC software module obtains redundant messages a, b and c from the memory according to the storage addresses of redundant messages a, b and c, and adds an FEC message header to messages 1-4 and redundant message ac respectively to obtain multiple FEC messages, and sends the encoded stream composed of FEC messages to the UDP proxy, and the UDP proxy sends the encoded stream to the second network device through the WAN.
[0142] Step 1004: The UDP proxy of the second network device receives the encoded stream. Packets 1 and 3 in the encoded stream are lost. When the FEC software module of the second network device collects any two redundant packets among packets 2, 4, and redundant packets a, b, c, the FEC software module sends a decoding task to the target hardware engine in the second network device. The decoding task carries the storage addresses of packets 2, 4, and any two redundant packets among redundant packets a, b, c, and decoding parameters. The decoding parameters include the number of packets with lost encoding parameters, the positions of the lost packets in the encoding matrix, and the target size.
[0143] Step 1005: The target hardware engine obtains packets 2, 4, and any two redundant packets among redundant packets a, b, c from the memory according to the storage addresses in the decoding task, forms a matrix to be decoded with packets 2, 4, and any two redundant packets among redundant packets a, b, c. The target hardware engine constructs a corresponding decoding matrix according to the decoding parameters, and the target hardware engine performs FEC decoding based on the matrix to be decoded and the decoding matrix to obtain the lost packets 1 and 3, stores the lost packets 1 and 3 in the memory, and sends the storage addresses of packets 1 and 3 to the FEC software module.
[0144] Step 1006: The FEC software module obtains the original packet 1 and the storage address of the spliced packet 1 from the memory according to the original packet 1 and the storage address of the spliced packet 1, and obtains the original packet 2 and the spliced packet 2. It splits the original packet 2 and 3 from the spliced packet 1, splits the original packet 3 and 5 from the spliced packet 2, and restores the order of the original packets 1 - 6 in the data stream, and sends the original packets 1 - 6 to the UDP proxy in order to form a data stream, and the UDP proxy sends the data stream to the second terminal.
[0145] Figure 11 It is a schematic structural diagram of a packet processing device provided by an embodiment of the present application. The device 1100 includes:
[0146] A processor 1101, configured to execute the above - mentioned step 201;
[0147] The processor 1101 is further configured to splice other original packets except the first packet among the multiple original packets according to the size of the first packet among the multiple original packets to obtain at least one spliced packet, where the first packet is the packet with the largest data volume among the multiple original packets;
[0148] The processor 1101 is further configured to, when the size of any one of the at least one spliced packet is smaller than the size of the first packet, perform padding processing on the at least one spliced packet to obtain equal - length data blocks, and the size of each data block in the equal - length data blocks is the size of the first packet;
[0149] The processor 1101 is further configured to perform forward error correction (FEC) encoding processing on the first message and the equal-length data blocks to obtain at least one redundant message.
[0150] Optionally, the apparatus further includes a memory for storing program instructions. The processor 1101 may be a CPU and is configured to run the instructions stored in the memory to implement the Figure 2 message processing method as shown.
[0151] In a possible implementation, the processor 1101 is configured to:
[0152] Execute the above step 202;
[0153] Perform splicing processing on each message group to obtain the at least one spliced message, and each spliced message corresponds to a message group.
[0154] In a possible implementation, the message processing apparatus further includes a target hardware engine 1102;
[0155] The processor 1101 is further configured to execute the above steps 202-203;
[0156] The target hardware engine 1102 is configured to execute the above step 205.
[0157] In a possible implementation, the processor 1101 is configured to:
[0158] Sort the multiple original messages according to the sizes of the respective original messages in the multiple original messages to obtain the order i of each original message, where i is an integer greater than or equal to zero. Among them, the original message with the order of 0 is the first message;
[0159] When i = 1, divide the original message with the order of 1 into the first target message group, and the order of the first target message group is 1;
[0160] When i > 1, if the sum of the size of the jth target message group and the size of the original message with the order of i is less than or equal to the target size, then merge the jth target message group and the original message with the order of i into the ith target message group. The target size is the size of the first message. The jth target message group is the message group with the smallest order among the at least one target message group, and the order of the jth target message group is j. The sum of the size of each message group in the at least one target message group and the size of the original message with the order of i is less than or equal to the target size, 0 < j < i;
[0161] When i > 1, if there is no such j-th target message group, add one such i-th target message group and divide the original message with the order of i into the i-th target message group;
[0162] After the last original message in the multiple original messages is grouped, use each remaining target message group as one of the at least one message group.
[0163] In a possible implementation, the processor 1101 is further configured to:
[0164] When the sum of the number of the at least one message group and the number of the first message in the multiple original messages reaches a first target number, and no other original messages other than the multiple original messages can be added to the at least one message group, perform splicing processing on each message group, where the first target number is the dimension of the matrix to be encoded during one FEC encoding; or,
[0165] When the number of the multiple original messages is equal to a second target number, and the original messages with the second target number are divided into at least one message group, perform splicing processing on each message group, where the second target number is the preset number of original messages for one FEC encoding.
[0166] In a possible implementation, the processor 1101 is further configured to:
[0167] When the size of each spliced message in the at least one spliced message is equal to the size of the first message, perform forward error correction (FEC) encoding on the first message and the at least one spliced message to obtain at least one redundant message.
[0168] In a possible implementation, the target hardware engine 1102 is further configured to execute the above step 208.
[0169] All of the above optional technical solutions can be combined arbitrarily to form alternative embodiments of the present disclosure, which will not be elaborated here one by one.
[0170] When the message processing device provided in the above embodiments processes messages, only the above division of each functional module is used for illustration. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the method embodiments of the message processing method provided in the above embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be elaborated here.
[0171] Those of ordinary skill in the art can understand that all or part of the steps to implement the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program. The said program can be stored in a computer-readable storage medium, and the above-mentioned storage medium can be a read-only memory, a disk, an optical disc, etc.
[0172] The above are only the preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application shall be included within the protection scope of the present application.
Claims
1. A message processing method, characterized in that, The method includes: Obtaining a plurality of original messages; Grouping the other original messages except the first message among the plurality of original messages according to the size of the first message in the plurality of original messages, to obtain a plurality of message groups, where the first message is the largest message among the plurality of original messages, each message group includes at least one original message and / or a data block in an original message, the sizes of the respective message groups except the last message group among the plurality of message groups are equal to the size of the first message, and the size of the last message group is less than or equal to the size of the first message; Performing splicing processing on each of the plurality of message groups respectively to obtain a plurality of spliced messages, each spliced message corresponds to a message group, and each spliced message is obtained by splicing the data in the corresponding message group, the sizes of the spliced messages corresponding to the respective message groups except the last message group among the plurality of message groups are equal to the size of the first message, and the size of the spliced message corresponding to the last message group is less than or equal to the size of the first message; When the size of the spliced message corresponding to the last message group among the plurality of spliced messages is equal to the size of the first message, performing forward error correction (FEC) encoding processing on the first message and the plurality of spliced messages to obtain at least one redundant message; When the size of the spliced message corresponding to the last message group among the plurality of spliced messages is less than the size of the first message, performing padding processing on the spliced message corresponding to the last message group, and the size of the padded spliced message is the size of the first message, performing FEC encoding processing on the first message and the equal-length data block to obtain at least one redundant message, where the equal-length data block includes the padded spliced message and the spliced messages corresponding to the respective message groups except the spliced message corresponding to the last message group among the plurality of spliced messages.
2. The method according to claim 1, wherein The grouping the other original messages except the first message among the plurality of original messages according to the size of the first message in the plurality of original messages to obtain a plurality of message groups includes: The processor groups the other original messages except the first message among the plurality of original messages according to the size of the first message in the plurality of original messages to obtain a plurality of message groups, and generates an encoding task according to the plurality of message groups, where the encoding task includes the address information of each message group; The performing splicing processing on each of the plurality of message groups respectively to obtain a plurality of spliced messages includes: The target hardware engine performs splicing processing on each message group according to the encoding task to obtain the plurality of spliced messages.
3. The method according to claim 1, wherein The performing splicing processing on each of the plurality of message groups respectively to obtain a plurality of spliced messages includes: When the sum of the number of the plurality of message groups and the number of the first messages among the plurality of original messages reaches a first target number, and no other original messages except the plurality of original messages can be added to the plurality of message groups, performing splicing processing on each message group, where the first target number is the dimension of the matrix to be encoded during one FEC encoding; or, When the number of the multiple original messages is equal to a second target number, and when the original messages of the second target number are divided into multiple message groups, splicing processing is performed on each message group, where the second target number is the number of original messages preset for performing FEC encoding once.
4. A message processing device, characterized in that, The apparatus includes: a processor, configured to obtain multiple original messages; The processor is further configured to group the other original messages except the first message among the multiple original messages according to the size of the first message in the multiple original messages, to obtain multiple message groups, where the first message is the message with the largest data volume among the multiple original messages, each message group includes at least one original message and / or a data block in an original message, the size of each of the multiple message groups except the last message group is equal to the size of the first message, and the size of the last message group is less than or equal to the size of the first message; The processor is further configured to perform splicing processing on each of the multiple message groups respectively, to obtain multiple spliced messages, each spliced message corresponds to a message group, and each spliced message is obtained by splicing the data in the corresponding message group. The size of each of the spliced messages corresponding to the multiple message groups except the last message group is equal to the size of the first message, and the size of the spliced message corresponding to the last message group is less than or equal to the size of the first message; The processor is further configured to, when the size of the spliced message corresponding to the last message group among the multiple spliced messages is equal to the size of the first message, perform forward error correction (FEC) encoding processing on the first message and the multiple spliced messages, to obtain at least one redundant message; The processor is further configured to, when the size of the spliced message corresponding to the last message group among the multiple spliced messages is less than the size of the first message, perform padding processing on the spliced message corresponding to the last message group, so that the size of the padded spliced message is the size of the first message, and perform FEC encoding processing on the first message and the equal-length data blocks, to obtain at least one redundant message, where the equal-length data blocks include the padded spliced message and each of the spliced messages except the spliced message corresponding to the last message group among the multiple spliced messages.
5. The device according to claim 4, characterized in that, The apparatus further includes a target hardware engine; The processor is further configured to generate an encoding task according to the multiple message groups, where the encoding task includes the address information of each message group; The target hardware engine is configured to perform splicing processing on each message group according to the encoding task, to obtain the multiple spliced messages.
6. The device according to claim 4, characterized in that, The processor is further configured to: when the sum of the number of the multiple message groups and the number of the first messages among the multiple original messages reaches a first target number, and no other original messages except the multiple original messages can be added to the multiple message groups, perform splicing processing on each message group, where the first target number is the dimension of the matrix to be encoded when performing FEC encoding once; or, When the number of the multiple original packets is equal to the second target number, and when the second target number of original packets is divided into multiple packet groups, splicing processing is performed on each packet group, where the second target number is the number of original packets preset for performing one FEC encoding.
7. A computer-readable storage medium, characterized in that, Instructions are stored in the storage medium, and the instructions are loaded and executed by a processor to implement the packet processing method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Efficient error correction that aggregates different media into encoded container packets
US20170294984A1