WO2018036007A1 - Method and apparatus for processing network data receiving, and storage medium - Google Patents

Method and apparatus for processing network data receiving, and storage medium Download PDF

Info

Publication number
WO2018036007A1
WO2018036007A1 PCT/CN2016/107150 CN2016107150W WO2018036007A1 WO 2018036007 A1 WO2018036007 A1 WO 2018036007A1 CN 2016107150 W CN2016107150 W CN 2016107150W WO 2018036007 A1 WO2018036007 A1 WO 2018036007A1
Authority
WO
WIPO (PCT)
Prior art keywords
network device
identifier
data packets
polling queue
network
Prior art date
Application number
PCT/CN2016/107150
Other languages
French (fr)
Chinese (zh)
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 WO2018036007A1 publication Critical patent/WO2018036007A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • H04L49/9063Intermediate storage in different physical parts of a node or terminal
    • H04L49/9068Intermediate storage in different physical parts of a node or terminal in the network interface card
    • H04L49/9073Early interruption upon arrival of a fraction of a packet

Definitions

  • the present invention relates to communication technologies, and in particular, to a method and device for processing network data reception, and a storage medium.
  • the Central Processing Unit usually uses an interrupt mechanism to process network data reception.
  • the existing interrupt mechanism is: when the network card receives the data packet, the network card sends an interrupt request to the CPU.
  • the CPU receives the interrupt request sent by the network card, it determines whether to call the interrupt processing program in the driver according to the specific interrupt setting. If the interrupt status is on, the interrupt handler in the NIC driver is called to receive the data packet, that is, the interrupt is completely received by the interrupt method. In the case of small data traffic load, this mechanism of interrupt processing reduces the processing time delay and greatly improves the CPU utilization.
  • the inventors of the present invention have found that when the network traffic is huge, the data packet cannot be effectively processed, and as the data packet continues to flow, the buffer queue is filled and the packet is lost.
  • the technical problem to be solved by the embodiments of the present invention is to provide a processing method and device for network data receiving, and a storage medium, to solve the problem that the interrupt mechanism is prone to interrupt livelock or packet loss when the network traffic is large.
  • the first embodiment of the present invention provides a method for processing network data reception, including:
  • the method further includes:
  • the method before the obtaining the identifier of the network device in the polling queue and obtaining the number of data packets corresponding to the network device according to the identifier of the network device, the method includes:
  • the method before the obtaining the identifier of the network device in the polling queue and obtaining the number of data packets corresponding to the network device according to the identifier of the network device, the method further includes:
  • the preset value P is determined according to the number of identifiers of the network devices in the polling queue.
  • the obtaining the identifier of the network device in the polling queue, and acquiring the number of data packets corresponding to the network device according to the identifier of the network device includes:
  • An embodiment of the present invention provides, in a second aspect, a processing apparatus for network data reception, including:
  • the obtaining module is configured to obtain an identifier of the network device in the polling queue, and obtain the number of data packets corresponding to the network device according to the identifier of the network device;
  • the determining module is configured to determine whether the number of data packets corresponding to the network device is greater than a preset value P;
  • the processing module is configured to process P data packets in the data packet corresponding to the network device when the number of data packets corresponding to the network device is greater than a preset value P.
  • the processing module is further configured to: when the number of data packets corresponding to the network device is less than a preset value P, process all data packets corresponding to the network device; The identifier of the network device whose number of data packets is less than a preset value P is deleted in the polling queue.
  • the method further includes:
  • a receiving module configured to: acquire, by the acquiring module, an identifier of the network device in the polling queue, and receive a data packet sent by the network device before acquiring the number of data packets corresponding to the network device according to the identifier of the network device And an interrupt request;
  • the method further includes: a calculating module, configured to acquire, by the acquiring module, an identifier of the network device in the polling queue, and obtain a data packet corresponding to the network device according to the identifier of the network device Before the quantity,
  • the preset value P is determined according to the number of identifiers of the network devices in the polling queue.
  • the embodiment of the present invention provides a processing device for receiving network data, including:
  • the embodiment of the present invention provides a storage medium storing executable instructions for performing the processing method of network data receiving provided by the embodiment of the present invention.
  • the processing method greatly reduces the interrupt overhead, and avoids packet loss by setting the number of processing packets once.
  • FIG. 1 is a flowchart of a method for processing network data reception according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a method for processing network data reception according to another embodiment of the present invention.
  • FIG. 3 is a flowchart of a method for processing network data reception according to still another embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a processing apparatus for receiving network data according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a processing apparatus for receiving network data according to another embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a processing apparatus for receiving network data according to still another embodiment of the present invention.
  • the identifier of the network device in the polling queue is obtained, and the number of data packets corresponding to the network device is obtained according to the identifier of the network device; and the number of data packets corresponding to the network device is determined. Whether the number of data packets corresponding to the network device is greater than the preset number, and processing the preset number of data packets in the data packet corresponding to the corresponding network device.
  • step S1 the identifier of the network device in the polling queue is obtained, and the number of data packets corresponding to the network device is obtained according to the identifier of the network device.
  • the network device is a peripheral device connected to the CPU, and may be a network card or the like.
  • the network device sends an interrupt request to the CPU.
  • the ID of the network device that receives multiple packets is stored in the polling queue.
  • step S2 it is determined whether the number of data packets corresponding to the network device is greater than a preset value P.
  • Step S3 if the number of data packets corresponding to the network device is greater than a preset value P, The P packets in the data packet corresponding to the network device (that is, the network device whose corresponding number of packets is larger than the preset value P) are processed.
  • step S1 the method includes:
  • Step S01 receiving a data packet sent by the network device and an interrupt request
  • the network device After registering the identity of the network device into the polling queue, the network device turns off the reception interrupt.
  • the network device by receiving the data packet sent by the network device and the interrupt request, registering the identifier of the network device in the polling queue according to the interrupt request, and adopting a polling manner to reduce the interruption.
  • the overhead guarantees the integrity of the data and avoids packet loss.
  • step S2 the method further includes:
  • step S5 the identifier of the network device whose number of data packets is less than a preset value P is deleted in the polling queue.
  • step S3 or S5 the next network device in the polling queue is acquired.
  • the identification of the above steps is repeated until there is no identifier for the network device in the polling queue.
  • the identification greatly reduces the interrupt overhead, and avoids packet loss by setting the number of processing packets once.
  • FIG. 2 is a flowchart of a method for processing network data reception according to another embodiment of the present invention.
  • the steps of the same reference numerals in FIG. 2 and FIG. 1 are applied to the same text description, and Let me repeat.
  • This embodiment further defines Embodiment 1.
  • the embodiment may include:
  • Step S04 Determine the preset value P according to the number of identifiers of the network device in the polling queue.
  • the preset value P is smaller to ensure that all network devices in the polling queue are accessed once in a certain time interval.
  • step S03 and step S04 may be set to be executed after the preset number of times is updated in the polling queue, or may be set to be executed after a preset time.
  • the preset value P is determined according to the number of identifiers of the network devices in the polling queue.
  • the value of the preset value P may be corrected according to the number of the identifiers of the updated network device.
  • the number of processing of the data packet can be adaptively increased or decreased, and the fair scheduling of the plurality of network devices is realized, and the real-time performance of the data processing is ensured.
  • step S03 and step S01 are not limited. What is shown in the drawings is only an implementation and is not a limitation of the order of execution.
  • FIG. 3 is a flowchart of a method for processing network data reception according to still another embodiment of the present invention.
  • the steps of the same reference numerals in FIG. 3 and FIG. 1 are applied to the same text description, and FIG. Let me repeat.
  • This embodiment further defines step S1 of the first embodiment. As shown in FIG. 3, step S1 in this embodiment may specifically include:
  • Step S101 Acquire, according to the identifier of the network device in the polling queue, the communication traffic of each network device in the polling queue.
  • Step S102 Calculate a preset time according to the communication traffic of each network device in the polling queue
  • step S103 the identifier of the network device in the polling queue is obtained according to the preset time, and the number of data packets corresponding to the network device is obtained according to the identifier of the network device.
  • the calculation of the preset time can be achieved by setting a timer.
  • the timer starts timing when there is data update in the polling queue. When the preset time is reached, the timer notifies the CPU to process the data packet. The timer is reset when the CPU starts data processing.
  • the timer determines the time interval of the next polling by querying the status of the current network, and adjusts the frequency of the timer to achieve the purpose of adaptive network conditions. If the network is in a large amount of traffic and the data buffer update frequency is high, then the corresponding polling frequency is increased, that is, the timer interval is reduced, and the preset time is shortened. If the amount of data on the network is small, the polling frequency is reduced accordingly, and the time interval of the timer is increased to increase the preset time.
  • the step S1 may further include: determining whether the network device exists in the polling queue, and when there is an identifier of the network device in the polling queue, performing step S101, when the identifier of the network device does not exist in the polling queue. , receiving interrupts.
  • the preset time is calculated according to the communication traffic of each network device in the polling queue, and the identifier of the network device in the polling queue is obtained according to the preset time, and is obtained according to the identifier of the network device.
  • the number of data packets corresponding to the network device, according to network traffic Time is adjusted to improve the effectiveness of user process and kernel space data interaction.
  • FIG. 4 is a schematic structural diagram of a processing apparatus for receiving network data according to an embodiment of the present invention. As shown in FIG. 4, the apparatus 10 includes:
  • the obtaining module 1 is configured to obtain the identifier of the network device in the polling queue, and obtain the number of data packets corresponding to the network device according to the identifier of the network device.
  • the determining module 2 is configured to determine whether the number of data packets corresponding to the network device is greater than a preset value P.
  • the processing module 3 is configured to process P data packets in the data packet corresponding to the network device when the number of data packets corresponding to the network device is greater than a preset value P.
  • the invention obtains the identifier of the network device in the polling queue, and when the number of data packets corresponding to the network device is greater than the preset value P, processes P packets in the data packet corresponding to the network device, and uses polling.
  • the way of processing greatly reducing the interrupt overhead, by setting the number of processing packets once, to avoid packet loss.
  • the processing module 3 is further configured to: when the number of data packets corresponding to the network device is less than a preset value P, process all data packets corresponding to the network device; in the polling queue And deleting an identifier of the network device whose number of data packets is less than a preset value P.
  • the identification greatly reduces the interrupt overhead, and avoids packet loss by setting the number of processing packets once.
  • FIG. 5 is a schematic structural diagram of a processing apparatus for receiving network data according to another embodiment of the present invention. The steps of the same reference numerals in FIG. 5 and FIG. 4 are applied to the same text as FIG. 4. The word description will not be repeated here.
  • the device 10 further includes:
  • the receiving module 4 is configured to: before the acquiring module 1 acquires the identifier of the network device in the polling queue, and obtain the number of data packets corresponding to the network device according to the identifier of the network device, receive the sending by the network device a data packet and an interrupt request; according to the interrupt request, registering an identifier of the network device into the polling queue.
  • the network device by receiving the data packet sent by the network device and the interrupt request, registering the identifier of the network device in the polling queue according to the interrupt request, and adopting a polling manner to reduce the interruption.
  • the overhead guarantees the integrity of the data and avoids packet loss.
  • FIG. 6 is a schematic structural diagram of a processing apparatus for receiving network data according to still another embodiment of the present invention. The steps of the same reference numerals in FIG. 6 and FIG. 4 are applied to the same text description, and FIG. Let me repeat. As shown in FIG. 6, the device 10 further includes:
  • the calculation module 5 is configured to acquire the identifier of the network device in the polling queue, and acquire the number of data packets corresponding to the network device according to the identifier of the network device, and obtain the polling queue.
  • the number of identifiers of the network device determining the preset value P according to the number of identifiers of the network devices in the polling queue.
  • the acquiring module 1 is configured to: obtain, according to the identifier of the network device in the polling queue, the communication traffic of each network device in the polling queue; according to each network in the polling queue The communication traffic of the device is calculated by the preset time; the identifier of the network device in the polling queue is obtained according to the preset time, and the number of data packets corresponding to the network device is obtained according to the identifier of the network device.
  • the preset time is calculated according to the communication traffic of each network device in the polling queue, and the identifier of the network device in the polling queue is obtained according to the preset time, and according to the The identifier of the network device acquires the number of data packets corresponding to the network device, and adjusts the preset time according to the network traffic, thereby improving the effectiveness of the interaction between the user process and the kernel space data.
  • modules shown in FIG. 4 and FIG. 5 are partitioning of the network data receiving device at the logical function level. According to the understanding of FIG. 4 and FIG. 5, some of the modules may also be merged, or Some modules are further divided to implement various optional structures of the network data receiving device.
  • the processing device for network data reception can also implement the functions of the above modes by the processor and the memory, and the instructions of the executable instructions in the memory are executed by the memory.
  • the memory can be implemented in a microprocessor (MCU), which can be implemented in a variety of volatile or non-volatile storage media.
  • MCU microprocessor
  • the memory and processor may be implemented in an integrated manner using an application specific integrated circuit (ASIC), a logic programmable gate (FPGA), or a complex programmable logic device (CPLD).
  • ASIC application specific integrated circuit
  • FPGA logic programmable gate
  • CPLD complex programmable logic device
  • the network device is used as an example for the network card.
  • the processing method of the network device by the system may be changed when the first data packet arrives.
  • the specific method is:
  • the NIC When the first packet arrives, the NIC generates a hardware interrupt and the system then enters interrupt processing. The system closes the receiving interrupt of the network card, registers the network card device into the polling queue, then wakes up the soft interrupt and enters the polling processing program.
  • the processor uses the polling mode to perform data reading on the network device in the polling queue. Before each reading, it is determined whether there is fixed quota data in the buffer of the network card, and if so, the data in the network card buffer is obtained. If the packet is not sufficiently fixed, the network device is logged out of the polling queue after all data has been read.
  • the present invention approaches the interrupt mode in the case of light load, and the response speed is fast; in the case of heavy load, it approaches the polling mode, efficiently processes the data packet and avoids the interruption in the case of heavy load. Live lock and packet loss issues.
  • the adjustable interrupt polling completes the effective reading of data from the network card to the kernel, and the user process reading data from the kernel is also an important part of improving the data reception of the high speed network.
  • Adapted polling daemon technology the specific approach is:
  • the upper application uses polling to monitor the status of the data buffer update.
  • a timer is turned on and the application is temporarily hibernated. If the polling is not turned on within the time specified by the timer, the timer wakes up the upper application to process the data.
  • the timer will start timing again.
  • the time interval of the next polling is determined by querying the current running state, and the frequency of the timer is adjusted to achieve the purpose of adaptive network conditions.
  • the network is in a large amount of traffic and the data buffer update frequency is high, increase the polling frequency accordingly and decrease the timer interval. If the amount of data on the network is small, the polling frequency is reduced accordingly, and the time interval of the timer is increased.
  • the quota (preset value P) can effectively solve the fair scheduling problem of multiple network devices.
  • the quota is set to be large, when there are many network devices in the polling queue, the data packets of each network device cannot be processed in time, so that the real-time performance of the data cannot be guaranteed.
  • the set quota is small and there are not many devices in the polling queue, it will cause frequent context switching, resulting in unnecessary overhead.
  • the adjustable maximum quota technology can dynamically change the number of readable quotas according to the number of network devices in the polling queue, thus ensuring data real-time and system effectiveness.
  • the inventors of the present invention have also noticed that in the case of a multi-core multi-network device, when a continuous flow of data packets comes, if the CPU is not specifically limited, that is, each CPU can be used to process the network. Device data packets, so that multiple CPUs can be used simultaneously to process a large number of data packets sent from multiple network devices. Since the hard interrupt is closed before the NIC soft interrupt is executed, no interruption can interrupt such processing. The process until the soft interrupt ends itself. In extreme cases, because no processor can be used to process other processes, it can cause the system to crash. Accordingly, the present invention proposes to limit the processing of network device data packets by a particular CPU, thereby avoiding the collapse of the system in such extreme cases while ensuring efficient use of the processor.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)

