A method and apparatus for processing data packets

CN117561706BActive Publication Date: 2026-08-11HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-22
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

目前,应用处理器可支持多核运算,但在组包收包的场景下,应用处理器处理数据包是单核处理,因此会出现其中一个核的负载过高,而其他核的负载较低的情况,导致应用处理器处理数据包的能力下降

Benefits of technology

[0014]由此,本申请实施例提供的应用处理装置包括多个核,应用处理装置能够根据解析数据段得到的数据段头,将每个数据段中的一个或多个接收数据包传输至与应用程序对应的核,使得在核上运行该应用程序从而处理该一个或多个接收数据包。从而能够通过多个核对多个接收数据包进行处理,相比于现有技术中通过单核对多个数据包进行处理,导致电子设备处理能力降低,本申请能够实现合理均衡电子设备多个核的负载,提高电子设备处理数据包的能力的技术效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117561706B_ABST
    Figure CN117561706B_ABST
Patent Text Reader

Abstract

A method and apparatus for processing data packets include demodulating multiple received data packets via a modem, dividing the multiple received data packets into at least one data segment, where each data segment corresponds to an application, and each data segment includes a data segment header used to identify the application. The application processor includes multiple cores for parsing the at least one data segment to obtain the data segment header, and transmitting one or more received data packets from each data segment to the core corresponding to the application based on the data segment header.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a method and apparatus for processing data packets. Background Technology

[0002] With the rapid development of 5G technology, the downlink speed on the air interface can reach 10Gbps or even more, so the terminal side also needs to have faster transmission and reception capabilities and stronger processing capabilities.

[0003] The terminal side includes an application processor, which processes the data packets received by the terminal. Currently, application processors can support multi-core processing, but in scenarios involving packet assembly and reception, the application processor processes data packets using a single core. This can lead to a situation where one core is overloaded while the other cores are underloaded, resulting in a decrease in the application processor's ability to process data packets. Summary of the Invention

[0004] This application provides a method and apparatus for processing data packets, which are applied to electronic devices. When an electronic device is assembling and receiving packets, it can reasonably balance the load of multiple cores of the application processor, thereby improving the ability of the electronic device to process data packets.

[0005] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:

[0006] In a first aspect, embodiments of this application provide an electronic device, which includes: a modem for demodulating multiple received data packets, dividing the multiple received data packets into at least one data segment, each data segment corresponding to an application, each data segment including a data segment header for identifying the application; and an application processor including multiple cores for parsing at least one data segment to obtain the data segment header, and transmitting one or more received data packets in each data segment to the core corresponding to the application according to the data segment header.

[0007] Therefore, the electronic device provided in this application embodiment can divide multiple received data packets into at least one data segment by changing the packet format, so that one or more received data packets included in each data segment correspond to the same application, and the data segment header is used to identify the application. This allows for easy and direct identification of the application corresponding to one or more received data packets included in each data segment without introducing additional processing overhead during data segment parsing. Furthermore, the application processor of the electronic device includes multiple cores. The application processor can transmit one or more received data packets in each data segment to the core corresponding to the application based on the data segment header obtained from parsing the data segment, so that the application runs on the core to process the one or more received data packets. This allows multiple received data packets to be processed by multiple cores. Compared to the prior art where multiple data packets are processed by a single core, resulting in a reduction in the processing power of the electronic device, this application can achieve a reasonable balance of the load on the multiple cores of the electronic device, improving the electronic device's ability to process data packets.

[0008] In one possible design, the application processor is specifically used to: parse at least one data segment at the network interface card (NIC) layer to obtain a data segment header, and determine the application based on the data segment header; transmit one or more received data packets from the NIC layer to the protocol stack layer; parse one or more received data packets at the protocol stack layer to obtain parsed data; and transmit the parsed data to the core corresponding to the application. Therefore, the electronic device provided in this application embodiment can determine the application corresponding to a data segment at the NIC layer based on the data segment header obtained from parsing the data segment. Compared to the prior art where L3 / L4 parsing multiple data packets at the NIC layer splits the multiple data packets, leading to additional overhead, this application can determine the application corresponding to multiple received data packets without introducing additional processing overhead at the NIC layer. Furthermore, the electronic device provided in this application embodiment can parse one or more received data packets at the protocol stack layer to obtain the data in each data segment, and transmit the parsed data to the core corresponding to the application, so that the application runs on the core to process the one or more received data packets. That is, the one or more received data packets in the data segment are processed on the core corresponding to the application in each data segment, so that the received data packets in different data segments run on the cores corresponding to different applications, thereby reasonably balancing the load of multiple cores of the electronic device and improving the electronic device's ability to process data packets.

[0009] In one possible design, the modem is specifically used to: determine the data segment corresponding to each received data packet based on the five-tuple information of each received data packet in a plurality of received data packets, so as to group one or more received data packets into each data segment. Therefore, the electronic device provided in this application embodiment can, by changing the packet format, determine the data segment corresponding to each received data packet based on the five-tuple information of each received data packet in a plurality of received data packets, and group one or more received data packets with the same five-tuple information into the same data segment. This allows for convenient and direct determination of the application corresponding to one or more received data packets included in each data segment without introducing additional processing overhead during data segment parsing.

[0010] Secondly, embodiments of this application provide a modulation and demodulation apparatus, which includes: a demodulation module for demodulating multiple received data packets; a packet assembly module for dividing the multiple received data packets into at least one data segment, wherein each data segment corresponds to an application, and each data segment includes a data segment header for identifying the application; and a transmission module for transmitting at least one data segment to an application processing device, wherein one or more received data packets in each data segment are used to transmit to the core corresponding to the application.

[0011] Therefore, the modulation and demodulation apparatus provided in this application embodiment can divide multiple received data packets into at least one data segment by changing the packet format, so that one or more received data packets included in each data segment correspond to the same application, and the data segment header is used to identify the application. Thus, when parsing the data segment, no additional processing overhead is introduced, and the application corresponding to one or more received data packets included in each data segment can be easily and directly determined.

