WO2023072065A1 - 数据处理方法、装置、电子设备和存储介质 - Google Patents

数据处理方法、装置、电子设备和存储介质 Download PDF

Info

Publication number
WO2023072065A1
WO2023072065A1 PCT/CN2022/127352 CN2022127352W WO2023072065A1 WO 2023072065 A1 WO2023072065 A1 WO 2023072065A1 CN 2022127352 W CN2022127352 W CN 2022127352W WO 2023072065 A1 WO2023072065 A1 WO 2023072065A1
Authority
WO
WIPO (PCT)
Prior art keywords
received data
data
ipa
application processor
network
Prior art date
Application number
PCT/CN2022/127352
Other languages
English (en)
French (fr)
Inventor
舒伟力
李青胜
Original Assignee
展讯通信(上海)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 展讯通信(上海)有限公司 filed Critical 展讯通信(上海)有限公司
Publication of WO2023072065A1 publication Critical patent/WO2023072065A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24568Data stream processing; Continuous queries

Definitions

  • the present application relates to the technical field of communication, and in particular to a data processing method, device, electronic equipment and storage medium.
  • IPA Internet Protocol Accelerator
  • a data processing method, device, electronic equipment and storage medium which can reduce resource consumption of processors.
  • a data processing method is provided, which is used in an electronic device.
  • the electronic device includes an application processor and an Internet Protocol Accelerator IPA.
  • the IPA is used to route and forward data.
  • the data processing method includes: obtaining the received data from the IPA Data; the virtual network card is triggered by an interrupt to offload the received data to obtain the offloaded received data; the offloaded received data is obtained through the network subsystem in the application processor.
  • the interrupt triggers the virtual network card to offload the received data
  • the process of obtaining the offloaded received data includes: obtaining the received data and the source ID and network ID corresponding to the received data; The identification obtains the corresponding device identification; configures the received data according to the device identification, and obtains the distributed received data.
  • the electronic device further includes a plurality of network cards of different types
  • the data processing method further includes: acquiring the sending data from any network card; and sending the sending data to the IPA.
  • acquiring the received data from the IPA includes: acquiring the received data from the IPA, and forming the received data in a socket cache skb format based on the received data.
  • an application processor is provided, which is used in an electronic device.
  • the electronic device includes an Internet Protocol Accelerator IPA, and the IPA is used to route and forward data.
  • the application processor includes: a first acquisition module, used to acquire The received data of the IPA; the shunt module is used to shunt the received data by triggering the virtual network card through an interrupt to obtain the shunted received data; the second acquisition module is used to obtain the shunted received data through the network subsystem in the application processor .
  • the distribution module is specifically used to: obtain the received data and the source identifier and network identifier corresponding to the received data; obtain the corresponding device identifier according to the source identifier and the network identifier; configure the received data according to the device identifier , to get the shunted received data.
  • the electronic device further includes a plurality of network cards of different types
  • the application processor further includes: a third acquisition module, configured to acquire data sent from any network card; a sending module, configured to send the data Send to IPA.
  • the first acquiring module is specifically configured to acquire received data from the IPA, and form received data in a socket buffer skb format based on the received data.
  • an application processor including: a main processor and a memory, the memory is used to store at least one instruction, and when the instruction is loaded and executed by the main processor, the above data processing method is realized.
  • an electronic device including the application processor of the second aspect or the third aspect and an Internet Protocol Accelerator IPA.
  • a computer-readable storage medium is provided, and a computer program is stored in the computer-readable storage medium, and when the computer program is run on a computer, it causes the computer to execute the above-mentioned data processing method.
  • the data processing method, device, electronic device, and storage medium in the embodiments of the present application use the interrupt to trigger the virtual network card to offload the received data. Since the interrupt operation is required in the process of data transmission, the interrupt process can be reused. Realize the shunting of received data, so that there is no need to shunt the data through independent threads. Compared with the way of shunting data through independent threads, it reduces the resource consumption of the processor and reduces the RTT. Through the unified processing of the interrupts of the virtual network cards, compared with the separate interrupt processing of the data of different network cards, there is no need to correspond to the respective interrupts of different network cards, thereby reducing the number of interruptions.
  • FIG. 1 is a structural block diagram of a partial structure of an electronic device in an embodiment of the present application
  • FIG. 2 is another structural block diagram of a partial structure of an electronic device in an embodiment of the present application.
  • FIG. 3 is a schematic flow diagram of a data processing method in an embodiment of the present application.
  • FIG. 4 is a schematic flow diagram of another data processing method in the embodiment of the present application.
  • FIG. 5 is a structural block diagram of an application processor in an embodiment of the present application.
  • socket buffer For the received data from IPA, the socket buffer (socket buffer,
  • RTT Round-Trip Time
  • the embodiment of the present application provides a data processing method for an electronic device, as shown in Figure 1 and Figure 2, the electronic device includes an application processor (Application Process, AP), a plurality of different types of network cards and an Internet Protocol accelerator IPA, IPA is used to route and forward data.
  • Application Process Application Process
  • AP Application Process
  • IPA Internet Protocol accelerator
  • the subject of execution of the data processing method in the embodiment of the present application is the AP.
  • network card can comprise Wi-Fi network card, USB network card, modem Modem network card, Ethernet Ethernet network card, IPA can comprise USB endpoint endpoint, Wi-Fi endpoint, high-speed serial computer expansion bus standard (peripheral component interconnect express, pcie) endpoint, Ethernet endpoints and communication processor (Communication Processor, CP) endpoints, the above-mentioned endpoints are used to realize the transmission of different network data, for example, the USB endpoint is used to transmit USB data, corresponding to the USB network card, and the CP endpoint is used to transmit cellular data.
  • pcie peripheral component interconnect express
  • CP Communication Processor
  • the Wi-Fi endpoint is used to transmit Wi-Fi data, corresponding to the Wi-Fi network card
  • the Ethernet endpoint is used to transmit Ethernet data, corresponding to the Ethernet network card
  • the pcie endpoint can also be used to transmit Ethernet data, That corresponds to the Ethernet network card.
  • electronic equipment may include more types of other endpoints and network cards, and may also reduce some endpoints and network cards.
  • the embodiment of the present application is specific to the number and type of network cards And the number and type of endpoints in the IPA are not limited.
  • the box corresponding to the AP is used to indicate the content related to the AP, for example, including the physical device and virtual module controlled by the AP, that is to say, the box corresponding to the AP in Figure 2 is not Indicates the content contained in the AP, but indicates the content related to the AP.
  • IPA also includes an AP output endpoint and an AP input endpoint. The AP output endpoint is used to output the data of the IPA to the AP, and the AP input endpoint is used to input the data from the AP to the IPA. The AP output endpoint can pass through the receiving channel 1 of the AP. To transmit data to N, the AP input endpoint can transmit data through the sending channels 1 to N of the AP.
  • the application processor includes a network subsystem network subsystem, and the network subsystem specifically belongs to a virtual module corresponding to the TCP/IP protocol layer, and is used to perform related processing of the TCP/IP protocol layer in the network.
  • IPA also includes a routing/bridge (router/bridge) module, which can be used to implement data routing and forwarding, bridge transmission, etc. between different endpoints. Through configuration, the acceleration function can be realized.
  • route/bridge routing/bridge
  • an electronic device when an electronic device receives data through a cellular network, the data is first input through the CP endpoint of the IPA and output to the AP through the IPA, so that the electronic device can obtain the data received through the cellular network.
  • the AP sends the data to the IPA
  • the IPA sends the data by the CP endpoint.
  • the electronic device may also transmit data through other communication methods, for example, transmit data through a corresponding communication method through a USB endpoint, a Wi-Fi endpoint, a pcie endpoint or an Ethernet endpoint in the IPA.
  • IPA sends the cellular network data received through the CP endpoint directly through the Wi-Fi endpoint to realize Wi-Fi hotspot connection. Function.
  • the data processing method in the embodiment of the present application includes:
  • Step 101 obtain the received data from the IPA, that is, obtain the received data through the AP output endpoint on the IPA;
  • Step 102 triggering the virtual dummy network card to offload the received data through an interrupt, and obtain the offloaded received data
  • a virtual network card will be specially created.
  • the IPA receives data
  • the received data is cached, and the fill task thread created by the IPA driver fills the received data to form the received data in skb format. And it will interrupt the new application programming interface (New Application Programming Interface, NAPI) that triggers the virtual network card to read data, and then distribute the received data.
  • NAPI New Application Programming Interface
  • the distribution refers to distinguishing which specific network card the received data corresponds to, that is, all network cards correspond to
  • the received data is uniformly received and managed by the virtual network card.
  • Step 103 obtain the distributed received data through the network subsystem in the application processor.
  • the received data is distributed by triggering the virtual network card through the interruption. Since the interruption operation is required in the process of data transmission, the interruption process can be reused to realize the distribution of the received data, thus eliminating the need for Splitting data through independent threads, compared with the way of splitting data through independent threads, reduces the resource consumption of the processor and reduces RTT, and because all data are uniformly processed through the interrupt of the virtual network card, Compared with the data of different network cards that need to be interrupted and processed separately, there is no need to correspond to the respective interrupts of different network cards, thereby reducing the number of interrupts.
  • the received data of all network cards is uniformly processed through the virtual network card, the same operation in the received data can be completed in a centralized manner, and some special processing required by different network cards can also be completed in the processing of the received data by the virtual network card Then execute it separately, and then send it to the network subsystem of the application processor.
  • the received data is the data corresponding to the USB network card, the data corresponding to the modem network card or the data corresponding to the Ethernet network card , it can be directly sent to the network subsystem of the application processor after being distributed by the virtual network card, and the received data corresponding to the Wi-Fi network card can be sent to the Wi-Fi network card through the notification chain after being distributed by the virtual network card.
  • the Fi network card performs some special processing on the data, and then sends it to the network subsystem of the application processor after processing, that is, the specific process of the embodiment of the present application for the above-mentioned step 103, obtaining the shunted received data through the network subsystem in the application processor It is not limited, and may be directly sent to the network subsystem, or may be sent to the network subsystem after other processing.
  • the IPA can also have a hardware offload function.
  • the offload can complete the functions originally performed by the AP on the hardware IPA.
  • the above step 102, triggering the virtual network card to offload the received data through an interrupt, and the process of obtaining the offloaded received data includes:
  • Step 1021 obtain the received data and the source identification (source, src) id and network identification net id corresponding to the received data;
  • src id is used to mark the network type, or network card type, for example, 0x1 means USB network card, 0x2 means Wi-Fi network card, net id is used to mark the serial number of the network card under the same network type or network card type, such as the modem network card mentioned above, the actual Including multiple modem network cards from modem network card 0 to modem network card n, 0 represents network card serial number 0, n represents network card serial number n, net id is used to mark a specific network card, for example, Modem nic0 represents modem network card 0, Modem nicn represents modem network card n, USB nic means USB network card, Veth nic0 means Ethernet network card 0, Veth nicen means Ethernet network card n;
  • Step 1022 obtain corresponding device identification (net device, netdev) according to source identification src id and network identification net id;
  • Table 1 is the mapping table of source identifier src id, network identifier net id and device identifier netdev. Based on this mapping table, the corresponding netdev can be obtained according to the matching between src id and net id, and netdev can determine the specific device corresponding to the received data.
  • the network card where the mapping table can be an array structure, no need to traverse the query or calculate the key value.
  • Step 1023 configure the received data according to the device identifier netdev, and obtain the distributed received data.
  • the received data is configured, that is, the corresponding netdev is set in the received data, even if the received data carries a specific netdev, and then the interface can be called to send the received data to the network subsystem of the application processor, so that the network subsystem The system can determine which network card the received data corresponds to according to netdev.
  • the data processing method further includes: acquiring the sending data from any network card; and sending the sending data to the IPA.
  • each network card driver calls the sending interface provided by the IPA driver to send, and after the sending is completed, the cache release action is released by the release task free task thread created by the IPA driver. That is to say, in the embodiment of the present application, the sending data that needs to be sent using IPA is still sent through each network card.
  • obtaining received data from IPA in step 101 includes: obtaining received data from IPA, and forming received data in socket cache skb format based on the received data, that is, by driving the IPA to create The filling task fill task thread fills the received data to form the received data in skb format.
  • the embodiment of the present application also provides an application processor, which is used in an electronic device.
  • the electronic device includes an Internet Protocol Accelerator (IPA), and the IPA is used to route and forward data.
  • the application processor includes: a first acquisition The module 10 is used to obtain the received data from the IPA; the split module 20 is used to trigger the virtual network card to split the received data through the interrupt to obtain the split received data; the second acquisition module 30 is used to pass through the application processor.
  • the network subsystem of the network obtains the received data after distribution.
  • the application processor may specifically apply the data processing method in any of the above-mentioned embodiments, and the specific process and principle are the same as those in the above-mentioned embodiments, which will not be repeated here.
  • modules of the application processor shown in FIG. 5 above is only a division of logical functions, and may be fully or partially integrated into one physical entity or physically separated during actual implementation. And these modules can all be implemented in the form of software calling through the processing element; they can also be implemented in the form of hardware; some modules can also be implemented in the form of software calling through the processing element, and some modules can be realized in the form of hardware.
  • any one of the first acquisition module 10, the shunt module 20 and the second acquisition module 30 can be a separate processing element, and can also be integrated in an application processor, for example, integrated in a certain chip of the application processor In addition, it can also be stored in the memory of the application processor in the form of a program, and a certain processing element of the application processor can call and execute the functions of the above modules.
  • the implementation of other modules is similar. In addition, all or part of these modules can be integrated together, and can also be implemented independently.
  • the processing element mentioned here may be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or an instruction in the form of software.
  • these modules of the first acquisition module 10, the shunt module 20 and the second acquisition module 30 may be one or more integrated circuits configured to implement the above method, for example: one or more specific integrated circuits (Application Specific Integrated Circuit, ASIC), or, one or more microprocessors (digital singnal processor, DSP), or, one or more field programmable gate arrays (Field Programmable Gate Array, FPGA), etc.
  • ASIC Application Specific Integrated Circuit
  • DSP digital singnal processor
  • FPGA Field Programmable Gate Array
  • the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, CPU) or other processors that can call programs.
  • CPU central processing unit
  • these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
  • SOC system-on-a-chip
  • the splitting module 20 is specifically configured to: obtain the received data and the source identifier and network identifier corresponding to the received data; obtain the corresponding device identifier according to the source identifier and the network identifier; perform processing on the received data according to the device identifier Configure to get the received data after shunting.
  • the electronic device further includes a plurality of network cards of different types
  • the application processor further includes: a third acquiring module (not shown in the figure), configured to acquire data sent from any network card; A module (not shown in the figure) is used to send the sending data to the IPA.
  • the first acquiring module is specifically configured to acquire received data from the IPA, and form received data in a socket buffer skb format based on the received data.
  • An embodiment of the present application further provides an application processor, including: a main processor and a memory, the memory is used to store at least one instruction, and when the instruction is loaded and executed by the main processor, the data processing method in any of the foregoing embodiments is implemented.
  • the application processor may specifically apply the data processing method in any of the above-mentioned embodiments, and the specific process and principle are the same as those in the above-mentioned embodiments, which will not be repeated here.
  • the main processor and the memory may be connected through a bus or in other ways.
  • the memory can be used to store non-transitory software programs, non-transitory computer-executable programs and modules, such as program instructions/modules corresponding to the application processor in the embodiments of the present application.
  • the main processor executes various functional applications and data processing methods by running non-transitory software programs, instructions and modules stored in the memory, that is, implements the methods in any of the above method embodiments.
  • the memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function; and necessary data and the like.
  • the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage devices.
  • the embodiment of the present application also provides an electronic device, including the above-mentioned application processor, multiple network cards of different types, and an internet protocol accelerator IPA.
  • the electronic equipment involved in this application may be a mobile phone, customer premise equipment (Customer Premise Equipment, CPE), tablet computer, personal computer (personal computer, PC), vehicle-mounted equipment or wearable equipment, etc.
  • CPE Customer Premise Equipment
  • PC personal computer
  • vehicle-mounted equipment or wearable equipment etc.
  • An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and when running on a computer, the computer is made to execute the data processing method in any of the foregoing embodiments.
  • all or part of them may be implemented by software, hardware, firmware or any combination thereof.
  • software When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the present application will be generated in whole or in part.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber, DSL) or wireless (eg, infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media.
  • the available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, a Solid State Disk).
  • "at least one” means one or more, and “multiple” means two or more.
  • “And/or” describes the association relationship of associated objects, indicating that there may be three kinds of relationships, for example, A and/or B may indicate that A exists alone, A and B exist simultaneously, or B exists alone. Among them, A and B can be singular or plural.
  • the character “/” generally indicates that the contextual objects are an “or” relationship.
  • “At least one of the following” and similar expressions refer to any combination of these items, including any combination of single items or plural items.
  • At least one of a, b, and c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, and c may be single or multiple.