Abstract

The present invention relates to a method and apparatus for processing network data receiving, and a storage medium. The method comprises: acquiring an identifier of a network device in a polling queue, and acquiring the number of data packets corresponding to the network device according to the identifier of the network device; determining whether the number of data packets corresponding to the network device is greater than a preset number; and if the number of data packets corresponding to the network device is greater than the preset number, processing the preset number of data packets in the data packets corresponding to the network device. By using a polling processing approach, the interrupt overheads are reduced, and the packet loss is avoided by setting the number of data packets processed once.

Description

网络数据接收的处理方法及装置、存储介质Network data receiving processing method and device, storage medium 技术领域Technical field
本发明涉及通信技术,尤其涉及一种网络数据接收的处理方法及装置、存储介质。The present invention relates to communication technologies, and in particular, to a method and device for processing network data reception, and a storage medium.
背景技术Background technique
目前,中央处理器(Central Processing Unit,缩写:CPU)通常采用中断机制来进行网络数据接收的处理。At present, the Central Processing Unit (CPU) usually uses an interrupt mechanism to process network data reception.
现有的中断机制为,当网卡收到数据包后,网卡会向CPU发送中断请求,当CPU收到网卡发送的中断请求后,根据具体的中断设置,判断是否调用驱动中的中断处理程序,如果是开中断状态则会调用网卡驱动中的中断处理程序接收数据包,即完全靠中断方式来收包。在数据流量负载不大的情况下,这种中断处理的机制减少了处理的时间延迟,大大提高了CPU的利用率。The existing interrupt mechanism is: when the network card receives the data packet, the network card sends an interrupt request to the CPU. When the CPU receives the interrupt request sent by the network card, it determines whether to call the interrupt processing program in the driver according to the specific interrupt setting. If the interrupt status is on, the interrupt handler in the NIC driver is called to receive the data packet, that is, the interrupt is completely received by the interrupt method. In the case of small data traffic load, this mechanism of interrupt processing reduces the processing time delay and greatly improves the CPU utilization.
但是,基于此,本发明的发明人发现,当网络流量巨大的时候,数据包无法被有效处理,随着数据包的不断涌进,就会塞满缓冲队列,造成丢包。However, based on this, the inventors of the present invention have found that when the network traffic is huge, the data packet cannot be effectively processed, and as the data packet continues to flow, the buffer queue is filled and the packet is lost.
发明内容Summary of the invention
有鉴于此,本发明实施例要解决的技术问题是,提供一种网络数据接收的处理方法及装置、存储介质,以解决中断机制在网络流量大时容易出现中断活锁或丢包的问题。In view of this, the technical problem to be solved by the embodiments of the present invention is to provide a processing method and device for network data receiving, and a storage medium, to solve the problem that the interrupt mechanism is prone to interrupt livelock or packet loss when the network traffic is large.
为解决以上技术问题,本发明实施例在第一方面提供一种网络数据接收的处理方法,包括: To solve the above technical problem, the first embodiment of the present invention provides a method for processing network data reception, including:
获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量;Obtaining an identifier of the network device in the polling queue, and acquiring, according to the identifier of the network device, a number of data packets corresponding to the network device;
判断所述网络设备对应的数据包数量是否大于预设值P;Determining whether the number of data packets corresponding to the network device is greater than a preset value P;
若所述网络设备对应的数据包数量大于预设值P,则对所述网络设备对应的数据包中的P个数据包进行处理。And if the number of data packets corresponding to the network device is greater than a preset value P, processing P data packets in the data packet corresponding to the network device.
在一种可能的实现方式中,在判断所述网络设备对应的数据包数量是否大于预设值P之后,还包括:In a possible implementation manner, after determining whether the number of data packets corresponding to the network device is greater than a preset value P, the method further includes:
若所述网络设备对应的数据包数量小于预设值P,对所述网络设备对应的全部数据包进行处理;If the number of data packets corresponding to the network device is less than a preset value P, process all data packets corresponding to the network device;
在所述轮询队列中删除所述数据包数量小于预设值P的所述网络设备的标识。And deleting, in the polling queue, an identifier of the network device that the number of data packets is less than a preset value P.
在一种可能的实现方式中,在所述获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量之前,包括:In a possible implementation, before the obtaining the identifier of the network device in the polling queue and obtaining the number of data packets corresponding to the network device according to the identifier of the network device, the method includes:
接收所述网络设备发送的数据包以及中断请求;Receiving a data packet sent by the network device and an interrupt request;
根据所述中断请求,将所述网络设备的标识注册到所述轮询队列中。And registering, according to the interrupt request, an identifier of the network device into the polling queue.
在一种可能的实现方式中,在所述获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量之前,还包括:In a possible implementation, before the obtaining the identifier of the network device in the polling queue and obtaining the number of data packets corresponding to the network device according to the identifier of the network device, the method further includes:
获取所述轮询队列中所述网络设备的标识的数量;Obtaining, by the number of identifiers of the network device in the polling queue;
根据所述轮询队列中所述网络设备的标识的数量,确定所述预设值P。The preset value P is determined according to the number of identifiers of the network devices in the polling queue.
在一种可能的实现方式中,所述获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量,包括:In a possible implementation, the obtaining the identifier of the network device in the polling queue, and acquiring the number of data packets corresponding to the network device according to the identifier of the network device, includes:
根据所述轮询队列中网络设备的标识,获取所述轮询队列中每个网络设备的通信流量; Obtaining, according to the identifier of the network device in the polling queue, the communication traffic of each network device in the polling queue;
根据所述轮询队列中每个网络设备的通信流量计算预设时间;Calculating a preset time according to communication traffic of each network device in the polling queue;
根据所述预设时间,获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量。Obtaining an identifier of the network device in the polling queue according to the preset time, and acquiring the number of data packets corresponding to the network device according to the identifier of the network device.
本发明实施例在第二方面提供一种网络数据接收的处理装置,包括:An embodiment of the present invention provides, in a second aspect, a processing apparatus for network data reception, including:
获取模块,配置为获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量;The obtaining module is configured to obtain an identifier of the network device in the polling queue, and obtain the number of data packets corresponding to the network device according to the identifier of the network device;
判断模块,配置为判断所述网络设备对应的数据包数量是否大于预设值P;The determining module is configured to determine whether the number of data packets corresponding to the network device is greater than a preset value P;
处理模块,配置为在所述网络设备对应的数据包数量大于预设值P时,对所述网络设备对应的数据包中的P个数据包进行处理。The processing module is configured to process P data packets in the data packet corresponding to the network device when the number of data packets corresponding to the network device is greater than a preset value P.
在一种可能的实现方式中,所述处理模块还配置为,在所述网络设备对应的数据包数量小于预设值P时,对所述网络设备对应的全部数据包进行处理;在所述轮询队列中删除所述数据包数量小于预设值P的所述网络设备的标识。In a possible implementation manner, the processing module is further configured to: when the number of data packets corresponding to the network device is less than a preset value P, process all data packets corresponding to the network device; The identifier of the network device whose number of data packets is less than a preset value P is deleted in the polling queue.
在一种可能的实现方式中,还包括:In a possible implementation manner, the method further includes:
接收模块,配置为在所述获取模块获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量之前,接收所述网络设备发送的数据包以及中断请求;a receiving module, configured to: acquire, by the acquiring module, an identifier of the network device in the polling queue, and receive a data packet sent by the network device before acquiring the number of data packets corresponding to the network device according to the identifier of the network device And an interrupt request;
根据所述中断请求,将所述网络设备的标识注册到所述轮询队列中。And registering, according to the interrupt request, an identifier of the network device into the polling queue.
在一种可能的实现方式中,还包括:计算模块,配置为在所述获取模块获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量之前,In a possible implementation, the method further includes: a calculating module, configured to acquire, by the acquiring module, an identifier of the network device in the polling queue, and obtain a data packet corresponding to the network device according to the identifier of the network device Before the quantity,
获取所述轮询队列中所述网络设备的标识的数量;Obtaining, by the number of identifiers of the network device in the polling queue;
根据所述轮询队列中所述网络设备的标识的数量,确定所述预设值P。The preset value P is determined according to the number of identifiers of the network devices in the polling queue.
在一种可能的实现方式中,所述获取模块还配置为: In a possible implementation manner, the obtaining module is further configured to:
根据所述轮询队列中网络设备的标识,获取所述轮询队列中每个网络设备的通信流量;Obtaining, according to the identifier of the network device in the polling queue, the communication traffic of each network device in the polling queue;
根据所述轮询队列中每个网络设备的通信流量计算预设时间;Calculating a preset time according to communication traffic of each network device in the polling queue;
根据所述预设时间,获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量。Obtaining an identifier of the network device in the polling queue according to the preset time, and acquiring the number of data packets corresponding to the network device according to the identifier of the network device.
本发明实施例在第三方面提供一种网络数据接收的处理装置,包括:The embodiment of the present invention provides a processing device for receiving network data, including:
处理器和存储器,所述存储器中存储有可执行指令,所述可执行指令用于引起所述处理器执行以下操作:a processor and a memory having stored therein executable instructions for causing the processor to perform the following operations:
获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量;Obtaining an identifier of the network device in the polling queue, and acquiring, according to the identifier of the network device, a number of data packets corresponding to the network device;
判断所述网络设备对应的数据包数量是否大于预设数量;Determining whether the number of data packets corresponding to the network device is greater than a preset number;
若所述网络设备对应的数据包数量大于所述预设数量,则对相应网络设备对应的数据包中所述预设数量的数据包进行处理。If the number of data packets corresponding to the network device is greater than the preset number, processing the preset number of data packets in the data packet corresponding to the corresponding network device.
本发明实施例在第四方面提供一种存储介质,存储有可执行指令,用于执行本发明实施例提供的网络数据接收的处理方法。The embodiment of the present invention provides a storage medium storing executable instructions for performing the processing method of network data receiving provided by the embodiment of the present invention.
本发明实施例具有以下有益效果:Embodiments of the present invention have the following beneficial effects:
通过获取轮询队列中的网络设备的标识,当网络设备对应的数据包数量大于预设值P时,对所述网络设备对应的数据包中的P个数据包进行处理,采用轮询方式的处理方式,大大减少了中断开销,通过设置一次数据包的处理个数,避免丢包。By acquiring the identifier of the network device in the polling queue, when the number of data packets corresponding to the network device is greater than the preset value P, the P packets in the data packet corresponding to the network device are processed, and the polling manner is adopted. The processing method greatly reduces the interrupt overhead, and avoids packet loss by setting the number of processing packets once.
附图说明DRAWINGS
包含在说明书中并且构成说明书的一部分的附图与说明书一起示出了本发明的示例性实施例、特征和方面,并且用于解释本发明的原理。The accompanying drawings, which are incorporated in FIG
图1示出本发明实施例提供的网络数据接收的处理方法的流程图;FIG. 1 is a flowchart of a method for processing network data reception according to an embodiment of the present invention;
图2示出本发明另一实施例提供的网络数据接收的处理方法的流程图; 2 is a flowchart of a method for processing network data reception according to another embodiment of the present invention;
图3示出发明再一实施例提供的网络数据接收的处理方法的流程图;FIG. 3 is a flowchart of a method for processing network data reception according to still another embodiment of the present invention;
图4示出本发明实施例提供的网络数据接收的处理装置的结构示意图;FIG. 4 is a schematic structural diagram of a processing apparatus for receiving network data according to an embodiment of the present invention;
图5示出本发明另一实施例提供的网络数据接收的处理装置的结构示意图;FIG. 5 is a schematic structural diagram of a processing apparatus for receiving network data according to another embodiment of the present invention;
图6示出本发明再一实施例提供的网络数据接收的处理装置的结构示意图。FIG. 6 is a schematic structural diagram of a processing apparatus for receiving network data according to still another embodiment of the present invention.
具体实施方式detailed description
下面结合附图,对本发明的具体实施方式进行详细描述,但应当理解本发明的保护范围并不受具体实施方式的限制。The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings, but it is understood that the scope of the present invention is not limited by the specific embodiments.
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。除非另有其它明确表示,否则在整个说明书和权利要求书中,术语“包括”或其变换如“包含”或“包括有”等等将被理解为包括所陈述的元件或组成部分,而并未排除其它元件或其它组成部分。The technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention. The term "comprising" or variations such as "comprises" or "comprises", etc., are to be understood to include the recited elements or components, and Other components or other components are not excluded.
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustrative." Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or preferred.
另外,为了更好的说明本发明,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本发明同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件未作详细描述,以便于凸显本发明的主旨。In addition, numerous specific details are set forth in the Detailed Description of the invention in the Detailed Description. Those skilled in the art will appreciate that the invention may be practiced without some specific details. In some instances, methods, means, and components that are well known to those skilled in the art are not described in detail in order to facilitate the invention.
本发明的发明人发现,当网络流量巨大的时候,相关技术会频繁地进行中断处理和切换,一旦中断负荷超过了最大无损转发率时,CPU就无法 响应其他任务,造成中断活锁。同时,如果当前正在处理前一个数据包时,下一个数据包到来时发出的中断可能会打断前面的过程。这种频繁的打断使得之前的数据包无法有效处理,随着数据包的不断涌进,就会塞满缓冲队列,造成丢包。The inventors of the present invention have found that when the network traffic is huge, the related technology frequently performs interrupt processing and switching, and once the interrupt load exceeds the maximum lossless forwarding rate, the CPU cannot Respond to other tasks, causing an interrupted livelock. At the same time, if the previous packet is currently being processed, the interrupt that is sent when the next packet arrives may interrupt the previous process. This frequent interruption makes the previous data packets unable to be processed effectively. As the data packets continue to flow in, the buffer queues are filled and the packets are lost.
针对上述问题,本发明各实施例中获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量;判断所述网络设备对应的数据包数量是否大于预设数量;若所述网络设备对应的数据包数量大于所述预设数量,则对相应网络设备对应的数据包中所述预设数量的数据包进行处理。For the above problem, in the embodiments of the present invention, the identifier of the network device in the polling queue is obtained, and the number of data packets corresponding to the network device is obtained according to the identifier of the network device; and the number of data packets corresponding to the network device is determined. Whether the number of data packets corresponding to the network device is greater than the preset number, and processing the preset number of data packets in the data packet corresponding to the corresponding network device.
下面结合具体实施例进行说明。The following description will be made in conjunction with specific embodiments.
实施例1Example 1
图1示出本发明实施例提供的网络数据接收的处理方法的流程图,如图1所示,该方法包括:FIG. 1 is a flowchart of a method for processing network data reception according to an embodiment of the present invention. As shown in FIG. 1, the method includes:
步骤S1,获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量。In step S1, the identifier of the network device in the polling queue is obtained, and the number of data packets corresponding to the network device is obtained according to the identifier of the network device.
具体地,网络设备为与CPU连接的外设,可以为网卡等。当第一个数据包到达网络设备时,网络设备向CPU发送中断请求。轮询队列中存储有多个接收到数据包的网络设备的标识。Specifically, the network device is a peripheral device connected to the CPU, and may be a network card or the like. When the first packet arrives at the network device, the network device sends an interrupt request to the CPU. The ID of the network device that receives multiple packets is stored in the polling queue.
网络设备将接收到的数据包存储到与网络设备对应的寄存器中,当CPU获取轮询队列中的网络设备的标识时,从相应的寄存器中获取网络设备对应的数据包数量。The network device stores the received data packet in a register corresponding to the network device. When the CPU acquires the identifier of the network device in the polling queue, the network device obtains the number of data packets corresponding to the network device from the corresponding register.
步骤S2,判断所述网络设备对应的数据包数量是否大于预设值P。In step S2, it is determined whether the number of data packets corresponding to the network device is greater than a preset value P.
其中,预设值P可以为根据经验值预先设定的,也可以为根据当前网络状态计算得到的。The preset value P may be preset according to an empirical value, or may be calculated according to a current network state.
步骤S3,若所述网络设备对应的数据包数量大于预设值P,则对所述 网络设备(即对应的数据包数量大于预设值P的网络设备)对应的数据包中的P个数据包进行处理。Step S3, if the number of data packets corresponding to the network device is greater than a preset value P, The P packets in the data packet corresponding to the network device (that is, the network device whose corresponding number of packets is larger than the preset value P) are processed.
本发明实施例通过获取轮询队列中的网络设备的标识,当网络设备对应的数据包数量大于预设值P时,对所述网络设备对应的数据包中的P个数据包进行处理,采用轮询方式的处理方式,大大减少了中断开销,通过设置一次数据包的处理个数,避免丢包。The embodiment of the present invention obtains the identifier of the network device in the polling queue, and when the number of data packets corresponding to the network device is greater than the preset value P, processes P data packets in the data packet corresponding to the network device, and adopts The processing method of the polling mode greatly reduces the interrupt overhead, and avoids packet loss by setting the number of processing packets once.
可选的,在步骤S1之前,包括:Optionally, before step S1, the method includes:
步骤S01,接收所述网络设备发送的数据包以及中断请求;Step S01, receiving a data packet sent by the network device and an interrupt request;
步骤S02,根据所述中断请求,将所述网络设备的标识注册到所述轮询队列中。Step S02: Register the identifier of the network device into the polling queue according to the interrupt request.
具体地,轮询队列中存储有多个接收到数据包的网络设备的标识。Specifically, the polling queue stores an identifier of a plurality of network devices that receive the data packet.
在将所述网络设备的标识注册到所述轮询队列中后,该网络设备关闭接收中断。After registering the identity of the network device into the polling queue, the network device turns off the reception interrupt.
由此,通过接收所述网络设备发送的数据包以及中断请求,根据所述中断请求,将所述网络设备的标识注册到所述轮询队列中,采用轮询方式的处理方式,减少了中断开销,保证了数据的完整性,避免丢包。Therefore, by receiving the data packet sent by the network device and the interrupt request, registering the identifier of the network device in the polling queue according to the interrupt request, and adopting a polling manner to reduce the interruption. The overhead guarantees the integrity of the data and avoids packet loss.
可选的,在步骤S2之后还包括:Optionally, after step S2, the method further includes:
步骤S4,若所述网络设备对应的数据包数量小于预设值P,对所述网络设备对应的全部数据包进行处理;Step S4: If the number of data packets corresponding to the network device is less than a preset value P, process all data packets corresponding to the network device;
步骤S5,在所述轮询队列中删除所述数据包数量小于预设值P的所述网络设备的标识。In step S5, the identifier of the network device whose number of data packets is less than a preset value P is deleted in the polling queue.
具体地,当网络设备对应的数据包数量小于预设值P时,CPU在处理时可以一次将数据包处理完成。将轮询队列中网络设备对应的所有数据包处理完成后,在所述轮询队列中删除该网络设备的标识。Specifically, when the number of data packets corresponding to the network device is less than the preset value P, the CPU may process the data packet at one time during processing. After all the data packets corresponding to the network device in the polling queue are processed, the identifier of the network device is deleted in the polling queue.
更为具体的,在步骤S3或S5之后,获取轮询队列中的下一网络设备 的标识,重复执行上述步骤,直至轮询队列中没有网络设备的标识为止。More specifically, after step S3 or S5, the next network device in the polling queue is acquired. The identification of the above steps is repeated until there is no identifier for the network device in the polling queue.
由此,通过在网络设备对应的数据包数量小于预设值P时,对全部数据包进行处理,在所述轮询队列中删除所述数据包数量小于预设值P的所述网络设备的标识,采用轮询方式的处理方式,大大减少了中断开销,通过设置一次数据包的处理个数,避免丢包。Therefore, when the number of data packets corresponding to the network device is less than the preset value P, all the data packets are processed, and the network device whose number of data packets is less than the preset value P is deleted in the polling queue. The identification, using the polling method, greatly reduces the interrupt overhead, and avoids packet loss by setting the number of processing packets once.
实施例2Example 2
图2示出本发明另一实施例提供的网络数据接收的处理方法的流程图,在图2中与图1采用相同附图标记的步骤均与图1适用于相同的文字说明,在此不再赘述。本实施例对实施例一进行进一步限定。2 is a flowchart of a method for processing network data reception according to another embodiment of the present invention. The steps of the same reference numerals in FIG. 2 and FIG. 1 are applied to the same text description, and Let me repeat. This embodiment further defines Embodiment 1.
如图2所示,本实施例在步骤S1之前,可以包括:As shown in FIG. 2, before the step S1, the embodiment may include:
步骤S03,获取所述轮询队列中所述网络设备的标识的数量;Step S03: Obtain the number of identifiers of the network device in the polling queue.
步骤S04,根据所述轮询队列中所述网络设备的标识的数量,确定所述预设值P。Step S04: Determine the preset value P according to the number of identifiers of the network device in the polling queue.
具体的,可以设置为,若所述轮询队列中所述网络设备的标识的数量越多则预设值P越小,以保证在一定时间间隔内将轮询队列中所有网络设备访问一次。Specifically, if the number of the identifiers of the network devices in the polling queue is larger, the preset value P is smaller to ensure that all network devices in the polling queue are accessed once in a certain time interval.
更为具体的,步骤S03和步骤S04可以设置为,轮询队列中更新预设次数后执行,也可以设置为经过预设时间后执行。当第一次进行预设值P的计算时,根据所述轮询队列中所述网络设备的标识的数量,确定所述预设值P。当已经存在预设值P时,可以根据更新后的网络设备的标识的数量对预设值P的值进行修正。More specifically, step S03 and step S04 may be set to be executed after the preset number of times is updated in the polling queue, or may be set to be executed after a preset time. When the calculation of the preset value P is performed for the first time, the preset value P is determined according to the number of identifiers of the network devices in the polling queue. When the preset value P already exists, the value of the preset value P may be corrected according to the number of the identifiers of the updated network device.
由此,可以实现自适应的增减一次数据包的处理个数,实现了多个网络设备公平调度,保证了数据处理的实时性。Thereby, the number of processing of the data packet can be adaptively increased or decreased, and the fair scheduling of the plurality of network devices is realized, and the real-time performance of the data processing is ensured.
需要说明的是,本实施例中,对步骤S03和步骤S01的执行顺序不进行限定。附图中给出的只是一种实现方式,并不是对执行先后顺序的限定。 It should be noted that, in this embodiment, the order of execution of step S03 and step S01 is not limited. What is shown in the drawings is only an implementation and is not a limitation of the order of execution.
实施例3Example 3
图3示出本发明再一实施例提供的网络数据接收的处理方法的流程图,在图3中与图1采用相同附图标记的步骤均与图1适用于相同的文字说明,在此不再赘述。本实施例对实施例一的步骤S1进行进一步限定。如图3所示,本实施例中步骤S1可以具体包括:FIG. 3 is a flowchart of a method for processing network data reception according to still another embodiment of the present invention. The steps of the same reference numerals in FIG. 3 and FIG. 1 are applied to the same text description, and FIG. Let me repeat. This embodiment further defines step S1 of the first embodiment. As shown in FIG. 3, step S1 in this embodiment may specifically include:
步骤S101,根据所述轮询队列中网络设备的标识,获取所述轮询队列中每个网络设备的通信流量;Step S101: Acquire, according to the identifier of the network device in the polling queue, the communication traffic of each network device in the polling queue.
步骤S102,根据所述轮询队列中每个网络设备的通信流量计算预设时间;Step S102: Calculate a preset time according to the communication traffic of each network device in the polling queue;
步骤S103,根据所述预设时间,获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量。In step S103, the identifier of the network device in the polling queue is obtained according to the preset time, and the number of data packets corresponding to the network device is obtained according to the identifier of the network device.
可以通过设置定时器来实现对预设时间的计算。当轮询队列中有数据更新时,定时器开始计时。到达预设时间时,定时器通知CPU对数据包进行处理。当CPU开始数据处理时,对定时器进行复位。定时器通过查询当前网络的状态来确定下一次轮询的时间间隔,并调整定时器的频率,从而达到自适应网络状况的目的。如果网络处于大流量的情况下,数据缓冲区更新频率很高,那么相应的加大轮询的频率,也就是减小定时器的时间间隔,缩短预设时间。如果网络上的数据量很小,那么相应的减少轮询频率,同时增加定时器的时间间隔,增大预设时间。The calculation of the preset time can be achieved by setting a timer. The timer starts timing when there is data update in the polling queue. When the preset time is reached, the timer notifies the CPU to process the data packet. The timer is reset when the CPU starts data processing. The timer determines the time interval of the next polling by querying the status of the current network, and adjusts the frequency of the timer to achieve the purpose of adaptive network conditions. If the network is in a large amount of traffic and the data buffer update frequency is high, then the corresponding polling frequency is increased, that is, the timer interval is reduced, and the preset time is shortened. If the amount of data on the network is small, the polling frequency is reduced accordingly, and the time interval of the timer is increased to increase the preset time.
步骤S1还可以包括:判断所述轮询队列中是否存在网络设备,当所述轮询队列中存在网络设备的标识时,执行步骤S101,当所述轮询队列中不存在网络设备的标识时,接收中断。The step S1 may further include: determining whether the network device exists in the polling queue, and when there is an identifier of the network device in the polling queue, performing step S101, when the identifier of the network device does not exist in the polling queue. , receiving interrupts.
由此,通过根据所述轮询队列中每个网络设备的通信流量计算预设时间,根据所述预设时间,获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量,根据网络流量对预 设时间进行调整,提高了用户进程与内核空间数据交互的有效性。Therefore, the preset time is calculated according to the communication traffic of each network device in the polling queue, and the identifier of the network device in the polling queue is obtained according to the preset time, and is obtained according to the identifier of the network device. The number of data packets corresponding to the network device, according to network traffic Time is adjusted to improve the effectiveness of user process and kernel space data interaction.
实施例4Example 4
图4示出本发明实施例提供的网络数据接收的处理装置的结构示意图,如图4所示,该装置10包括:FIG. 4 is a schematic structural diagram of a processing apparatus for receiving network data according to an embodiment of the present invention. As shown in FIG. 4, the apparatus 10 includes:
获取模块1,配置为获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量。The obtaining module 1 is configured to obtain the identifier of the network device in the polling queue, and obtain the number of data packets corresponding to the network device according to the identifier of the network device.
判断模块2,配置为判断所述网络设备对应的数据包数量是否大于预设值P。The determining module 2 is configured to determine whether the number of data packets corresponding to the network device is greater than a preset value P.
处理模块3,配置为在所述网络设备对应的数据包数量大于预设值P时,对所述网络设备对应的数据包中的P个数据包进行处理。The processing module 3 is configured to process P data packets in the data packet corresponding to the network device when the number of data packets corresponding to the network device is greater than a preset value P.
本发明通过获取轮询队列中的网络设备的标识,当网络设备对应的数据包数量大于预设值P时,对所述网络设备对应的数据包中的P个数据包进行处理,采用轮询方式的处理方式,大大减少了中断开销,通过设置一次数据包的处理个数,避免丢包。The invention obtains the identifier of the network device in the polling queue, and when the number of data packets corresponding to the network device is greater than the preset value P, processes P packets in the data packet corresponding to the network device, and uses polling. The way of processing, greatly reducing the interrupt overhead, by setting the number of processing packets once, to avoid packet loss.
可选的,所述处理模块3还配置为,在所述网络设备对应的数据包数量小于预设值P时,对所述网络设备对应的全部数据包进行处理;在所述轮询队列中删除所述数据包数量小于预设值P的所述网络设备的标识。Optionally, the processing module 3 is further configured to: when the number of data packets corresponding to the network device is less than a preset value P, process all data packets corresponding to the network device; in the polling queue And deleting an identifier of the network device whose number of data packets is less than a preset value P.
由此,通过在网络设备对应的数据包数量小于预设值P时,对全部数据包进行处理,在所述轮询队列中删除所述数据包数量小于预设值P的所述网络设备的标识,采用轮询方式的处理方式,大大减少了中断开销,通过设置一次数据包的处理个数,避免丢包。Therefore, when the number of data packets corresponding to the network device is less than the preset value P, all the data packets are processed, and the network device whose number of data packets is less than the preset value P is deleted in the polling queue. The identification, using the polling method, greatly reduces the interrupt overhead, and avoids packet loss by setting the number of processing packets once.
实施例5Example 5
图5示出本发明另一实施例提供的网络数据接收的处理装置的结构示意图,在图5中与图4采用相同附图标记的步骤均与图4适用于相同的文 字说明,在此不再赘述。如图5所示,该装置10还包括:FIG. 5 is a schematic structural diagram of a processing apparatus for receiving network data according to another embodiment of the present invention. The steps of the same reference numerals in FIG. 5 and FIG. 4 are applied to the same text as FIG. 4. The word description will not be repeated here. As shown in FIG. 5, the device 10 further includes:
接收模块4,配置为在所述获取模块1获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量之前,接收所述网络设备发送的数据包以及中断请求;根据所述中断请求,将所述网络设备的标识注册到所述轮询队列中。The receiving module 4 is configured to: before the acquiring module 1 acquires the identifier of the network device in the polling queue, and obtain the number of data packets corresponding to the network device according to the identifier of the network device, receive the sending by the network device a data packet and an interrupt request; according to the interrupt request, registering an identifier of the network device into the polling queue.
由此,通过接收所述网络设备发送的数据包以及中断请求,根据所述中断请求,将所述网络设备的标识注册到所述轮询队列中,采用轮询方式的处理方式,减少了中断开销,保证了数据的完整性,避免丢包。Therefore, by receiving the data packet sent by the network device and the interrupt request, registering the identifier of the network device in the polling queue according to the interrupt request, and adopting a polling manner to reduce the interruption. The overhead guarantees the integrity of the data and avoids packet loss.
实施例6Example 6
图6示出本发明再一实施例提供的网络数据接收的处理装置的结构示意图,在图6中与图4采用相同附图标记的步骤均与图4适用于相同的文字说明,在此不再赘述。如图6所示,该装置10还包括:FIG. 6 is a schematic structural diagram of a processing apparatus for receiving network data according to still another embodiment of the present invention. The steps of the same reference numerals in FIG. 6 and FIG. 4 are applied to the same text description, and FIG. Let me repeat. As shown in FIG. 6, the device 10 further includes:
计算模块5,配置为在所述获取模块1获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量之前,获取所述轮询队列中所述网络设备的标识的数量;根据所述轮询队列中所述网络设备的标识的数量,确定所述预设值P。The calculation module 5 is configured to acquire the identifier of the network device in the polling queue, and acquire the number of data packets corresponding to the network device according to the identifier of the network device, and obtain the polling queue. The number of identifiers of the network device; determining the preset value P according to the number of identifiers of the network devices in the polling queue.
由此,可以实现自适应的增减一次数据包的处理个数,提高了多个网络设备公平调度,以及数据的实时性。Thereby, it is possible to adaptively increase or decrease the number of processing of one data packet, improve fair scheduling of multiple network devices, and real-time data.
可选的,所述获取模块1具体配置为:根据所述轮询队列中网络设备的标识,获取所述轮询队列中每个网络设备的通信流量;根据所述轮询队列中每个网络设备的通信流量计算预设时间;根据所述预设时间,获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量。Optionally, the acquiring module 1 is configured to: obtain, according to the identifier of the network device in the polling queue, the communication traffic of each network device in the polling queue; according to each network in the polling queue The communication traffic of the device is calculated by the preset time; the identifier of the network device in the polling queue is obtained according to the preset time, and the number of data packets corresponding to the network device is obtained according to the identifier of the network device.
由此,通过根据所述轮询队列中每个网络设备的通信流量计算预设时间,根据所述预设时间,获取轮询队列中的网络设备的标识,并根据所述 网络设备的标识获取所述网络设备对应的数据包数量,根据网络流量对预设时间进行调整,提高了用户进程与内核空间数据交互的有效性。Therefore, the preset time is calculated according to the communication traffic of each network device in the polling queue, and the identifier of the network device in the polling queue is obtained according to the preset time, and according to the The identifier of the network device acquires the number of data packets corresponding to the network device, and adjusts the preset time according to the network traffic, thereby improving the effectiveness of the interaction between the user process and the kernel space data.
需要指出地,图4和图5中示出的模块是对网络数据接收装置在逻辑功能层面的划分,根据对图4和图5的理解,还可以对其中的部分模块进行合并,或者对其中的部分模块进行进一步的划分,从而实现网络数据接收装置多种可选的结构。It should be noted that the modules shown in FIG. 4 and FIG. 5 are partitioning of the network data receiving device at the logical function level. According to the understanding of FIG. 4 and FIG. 5, some of the modules may also be merged, or Some modules are further divided to implement various optional structures of the network data receiving device.
从硬件实现上来说,网络数据接收的处理装置还可以通过处理器和存储器配合,由存储器执行存储器中的可执行指令的指令而实现上述各模的功能。In terms of hardware implementation, the processing device for network data reception can also implement the functions of the above modes by the processor and the memory, and the instructions of the executable instructions in the memory are executed by the memory.
作为存储器和处理器的一个示例,存储器可以采用微处理器(MCU)实现,存储器可以采用各种易失性或非易失性的存储介质实现。As an example of a memory and processor, the memory can be implemented in a microprocessor (MCU), which can be implemented in a variety of volatile or non-volatile storage media.
作为存储器和处理器的另一示例,存储器和处理器可以采用专用集成电路(ASIC)、逻辑可编程门电路(FPGA)或复杂可编程逻辑器件(CPLD)等集成的方式实现。As another example of a memory and a processor, the memory and processor may be implemented in an integrated manner using an application specific integrated circuit (ASIC), a logic programmable gate (FPGA), or a complex programmable logic device (CPLD).
实施例7Example 7
以所述网络设备为网卡为例进行说明。The network device is used as an example for the network card.
本发明实施例中可以在第一个数据包到达时转变系统对网络设备的处理方法。具体方法是:In the embodiment of the present invention, the processing method of the network device by the system may be changed when the first data packet arrives. The specific method is:
当第一个数据包到达时,网卡产生硬件中断,随后系统进入中断处理。系统关闭网卡的接收中断,将网卡设备注册到轮询队列中,然后唤醒软中断,进入轮询处理程序。When the first packet arrives, the NIC generates a hardware interrupt and the system then enters interrupt processing. The system closes the receiving interrupt of the network card, registers the network card device into the polling queue, then wakes up the soft interrupt and enters the polling processing program.
处理器采用轮询方式对轮询队列中的网络设备进行数据读取,每次读取前判断该网卡的缓冲区中是否有固定配额的数据,如果有,则获取该网卡缓冲区中的数据;如果数据包不够固定配额,则将所有数据读取后将网络设备从轮询队列中注销。 The processor uses the polling mode to perform data reading on the network device in the polling queue. Before each reading, it is determined whether there is fixed quota data in the buffer of the network card, and if so, the data in the network card buffer is obtained. If the packet is not sufficiently fixed, the network device is logged out of the polling queue after all data has been read.
随后判断轮询队列是否为空,如果非空,则返回轮询开始,否则软中断处理结束,再打开网卡的接收中断。Then it is judged whether the polling queue is empty. If it is not empty, the polling start is returned, otherwise the soft interrupt processing ends, and then the receiving of the network card is interrupted.
因此,本发明在轻负载的情况下趋近于中断方式,响应速度很快;而在重负载的情况下,趋近于轮询方式,高效的处理数据包并且避免了重负载情况下的中断活锁及丢包问题。Therefore, the present invention approaches the interrupt mode in the case of light load, and the response speed is fast; in the case of heavy load, it approaches the polling mode, efficiently processes the data packet and avoids the interruption in the case of heavy load. Live lock and packet loss issues.
本发明的发明人注意到:可调节的中断轮询完成了数据从网卡到内核的有效读取,而用户进程从内核读取数据同样也是提高高速网络数据接收的重要部分,因此,提出了自适应的轮询守护进程技术,具体做法是:The inventors of the present invention have noticed that the adjustable interrupt polling completes the effective reading of data from the network card to the kernel, and the user process reading data from the kernel is also an important part of improving the data reception of the high speed network. Adapted polling daemon technology, the specific approach is:
上层应用采用轮询的方式来监视数据缓冲区更新的状态。当数据缓冲区更新后,开启一个定时器同时使应用程序暂时休眠,如果在定时器规定的时间内,轮询没有开启,那么定时器就会唤醒上层的应用程序来处理数据。The upper application uses polling to monitor the status of the data buffer update. When the data buffer is updated, a timer is turned on and the application is temporarily hibernated. If the polling is not turned on within the time specified by the timer, the timer wakes up the upper application to process the data.
如果上层程序已经处理了缓冲区中的数据,定时器就会重新开始计时。在定时器中断处理函数中通过查询当前运行的状态来确定下一次轮询的时间间隔,并调整定时器的频率,从而达到自适应网络状况的目的。If the upper program has processed the data in the buffer, the timer will start timing again. In the timer interrupt processing function, the time interval of the next polling is determined by querying the current running state, and the frequency of the timer is adjusted to achieve the purpose of adaptive network conditions.
如果网络处于大流量的情况下,数据缓冲区更新频率很高,那么相应的加大轮询的频率,同时减小定时器的时间间隔。如果网络上的数据量很小,那么相应的减少轮询频率,同时增加定时器的时间间隔。If the network is in a large amount of traffic and the data buffer update frequency is high, increase the polling frequency accordingly and decrease the timer interval. If the amount of data on the network is small, the polling frequency is reduced accordingly, and the time interval of the timer is increased.
在轮询过程中,如果系统连接多个网络设备,设置配额(预设值P)可以有效地解决多个网络设备的公平调度问题。然而如果设置配额较大,当轮询队列中的网络设备较多时,就不能及时的处理各个网络设备的数据包,从而使数据的实时性无法得到保障。相反地,如果设置配额较小,而轮询队列中的设备不多时,又会造成频繁的上下文切换,造成不必要的开销。可调节的最大配额技术则可以动态的根据轮询队列中网络设备的多少来改变一次可读的配额数,从而保证了数据实时性和系统有效性。 During the polling process, if the system is connected to multiple network devices, setting the quota (preset value P) can effectively solve the fair scheduling problem of multiple network devices. However, if the quota is set to be large, when there are many network devices in the polling queue, the data packets of each network device cannot be processed in time, so that the real-time performance of the data cannot be guaranteed. Conversely, if the set quota is small and there are not many devices in the polling queue, it will cause frequent context switching, resulting in unnecessary overhead. The adjustable maximum quota technology can dynamically change the number of readable quotas according to the number of network devices in the polling queue, thus ensuring data real-time and system effectiveness.
除此之外,本发明的发明人还注意到:在多核多网络设备的情况下,当数据包源源不断的到来时,如果不对CPU进行特定的限制,即每个CPU都可以用来处理网络设备数据包,这样多个CPU有可能同时被用作处理多个网络设备的发来的大量的数据包,由于在执行网卡软中断之前,硬中断已经关闭,所以没有中断可以打断这样的处理过程,直到软中断自己执行结束为止。在极端情况下,由于没有处理器可以用来处理其他进程,就会导致系统死机。因此,本发明提出可以限制由特定的CPU来执行网络设备数据包的处理,从而避免这种极端情况下系统的崩溃,同时保证处理机的有效使用。In addition, the inventors of the present invention have also noticed that in the case of a multi-core multi-network device, when a continuous flow of data packets comes, if the CPU is not specifically limited, that is, each CPU can be used to process the network. Device data packets, so that multiple CPUs can be used simultaneously to process a large number of data packets sent from multiple network devices. Since the hard interrupt is closed before the NIC soft interrupt is executed, no interruption can interrupt such processing. The process until the soft interrupt ends itself. In extreme cases, because no processor can be used to process other processes, it can cause the system to crash. Accordingly, the present invention proposes to limit the processing of network device data packets by a particular CPU, thereby avoiding the collapse of the system in such extreme cases while ensuring efficient use of the processor.
前述对本发明的具体示例性实施方案的描述是为了说明和例证的目的。这些描述并非想将本发明限定为所公开的精确形式,并且很显然,根据上述教导,可以进行很多改变和变化。对示例性实施例进行选择和描述的目的在于解释本发明的特定原理及其实际应用,从而使得本领域的技术人员能够实现并利用本发明的各种不同的示例性实施方案以及各种不同的选择和改变。本发明的范围意在由权利要求书及其等同形式所限定。The foregoing description of the specific exemplary embodiments of the present invention has The description is not intended to limit the invention to the precise forms disclosed. The embodiments were chosen and described in order to explain the particular embodiments of the invention Choose and change. The scope of the invention is intended to be defined by the claims and their equivalents.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。 The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.

