Data processing method, device, electronic device and storage medium

By storing the data received by non-PMD-type network cards in the network data processing suite and using drainage functions to achieve compatibility, the adaptation problem of DPDK technology for non-PMD-type network cards is solved, reducing costs and expanding application scenarios.

CN116208573BActive Publication Date: 2024-11-08NEUSOFT CORP
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202211415427.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-11
Publication Date
2024-11-08
Estimated Expiration
2042-11-11

AI Technical Summary

Technical Problem

DPDK technology can only be adapted to PMD-type network cards, but cannot be compatible with non-PMD-type network cards, resulting in limited application scenarios and high cost.

Method used

When the target network card receives data, it is stored in the storage space determined by the network data processing suite, and the PMD type network card and the registered drainage function are used to drive the PMD type network card and realize compatibility with non-PMD type network card, enriching network processing Application scenarios of the suite.

Benefits of technology

This enables the network data processing suite to be compatible with various types of network cards, especially non-PMD-type network cards, thereby reducing product costs and expanding application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116208573B_ABST
    Figure CN116208573B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a data processing method, device, electronic device and storage medium. The method includes: in response to receiving target data through a target network card, storing the target data in a target storage space of the target device; processing the target data stored in the target storage space through the network data processing suite; wherein the target network card is a non-polling mode driven PMD type network card, and the target storage space is a storage space determined by the network data processing suite of the target device. In this way, the target data received through the target network card is stored in the target storage space determined by the network data processing suite, so that the network data processing suite can be compatible with various types of network cards, especially compatible with non-PMD type target network cards, thereby enriching the application scenarios of network processing suites (such as DPDK).
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular, to a data processing method, device, electronic device and storage medium. Background Art

[0002] As the amount of network data increases, the demand for high-speed data forwarding is also increasing. Data Plan Development Kit (DPDK) technology can be used to provide fast packet forwarding. DPDK is a high-performance network driver component developed by today's technology. It has the advantages of reducing interrupts, reducing memory copies, and reducing complexity through customized protocol stacks. It provides a simple, convenient, complete and fast packet processing solution for data plane applications.

[0003] However, among related technologies, DPDK technology has high requirements for network cards and its application scenarios are limited. Summary of the invention

[0004] In order to overcome the above problems existing in the related art, the present disclosure provides a data processing method, device, electronic device and storage medium.

[0005] According to a first aspect of an embodiment of the present disclosure, a data processing method is provided, the method comprising:

[0006] In response to receiving the target data through the target network card, the target data is stored in the target storage space of the target device; wherein the target network card is a non-polling mode driven PMD type network card, and the target storage space is a storage space determined by the network data processing kit of the target device;

[0007] The target data stored in the target storage space is processed by the network data processing suite.

[0008] In some embodiments, in response to receiving the target data through the target network card, storing the target data in a target storage space of the target device includes:

[0009] In response to receiving the target data through the target network card, storing the target data in the target queue;

[0010] When the target queue meets the target preset condition, the target data is transferred from the target queue to the target storage space.

[0011] In some embodiments, the method further comprises:

[0012] In the case where it is determined that the target network card is a non-PMD type network card, registering a target drainage function in a network card driver of the target network card;

[0013] In response to receiving the target data through the target network card, storing the target data in the target storage space of the target device includes:

[0014] When the target data is received through the target network card, the target data is stored in the target queue through the target drainage function.

[0015] In some embodiments, storing the target data into a target queue through the target drainage function comprises:

[0016] Determine the data type of the target data through the target drainage function;

[0017] When the data type is a preset type, the target data is stored in the target queue.

[0018] In some embodiments, the target preset conditions include:

[0019] The number of data to be transferred stored in the target queue is greater than or equal to a preset number; or,

[0020] The storage time length of the target data in the target queue is greater than or equal to a preset time length.

[0021] In some embodiments, the processing of the target data stored in the target storage space by the network data processing suite includes:

[0022] Determine the network card identifier corresponding to the target network card through the network data processing suite;

[0023] The target data is processed according to the network card identifier.

[0024] In some embodiments, the processing the target data according to the network card identifier includes:

[0025] Determine the entry identifier and target data structure corresponding to the target network card according to the network card identifier;