[0012] In one possible design, the packet assembly module is specifically used to: determine the data segment corresponding to each received data packet based on the five-tuple information of each received data packet in multiple received data packets, so as to assemble one or more received data packets into each data segment. Therefore, the modulation and demodulation apparatus provided in this application embodiment can, by changing the packet assembly format, determine the data segment corresponding to each received data packet based on the five-tuple information of each received data packet in multiple received data packets, and assemble one or more received data packets with the same five-tuple information into the same data segment. This allows for convenient and direct determination of the application program corresponding to the one or more received data packets included in each data segment without introducing additional processing overhead during data segment parsing.

[0013] Thirdly, embodiments of this application provide an application processing apparatus, which includes multiple cores. The application processing apparatus includes: a receiving module, configured to receive at least one data segment from a modem, wherein each data segment corresponds to an application, and each data segment includes a data segment header for identifying the application; a parsing module, configured to parse the at least one data segment to obtain the data segment header; and a scheduling module, configured to transmit one or more received data packets in each data segment to the core corresponding to the application according to the data segment header.

[0014] Therefore, the application processing device provided in this application embodiment includes multiple cores. The application processing device can transmit one or more received data packets from each data segment to the core corresponding to the application program based on the data segment header obtained by parsing the data segments, so that the application program runs on the core to process the one or more received data packets. This allows multiple received data packets to be processed by multiple cores. Compared to the prior art where multiple data packets are processed by a single core, resulting in a reduction in the processing power of the electronic device, this application achieves a reasonable balance of the load on multiple cores of the electronic device, thereby improving the electronic device's ability to process data packets.

[0015] In one possible design, the parsing module is specifically used for: parsing at least one data segment at the network interface card (NIC) layer to obtain a data segment header, and determining the application based on the data segment header; transmitting one or more received data packets from the NIC layer to the protocol stack layer; parsing one or more received data packets at the protocol stack layer to obtain parsed data; and a scheduling module, specifically used for transmitting the parsed data to the core corresponding to the application. Therefore, the application processing apparatus provided in this application embodiment can determine the application corresponding to a data segment at the NIC layer based on the data segment header obtained from parsing the data segment. Compared to the prior art where L3 / L4 parsing multiple data packets at the NIC layer splits the multiple data packets, leading to additional overhead, this application can determine the application corresponding to multiple received data packets without introducing additional processing overhead at the NIC layer. Furthermore, the application processing device provided in this application embodiment can parse one or more received data packets at the protocol stack layer to obtain the data in each data segment, and transmit the parsed data to the core corresponding to the application, so that the application runs on the core to process the one or more received data packets. That is, the one or more received data packets in the data segment are processed on the core corresponding to the application in each data segment, so that the received data packets in different data segments run on the cores corresponding to different applications, thereby reasonably balancing the load of multiple cores of the electronic device and improving the electronic device's ability to process data packets.

[0016] Fourthly, embodiments of this application provide a method for processing data packets, applied to an electronic device including multiple cores. The method includes: demodulating multiple received data packets; dividing the multiple received data packets into at least one data segment, each data segment corresponding to an application, each data segment including a data segment header for identifying the application; parsing the at least one data segment to obtain the data segment header; and transmitting one or more received data packets in each data segment to the core corresponding to the application based on the data segment header. The beneficial effects achieved by this fourth aspect are described in the beneficial effects of the first aspect.

[0017] In one possible design, parsing at least one data segment to obtain a data segment header, and transmitting one or more received data packets from each data segment to the core corresponding to the application based on the data segment header, specifically includes: parsing at least one data segment at the network interface card (NIC) layer to obtain a data segment header, determining the application based on the data segment header; transmitting one or more received data packets from the NIC layer to the protocol stack layer; parsing one or more received data packets at the protocol stack layer to obtain parsed data; and transmitting the parsed data to the core corresponding to the application.

[0018] In one possible design, demodulating multiple received data packets and dividing them into at least one data segment specifically includes: determining the data segment corresponding to each received data packet based on the five-tuple information of each received data packet in the multiple received data packets, so as to group one or more received data packets into each data segment.

[0019] Fifthly, a computer-readable storage medium includes computer instructions that, when executed on a computer or processor, cause the computer or processor to perform the fourth aspect and any possible design method described in the fourth aspect.

[0020] For the other beneficial effects mentioned above, please refer to the description of the beneficial effects of the first aspect, which will not be repeated here. Attached Figure Description

[0021] Figure 1 This is a flowchart illustrating a data packet processing procedure.

[0022] Figure 2 This is a flowchart illustrating a data packet processing procedure.

[0023] Figure 3 This is a schematic diagram illustrating an application scenario of a data packet processing method provided in an embodiment of this application.

[0024] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;

[0025] Figure 5 A flowchart illustrating a method for processing data packets provided in an embodiment of this application;

[0026] Figure 6 A schematic diagram illustrating a package format provided in an embodiment of this application;

[0027] Figure 7 A schematic diagram illustrating a package format provided in an embodiment of this application;

[0028] Figure 8 A flowchart illustrating a method for processing data packets provided in an embodiment of this application;

[0029] Figure 9 This is a schematic diagram of the structural composition of a device provided in an embodiment of this application;

[0030] Figure 10 This is a schematic diagram of the structural composition of a device provided in an embodiment of this application;

[0031] Figure 11 This is a schematic diagram of the structural composition of an electronic device provided in an embodiment of this application. Detailed Implementation

[0032] For ease of understanding, some concepts related to the embodiments of this application are illustrated below for reference.

[0033] A data packet is a unit of data in Transmission Control Protocol / Internet Protocol (TCP / IP) communication. A data packet includes the physical layer, data link layer, Transmission Control Protocol (TCP) layer, and Internet Protocol (IP) layer, corresponding to layers 1, 2, 3 (L3), and 4 (L4) of the data packet, respectively. Each layer appends a header to the data in the data packet, containing necessary information for that layer. Specifically, the TCP header contains the source and destination ports of the data packet, while the IP header contains the source IP address, destination IP address, and protocol number. In this embodiment, L3 / L4 refers to the TCP / IP layer of the data packet. Parsing the L3 / L4 header of a data packet can be understood as parsing the TCP / IP header of the data packet, thereby obtaining the source IP address, destination IP address, protocol number, source port, and destination port—that is, obtaining the five-tuple information of the data packet.