Claims (12)

  1. 一种网络数据接收的处理方法,包括:A method for processing network data reception, comprising:
    获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量;Obtaining an identifier of the network device in the polling queue, and acquiring, according to the identifier of the network device, a number of data packets corresponding to the network device;
    判断所述网络设备对应的数据包数量是否大于预设数量;Determining whether the number of data packets corresponding to the network device is greater than a preset number;
    若所述网络设备对应的数据包数量大于所述预设数量,则对相应网络设备对应的数据包中所述预设数量的数据包进行处理。If the number of data packets corresponding to the network device is greater than the preset number, processing the preset number of data packets in the data packet corresponding to the corresponding network device.
  2. 根据权利要求1所述的处理方法,其中,在判断所述网络设备对应的数据包数量是否大于预设数量之后,还包括:The processing method according to claim 1, wherein after determining whether the number of data packets corresponding to the network device is greater than a preset number, the method further includes:
    若所述网络设备对应的数据包数量小于所述预设数量,对相应网络设备对应的全部数据包进行处理;If the number of data packets corresponding to the network device is less than the preset number, processing all data packets corresponding to the corresponding network device;
    在所述轮询队列中删除所对应的数据包数量小于所述预设数量的所述网络设备的标识。And deleting, in the polling queue, that the number of corresponding data packets is smaller than the preset number of identifiers of the network device.
  3. 根据权利要求1所述的处理方法,其中,在所述获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量之前,还包括:The processing method according to claim 1, wherein before the obtaining the identifier of the network device in the polling queue and obtaining the number of data packets corresponding to the network device according to the identifier of the network device, the method further includes:
    接收所述网络设备发送的数据包以及中断请求;Receiving a data packet sent by the network device and an interrupt request;
    根据所述中断请求,将所述网络设备的标识注册到所述轮询队列中。And registering, according to the interrupt request, an identifier of the network device into the polling queue.
  4. 根据权利要求1或2所述的处理方法,其中,在所述获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量之前,还包括:The processing method according to claim 1 or 2, wherein before the obtaining the identifier of the network device in the polling queue and obtaining the number of data packets corresponding to the network device according to the identifier of the network device, :
    获取所述轮询队列中所述网络设备的标识的数量;Obtaining, by the number of identifiers of the network device in the polling queue;
    根据所述轮询队列中所述网络设备的标识的数量,确定所述预设数量。And determining the preset quantity according to the number of identifiers of the network device in the polling queue.
  5. 根据权利要求1或2所述的处理方法,其中,所述获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的 数据包数量,包括:The processing method according to claim 1 or 2, wherein the obtaining the identifier of the network device in the polling queue, and acquiring the corresponding network device according to the identifier of the network device The number of packets, including:
    根据所述轮询队列中网络设备的标识,获取所述轮询队列中每个网络设备的通信流量;Obtaining, according to the identifier of the network device in the polling queue, the communication traffic of each network device in the polling queue;
    根据所述轮询队列中每个网络设备的通信流量计算预设时间;Calculating a preset time according to communication traffic of each network device in the polling queue;
    根据所述预设时间,获取所述轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量。And obtaining, according to the preset time, an identifier of the network device in the polling queue, and acquiring, according to the identifier of the network device, a number of data packets corresponding to the network device.
  6. 一种网络数据接收的处理装置,包括:A processing device for receiving network data, comprising:
    获取模块,配置为获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量;The obtaining module is configured to obtain an identifier of the network device in the polling queue, and obtain the number of data packets corresponding to the network device according to the identifier of the network device;
    判断模块,配置为判断所述网络设备对应的数据包数量是否大于预设数量;The determining module is configured to determine whether the number of data packets corresponding to the network device is greater than a preset number;
    处理模块,配置为在所述网络设备对应的数据包数量大于预设数量时,对相应网络设备对应的数据包中的预设数量的数据包进行处理。The processing module is configured to process, when the number of data packets corresponding to the network device is greater than a preset number, process a preset number of data packets in the data packet corresponding to the corresponding network device.
  7. 根据权利要求6所述的处理装置,其中,The processing apparatus according to claim 6, wherein
    所述处理模块还配置为,在所述网络设备对应的数据包数量小于预设数量时,对相应网络设备对应的全部数据包进行处理;在所述轮询队列中删除所对应的数据包数量小于所述预设数量的所述网络设备的标识。The processing module is further configured to: when the number of data packets corresponding to the network device is less than a preset number, process all data packets corresponding to the corresponding network device; delete the corresponding number of data packets in the polling queue. Less than the preset number of identifiers of the network device.
  8. 根据权利要求6所述的处理装置,其中,还包括:The processing apparatus according to claim 6, further comprising:
    接收模块,配置为在所述获取模块获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量之前,接收所述网络设备发送的数据包以及中断请求;a receiving module, configured to: acquire, by the acquiring module, an identifier of the network device in the polling queue, and receive a data packet sent by the network device before acquiring the number of data packets corresponding to the network device according to the identifier of the network device And an interrupt request;
    根据所述中断请求,将所述网络设备的标识注册到所述轮询队列中。And registering, according to the interrupt request, an identifier of the network device into the polling queue.
  9. 根据权利要求6或7所述的处理装置,其中,还包括:The processing apparatus according to claim 6 or 7, further comprising:
    计算模块,配置为在所述获取模块获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量之前, a calculation module, configured to acquire an identifier of the network device in the polling queue, and obtain the number of data packets corresponding to the network device according to the identifier of the network device,
    获取所述轮询队列中所述网络设备的标识的数量;Obtaining, by the number of identifiers of the network device in the polling queue;
    根据所述轮询队列中所述网络设备的标识的数量,确定所述预设数量。And determining the preset quantity according to the number of identifiers of the network device in the polling queue.
  10. 根据权利要求6或7所述的处理装置,其中,所述获取模块还配置为:The processing device according to claim 6 or 7, wherein the obtaining module is further configured to:
    根据所述轮询队列中网络设备的标识,获取所述轮询队列中每个网络设备的通信流量;Obtaining, according to the identifier of the network device in the polling queue, the communication traffic of each network device in the polling queue;
    根据所述轮询队列中每个网络设备的通信流量计算预设时间;Calculating a preset time according to communication traffic of each network device in the polling queue;
    根据所述预设时间,获取所述轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量。And obtaining, according to the preset time, an identifier of the network device in the polling queue, and acquiring, according to the identifier of the network device, a number of data packets corresponding to the network device.
  11. 一种网络数据接收的处理装置,包括:处理器和存储器,所述存储器中存储有可执行指令,所述可执行指令用于引起所述处理器执行以下操作:A processing device for receiving network data, comprising: a processor and a memory, wherein the memory stores executable instructions, wherein the executable instructions are used to cause the processor to perform the following operations:
    获取轮询队列中的网络设备的标识,并根据所述网络设备的标识获取所述网络设备对应的数据包数量;Obtaining an identifier of the network device in the polling queue, and acquiring, according to the identifier of the network device, a number of data packets corresponding to the network device;
    判断所述网络设备对应的数据包数量是否大于预设数量;Determining whether the number of data packets corresponding to the network device is greater than a preset number;
    若所述网络设备对应的数据包数量大于所述预设数量,则对相应网络设备对应的数据包中所述预设数量的数据包进行处理。If the number of data packets corresponding to the network device is greater than the preset number, processing the preset number of data packets in the data packet corresponding to the corresponding network device.
  12. 一种存储介质,存储有可执行指令,用于执行权利要求1至5任一项所述的网络数据接收的处理方法。 A storage medium storing executable instructions for performing the processing method of network data reception according to any one of claims 1 to 5.