[0026] According to the target data structure and the entry identifier, the data structure of the target data is converted to obtain processed target data.

[0027] According to a second aspect of an embodiment of the present disclosure, a data processing device is provided, the device comprising:

[0028] A storage module, configured to store the target data in a target storage space of a target device in response to receiving the target data through a target network card; wherein the target network card is a non-polling mode driven PMD type network card, and the target storage space is a storage space determined by a network data processing kit of the target device;

[0029] A processing module is used to process the target data stored in the target storage space through the network data processing suite.

[0030] In some embodiments, the storage module is used to store the target data in a target queue in response to receiving the target data through a target network card; and transfer the target data from the target queue to the target storage space when the target queue meets a target preset condition.

[0031] In some embodiments, the apparatus further comprises:

[0032] A registration module, used for registering a target drainage function in a network card driver of the target network card when it is determined that the target network card is a non-PMD type network card;

[0033] The storage module is used to store the target data into the target queue through the target diversion function when the target data is received through the target network card.

[0034] In some embodiments, the storage module is used to determine the data type of the target data through the target diversion function; when the data type is a preset type, the target data is stored in the target queue.

[0035] In some embodiments, the target preset conditions include:

[0036] The number of data to be transferred stored in the target queue is greater than or equal to a preset number; or,

[0037] The storage time length of the target data in the target queue is greater than or equal to a preset time length.

[0038] In some embodiments, the processing module is used to determine the network card identifier corresponding to the target network card through the network data processing suite; and process the target data according to the network card identifier.

[0039] In some embodiments, the processing module is used to determine the entry identifier and target data structure corresponding to the target network card according to the network card identifier; and convert the data structure of the target data according to the target data structure and the entry identifier to obtain processed target data.

[0040] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a memory on which a computer program is stored; and a processor for executing the computer program in the memory to implement the steps of the method described in the first aspect of the present disclosure.

[0041] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in the first aspect of the present disclosure are implemented.

[0042] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: in response to receiving target data through a target network card, the target data is stored in the target storage space of the target device; the target data stored in the target storage space is processed by the network data processing suite; wherein the target network card is a non-polling mode driven PMD type network card, and the target storage space is a storage space determined by the network data processing suite of the target device. In this way, the target data received through the target network card is stored in the target storage space determined by the network data processing suite, so that the network data processing suite can be compatible with various types of network cards, especially non-PMD type network cards, thereby enriching the application scenarios of network processing suites (such as DPDK).

[0043] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0045] Figure 1 The invention is a flow chart of a data processing method according to an exemplary embodiment.

[0046] Figure 2 The figure is a flowchart of another data processing method according to an exemplary embodiment.

[0047] Figure 3 It is a structural schematic diagram of a data processing system for implementing the above data processing method according to an exemplary embodiment.

[0048] Figure 4 The present invention is a flowchart of a method for data interaction between a forwarding module user state and a forwarding module kernel state according to an exemplary embodiment.

[0049] Figure 5 It is a block diagram of a data processing device according to an exemplary embodiment.

[0050] Figure 6 is a block diagram of another data processing device according to an exemplary embodiment.

[0051] Figure 7 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0052] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0053] It should be noted that all actions of acquiring signals, information or data in the present disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.

[0054] In the description of the present disclosure, the terms used, such as "first", "second", etc., are used to distinguish similar objects and do not have to be understood as a specific order or sequence. In addition, in the description with reference to the accompanying drawings, the same symbols in different drawings represent the same elements unless otherwise stated.

[0055] In the description of the present disclosure, unless otherwise specified, "multiple" means two or more than two, and other quantifiers are similar thereto; "at least one item", "one or more items" or similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one item a can represent any number of a; for another example, one or more items among a, b and c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple; "and / or" is a kind of association relationship that describes the associated objects, indicating that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural.

[0056] Although operations or steps are described in a specific order in the drawings in the embodiments of the present disclosure, it should not be understood that it is required to perform these operations or steps in the specific order shown or in a serial order, or to perform all the operations or steps shown to obtain the desired results. In the embodiments of the present disclosure, these operations or steps can be performed in series; these operations or steps can also be performed in parallel; or some of these operations or steps can be performed.