[0034] Five-tuple information: including source IP address, destination IP address, protocol number, source port, and destination port. In this embodiment, data packets with all the same five-tuple information correspond to the same data stream.

[0035] Packet aggregation: The terminal's modem needs to send multiple data packets received from the air interface to the application processor for processing. By grouping multiple data packets into one data packet for transmission, the transmission rate can be improved.

[0036] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone.

[0037] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise stated, "multiple" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0038] Currently, in scenarios involving packet assembly and reception, the process of processing data packets on the terminal side is as follows: Figure 1 As shown, the terminal side includes a modem and an application processor. The modem receives data packets and sends them to the application processor, which processes the data packets, specifically including the following steps:

[0039] Step 1: The modem receives multiple data packets from the air interface side.

[0040] Step 2: The modem assembles multiple data packets in the order they are received from the air interface side.

[0041] Step 2 can be understood as the modem assembling multiple data packets into a large data packet (i.e., the assembled data packet) according to the receiving order from the air interface side.

[0042] Step 3: The modem sends the assembled data packets to the application processor via the Universal Serial Bus (USB).

[0043] Step 4: The application processor receives the assembled data packets at the hardware adaptation layer and transmits the assembled data packets to the network interface card layer of the application processor.

[0044] In this context, the application processor can be understood as the central processing unit (CPU). The application processor includes the hardware adaptation layer, network interface card (NIC) layer, protocol stack layer, and application layer. Each layer's header in the data packet has its own dedicated software for parsing. Specifically, the hardware adaptation layer and NIC layer can be understood as the software that parses the data packet's link layer header; the protocol stack layer in the application processor can be understood as the combined software that parses the TCP and IP layer headers; and the application layer includes one or more application programs. The application processor runs different software at different layers to perform different actions. For example, at the hardware adaptation layer, the application processor is primarily responsible for transmitting the received, assembled data packets to the NIC layer.

[0045] Specifically, in step 4, the application processor schedules the assembled data packets to one core (i.e., a single core) of the application processor at the hardware adaptation layer, and then transmits the assembled data packets to the network interface card layer of the application processor through the single core.

[0046] Step 5: The application processor deassembles the assembled data packets at the network interface card (NIC) layer to obtain multiple data packets.

[0047] After receiving the assembled data packet at the network interface card (NIC) layer, the application processor deassembles the assembled data packet into multiple data packets. This can also be understood as deassembling a large data packet (i.e., the assembled data packet) into multiple data packets.

[0048] Specifically, in step 5, the application processor deassembles the assembled data packets at the network interface card layer using a single core to obtain multiple data packets.

[0049] Step 6: The application processor transmits multiple data packets to the application processor's protocol stack layer at the network interface card layer.

[0050] Specifically, in step 6, the application processor schedules the multiple data packets obtained after deconstructing the packets to a single core at the network interface card layer for transmission to the protocol stack layer.

[0051] Therefore, when the downlink rate on the air interface side is too high and the modem receives a large number of data packets from the air interface side, the application processor will deassemble and transmit multiple data packets on the network card layer through a single core, which will result in a large load on the single core, thereby reducing the speed at which the application processor processes data packets, i.e., reducing the processing capacity on the terminal side.

[0052] Step 7: The application processor decrypts multiple data packets at the protocol stack layer to obtain multiple user data packets, and copies the multiple user data packets to the core corresponding to the application.

[0053] After receiving multiple data packets at the protocol stack layer, the application processor will decompile the multiple data packets to obtain multiple user data packets. This can be understood as parsing each data packet layer by layer to obtain the user data in each data packet.

[0054] Specifically, in step 7, the application processor decrypts multiple data packets on the protocol stack layer using a single core to obtain multiple user data packets, and then schedules the multiple user data packets to the single core to copy them to the core corresponding to the application.

[0055] Therefore, when there is a large amount of user data obtained from decrypting data packets, the application processor decrypts multiple data packets on the protocol stack layer using a single core and copies the user data in the data packets to the core corresponding to the application. This results in a large load on that single core, which in turn reduces the processing capacity on the terminal side.

[0056] As can be seen, in the above-mentioned terminal-side data packet processing, steps 5-7 involve the application processor's processes of unpacking, depackaging, and copying user data to the core corresponding to the application. These steps are the most demanding in terms of application processor load. However, currently, in the above-mentioned packet assembly and reception scenario, the terminal only processes data packets using a single core. This can lead to a situation where one core of the application processor is overloaded, while other cores are underloaded or idle. Furthermore, processing data packets with a single core takes a long time and is slow, thus reducing the terminal's processing capacity.

[0057] Therefore, in order to process data packets through multiple cores and balance the load across them, a scheme was proposed whereby the application processor unassembles packets at the network interface card (NIC) layer and then parses the L3 / L4 headers of multiple data packets, i.e., the TCP / IP layer headers of multiple data packets. For example... Figure 2 As shown, this solution can be understood as replacing steps 5-7 with steps 5'-7', while keeping the processes of steps 1-4 unchanged. Steps 5'-7' are as follows:

[0058] Step 5': The application processor deassembles the assembled data packets at the network interface card (NIC) layer to obtain multiple data packets, and then parses the L3 / L4 headers of the multiple data packets.

[0059] Parsing the L3 / L4 headers of data packets yields the packet's 5-tuple information, which determines the data stream to which the packet belongs. The same data stream is initiated by the same application, and the same application can initiate multiple different data streams. In other words, the same data stream corresponds to the same application, and multiple different data streams can correspond to the same application. At the network interface card (NIC) layer, the application processor can distinguish multiple data packets according to their data streams by parsing their L3 / L4 headers, effectively streaming the data packets.

[0060] Specifically, in step 5', the application processor deassembles the assembled data packets at the network interface card layer using a single core to obtain multiple data packets, and then parses the L3 / L4 headers of the multiple data packets using a single core.

[0061] Step 6': The application processor transmits multiple data packets to the application processor's protocol stack layer at the network interface card layer.