Abstract

提供一种数据处理方法、装置、电子设备和存储介质,涉及通信技术领域,可以降低对处理器的资源消耗。数据处理方法,用于电子设备,电子设备包括应用处理器以及网际互连协议加速器IPA,IPA用于对数据进行路由转发,数据处理方法包括:获取来自于IPA的接收数据(101);通过中断触发虚拟网卡对接收数据进行分流,得到分流后的接收数据(102);通过应用处理器中的网络子系统获取分流后的接收数据(103)。

Description

数据处理方法、装置、电子设备和存储介质
本申请要求于2021年10月25日提交中国专利局、申请号为202111240330.4、申请名称为“数据处理方法、装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,特别涉及一种数据处理方法、装置、电子设备和存储介质。
背景技术
随着网络的发展,电子设备上的网络设备类型越来越多,同一个电子设备上往往都会同时设置蜂窝网络、通用串行总线(Universal Serial Bus,USB)、Wi-Fi、以太网等网络设备,因此出现了网际互连协议加速器(Internet Protocol Accelerator,IPA),设备上所有的网络设备的数据都由此IPA来路由转发。目前通过IPA来接收数据的方案中,会通过处理器创建额外的线程来对接收数据进行处理,并触发网卡来读取数据,这种方案对于处理器的资源消耗较大。
发明内容
一种数据处理方法、装置、电子设备和存储介质,可以降低对处理器的资源消耗。
第一方面,提供一种数据处理方法,用于电子设备,电子设备包括应用处理器以及网际互连协议加速器IPA,IPA用于对数据进行路由转发,数据处理方法包括:获取来自于IPA的接收数据;通过中断触发虚拟网卡对接收数据进行分流,得到分流后的接收数据;通过应用处理器中的网络子系统获取分流后的接收数据。
在一种可能的实施方式中,通过中断触发虚拟网卡对接收数据进行分流,得到分流后的接收数据的过程包括:获取接收数据以及与接收数据对应的源标识和网络标识;根据源标识和网络标识得到对应的设备标识;根据设备标识对接收数据进行配置,得到分流后的接收数据。
在一种可能的实施方式中,电子设备还包括多个不同类型的网卡,数据处理方法还包括:获取来自于任意网卡的发送数据;将发送数据发送至IPA。
在一种可能的实施方式中,获取来自于IPA的接收数据包括:获取来自于IPA的接收数据,并基于接收数据形成套接字缓存skb格式的接收数据。
第二方面,提供一种应用处理器,用于电子设备,电子设备包括网际互连协议加速器IPA,IPA用于对数据进行路由转发,应用处理器包括:第一获取模块,用于获取来自于IPA的接收数据;分流模块,用于通过中断触发虚拟网卡对接收数据进行分 流,得到分流后的接收数据;第二获取模块,用于通过应用处理器中的网络子系统获取分流后的接收数据。
在一种可能的实施方式中,分流模块具体用于:获取接收数据以及与接收数据对应的源标识和网络标识;根据源标识和网络标识得到对应的设备标识;根据设备标识对接收数据进行配置,得到分流后的接收数据。
在一种可能的实施方式中,电子设备还包括多个不同类型的网卡,应用处理器还包括:第三获取模块,用于获取来自于任意网卡的发送数据;发送模块,用于将发送数据发送至IPA。
在一种可能的实施方式中,第一获取模块具体用于,获取来自于IPA的接收数据,并基于接收数据形成套接字缓存skb格式的接收数据。
第三方面,提供一种应用处理器,包括:主处理器和存储器,存储器用于存储至少一条指令,指令由主处理器加载并执行时以实现上述的数据处理方法。
第四方面,提供一种电子设备,包括第二方面或第三方面的应用处理器以及网际互连协议加速器IPA。
第五方面,提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行上述的数据处理方法。
本申请实施例中的数据处理方法、装置、电子设备和存储介质,通过中断触发虚拟网卡对接收数据进行分流,由于数据传输的过程中本身就需要中断操作,因此可以复用其中的中断流程来实现接收数据的分流,从而无需通过独立的线程对数据进行分流,相对于通过独立的线程对数据进行分流的方式,降低了对处理器的资源消耗,且降低了RTT,并且由于所有的数据均通过虚拟网卡的中断统一处理,与不同网卡的数据需要分别中断处理相比,无需对应不同的网卡各自中断,从而降低了中断次数。
附图说明
图1为本申请实施例中一种电子设备的部分结构的结构框图;
图2为本申请实施例中一种电子设备的部分结构的另一种结构框图;
图3为本申请实施例中一种数据处理方法的流程示意图;
图4为本申请实施例中另一种数据处理方法的流程示意图;
图5为本申请实施例中一种应用处理器的结构框图。
具体实施方式
本申请的实施方式部分使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。
对于来自于IPA的接收数据,可通过中断触发获取套接字缓存(socket buffer,
skb)格式的接收数据,并通过独立的接收任务(receive task,recv task)线程对接收数据进行分流,并缓存,然后触发对应的网卡(Network Interface Card,NIC)驱动读取缓存的接收数据,然后发送至应用处理器中的网络子系统network subsystem,即通过不同网卡从IPA接收数据。然而,由于需要创建独立的recv task线程对数据进行处理,导致对中央处理器(central processing unit,CPU)中无内部互锁流水级的微 处理器(microprocessor without interlocked piped stages,mips)的消耗较多,即对于CPU的资源消耗较多,且往返时延(Round-Trip Time,RTT)较高;另外,由于需要recv task具有较高的优先级,这样会导致触发软中断时软中断不能及时得到调度,从而可能导致来自于IPA的数据不能及时传输。
本申请实施例提供一种数据处理方法,用于电子设备,如图1和图2所示,电子设备包括应用处理器(Application Process,AP)、多个不同类型的网卡以及网际互连协议加速器IPA,IPA用于对数据进行路由转发。本申请实施例中数据处理方法的执行主体即为AP。
例如网卡可以包括Wi-Fi网卡、USB网卡、调制解调器Modem网卡、以太网Ethernet网卡,IPA可以包括USB端点endpoint、Wi-Fi端点、高速串行计算机扩展总线标准(peripheral component interconnect express,pcie)端点、以太网端点和通信处理器(Communication Processor,CP)端点,上述各端点用于实现不同网络数据的传输,例如,其中USB端点用于传输USB数据,对应USB网卡,CP端点用于传输蜂窝数据,对应调制解调器网卡,Wi-Fi端点用于传输Wi-Fi数据,对应Wi-Fi网卡,以太网端点用于传输以太网数据,对应以太网网卡,另外,pcie端点也可以用于传输以太网数据,即对应以太网网卡。需要说明的是,以上各网卡以及端点仅为举例,根据需要,电子设备中可以包括更多类型的其他端点和网卡,也可以减少部分端点和网卡,本申请实施例对于具体的网卡数量、类型以及IPA中端点的数量、类型不做限定。
另外需要说明的是,在图2中,AP对应的框用于表示与AP相关的内容,例如包括AP所控制的实体器件和虚拟模块等,也就是说,图2中AP对应的框并不表示AP所包含的内容,而是表示与AP相关的内容。IPA还包括AP输出端点和AP输入端点,AP输出端点用于将IPA的数据输出至AP,AP输入端点用于将来自于AP的数据输入至IPA,其中AP输出端点可以通过AP的接收通道1至N来传输数据,AP输入端点可以通过AP的发送通道1至N来传输数据。
应用处理器包括网络子系统network subsystem,网络子系统具体属于TCP/IP协议层对应的虚拟模块,用于执行网络中TCP/IP协议层的相关处理。
IPA还包括路由/桥接(router/bridge)模块,可以用于实现不同端点之间的数据路由转发、桥接传输等,通过配置,可以实现加速的功能。
例如,当电子设备通过蜂窝网络接收数据时,数据首先通过IPA的CP端点输入,并通过IPA输出至AP,以使电子设备可以获取通过蜂窝网络接收数据,当电子设备通过蜂窝网络发送数据时,AP将数据发送至IPA,IPA由CP端点发送数据。另外,电子设备也可以通过其他通信方式传输数据,例如通过IPA中的USB端点、Wi-Fi端点、pcie端点或以太网端点通过对应的通信方式来传输数据。另外,利用IPA中路由/桥接模块的配置,还可以实现其他形式的数据传输,例如,IPA将通过CP端点接收到的蜂窝网络数据直接通过Wi-Fi端点发送出去,以实现Wi-Fi热点的功能。
如图3所示,本申请实施例中数据处理方法包括:
步骤101、获取来自于IPA的接收数据,即通过IPA上的AP输出端点获取接收数据;
步骤102、通过中断触发虚拟dummy网卡对接收数据进行分流,得到分流后的接收数据;
在本申请实施例中,会专门创建一个虚拟网卡,当IPA有接收数据到来之后,接收数据被缓存,由IPA驱动创建的填充任务fill task线程对接收数据进行填充,形成skb格式的接收数据,并且会中断触发虚拟网卡的新应用程序接口(New Application Programming Interface,NAPI)来读取数据,然后对接收数据进行分流,分流是指区别出接收数据对应哪一个具体的网卡,即所有网卡对应的接收数据均由虚拟网卡统一接收管理。
步骤103、通过应用处理器中的网络子系统获取分流后的接收数据。
本申请实施例中的数据处理方法,通过中断触发虚拟网卡对接收数据进行分流,由于数据传输的过程中本身就需要中断操作,因此可以复用其中的中断流程来实现接收数据的分流,从而无需通过独立的线程对数据进行分流,相对于通过独立的线程对数据进行分流的方式,降低了对处理器的资源消耗,且降低了RTT,并且由于所有的数据均通过虚拟网卡的中断统一处理,与不同网卡的数据需要分别中断处理相比,无需对应不同的网卡各自中断,从而降低了中断次数。
另外,由于所有网卡的接收数据均通过虚拟网卡统一处理,因此,可以针对接收数据中相同的操作集中完成,而对于不同网卡所需要的一些特殊处理,也可以在虚拟网卡对接收数据的处理完成之后再单独执行,之后再发送至应用处理器的网络子系统,例如,在一种可能的实施方式中,如果接收数据为USB网卡对应的数据、调制解调器网卡对应的数据或者以太网网卡对应的数据,则可以通过虚拟网卡分流之后,直接发送至应用处理器的网络子系统,而对于Wi-Fi网卡对应的接收数据,在通过虚拟网卡分流之后,还可以通过通知链的方式先给到Wi-Fi网卡对数据进行一些特殊处理,处理之后再发送至应用处理器的网络子系统,即本申请实施例对于上述步骤103、通过应用处理器中的网络子系统获取分流后的接收数据的具体过程不做限定,可以直接发送至网络子系统,也可以通过其他处理之后再发送网络子系统。
另外,IPA还可以具有硬件卸载offload功能,offload可以将本来通过AP执行的功能放在硬件IPA上完成,
在一种可能的实施方式中,如图4所示,上述步骤102、通过中断触发虚拟网卡对所述接收数据进行分流,得到分流后的接收数据的过程包括:
步骤1021、获取接收数据以及与接收数据对应的源标识(source,src)id和网络标识net id;
其中,中断触发虚拟网卡的NAPI读取数据之后,即可以进入步骤1021。src id用于标记网络类型,或者说网卡类型,例如0x1表示USB网卡,0x2表示Wi-Fi网卡,net id用于标记在同一网络类型或者说网卡类型下的网卡序号,例如上述调制解调器网卡,实际包括调制解调器网卡0至调制解调器网卡n多个调制解调器网卡,0表示网卡序号0,n表示网卡序号n,net id用于标记具体的网卡,例如Modem nic0表示调制解调器网卡0,Modem nicn表示调制解调器网卡n,USB nic表示USB网卡,Veth nic0表示以太网网卡0,Veth nicen表示以太网网卡n;
步骤1022、根据源标识src id和网络标识net id得到对应的设备标识(net  device,netdev);
表1
src id net id netdev
0x1 -1 USB nic
0x2 -1 Wi-Fi nic
0x6 0 Modem nic0
0x6 n Modem nicn
0x10 0 Veth nic0
0x10 n Veth nicn
其中,表1为源标识src id、网络标识net id和设备标识netdev的映射表,基于该映射表,可以根据src id和net id匹配得到对应的netdev,netdev即可以确定接收数据所对应的具体的网卡,其中映射表可以为数组结构,无需遍历查询或者计算key值。
步骤1023、根据设备标识netdev对接收数据进行配置,得到分流后的接收数据。
其中对接收数据进行配置,即在接收数据中将对应的netdev进行置位,即使接收数据中携带具体的netdev,然后可以调用接口将接收数据发送至应用处理器的网络子系统,以便于网络子系统可以根据netdev确定接收数据对应具体哪一个网卡。
在一种可能的实施方式中,数据处理方法还包括:获取来自于任意网卡的发送数据;将发送数据发送至IPA。对于来自于AP,需要由IPA发送的数据,由各网卡驱动分别调用IPA驱动提供的发送接口进行发送,发送完毕之后缓存的释放动作由IPA驱动创建的释放任务free task线程统一释放。也就是说,在本申请实施例中,对于需要使用IPA发送的发送数据,仍通过各网卡进行发送。
在一种可能的实施方式中,步骤101中获取来自于IPA的接收数据包括:获取来自于IPA的接收数据,并基于接收数据形成套接字缓存skb格式的接收数据,即通过由IPA驱动创建的填充任务fill task线程对接收数据进行填充,形成skb格式的接收数据。
如图5所示,本申请实施例还提供一种应用处理器,用于电子设备,电子设备包括网际互连协议加速器IPA,IPA用于对数据进行路由转发,应用处理器包括:第一获取模块10,用于获取来自于IPA的接收数据;分流模块20,用于通过中断触发虚拟网卡对接收数据进行分流,得到分流后的接收数据;第二获取模块30,用于通过应用处理器中的网络子系统获取分流后的接收数据。
其中,应用处理器具体可以应用上述任意实施例中的数据处理方法,具体过程和原理与上述实施例相同,在此不再赘述。
应理解以上图5所示应用处理器的各个模块的划分仅仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。且这些模块 可以全部以软件通过处理元件调用的形式实现;也可以全部以硬件的形式实现;还可以部分模块以软件通过处理元件调用的形式实现,部分模块通过硬件的形式实现。例如,第一获取模块10、分流模块20和第二获取模块30中的任意一者可以为单独设立的处理元件,也可以集成在应用处理器中,例如集成在应用处理器的某一个芯片中实现,此外,也可以以程序的形式存储于应用处理器的存储器中,由应用处理器的某一个处理元件调用并执行以上各个模块的功能。其它模块的实现与之类似。此外这些模块全部或部分可以集成在一起,也可以独立实现。这里所述的处理元件可以是一种集成电路,具有信号的处理能力。在实现过程中,上述方法的各步骤或以上各个模块可以通过处理器元件中的硬件的集成逻辑电路或者软件形式的指令完成。
例如,第一获取模块10、分流模块20和第二获取模块30这些模块可以是被配置成实施以上方法的一个或多个集成电路,例如:一个或多个特定集成电路(Application Specific Integrated Circuit,ASIC),或,一个或多个微处理器(digital singnal processor,DSP),或,一个或者多个现场可编程门阵列(Field Programmable Gate Array,FPGA)等。再如,当以上某个模块通过处理元件调度程序的形式实现时,该处理元件可以是通用处理器,例如中央处理器(Central Processing Unit,CPU)或其它可以调用程序的处理器。再如,这些模块可以集成在一起,以片上系统(system-on-a-chip,SOC)的形式实现。
在一种可能的实施方式中,分流模块20具体用于:获取接收数据以及与接收数据对应的源标识和网络标识;根据源标识和网络标识得到对应的设备标识;根据设备标识对接收数据进行配置,得到分流后的接收数据。
在一种可能的实施方式中,电子设备还包括多个不同类型的网卡,应用处理器还包括:第三获取模块(图中未示出),用于获取来自于任意网卡的发送数据;发送模块(图中未示出),用于将发送数据发送至IPA。
在一种可能的实施方式中,第一获取模块具体用于,获取来自于IPA的接收数据,并基于接收数据形成套接字缓存skb格式的接收数据。
本申请实施例还提供一种应用处理器,包括:主处理器和存储器,存储器用于存储至少一条指令,指令由主处理器加载并执行时以实现上述任意实施例中的数据处理方法。
其中,应用处理器具体可以应用上述任意实施例中的数据处理方法,具体过程和原理与上述实施例相同,在此不再赘述。
主处理器的数量可以为一个或多个,主处理器和存储器可以通过总线或者其他方式连接。存储器作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序、非暂态计算机可执行程序以及模块,如本申请实施例中的应用处理器对应的程序指令/模块。主处理器通过运行存储在存储器中的非暂态软件程序、指令以及模块,从而执行各种功能应用以及数据处理方法,即实现上述任意方法实施例中的方法。存储器可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;以及必要数据等。此外,存储器可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。
本申请实施例还提供一种电子设备,包括上述的应用处理器、多个不同类型的网卡以及网际互连协议加速器IPA。
本申请所涉及的电子设备可能为手机、客户终端设备(Customer Premise Equipment,CPE)、平板电脑、个人计算机(personal computer,PC)、车载设备或可穿戴设备等。
本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行上述任意实施例中的数据处理方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk)等。
本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示单独存在A、同时存在A和B、单独存在B的情况。其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项”及其类似表达,是指的这些项中的任意组合,包括单项或复数项的任意组合。例如,a,b和c中的至少一项可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。
以上仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (11)

  1. 一种数据处理方法,其特征在于,用于电子设备,所述电子设备包括应用处理器以及网际互连协议加速器IPA,所述IPA用于对数据进行路由转发,所述数据处理方法包括:
    获取来自于所述IPA的接收数据;
    通过中断触发虚拟网卡对所述接收数据进行分流,得到分流后的接收数据;
    通过所述应用处理器中的网络子系统获取所述分流后的接收数据。
  2. 根据权利要求1所述的数据处理方法,其特征在于,
    所述通过中断触发虚拟网卡对所述接收数据进行分流,得到分流后的接收数据的过程包括:
    获取所述接收数据以及与所述接收数据对应的源标识和网络标识;
    根据所述源标识和所述网络标识得到对应的设备标识;
    根据所述设备标识对所述接收数据进行配置,得到分流后的接收数据。
  3. 根据权利要求1所述的数据处理方法,其特征在于,所述电子设备还包括多个不同类型的网卡,所述方法还包括:
    获取来自于任意所述网卡的发送数据;
    将所述发送数据发送至所述IPA。
  4. 根据权利要求1所述的数据处理方法,其特征在于,
    所述获取来自于所述IPA的接收数据包括:
    获取来自于所述IPA的接收数据,并基于所述接收数据形成套接字缓存skb格式的接收数据。
  5. 一种应用处理器,其特征在于,用于电子设备,所述电子设备包括网际互连协议加速器IPA,所述IPA用于对数据进行路由转发,所述应用处理器包括:
    第一获取模块,用于获取来自于所述IPA的接收数据;
    分流模块,用于通过中断触发虚拟网卡对所述接收数据进行分流,得到分流后的接收数据;
    第二获取模块,用于通过所述应用处理器中的网络子系统获取所述分流后的接收数据。
  6. 根据权利要求5所述的应用处理器,其特征在于,
    所述分流模块具体用于:
    获取所述接收数据以及与所述接收数据对应的源标识和网络标识;
    根据所述源标识和所述网络标识得到对应的设备标识;
    根据所述设备标识对所述接收数据进行配置,得到分流后的接收数据。
  7. 根据权利要求5所述的应用处理器,其特征在于,所述电子设备还包括多个不同类型的网卡,所述应用处理器还包括:
    第三获取模块,用于获取来自于任意所述网卡的发送数据;
    发送模块,用于将所述发送数据发送至所述IPA。
  8. 根据权利要求5所述的应用处理器,其特征在于,
    所述第一获取模块具体用于,获取来自于所述IPA的接收数据,并基于所述接收 数据形成套接字缓存skb格式的接收数据。
  9. 一种应用处理器,其特征在于,包括:
    主处理器和存储器,所述存储器用于存储至少一条指令,所述指令由所述主处理器加载并执行时以实现如权利要求1至4中任意一项所述的数据处理方法。
  10. 一种电子设备,特征在于,包括如权利要求5至9中任意一项所述的应用处理器以及网际互连协议加速器IPA。
  11. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行如权利要求1至4中任意一项所述的数据处理方法。