PCT/CN2016/107150 2016-08-25 2016-11-24 Method and apparatus for processing network data receiving, and storage medium WO2018036007A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610727058.5 2016-08-25
CN201610727058.5A CN106375239B (en) 2016-08-25 2016-08-25 A kind of received processing method and processing device of network data

Publications (1)

Publication Number Publication Date
WO2018036007A1 true WO2018036007A1 (en) 2018-03-01

Family

ID=57878443

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/107150 WO2018036007A1 (en) 2016-08-25 2016-11-24 Method and apparatus for processing network data receiving, and storage medium

Country Status (2)

Country Link
CN (1) CN106375239B (en)
WO (1) WO2018036007A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108965032A (en) * 2018-08-22 2018-12-07 北京奇虎科技有限公司 A kind of message push amount statistical method and device based on round-robin queue
CN111200541A (en) * 2019-12-31 2020-05-26 山石网科通信技术股份有限公司 Network data processing method and device

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107659512A (en) * 2017-10-18 2018-02-02 盛科网络(苏州)有限公司 A kind of method and apparatus for handling network interface card message
CN110968403A (en) * 2018-09-28 2020-04-07 深信服科技股份有限公司 CPU work control method, device, equipment and storage medium
CN110968402A (en) * 2018-09-28 2020-04-07 深信服科技股份有限公司 CPU work control method, device, equipment and storage medium
CN109800073B (en) * 2019-01-28 2021-06-18 Oppo广东移动通信有限公司 Real-time process scheduling method, device, terminal and storage medium
KR20210016684A (en) * 2019-08-05 2021-02-17 에스케이하이닉스 주식회사 Data Processing System and Operating Method Thereof
CN113079114B (en) * 2021-06-04 2021-08-27 鹏城实验室 Data packet receiving method, device, terminal and storage medium
CN116668538B (en) * 2023-08-02 2023-10-03 深圳市翼联网络通讯有限公司 USB novel network card and communication method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7937499B1 (en) * 2004-07-09 2011-05-03 Oracle America, Inc. Methods and apparatus for dynamically switching between polling and interrupt mode for a ring buffer of a network interface card
CN103440213A (en) * 2013-07-23 2013-12-11 深圳市共进电子股份有限公司 Network card driving method applied to system with multiple CPUs (Central Processing Unit) and network cards
CN103441941A (en) * 2013-08-13 2013-12-11 广东睿江科技有限公司 High performance data message capture method and device based on Linux
WO2015089824A1 (en) * 2013-12-20 2015-06-25 华为技术有限公司 Method and apparatus for switching polling and interruption

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101309257A (en) * 2008-07-08 2008-11-19 中兴通讯股份有限公司 Single board communication method and system based on internal integrated circuit bus
CN101938406B (en) * 2009-07-02 2012-07-04 华为技术有限公司 Method and device for microwave multichannel message transmission and transmission system thereof
CN102063335B (en) * 2009-11-13 2014-04-02 大唐移动通信设备有限公司 Interrupt controller and method for processing interrupt of multi-core processor shared device
CN101827333A (en) * 2010-05-19 2010-09-08 北京神州泰岳软件股份有限公司 Data processing method of background server of mobile phone browser
CN103023809B (en) * 2012-12-28 2015-07-22 中国船舶重工集团公司第七0九研究所 Information system synchronous data processing method utilizing secondary buffer technology
CN103888317B (en) * 2014-03-31 2017-03-29 西南科技大学 A kind of unrelated network redundancy flow removing method of agreement
CN105071973B (en) * 2015-08-28 2018-07-17 迈普通信技术股份有限公司 A kind of message method of reseptance and the network equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7937499B1 (en) * 2004-07-09 2011-05-03 Oracle America, Inc. Methods and apparatus for dynamically switching between polling and interrupt mode for a ring buffer of a network interface card
CN103440213A (en) * 2013-07-23 2013-12-11 深圳市共进电子股份有限公司 Network card driving method applied to system with multiple CPUs (Central Processing Unit) and network cards
CN103441941A (en) * 2013-08-13 2013-12-11 广东睿江科技有限公司 High performance data message capture method and device based on Linux
WO2015089824A1 (en) * 2013-12-20 2015-06-25 华为技术有限公司 Method and apparatus for switching polling and interruption

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108965032A (en) * 2018-08-22 2018-12-07 北京奇虎科技有限公司 A kind of message push amount statistical method and device based on round-robin queue
CN108965032B (en) * 2018-08-22 2022-07-01 北京奇虎科技有限公司 Message pushing amount statistical method and device based on circular queue
CN111200541A (en) * 2019-12-31 2020-05-26 山石网科通信技术股份有限公司 Network data processing method and device