[0062] In this context, transmitting multiple data packets to the application processor's protocol stack can be understood as follows: based on the result of splitting multiple data packets in step 5', data packets belonging to the same data stream are scheduled to the same core and transmitted to the application processor's protocol stack. That is, in step 6', the application processor schedules the multiple data packets obtained after decomposing the packets to multiple cores at the network interface card layer and transmits them to the protocol stack.

[0063] Step 7': The application processor decrypts multiple data packets at the protocol stack layer to obtain multiple user data packets, and copies the multiple user data packets to the core corresponding to the application.

[0064] Specifically, in step 7', the application processor decrypts multiple data packets using multiple cores at the protocol stack layer to obtain multiple user data packets, and then schedules these multiple user data packets to multiple cores to copy them to the core corresponding to the application. This can also be understood as scheduling multiple user data packets belonging to the same data stream to the same core and copying them to the core corresponding to the application of that data stream.

[0065] Replacing steps 5-7 with steps 5'-7' allows the application processor to process data packets using multiple cores, reducing the load on a single core. However, this adds extra processing at the network interface card (NIC) layer. Specifically, it adds the process of parsing the L3 / L4 headers of multiple data packets, and the application processor still follows the original processing flow at the protocol stack layer. Therefore, this approach leads to increased resource consumption and introduces additional processing overhead for the application processor.

[0066] Therefore, this application proposes a method for processing data packets, which can be applied to electronic devices. Considering the problem in existing technologies where a single core processes data packets in packet assembly and reception scenarios, leading to a decrease in the application processor's data packet processing capability, this application, in packet assembly and reception scenarios, divides multiple received data packets into at least one data segment. Each data segment corresponds to an application program, and each data segment includes a data segment header. Based on the data segment header, one or more received data packets from each data segment are transmitted to the core corresponding to the application program. This reasonably balances the load on multiple cores of the application processor, avoiding situations where one core has a high load while other cores have a low load or are idle, thus improving the electronic device's data packet processing capability.

[0067] like Figure 3 As shown, the data packet processing method proposed in this application can be applied to scenarios involving packet assembly and reception. This scenario includes electronic devices and external devices. Electronic devices can be, for example, chips, mobile terminals, tablets, laptops, personal computers (PCs), etc., while external devices can be, for example, servers. The electronic devices and external devices can communicate with each other, for example, by transmitting data packets. The external devices send multiple receive data packets to the electronic devices, and the electronic devices receive and process these multiple receive data packets. Communication between the electronic devices and external devices can occur through one or more intermediate nodes, such as base stations, wireless routers, wired routers, gateways, or relay nodes.

[0068] In one example, such as Figure 4 The diagram shows a hardware structure schematic of an electronic device, which can be a chip. Figure 4 The example chip is 400. Chip 400 may include a processor 401, a memory 402, and a chip interface 403, etc.

[0069] It is understood that the structure illustrated in the embodiments of this application does not constitute a specific limitation on chip 400. In other embodiments of this application, chip 400 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0070] Processor 401 may include one or more processing units for processing multiple received data packets received from chip interface 403, such as assembling multiple received data packets, deassembling multiple assembled data packets, decomposing multiple received data packets, and scheduling multiple received data packets. Different processing units may be independent components or integrated into one or more processors. For example, processor 401 may include a graphics processing unit (GPU), a central processing unit (CPU), and / or a neural network processing unit (NPU). In this embodiment, processor 401 includes modem 4011 and application processor 4012.

[0071] The modem 4011 can be used to receive and process received data packets. In this embodiment, the modem 4011 can be used to parse the L3 / L4 headers of multiple received data packets to obtain the five-tuple information of the multiple received data packets, identify the data streams corresponding to the multiple received data packets, and group one or more received data packets corresponding to the same data stream into the same data segment for packet assembly. This can be understood as one data segment corresponding to one data stream, that is, one or more received data packets in one data segment corresponding to the same application stream. Since a data stream is initiated by one application stream, it can also be understood as one data stream corresponding to one application stream. The modem 4011 is also used to send out the packetized data packets.

[0072] Application processor 4012 can be used to receive and process received data packets. In this embodiment, application processor 4012 can be used to deassemble the packetized data packets to obtain at least one data segment, and transmit one or more received data packets in each data segment to the core corresponding to the application program.

[0073] Memory 402 can be used to store one or more computer programs, which include instructions. Processor 401 can execute the instructions stored in memory 402, thereby causing chip 400 to perform the data packet processing method provided in the embodiments of this application. Memory 402 may include a code storage area and a data storage area. The data storage area may store data created during the use of chip 400. In addition, memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as one or more disk storage components, flash memory components, universal flash storage (UFS), etc. In the embodiments of this application, memory 402 can be used to store one or more application programs.

[0074] Chip interface 403 may include one or more chip interfaces. For example, chip interface 403 may be an interface for external communication of the modem 4011 in processor 401, or it may be an antenna or Ethernet interface, etc. Chip interface 403 is used to communicate with external devices of the chip, such as communicating with a server.

[0075] Using the electronic device provided in this application, the following describes, with reference to the accompanying drawings, the method for processing data packets proposed in this application for electronic devices. Taking the electronic device as a chip as an example, the process of dividing multiple received data packets into at least one data segment during the chip's packet assembly and reception process, where each data segment corresponds to an application program and each data segment includes a data segment header, and transmitting one or more received data packets in each data segment to the core corresponding to the application program according to the data segment header.

[0076] like Figure 5 As shown in the figure, this application provides a method for processing data packets. The method is applied to an electronic device, which includes multiple cores. Taking the electronic device as chip 400 as an example, the method includes:

[0077] Step 501: Demodulate multiple received data packets and divide them into at least one data segment.

[0078] In this context, multiple received data packets can be understood as multiple data packets received by an electronic device from an external device, such as multiple data packets received from a server. These multiple received data packets can originate from different servers and, for example, can be multiple Ethernet data packets. Each received data packet has a corresponding data stream, which can be the same or different. The data stream is initiated by an application; one application can initiate multiple data streams, meaning the same application can initiate multiple different data streams, i.e., multiple data streams with different 5-tuple information. One data stream corresponds to one application; in other words, each received data packet has a corresponding application.