PCT/CN2022/127352 2021-10-25 2022-10-25 数据处理方法、装置、电子设备和存储介质 WO2023072065A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111240330.4 2021-10-25
CN202111240330.4A CN113986969A (zh) 2021-10-25 2021-10-25 数据处理方法、装置、电子设备和存储介质

Publications (1)

Publication Number Publication Date
WO2023072065A1 true WO2023072065A1 (zh) 2023-05-04

Family

ID=79740891

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/127352 WO2023072065A1 (zh) 2021-10-25 2022-10-25 数据处理方法、装置、电子设备和存储介质

Country Status (2)

Country Link
CN (1) CN113986969A (zh)
WO (1) WO2023072065A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113986969A (zh) * 2021-10-25 2022-01-28 展讯通信(上海)有限公司 数据处理方法、装置、电子设备和存储介质
CN115442319B (zh) * 2022-08-31 2024-03-12 北京天融信网络安全技术有限公司 数据传输方法、电子设备和计算机可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100037035A1 (en) * 2008-08-11 2010-02-11 International Business Machines Corporation Generating An Executable Version Of An Application Using A Distributed Compiler Operating On A Plurality Of Compute Nodes
CN103281251A (zh) * 2013-06-18 2013-09-04 北京百度网讯科技有限公司 数据中心间的数据传输方法、系统及其子系统
CN111884902A (zh) * 2020-06-16 2020-11-03 四川速宝网络科技有限公司 一种vpn场景网络分流方法及装置
CN113986969A (zh) * 2021-10-25 2022-01-28 展讯通信(上海)有限公司 数据处理方法、装置、电子设备和存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100037035A1 (en) * 2008-08-11 2010-02-11 International Business Machines Corporation Generating An Executable Version Of An Application Using A Distributed Compiler Operating On A Plurality Of Compute Nodes
CN103281251A (zh) * 2013-06-18 2013-09-04 北京百度网讯科技有限公司 数据中心间的数据传输方法、系统及其子系统
CN111884902A (zh) * 2020-06-16 2020-11-03 四川速宝网络科技有限公司 一种vpn场景网络分流方法及装置
CN113986969A (zh) * 2021-10-25 2022-01-28 展讯通信(上海)有限公司 数据处理方法、装置、电子设备和存储介质