[0057] First, the application scenario of the present disclosure is described. The present disclosure can be applied to network data processing scenarios. The data plane development kit DPDK can provide a simple, convenient, complete and fast packet processing solution for data plane applications. DPDK technology can work in the Linux user state space and is widely used in the development of layer 2 or layer 3 forwarding functions. In addition, desktop-level UTM (Unified Threat Management) products can be implemented based on DPDK technology. For example, network packet processing, memory management and CPU scheduling can be implemented in the user state of DPDK, effectively improving product performance.

[0058] It should be noted that when the Linux kernel receives data packets through the network card device, it can receive them through interrupt mode or polling mode, and the network card device can also be divided into two categories: PMD (Pool Mode Driver) type network card and non-PMD type network card. In the related technology, DPDK technology can only adapt to PMD type network cards, and for non-PMD type network cards, it is not compatible with DPDK technology, resulting in limited application scenarios of DPDK technology. PMD type network cards are often more expensive, resulting in higher costs for products using DPDK technology, so for network products based on DPDK technology, it is particularly important to be able to support non-PMD type network card communications for low-cost devices at the same time.

[0059] In order to solve the above problems, the present disclosure provides a data processing method, device, electronic device and storage medium, which store the target data received through the target network card to the target storage space determined by the network data processing suite, and process the target data stored in the target storage space through the network data processing suite, so that the network data processing suite can be compatible with various types of network cards, especially non-PMD type target network cards, thereby enriching the application scenarios of the network processing suite (such as DPDK).

[0060] The present disclosure is described below in conjunction with specific embodiments.

[0061] Figure 1is a flow chart of a data processing method according to an exemplary embodiment. The method can be applied to a target device, which can be any electronic device, such as a router, a firewall or a server. Figure 1 As shown, the method may include:

[0062] S101 . In response to receiving target data through a target network card, storing the target data in a target storage space of a target device.

[0063] The target network card is a non-polling mode driven PMD type network card, and the target storage space is a storage space determined by a network data processing kit of the target device.

[0064] In some embodiments, the target storage space may include memory, memory cache mbuf or hard disk space, etc.

[0065] S102: Process the target data stored in the target storage space through a network data processing suite.

[0066] In some embodiments, when the target network card is not a PMD type network card, the network card driver of the target network card can be modified, and the received target data can be stored in the target storage space through the network card driver. For example, a drainage function can be registered in the network card driver, and the target data can be drained to the target storage space through the drainage function.

[0067] In some embodiments, the network data processing suite may include DPDK. In other embodiments, the network data processing suite may include high-performance network data processing frameworks such as Windriver and netmap, and the present disclosure does not limit the specific type of the network data processing suite.

[0068] By adopting the above method, in response to receiving target data through a target network card, the target data is stored in a target storage space of a target device; the target data stored in the target storage space is processed by a network data processing suite; wherein the target network card is a non-PMD type network card, and the target storage space is a storage space determined by the network data processing suite of the target device. In this way, the target data received through the target network card is stored in the target storage space determined by the network data processing suite, so that the network data processing suite can be compatible with various types of network cards, especially with non-PMD type target network cards, thereby enriching the application scenarios of the network processing suite (such as DPDK).

[0069] Figure 2 FIG. 1 is a flow chart of another data processing method according to an exemplary embodiment. Figure 2 As shown, the above step S101 may include the following sub-steps:

[0070] S1011 . In response to receiving target data through a target network card, store the target data into a target queue.

[0071] In some embodiments, the target device may register a drainage function in the network card driver of the target network card according to the network card type, so as to process the target data (e.g., store, forward, or discard). For example, the target device may register a target drainage function in the network card driver of the target network card when it is determined that the target network card is not a PMD type; conversely, if the target network card is a PMD type network card, it is not necessary to register the target drainage function.

[0072] After the target diversion function has been registered in the network card driver of the target network card, when the target device receives the target data through the target network card, the target data can be stored in the target queue through the target diversion function.

[0073] In some implementations, the data type of the target data can be determined by the target drainage function; when the data type is a preset type, the target data is stored in the target queue.

[0074] For example, the data type may include control plane data and user plane data, wherein the preset type may be user plane data, and thus the user plane data may be stored in the target queue.