[0079] Multiple received data packets are divided into at least one data segment according to the data stream. Specifically, one or more received data packets corresponding to the same data stream are grouped into the same data segment, which can be understood as one data stream corresponding to one data segment. Each data segment in the at least one data segment corresponds to one application, which can be understood as one data segment corresponding to one application, and multiple data segments can correspond to the same application, that is, the multiple data streams corresponding to the multiple data segments are initiated by the same application.

[0080] At least one data segment includes a data segment header, which is used to identify the application. For example, the data segment header includes data stream identifier (ID) information, which is used to indicate the application corresponding to the data segment. This can be understood as indicating the application corresponding to one or more received data packets that are divided into the data segment.

[0081] For example, after receiving multiple data packets, an electronic device demodulates these packets, identifies the data streams corresponding to each packet, and thus splits the data packets into multiple data segments. This can be understood as grouping multiple data packets together. Figure 6As shown, taking multiple received data packets as received data packet 0, received data packet 1, and received data packet 2 as an example, after the electronic device demodulates received data packets 0, 1, and 2, it identifies received data packet 2 as corresponding to the first data stream, and received data packets 0 and 1 as corresponding to the second data stream. The electronic device separately packages received data packet 2 into a first data segment, and the first data segment includes a data segment header 0, which is used to identify the first application corresponding to the first data segment. The electronic device packages received data packets 0 and 1 together in the order they are received into a second data segment, and the second data segment includes a data segment header 1, which is used to identify the second application corresponding to the second data segment. The first application and the second application can be the same application or different applications.

[0082] Specifically, step 501 described above can be performed by a modem in an electronic device, for example, it can be... Figure 4 The modem 4011 in the middle is used for execution.

[0083] In some optional embodiments, step 501 specifically includes:

[0084] Step 5011: Determine the data segment corresponding to each received data packet based on the five-tuple information of each received data packet in the multiple received data packets, so as to group one or more received data packets into each data segment.

[0085] In step 501, demodulating multiple received data packets can, for example, involve parsing the L3 / L4 headers of multiple received data packets to obtain the 5-tuple information for each received data packet. Data packets with identical 5-tuple information correspond to the same data stream; that is, data packets with identical 5-tuple information can be grouped into the same data segment and correspond to the same application. It can be understood that the process of the application processor parsing the L3 / L4 headers of multiple data packets at the network interface card layer in step 5' of the prior art is performed by the modem 4011 of this application. The modem 4011 of this application has the capability to parse the L3 / L4 headers of multiple received data packets and obtain the 5-tuple information for each received data packet. For example, the modem 4011 of this application includes a hardware accelerator, and the modem 4011 uses the hardware accelerator to perform the step of parsing the L3 / L4 headers of multiple received data packets to obtain the 5-tuple information for each received data packet. After obtaining the 5-tuple information of each received data packet, the modem 4011 can group one or more received data packets with the same 5-tuple information into the same data segment. This step can also be performed by the hardware accelerator in the modem 4011.

[0086] For example, after the electronic device obtains the 5-tuple information of each received data packet, it determines the data segment corresponding to each received data packet based on the 5-tuple information of each received data packet, and packages one or more received data packets with the same 5-tuple information into the same data segment.

[0087] like Figure 6 As shown, the electronic device groups one or more received data packets with identical five-tuple information into the same data segment, following the order in which they are received. The grouped received data packets include a packet header, a data segment header for each data segment, and one or more received data packets within each data segment. The packet header stores descriptive information about the entire grouped received data packets. The data segment header for each data segment identifies the data stream corresponding to that data segment, i.e., the application program corresponding to that data segment. The one or more received data packets within each data segment are one or more received data packets corresponding to the same data stream, i.e., one or more received data packets corresponding to the application program identified by the data segment header.

[0088] Taking the Universal Serial Bus (USB) Network Control Model (NCM) packet format as an example, the multiple received data packets after packetization are as follows: Figure 7 As shown, it includes the NCM header, multiple NCM data pointers (NDPs), and multiple received data packets.

[0089] The NCM header can be understood as the packet assembly header, used to store descriptive information for the multiple received data packets assembled from the NCM header. The NCM header includes information such as the NCM transfer header (NTH), length (NCM header), and pointer (NDP). The NTH is the packet assembly identifier, used to store a fixed-string application-specific integrated circuit (ASIC) code. The length (NCM header) describes the length of the entire NCM header. The pointer (NDP) points to the position of the first NDP in the multiple received data packets assembled from the NCM header; it can be understood that parsing this pointer (NDP) allows access to the first NDP header.

[0090] Multiple NDPs can be understood as multiple data segments. Currently, the NCM packet format of the USB communication device class (CDC) specification does not specify the division rules for each NDP. In this embodiment, it is optimized so that the data packets included in each NDP correspond to the same data stream, that is, to the same application.

[0091] like Figure 7 As shown, taking multiple NDPs including NDP0 and NDP1 as an example, where NDP0 includes receive data packet 2, and NDP1 includes receive data packet 0 and receive data packet 1, NDP0 includes information such as NDP0 header, length (NDP0), pointer (next NDP), pointer (receive data packet 2), and length (receive data packet 2). The NDP0 header can be understood as a data segment header. Currently, in the NCM packet format of the USB CDC specification, the NDP header stores the "ncmx" string ASIC code value by default. In this embodiment, it is optimized so that the NCM header stores information used to identify the application. It can be understood that the NDP0 header is used to represent information about the application corresponding to the NDP0, such as storing data stream ID information. For example, when putting the data stream ID information into the NDP0 header, the first 16 bits can be filled with fixed characters, and the last 16 bits can be filled with the data stream ID information; this application does not impose any restrictions. Length (NDP0) describes the length of the entire NDP0, pointer (next NDP) points to the position of the next NDP, pointer (received data packet 2) points to the position of received data packet 2, and length (received data packet 2) describes the length of received data packet 2.