Also Published As

Publication number Publication date
CN106375239A (en) 2017-02-01
CN106375239B (en) 2019-02-12

Similar Documents

Publication Publication Date Title
WO2018036007A1 (en) Method and apparatus for processing network data receiving, and storage medium
US7567567B2 (en) Network system including packet classification for partitioned resources
US8006016B2 (en) Hiding system latencies in a throughput networking systems
US7415034B2 (en) Virtualized partitionable shared network interface
US20200125397A1 (en) Interrupt request processing method and apparatus, and virtualized device
WO2018076793A1 (en) Nvme device, and methods for reading and writing nvme data
US6434630B1 (en) Host adapter for combining I/O completion reports and method of using the same
CN110896404B (en) Data processing method and device and computing node
US7889734B1 (en) Method and apparatus for arbitrarily mapping functions to preassigned processing entities in a network system
US7353360B1 (en) Method for maximizing page locality
US7664127B1 (en) Method for resolving mutex contention in a network system
US7443878B2 (en) System for scaling by parallelizing network workload
US7779164B2 (en) Asymmetrical data processing partition
US20160124762A1 (en) Guest idle based vm request completion processing
US7843926B1 (en) System for providing virtualization of network interfaces at various layers
KR20190047035A (en) Nonvolatile memory persistence method and computing device
US7865624B1 (en) Lookup mechanism based on link layer semantics
WO2020238989A1 (en) Method and apparatus for scheduling task processing entity
WO2017032152A1 (en) Method for writing data into storage device and storage device
US8510491B1 (en) Method and apparatus for efficient interrupt event notification for a scalable input/output device
US20150100818A1 (en) Back-off mechanism for a peripheral page request log
US7415035B1 (en) Device driver access method into a virtualized network interface
CN103634230A (en) Dynamic prediction-based network driver layer data packet receiving method and system
CN109117271A (en) Automatically adjust method, storage medium and the terminal device of cpu load
CN111886583A (en) Techniques to support holistic view of cache service classes of a processor cache

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: 16914027

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16914027

Country of ref document: EP

Kind code of ref document: A1