[0075] In other implementations, the target traffic diversion function may also directly store the target data into the target queue without considering the data type of the target data.

[0076] In some implementations, the step S1011 can be implemented by a kernel drainage module, and the kernel drainage module includes the target drainage function. In this way, by providing a kernel drainage module and registering a function pointer, the adaptability and extensibility of the product can be improved.

[0077] S1012: When the target queue meets the target preset condition, transfer the target data from the target queue to the target storage space.

[0078] In some embodiments of the present disclosure, the above target preset condition may include any one of the following conditions:

[0079] Preset condition 1: the number of data to be transferred stored in the target queue is greater than or equal to the preset number.

[0080] The data to be transferred includes data received from the target network card but not yet transferred to the target storage space, and the data to be transferred may include the above-mentioned target data. The preset number may be any preset value, such as 256, 512 or other any values.

[0081] It should be noted that the preset number may be less than or equal to the total queue length of the target queue, which is used to identify the total number of data to be transferred that can be stored in the target queue. For example, the total queue length of the target queue may be 1000, 2000 or any other value, and the preset number may be 1 / 2, 1 / 3 or any other proportion of the total queue length.

[0082] Preset condition 2: The storage time of the target data in the target queue is greater than or equal to the preset time.

[0083] Among them, the storage duration can represent the time difference from the moment when the target data enters the target queue to the current moment. In order to improve the efficiency of data forwarding, when the storage duration of the target data is greater than or equal to the preset duration, even if the target queue does not meet the above-mentioned preset condition one (that is, the number of data to be transferred stored in the target queue is less than the preset number), the target data can still be transferred from the target queue to the target storage space.

[0084] In some embodiments, the method of transferring target data from the target queue to the target storage space may include: transferring the target data together with all the data to be transferred in the target queue to the target storage space, which can improve the efficiency of data transfer and avoid multiple transfers.

[0085] In some embodiments, the above step S1012 can be implemented by an asynchronous queue packet receiving module, and the above target queue can be an asynchronous packet receiving and sending queue, that is, the entry and exit of the target queue can be done asynchronously without synchronization.

[0086] For example, through the asynchronous queue packet receiving module, the tasklet framework can be used to register the packet receiving queue processing function, which can transfer the target data from the target queue to the target storage space when the target queue meets the target preset conditions, thereby transferring the target data in the target queue that the kernel has directed to the target storage space, which is the storage space for data forwarding determined by the network data processing suite. In this way, through the asynchronous queue packet receiving module, the target data can be forwarded to the data forwarding module of the network data processing suite (such as DPDK), thereby achieving the compatibility of the network data processing suite with non-PMD type network card devices.

[0087] In some embodiments, the above step S102 may include:

[0088] The network card identification corresponding to the target network card is determined through the network data processing suite, and the target data is processed according to the network card identification.

[0089] There are multiple ways to process the target data according to the network card identifier, for example:

[0090] In some implementations, a network card identifier may be added to the target data to distinguish from which target network card the target data is received.

[0091] In some other implementations, the target data may be processed according to a target data structure, wherein the target data structure may be a pre-set data structure for encapsulating the target data.

[0092] In some other implementations, the entry identifier and target data structure corresponding to the target network card may be first determined according to the network card identifier; then, the data structure of the target data may be converted according to the target data structure and the entry identifier to obtain processed target data.

[0093] For example, when the target device is loading the network card driver, it can obtain the network card registration information corresponding to the target network card, and the network card registration information can include the network card identifier of the target network card and the target data structure, and the network card identifier can include the entry identifier and / or exit identifier corresponding to the target network card. The entry identifier is an identifier used when receiving data through the target network card, and the exit identifier can be an identifier used when sending data through the target network card.

[0094] In this way, the target device can process the target data according to the target data structure and the entry identifier. For example, the entry identifier can be added to the corresponding field position according to the target data structure.

[0095] It should be noted that the target device may include one or more target network cards. When the target device includes multiple target network cards, different target network cards correspond to different network card identifiers, and the target data structures corresponding to different target network cards may be the same or different. The target device may store the correspondence between the network card identifier and the target data structure.