[0092] The format of NDP1 is similar to that of NDP0. NDP1 includes information such as NDP1 header, length (NDP1), pointer (next NDP), pointer (received data packet 0), length (received data packet 0), pointer (received data packet 1), and length (received data packet 1). The data stream ID information stored in the NDP1 header is different from that stored in the NDP0 header. This can be understood as NDP1 and NDP0 corresponding to different applications. Length (NDP1) describes the length of the entire NDP1. Pointer (next NDP) points to the position of the next NDP. When NDP1 is the last NDP, which can be understood as the current data segment being the last data segment, pointer (next NDP) is null. Pointer (received data packet 0) points to the position of received data packet 0, length (received data packet 0) describes the length of received data packet 0, pointer (received data, 1) points to the position of received data packet 1, and length (received data packet 1) describes the length of received data packet 1.

[0093] Multiple received data packets can be, for example, multiple Ethernet data packets. Based on the 5-tuple information of each received data packet, one or more received data packets with the same 5-tuple information are grouped according to... Figure 6 or Figure 7 The package format packages are grouped in the same data segment.

[0094] exist Figure 7In the example CDC protocol specification's NCM packet format, the inclusion of one or more received data packets in the NDP can be understood as the inclusion of pointer information for those one or more received data packets, which is used to index the location of those one or more received data packets. For example, the location of received data packet 1 is indexed through the pointer (received data packet 1) information in NDP1. NDP1 does not directly include received data packet 1, but it includes pointer (received data packet 1) information indicating the location of received data packet 1, which can be represented as NDP1 including received data packet 1. Correspondingly, the packet format proposed in this application embodiment can also be an artificially defined packet format, in which each data segment directly includes one or more received data packets, and these one or more data packets correspond to the same data stream, that is, to the same application.

[0095] Step 502: Parse at least one data segment to obtain the data segment header, and transmit one or more received data packets in each data segment to the core corresponding to the application based on the data segment header.

[0096] Parsing at least one data segment can be understood as the electronic device unpacking multiple received data packets after they have been assembled, to obtain the data segment header included in each data segment of at least one data segment, as well as one or more received data packets in each data segment.

[0097] An electronic device comprises multiple cores, which can be understood as an application processor within the electronic device comprising multiple cores. One application corresponds to one core, meaning one application runs on one core. Based on the data segment header obtained by parsing at least one data segment, where the data stream ID information included in the data segment header identifies the application corresponding to that data segment, transmitting one or more received data packets from each data segment to the core corresponding to the application of that data segment can be understood as scheduling those one or more received data packets to run on the core corresponding to the application of that data segment.

[0098] For example, an electronic device can deassemble multiple received data packets into a single packet, obtaining the header of each data segment and one or more received data packets within each segment. Based on the application identified by the header of each data segment, it transmits one or more received data packets from each segment to the corresponding core of the application. The application then runs on the core to process the one or more received data packets. (Reference) Figure 6The multiple received data packets shown are reassembled. After the electronic device deassembles these packets, it obtains information such as data segment header 0, received data packet 2, data segment header 1, received data packet 0, and received data packet 1. Based on data segment header 0, the electronic device transmits received data packet 2 to the core corresponding to the first application identified by data segment header 0, and runs the first application on that core to process received data packet 2. Based on data segment header 1, the electronic device transmits received data packet 0 and received data packet 1 to the core corresponding to the second application identified by data segment header 1, and runs the second application on that core to process received data packet 0 and received data packet 1.

[0099] Specifically, step 502 described above can be executed by an application processor in an electronic device, for example, it can be... Figure 4 The application processor 4012 in the system executes the commands.

[0100] In some optional embodiments, the application processor includes a hardware adaptation layer, a network interface card (NIC) layer, a protocol stack layer, and an application layer. Each layer's header in the data packet has its own independent software for parsing. The hardware adaptation layer and NIC layer can be understood as software parsing the data packet link layer header. The protocol stack layer in the application processor can be understood as a collection of software parsing the TCP layer header and IP layer header. The application layer includes one or more applications, each running on a single core. The hardware adaptation layer, NIC layer, and protocol stack layer support multi-core operation. Step 502 specifically includes:

[0101] Step 5021: Parse at least one data segment at the network interface card (NIC) layer to obtain the data segment header, and determine the application based on the data segment header.

[0102] In this process, after receiving multiple reassembled data packets at the hardware adaptation layer, the electronic device transmits these packets to the network interface card (NIC) layer. At the NIC layer, the electronic device deassembles these packets, obtaining the header of each data segment, and determines the application program corresponding to each segment based on the application program identified in the header.

[0103] Step 5022: Transmit one or more received data packets from the network interface card layer to the protocol stack layer.

[0104] In this context, the electronic device transmits one or more received data packets corresponding to the same application to the protocol stack layer. This can be understood as the electronic device scheduling one or more received data packets corresponding to the same application to the same core for transmission to the protocol stack layer. In other words, the electronic device schedules one or more received data packets corresponding to different applications from multiple received data packets to different cores for transmission to the protocol stack layer.

[0105] For example, at the network interface card (NIC) layer, an electronic device transmits one or more received data packets from each data segment to the protocol stack layer through different upload queues, based on the application identified by the data segment header of each data segment. Within the same upload queue, one or more received data packets from the same data segment are transmitted.

[0106] Step 5023: Parse one or more received data packets at the protocol stack layer to obtain the parsed data.

[0107] In this process, the electronic device parses the received data packets layer by layer at the protocol stack layer to obtain the parsed data. The parsed data of one or more received data packets in the same data segment corresponds to the same application.

[0108] Step 5024: Transfer the parsed data to the core corresponding to the application.

[0109] In this process, the electronic device transmits the parsed data to the core corresponding to the application that corresponds to the parsed data. Specifically, it transmits the parsed data to the core corresponding to the application that corresponds to the data segment of the parsed data. This can be understood as one or more received data packets corresponding to the same data segment belonging to the same application, with each application corresponding to one core. The data parsed from one or more received data packets corresponding to the same data segment is then scheduled to the core corresponding to the application.