Also Published As

Publication number Publication date
CN113986969A (zh) 2022-01-28

Similar Documents

Publication Publication Date Title
WO2023072065A1 (zh) 数据处理方法、装置、电子设备和存储介质
TWI521437B (zh) 用於網路的方法和系統
US8913613B2 (en) Method and system for classification and management of inter-blade network traffic in a blade server
WO2020073903A1 (zh) 时延敏感网络通信方法及其装置
CN105511954A (zh) 一种报文处理方法及装置
WO2019129167A1 (zh) 一种处理数据报文的方法和网卡
US20160266925A1 (en) Data forwarding
WO2020038257A1 (en) Method for link aggregation and related products
KR102025680B1 (ko) Sdn 기반의 arp 구현 방법 및 장치
US20200364080A1 (en) Interrupt processing method and apparatus and server
WO2020034812A1 (zh) 用户面功能配置的方法、装置及设备
WO2019085907A1 (zh) 一种基于软件定义网络的数据发送方法、装置及系统
JP2008129767A (ja) ネットワーク装置
WO2015106623A1 (zh) 一种配置、下发流表项的方法及装置
CN110602001A (zh) 远端环回测试装置及方法
CN112019492B (zh) 访问控制方法、装置及存储介质
US20200244623A1 (en) Data transmission method, server and offload card
CN106790162B (zh) 虚拟网络优化方法与系统
WO2023010730A1 (zh) 数据包解析的方法和服务器
EP3136251B1 (en) Flit transmission method and device of network on chip
US9258273B2 (en) Duplicating packets efficiently within a network security appliance
CN114124804A (zh) 一种通信方法、装置以及系统
WO2019119836A1 (zh) 报文处理的方法和设备
JP2009116561A (ja) データ転送システム
KR101115098B1 (ko) 플로우 프로세싱 유닛 및 플로우 프로세싱 유닛 제어 방법

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22885942

Country of ref document: EP

Kind code of ref document: A1