[0096] In some embodiments of the present disclosure, the above method steps may be implemented by one or more software modules. Figure 3 FIG. 1 is a schematic diagram showing a structure of a data processing system for implementing the above data processing method according to an exemplary embodiment. Figure 3 As shown, the data processing system may include a network card driver 301, a kernel 302, a kernel traffic diversion module 303, an asynchronous queue packet receiving module 304, and a data forwarding module 305. The data forwarding module may be a forwarding module in a network data processing kit (eg, DPDK).

[0097] Among them, the kernel diversion module 303 can register the target diversion function in the network card driver 301 through the kernel 302. When the network card driver receives the target data through the target network card, the target data can be stored in the target queue through the target diversion function, thereby realizing the S1011 step in the above data processing method; the asynchronous queue packet receiving module 304 can transfer the target data from the target queue to the target storage space when the target queue meets the target preset conditions, thereby realizing the S1012 step in the above data processing method; the data forwarding module 305 can be used to process the target data stored in the target storage space through the network data processing suite, thereby realizing the S102 step in the above data processing method.

[0098] It should be noted that the above kernel may be a Linux system kernel, and the above modules in the data processing system may all be software modules running under the Linux system, and may run on the same processor or on different processors respectively.

[0099] In this way, through Figure 3 The data processing system shown can make the network data processing suite compatible with various types of network cards, especially non-PMD type target network cards, without making changes to the kernel, thereby enriching the application scenarios of the network processing suite (such as DPDK).

[0100] Furthermore, in some embodiments, the above-mentioned data processing system may also include a network card information registration and synchronization module 306, which may be used to: when the target device is loading the network card driver, obtain the network card registration information corresponding to the target network card from the network card driver 301, and synchronize the network card registration information to the data forwarding module 305.

[0101] The network card registration information may include the network card identification of the target network card and the target data structure, and the network card identification may include the entry identification and / or exit identification corresponding to the target network card. The entry identification is an identification used when receiving data through the target network card, and the exit identification may be an identification used when sending data through the target network card. In this way, the data forwarding module 305 can store the network card registration information of the target network card and process the target data according to the network card registration information.

[0102] In some embodiments, the data forwarding module 305 may include a forwarding module kernel state 3051 and a forwarding module user state 3052, wherein the kernel state (Kernel Mode) can be used to run operating system programs and operate hardware; the user state (User Mode) can be used to run user programs, and the forwarding module kernel state 3051 and the forwarding module user state 3052 can forward user state and kernel state data through a target transmission channel 3053, and the target transmission channel can be composed of one or more transmission queues.

[0103] When receiving target data through the target network card, the flow direction of the target data can be: network card driver->kernel->kernel drainage module->asynchronous queue packet receiving module->forwarding module kernel state->target channel->forwarding module user state.

[0104] When sending data through the target network card, the flow direction of the data transmission can be: forwarding module user state -> target channel -> forwarding module kernel state -> kernel -> network card driver.

[0105] In this way, data can be received and sent through the target network card.

[0106] For example, for a non-PMD type target network card, when the network card driver receives the target data through the target network card, the target data can be stored in the target queue through the pre-registered target diversion function; then, the target data is sent to the forwarding module kernel state through the asynchronous queue packet receiving module; the forwarding module kernel state can obtain the network card identifier of the target network card corresponding to the target data, determine the target data structure according to the network card identifier, write the entry identifier corresponding to the target network card into the target data structure, and then send the target data to the forwarding module user state through the pre-defined first label and the above-mentioned target transmission channel. The forwarding module user state can perform a series of processing on the target data, such as anti-virus processing of the firewall, etc. Among them, the above-mentioned first label can be called hook1, which can be used to characterize the data flow direction, such as the application program that processes the data, etc.

[0107] Furthermore, when the forwarding module user state has data that needs to be sent through the target network card, the forwarding module user state can also determine the network card identifier of the target network card for the data to be sent, and send the data to be sent to the forwarding module kernel state through the above-mentioned target transmission channel through a predefined second tag (also called hook2). After the forwarding module kernel state receives the data to be sent, it determines the exit identifier corresponding to the data to be sent through the network card identifier, and sends the data to be sent through the target network card.

[0108] In this way, packet receiving and packet sending based on a non-PMD type target network card can be achieved.