[0110] Therefore, the data packet processing method provided in this application can be applied to electronic devices, such as chips. During the packet assembly and reception process, multiple received data packets are divided into at least one data segment, each data segment corresponding to an application. The header of each data segment identifies the packet assembly format of the application. During unpacking, one or more received data packets from each data segment are transmitted to the core corresponding to the application of that data segment. Compared to the prior art, which does not standardize the data segment in the packet assembly format and processes multiple data packets through a single core, resulting in a large load on the single core and reduced processing power of the electronic device, this application achieves a reasonable balance of the load on multiple cores of the electronic device by changing the packet assembly format and processing multiple received data packets through multiple cores, thereby improving the electronic device's data packet processing capability.

[0111] like Figure 8As shown, the electronic device includes a modem and an application processor. The modem is used to receive and process multiple received data packets from the air interface side. The application processor is used to receive and process multiple received data packets from the modem / demodem. The application processor includes multiple cores and includes a hardware adaptation layer, a network interface card layer, a protocol stack layer, and an application layer. The application layer includes one or more programs, specifically including the following steps:

[0112] Step a: The modem receives multiple data packets from the air interface side.

[0113] For example, a modem can receive multiple data packets sent by a server from the air interface side.

[0114] Step b: The modem demodulates multiple received data packets.

[0115] Step b can be found in the description of step 501 above, and will not be repeated here.

[0116] Step c: The modem divides multiple received data packets into at least one data segment.

[0117] In this configuration, at least one data segment corresponds to an application, and each data segment includes a data segment header used to identify the application. Step c can be found in the description of step 501 above, and will not be repeated here.

[0118] Step c specifically includes step c1, determining the data segment corresponding to each received data packet based on the five-tuple information of each received data packet in the multiple received data packets, so as to group one or more received data packets into each data segment. Step c1 can be referred to the description of step 5011 above, and will not be repeated here.

[0119] The modem may include, for example, a hardware accelerator. The processes described in steps b and c above can be specifically performed by the hardware accelerator, that is, the hardware accelerator splits and reassembles the multiple received data packets.

[0120] Step d: The modem sends at least one data segment to the application processor.

[0121] In each data segment, one or more received data packets are used to transmit to the core corresponding to the application. The modem can send at least one data segment to the application processor via wired or wireless means; for example, the modem can send at least one data segment to the application processor via USB.

[0122] Step e: The application processor receives at least one data segment from the modem.

[0123] The application processor receives at least one data segment at the hardware adaptation layer and transmits the at least one data segment to the network interface card layer of the application processor.

[0124] Step f: The application processor parses at least one data segment to obtain the data segment header.

[0125] Step f can be found in the description of step 502 above, and will not be repeated here.

[0126] Step f specifically includes: Step f1, parsing at least one data segment at the network interface card layer to obtain the data segment header, and determining the application based on the data segment header.

[0127] Step f2: Transmit one or more received data packets from the network interface card layer to the protocol stack layer.

[0128] Step f3: Parse one or more received data packets at the protocol stack layer to obtain the parsed data;

[0129] Step f4: Transfer the parsed data to the core corresponding to the application.

[0130] Steps f1-f4 can be found in the description of steps 5021-5024 above, and will not be repeated here.

[0131] Step g: The application processor transmits one or more received data packets from each data segment to the core corresponding to the application, based on the data segment header.

[0132] Step g can be found in the description of step 502 above, and will not be repeated here.

[0133] Therefore, the data packet processing method provided in this application can be applied to an electronic device, which includes a modem and an application processor. During the packet assembly and reception process, the modem divides multiple received data packets into at least one data segment. Each data segment corresponds to an application, and the header of each data segment identifies the packet assembly format of the application. During unpacking, the application processor transmits one or more received data packets from each data segment to the core corresponding to the application of that data segment. Compared to the prior art which introduces additional overhead on the application processor side, reducing the processing power of the electronic device, this application, by changing the packet assembly format, processes multiple received data packets using multiple cores without introducing additional overhead on the application processor side. This achieves a reasonable balance of the load on the multiple cores of the electronic device, improving the data packet processing capability of the electronic device.

[0134] It is understood that, in order to achieve the aforementioned functions, the electronic device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in a hardware-driven or software-driven manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application.

[0135] This application embodiment can divide the above-described electronic device into functional modules based on the method example described above. 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 this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.

[0136] When dividing each function into modules according to its corresponding function. Figure 9 This diagram illustrates a possible configuration of the modulation and demodulation apparatus 900 involved in the above embodiments. The modulation and demodulation apparatus 900 can be a modem or modulator-demodulator involved in the above embodiments, such as... Figure 9 As shown, the modulation and demodulation device 900 may include: a demodulation module 901, a packet assembly module 902, and a transmission module 903.

[0137] The demodulation module 901 can be used to support the modulation and demodulation device 900 in performing the above steps 501 and b, and / or other processes used in the technology described herein.

[0138] The package module 902 can be used to support the modem 900 in performing the above steps 501, 5011, c and c1, and / or other processes used in the technology described herein.

[0139] The transmitting module 903 can be used to support the modem 900 in performing the above-described steps d, and / or other processes used in the techniques described herein.

[0140] It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.

[0141] The modulation and demodulation device 900 provided in this embodiment is used to perform the above-described method for processing data packets, and therefore can achieve the same effect as the above-described implementation method.

[0142] When dividing each function into modules according to its corresponding function. Figure 10 This diagram illustrates a possible configuration of the application processing device 1000 involved in the above embodiments. The application processing device 1000 can be the application processor involved in the above embodiments, such as... Figure 10 As shown, the application processing device 1000 may include: a receiving module 1001, a parsing module 1002, and a scheduling module 1003.

[0143] The receiving module 1001 can be used to support the application processing device 1000 in performing the above-described steps e, and / or other processes for the technology described herein.

[0144] The parsing module 1002 can be used to support the application processing device 1000 in performing the above steps 502, 5021, 5022, 5023, f, f1, f2 and f3, and / or other processes used in the technology described herein.

[0145] The scheduling module 1003 can be used to support the application processing device 1000 in executing the above steps 502, 5024, f4 and g, and / or other processes used in the techniques described herein.

[0146] It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.

[0147] The application processing device 1000 provided in this embodiment is used to execute the above-described method for processing data packets, and therefore can achieve the same effect as the above-described implementation method.