[0109] Figure 4 FIG. 1 is a flow chart showing a method for data interaction between a forwarding module user state and a forwarding module kernel state according to an exemplary embodiment. Figure 4 As shown, the forwarding module kernel state 3051 and the forwarding module user state 3052 can exchange data through the target transmission channel 3053, and the target transmission channel 3053 can include one or more transmission queues. For example, the target transmission channel 3053 can include the following at least 4 transmission queues: queue 1, queue 2, queue 3 and queue 4.

[0110] Among them, queue 1 and queue 2 can be used to transmit information from the forwarding module user state to the forwarding module kernel state, wherein queue 1 can be used to transmit the target memory address (such as the memory cache mbuf address) obtained by the forwarding module user state to the forwarding module kernel state, wherein the target memory address can be used to address the target storage space; queue 2 can be used to send the data packet information of the forwarding module user state to the forwarding module kernel state.

[0111] In some embodiments, the target memory address may be a virtual address corresponding to the forwarding module kernel state. For example, the forwarding module user state may determine a physical address for storing the target data, convert the physical address to obtain a first virtual address corresponding to the forwarding module kernel state, use the first virtual address as the target memory address, and transmit it to the forwarding module kernel state. Furthermore, the forwarding module user state may also convert the physical address to obtain a second virtual address corresponding to the forwarding module user state, so that the forwarding module user state processes the target data according to the second virtual address.

[0112] The above-mentioned queues 3 and 4 can be used to transmit information from the forwarding module kernel state to the forwarding module user state, wherein queue 3 can be used for the forwarding module kernel state to copy the received target data to the target storage space, and the target storage space can be determined based on the first virtual address transmitted through queue 1; queue 4 can be used for the forwarding module kernel state to notify the forwarding module user state to release memory resources. For example, when the packet is sent or packet loss processing is required, the forwarding module kernel state can notify the forwarding module user state through queue 4 to release the corresponding memory cache mbuf.

[0113] Figure 5 is a block diagram of a data processing device 500 according to an exemplary embodiment. Figure 5 As shown, the apparatus 500 may include:

[0114] The storage module 1101 is used for storing the target data in a target storage space of a target device in response to receiving the target data through a target network card; wherein the target network card is a network card driving the PMD in a non-polling mode, and the target storage space is a storage space determined by a network data processing kit of the target device;

[0115] The processing module 1102 is used to process the target data stored in the target storage space through the network data processing suite.

[0116] In some embodiments, the storage module 1101 is used to store the target data in a target queue in response to receiving the target data through the target network card; when the target queue meets the target preset conditions, the target data is transferred from the target queue to the target storage space.

[0117] Figure 6 is a block diagram of another data processing device according to an exemplary embodiment. Figure 6 As shown, the device 500 may also include:

[0118] A registration module 1103 is used to register a target diversion function in a network card driver of the target network card when it is determined that the target network card is a non-PMD network card;

[0119] The storage module 1101 is used for storing the target data into the target queue through the target diversion function when the target data is received through the target network card.

[0120] In some embodiments, the storage module 1101 is used to determine the data type of the target data through the target diversion function; when the data type is a preset type, the target data is stored in the target queue.

[0121] In some embodiments, the target preset conditions include:

[0122] The number of data to be transferred stored in the target queue is greater than or equal to a preset number; or,

[0123] The storage time length of the target data in the target queue is greater than or equal to a preset time length.

[0124] In some embodiments, the processing module 1102 is used to determine the network card identifier corresponding to the target network card through the network data processing suite; and process the target data according to the network card identifier.

[0125] In some embodiments, the processing module 1102 is used to determine the entry identifier and target data structure corresponding to the target network card according to the network card identifier; and convert the data structure of the target data according to the target data structure and the entry identifier to obtain processed target data.

[0126] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0127] Figure 7 FIG. 2 is a block diagram of an electronic device 2000 according to an exemplary embodiment. Figure 7 As shown, the electronic device 2000 may include: a processor 2001 and a memory 2002. The electronic device 2000 may also include one or more of a multimedia component 2003, an input / output (I / O) interface 2004, and a communication component 2005.

[0128] The processor 2001 is used to control the overall operation of the electronic device 2000 to complete all or part of the steps in the above-mentioned data processing method. The memory 2002 is used to store various types of data to support the operation of the electronic device 2000, and these data may include, for example, instructions for any application or method used to operate on the electronic device 2000, and application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 2002 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, magnetic disk or optical disk. The multimedia component 2003 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone, which is used to receive external audio signals. The received audio signal may be further stored in the memory 2002 or sent through the communication component 2005. The audio component also includes at least one speaker for outputting audio signals. The input / output interface 2004 provides an interface between the processor 2001 and other interface modules, and the above-mentioned other interface modules may be keyboards, mice, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 2005 is used for wired or wireless communication between the electronic device 2000 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, 5G, NB-IOT, eMTC, or other 6G, etc., or a combination of one or more of them, is not limited here. Therefore, the corresponding communication component 2005 may include: Wi-Fi module, Bluetooth module, NFC module, etc.

[0129] In an exemplary embodiment, the electronic device 2000 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned data processing method.

[0130] In another exemplary embodiment, there is also provided a computer-readable storage medium, which stores a computer program or program instructions, and when the computer program or program instructions are executed by the processor, the steps of the above-mentioned data processing method are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 2002 including program instructions, and the above-mentioned program instructions can be executed by the processor 2001 of the electronic device 2000 to complete the above-mentioned data processing method. By way of example, the computer-readable storage medium can be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0131] In another exemplary embodiment, a computer program product is also provided. The computer program product includes a computer program executable by a programmable device, and the computer program has a code portion for executing the above data processing method when executed by the programmable device.

[0132] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0133] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A data processing method, It is characterized in that The method comprises: In response to receiving the target data through the target network card, the target data is stored in the target storage space of the target device; wherein the target network card is a non-polling mode driven PMD type network card, and the target storage space is a storage space determined by the network data processing kit of the target device; The target data stored in the target storage space is processed by the network data processing suite.

2. The method according to claim 1, It is characterized in that In response to receiving the target data through the target network card, storing the target data in the target storage space of the target device includes: In response to receiving the target data through the target network card, storing the target data in the target queue; When the target queue meets the target preset condition, the target data is transferred from the target queue to the target storage space.

3. The method according to claim 2, It is characterized in that The method further comprises: In the case where it is determined that the target network card is a non-PMD type network card, registering a target drainage function in a network card driver of the target network card; In response to receiving the target data through the target network card, storing the target data in the target storage space of the target device includes: When the target data is received through the target network card, the target data is stored in the target queue through the target drainage function.

4. The method according to claim 3, It is characterized in that The storing the target data into the target queue through the target drainage function comprises: Determine the data type of the target data through the target drainage function; When the data type is a preset type, the target data is stored in the target queue.

5. The method according to claim 2, It is characterized in that The target preset conditions include: The number of data to be transferred stored in the target queue is greater than or equal to a preset number; or, The storage time length of the target data in the target queue is greater than or equal to a preset time length.

6. The method according to claim 1, It is characterized in that The processing of the target data stored in the target storage space by the network data processing suite includes: Determine the network card identifier corresponding to the target network card through the network data processing suite; The target data is processed according to the network card identifier.

7. The method according to claim 6, It is characterized in that The processing of the target data according to the network card identifier includes: Determine the entry identifier and target data structure corresponding to the target network card according to the network card identifier; According to the target data structure and the entry identifier, the data structure of the target data is converted to obtain processed target data.

8. A data processing device, It is characterized in that The device comprises: A storage module, configured to store the target data in a target storage space of a target device in response to receiving the target data through a target network card; wherein the target network card is a non-polling mode driven PMD type network card, and the target storage space is a storage space determined by a network data processing kit of the target device; A processing module is used to process the target data stored in the target storage space through the network data processing suite.

9. An electronic device, It is characterized in that include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • DPDK-based message processing method and computer equipment

    CN108628684A

  • Firewall design method based on programmable data plane

    CN111600852A

  • Real-time flow detection system and method compatible with multiple inference engines

    CN114189368A

  • Data acquisition method and device and computer readable medium

    CN114944996A

  • Data receiving method and device, data sending method and device, electronic equipment and medium

    CN115269213A