[0148] When using integrated units, such as Figure 11As shown in the illustration, this application discloses an electronic device 1100, which can be the chip 400 in the above embodiments. The electronic device 1100 may include a processing module, a storage module, and a communication module. The processing module can be used to control and manage the actions of the electronic device 1100, for example, it can support the electronic device 1100 in executing the steps performed by the demodulation module 901, packet assembly module 902, sending module 903, receiving module 1001, parsing module 1002, and scheduling module 1003. The storage module can be used to support the electronic device 1100 in storing program code and data. The communication module can be used to support communication between the electronic device 1100 and other devices, for example, it can support the electronic device 1100 in executing step a.

[0149] Of course, the unit modules in the above-mentioned electronic device 1100 include, but are not limited to, the processing module, storage module and communication module.

[0150] The processing module can be a processor or a controller. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination of functions that implement computing capabilities, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module can be a memory. The communication module can specifically be a device that interacts with other external devices.

[0151] For example, the processing module can be a processor 401, the storage module can be a memory 402, and the communication module can be a chip interface 403. The electronic device 1100 provided in this embodiment can be... Figure 4 The chip 400 shown is an example. The processor 401, memory 402, chip interface 403, etc., can be connected together, for example, via a bus.

[0152] This application also provides an electronic device including one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, including computer instructions. When the one or more processors execute the computer instructions, the electronic device performs the aforementioned method steps to implement the data packet processing method in the above embodiments.

[0153] This application also provides a computer-readable storage medium storing computer program code, which, when computer instructions are executed on a computer or processor, causes the computer or processor to perform the data packet processing method described in the above embodiments.

[0154] In this embodiment, the electronic device and computer storage medium are used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.

[0155] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0156] In the several embodiments provided in this application, it should be understood that the disclosed apparatus 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 device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0157] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

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

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

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

Claims

1. An electronic device, characterized in that, The electronic device includes: A modem for demodulating multiple received data packets and dividing the multiple received data packets into at least one data segment, wherein each data segment corresponds to an application, and each data segment includes a data segment header for identifying the application. The application processor includes multiple cores, which are used to parse the at least one data segment to obtain the data segment header, and transmit one or more received data packets in each data segment to the core corresponding to the application based on the data segment header.

2. The electronic device according to claim 1, characterized in that, The application processor is specifically used for: At the network interface card (NIC) layer, at least one data segment is parsed to obtain the data segment header, and the application is determined based on the data segment header. Transmit the one or more received data packets from the network interface card layer to the protocol stack layer; The one or more received data packets are parsed at the protocol stack layer to obtain parsed data; The parsed data is then transmitted to the kernel corresponding to the application.

3. The electronic device according to claim 1 or 2, characterized in that, The modem is specifically used for: The data segment corresponding to each received data packet is determined based on the five-tuple information of each received data packet in the plurality of received data packets, so as to package the one or more received data packets in each data segment.

4. A modulation and demodulation device, characterized in that, The modulation and demodulation device includes: The demodulation module is used to demodulate multiple received data packets; A packet assembly module is used to divide the plurality of received data packets into at least one data segment, wherein each data segment corresponds to an application, and each data segment includes a data segment header, which is used to identify the application. A sending module is configured to send the at least one data segment to an application processing device, wherein one or more received data packets in each data segment are used for transmission to a core corresponding to the application.

5. The modulation and demodulation apparatus according to claim 4, characterized in that, The package assembly module is specifically used for: The data segment corresponding to each received data packet is determined based on the five-tuple information of each received data packet in the plurality of received data packets, so as to package the one or more received data packets in each data segment.

6. An application processing apparatus, the application processing apparatus comprising a plurality of cores, characterized in that, The application processing device includes: A receiving module is configured to receive at least one data segment from a modem, wherein each data segment corresponds to an application program, and each data segment includes a data segment header for identifying the application program. The parsing module is used to parse the at least one data segment to obtain the data segment header; The scheduling module is used to transmit one or more received data packets in each data segment to the core corresponding to the application, based on the data segment header.

7. The application processing apparatus according to claim 6, characterized in that, The parsing module is specifically used for: At the network interface card (NIC) layer, at least one data segment is parsed to obtain the data segment header, and the application is determined based on the data segment header. Transmit the one or more received data packets from the network interface card layer to the protocol stack layer; The one or more received data packets are parsed at the protocol stack layer to obtain parsed data; The scheduling module is specifically used to transmit the parsed data to the core corresponding to the application.

8. A method for processing data packets, the method being applied to an electronic device, the electronic device comprising multiple cores, characterized in that, The method includes: Demodulate multiple received data packets and divide the multiple received data packets into at least one data segment. Each data segment in the at least one data segment corresponds to an application. Each data segment includes a data segment header, which is used to identify the application. Parse the at least one data segment to obtain the data segment header, and transmit one or more received data packets in each data segment to the core corresponding to the application based on the data segment header.

9. The method according to claim 8, characterized in that, The step of parsing the at least one data segment to obtain the data segment header, and transmitting one or more received data packets from each data segment to the kernel corresponding to the application based on the data segment header, specifically includes: At the network interface card (NIC) layer, at least one data segment is parsed to obtain the data segment header, and the application is determined based on the data segment header. Transmit the one or more received data packets from the network interface card layer to the protocol stack layer; The one or more received data packets are parsed at the protocol stack layer to obtain parsed data; The parsed data is then transmitted to the kernel corresponding to the application.

10. The method according to claim 8 or 9, characterized in that, Demodulating multiple received data packets and dividing the multiple received data packets into at least one data segment specifically includes: The data segment corresponding to each received data packet is determined based on the five-tuple information of each received data packet in the plurality of received data packets, so as to package the one or more received data packets in each data segment.

11. A computer-readable storage medium, characterized in that, Includes computer instructions that, when executed on a computer or processor, cause the computer or processor to perform the method described in any one of claims 8-10.

Citation Information

Patent Citations

  • System and method for transmitting data over a communication network

    CN107809394A

  • Radio resource control connection method and device, and computer storage medium

    CN108430070A