Receive queue scheduling method, apparatus, medium, and computer program product

By performing preliminary analysis and whitelist lookup of network flows, and combining this with field-programmable gate array (FPGA) hardware, we achieved efficient queue allocation and processor scheduling for network flows. This solved the problem that a single-core processor could not meet the needs of multiple network interface cards (NICs) and enabled efficient task processing and latency avoidance.

CN118660017BActive Publication Date: 2025-12-12LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411044585.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2025-12-12
Estimated Expiration
2044-07-31

AI Technical Summary

Technical Problem

In existing technologies, cloud-based infrastructure based on central processing units (CPUs) has bottlenecks in the network data forwarding stage. A single-core CPU cannot meet the needs of multi-queue network cards, and strictly binding tasks and queues will increase task latency.

Method used

By performing preliminary analysis of the network flow, it is divided into target mouse flow and target elephant flow. The critical mouse flow is identified by querying a whitelist, and queue allocation is performed using field-programmable gate array hardware. When a queue conflict notification is received, the critical mouse flow is scheduled to an idle processor.

Benefits of technology

It achieves a balance between queue and processor, meets network card requirements, avoids task latency, and balances the processing efficiency of various tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118660017B_ABST
    Figure CN118660017B_ABST
Patent Text Reader

Abstract

The application relates to the computer technical field and discloses a receiving queue scheduling method, equipment, a medium and a computer program product, which comprises the following steps: performing preliminary analysis on a network flow, dividing the network flow into a target mouse flow and a target elephant flow; in the target mouse flow, a key mouse flow is determined by adopting a query whitelist mode; after receiving a target instruction, a processor state is sent to field programmable gate array hardware, so that the field programmable gate array hardware performs corresponding queue distribution on the key mouse flow, a non-key mouse flow and the target elephant flow according to the processor state; when a queue conflict notification signal sent by the field programmable gate array hardware is received, an application process corresponding to the key mouse flow is scheduled to an idle processor, and the field programmable gate array hardware is notified. The whole process is realized by means of software and hardware cooperation, the balance of queues and processors is effectively completed, various tasks can be considered, and the task delay is not increased.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a receiving queue scheduling method, device, medium and computer program product. BACKGROUND

[0002] With the rapid development of cloud computing, big data and artificial intelligence, the network interface rate of data center evolves to 100G and above, and the growth rate of network bandwidth is much faster than that of central processor computing power, which causes the bottleneck of cloud-based infrastructure based on central processor in the network data forwarding stage.

[0003] In the related technical solution, the data packet is quickly transmitted into the central processor and processed by using the multi-queue network card, which mainly uses multi-queue and flow classification to achieve more efficient Input / Output (IO) processing. The multi-queue can configure multiple traffic queues for each network interface, which means that multiple central processors can be used for acceleration. However, with the continuous improvement of network IO bandwidth, single-core central processors cannot fully meet the needs of network cards. In addition, in order to transmit data packets into the central processor faster, the task, central processor and queue are usually strictly bound, which avoids cross-cache access of the central processor to the queue, but increases the delay of the task. SUMMARY

[0004] The purpose of the present application is to provide a receiving queue scheduling method, device, medium and computer program product, which can meet the needs of network cards, effectively complete the balance of queues and processors, and can consider various tasks without increasing the delay of the task.

[0005] In order to solve the above technical problems, the present application provides a receiving queue scheduling method, which comprises:

[0006] performing preliminary analysis on the network flow, and dividing the network flow into target mouse flow and target elephant flow;

[0007] In the target mouse flow, the key mouse flow is determined by querying the white list; the remaining mouse flow in the target mouse flow except the key mouse flow is the non-key mouse flow;

[0008] After receiving the target instruction, the processor state is sent to the field programmable gate array hardware, so that the field programmable gate array hardware performs corresponding queue allocation on the key mouse flow, the non-key mouse flow and the target elephant flow according to the processor state;

[0009] When receiving the queue conflict notification signal sent by the field programmable gate array hardware, the application process corresponding to the key mouse flow is scheduled to the idle processor, and the field programmable gate array hardware is notified.

[0010] In a first aspect, in the above-mentioned method for scheduling a receiving queue, the network flow is preliminarily analyzed, and the network flow is divided into a target mouse flow and a target elephant flow, comprising:

[0011] The network flow transmitted from the optical fiber interface is preliminarily analyzed to obtain an analysis result of the data frame length and the duration of the network flow.

[0012] According to the analysis result of the data frame length and the duration of the network flow, the network flow is divided into a target mouse flow and a target elephant flow.

[0013] In another aspect, in the above-mentioned method for scheduling a receiving queue, according to the analysis result of the data frame length and the duration of the network flow, the network flow is divided into a target mouse flow and a target elephant flow, comprising:

[0014] From the analysis result of the data frame length and the duration of the network flow, the handshake moment of the network flow is set as an initial moment, when the data frame length of one of the packets of the network flow is greater than a set threshold value, a first moment is set and the corresponding packet is determined as a suspected elephant flow, and the total byte quantity at the first moment is obtained.

[0015] When the duration of the network flow reaches a second moment, the total byte quantity at the second moment is obtained; the second moment is the sum of the first moment and a preset elephant flow duration parameter.

[0016] According to the transmission quantity of the suspected elephant flow, the total byte quantity at the first moment and the total byte quantity at the second moment, the target elephant flow and the target mouse flow in the network flow are distinguished.

[0017] In another aspect, in the above-mentioned method for scheduling a receiving queue, according to the transmission quantity of the suspected elephant flow, the total byte quantity at the first moment and the total byte quantity at the second moment, the target elephant flow and the target mouse flow in the network flow are distinguished, comprising:

[0018] It is judged whether the value obtained by dividing the transmission quantity of the suspected elephant flow by the difference between the total byte quantity at the first moment and the total byte quantity at the second moment is greater than a set percentage.

[0019] If yes, the suspected elephant flow is a target elephant flow; if no, the suspected elephant flow is a target mouse flow.

[0020] In another aspect, in the above-mentioned method for scheduling a receiving queue, a white list query method is used to determine a key mouse flow, comprising:

[0021] According to the pre-created whitelist table, it is judged whether the target mouse flow is marked or not;

[0022] If marked, the marked mouse flow is determined as a non-key mouse flow; if not marked, the unmarked mouse flow is determined as a key mouse flow.

[0023] On the other hand, in the above-mentioned receiving queue scheduling method provided by the present application, before judging whether the target mouse flow is marked or not, it further includes:

[0024] Creating a task flow supporting user specified marking, supporting multiple tuple switching, supporting custom start byte position and length, supporting specified destination processor and whitelist table containing hash value in the marking;

[0025] According to the created whitelist table, it is judged whether the target mouse flow is marked or not.

[0026] On the other hand, in the above-mentioned receiving queue scheduling method provided by the present application, according to the created whitelist table, it is judged whether the target mouse flow is marked or not, including:

[0027] According to the indication in the created whitelist table, the hash value of the target mouse flow is calculated;

[0028] If the calculated hash value is equal to the hash value in the marking or not;

[0029] If yes, the target mouse flow is determined as marked; if not, the target mouse flow is determined as unmarked.

[0030] On the other hand, in the above-mentioned receiving queue scheduling method provided by the present application, before sending the processor state to the field programmable gate array hardware, it further includes:

[0031] Timing to obtain all processor idle states;

[0032] According to the obtained processor idle states, the usage rate of idle processes of the processor is obtained;

[0033] When the usage rate of idle processes of the processor is less than the set usage rate threshold, all processor states are sent to the field programmable gate array hardware.

[0034] On the other hand, in the above-mentioned receiving queue scheduling method provided by the present application, while sending the processor state to the field programmable gate array hardware, it further includes:

[0035] The correspondence between the queue and the processor is sent to the FPGA hardware, so that the FPGA hardware reads the correspondence between the queue and the processor and the processor state, and then performs corresponding queue allocation on the critical mouse flow, the non-critical mouse flow and the target elephant flow according to the read information.

[0036] In another aspect, in the above-mentioned receiving queue scheduling method provided by the application, the corresponding queue allocation for the critical mouse flow, the non-critical mouse flow and the target elephant flow comprises:

[0037] For the critical mouse flow, queue allocation is performed according to the destination processor field and the correspondence between the queue and the processor;

[0038] For the non-critical mouse flow and the target elephant flow, the corresponding queue number is calculated according to the total number of queues by taking the remainder of the quintuple hash result, and queue allocation is performed according to the calculated queue number.

[0039] In another aspect, in the above-mentioned receiving queue scheduling method provided by the application, when the queue conflict notification signal sent by the FPGA hardware is received, the application process corresponding to the critical mouse flow is scheduled to an idle processor, comprising:

[0040] When the queue conflict notification signal sent by the FPGA hardware is received, it is judged whether the flow that causes the queue conflict exists the critical mouse flow in response to the queue conflict notification signal;

[0041] If the flow that causes the queue conflict exists the critical mouse flow, the application process corresponding to the critical mouse flow that causes the queue conflict is scheduled to an idle processor.

[0042] In another aspect, in the above-mentioned receiving queue scheduling method provided by the application, before judging whether the flow that causes the queue conflict exists the critical mouse flow, it further comprises:

[0043] It is judged whether the flow that causes the queue conflict exists the non-critical mouse flow or the target elephant flow;

[0044] If the flow that causes the queue conflict exists the non-critical mouse flow or the target elephant flow, the non-critical mouse flow or the target elephant flow is scheduled to an idle queue.

[0045] In order to solve the above-mentioned technical problems, the application further provides a receiving queue scheduling device, which comprises:

[0046] A memory for storing a computer program;

[0047] A processor is configured to implement the steps of the receiving queue scheduling method when executing the computer program.

[0048] To solve the above technical problems, the application further provides a nonvolatile storage medium, which stores a computer program, and the computer program is configured to implement the steps of the receiving queue scheduling method when executed by a processor.

[0049] To solve the above technical problems, the application further provides a computer program product, which comprises computer programs / instructions, and the computer programs / instructions are configured to implement the steps of the receiving queue scheduling method when executed by a processor.

[0050] As can be seen from the above technical solutions, the receiving queue scheduling method provided by the application comprises the following steps: performing preliminary analysis on a network flow, and dividing the network flow into target mouse flows and target elephant flows; in the target mouse flows, a white list is queried to determine key mouse flows; the remaining mouse flows in the target mouse flows, except the key mouse flows, are non-key mouse flows; after receiving a target instruction, a processor state is sent to field programmable gate array hardware, so that the field programmable gate array hardware performs corresponding queue allocation on the key mouse flows, the non-key mouse flows and the target elephant flows according to the processor state; when a queue conflict notification signal sent by the field programmable gate array hardware is received, an application process corresponding to the key mouse flows is scheduled to an idle processor, and the field programmable gate array hardware is notified.

[0051] The application has the following beneficial effects: the above receiving queue scheduling method provided by the application first divides network flows into target mouse flows and target elephant flows according to the preliminary analysis results of the network flows, then further analyzes the target mouse flows, and determines key mouse flows by querying a white list; after receiving an instruction, a processor state is sent to field programmable gate array hardware, so that the field programmable gate array hardware can complete effective allocation of queues according to the processor state, which simplifies the process, meets the requirements of a network card, and when a queue conflict notification signal sent by the field programmable gate array hardware is received, an application process corresponding to the key mouse flows is scheduled to an idle processor, and the field programmable gate array hardware is notified, so that the key task is not disturbed and affected, the whole process is realized by means of software and hardware cooperation, effective allocation of queues and processors is realized, various tasks can be considered, and the delay of the task is not increased.

[0052] In addition, the application further provides a receiving queue scheduling device, a nonvolatile storage medium and a computer program product for the receiving queue scheduling method, which have the same or corresponding technical features as the above-mentioned receiving queue scheduling method and have the same effects. BRIEF DESCRIPTION OF DRAWINGS

[0053] In order to more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. Obviously, the drawings described below are only some of the embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.

[0054] Figure 1 The flow chart of the receiving queue scheduling method provided by the embodiment of the present application is shown in

[0055] Figure 2 The frame schematic diagram of the receiving queue scheduling method provided by the embodiment of the present application is shown in

[0056] Figure 3 The structure schematic diagram of the receiving queue scheduling device provided by the embodiment of the present application is shown in

[0057] Figure 4 The structure schematic diagram of the receiving queue scheduling device provided by the embodiment of the present application is shown in DETAILED DESCRIPTION

[0058] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative effort belong to the protection scope of the present application.

[0059] In order to make the person skilled in the art better understand the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments. Figure 1 The flow chart of the receiving queue scheduling method provided by the embodiment of the present application is shown in Figure 1 The method comprises the following steps.

[0060] S101, performing preliminary analysis on the network flow, and dividing the network flow into target mouse flow and target elephant flow.

[0061] It should be noted that the network flow refers to the unidirectional message flow transmitted between a source Internet Protocol (IP) address and a destination IP address within a period of time, and all messages have the same source port number, destination port number, protocol number, source IP address and destination IP address, i.e. the same five-tuple content. The network flow can include data flow, voice flow, video flow, etc.

[0062] The mouse flow is similar to the service query flow, and the flow is very small, but it requires fast response, such as network search and programming model parallel computing services.

[0063] Elephant flow is similar to data backup flow, which occupies a large bandwidth in the network, but has a lower delay requirement, such as data center data batch backup and virtual machine migration. Elephant flow performs a large amount of data flow transmission in real-time network flow monitoring, and performs data transmission within a continuous time.

[0064] Figure 2 A framework schematic diagram of the receiving queue scheduling method provided by the embodiment of the application is shown in FIG. 1. Figure 2 As shown in FIG. 1, the optical port refers to a short name of a fiber interface, which is applied to a fiber bandwidth interface of a large device. In step S101, the network flow can be obtained from the fiber interface, and the network flow is preliminarily analyzed. According to the preliminary analysis result, the network flow can be divided into mouse flow and elephant flow, which can be referred to as target mouse flow and target elephant flow.

[0065] In the target mouse flow, the key mouse flow is determined by querying the white list in step S102; and the remaining mouse flow in the target mouse flow is non-key mouse flow.

[0066] It should be noted that the key mouse flow can be understood as the mouse flow of a key task; and the non-key mouse flow can be understood as the mouse flow of a non-key task.

[0067] In step S102, since the number of mouse flows is large, the key task mouse flow is determined by querying the white list. The remaining mouse flow is naturally the mouse flow of a non-key task.

[0068] After receiving the target instruction, the processor state is sent to the field programmable gate array hardware in step S103, so that the field programmable gate array hardware performs corresponding queue allocation on the key mouse flow, the non-key mouse flow and the target elephant flow according to the processor state.

[0069] It should be noted that the field programmable gate array (FPGA) is a programmable logic device, which is similar to a microprocessor, and the control program is stored in the memory. After power-on, the program is automatically loaded to the chip for execution. The mark in the white list can be issued by the field programmable gate array.

[0070] The execution subject of the application can be a host. After the host confirms the key mouse flow, the non-key mouse flow and the target elephant flow, the host can collect the processor state, and send the processor to the field programmable gate array hardware, so that the field programmable gate array hardware performs corresponding queue allocation on the key mouse flow, the non-key mouse flow and the target elephant flow according to the processor state.

[0071] It should be noted that the quality of service (Quality of Service, QoS) can allocate bandwidth for various services under limited bandwidth resources, and provide end-to-end quality of service guarantee for services. For example, voice, video and important data applications in network devices can be preferentially serviced by configuring QoS. Virtualization technology can virtualize a computer into multiple logical computers, and multiple logical computers can run on one computer, each of which can run different operating systems, and application programs can run in independent spaces without affecting each other, thereby improving the working efficiency of the computer. The application can be supported by the quality of service and the virtualization technology, and by the multi-queue network card driver, each queue can be corresponded to a different processor core to meet the demand of the network card. In practical application, the host can bind each queue to different processors according to the processor hardware affinity.

[0072] S104, when receiving the queue conflict notification signal sent by the field programmable gate array hardware, scheduling the application process corresponding to the critical mouse flow to the idle processor, and notifying the field programmable gate array hardware.

[0073] The above-mentioned receiving queue scheduling method provided by the embodiment of the application first divides the network flow into target mouse flow and target elephant flow according to the preliminary analysis result of the network flow, and then further analyzes the target mouse flow, and determines the critical mouse flow by querying the white list; after receiving the instruction, the processor state is sent to the field programmable gate array hardware, and the field programmable gate array hardware can complete the effective allocation of the queue according to the processor state, which is simple and meets the demand of the network card; when receiving the queue conflict notification signal sent by the field programmable gate array hardware, the application process corresponding to the critical mouse flow is scheduled to the idle processor, and the field programmable gate array hardware is notified, so as to avoid the interference and influence of the critical task. The whole process is realized by means of software and hardware cooperation, and the balance of the queue and the processor is effectively completed, various tasks can be considered, and the delay of the task is not increased.

[0074] Further, in the above-mentioned receiving queue scheduling method provided by the embodiment of the application, the step S101 of preliminarily analyzing the network flow and dividing the network flow into target mouse flow and target elephant flow can specifically include: preliminarily analyzing the network flow transmitted from the optical fiber interface to obtain the analysis result of the data frame length and the duration of the network flow; and dividing the network flow into target mouse flow and target elephant flow according to the analysis result of the data frame length and the duration of the network flow.

[0075] In the implementation, as Figure 2As shown, the flow type arbitration refers to that the application can preliminarily analyze the network flow transmitted from the fiber interface, and according to the analysis result of the data frame length and the duration of the network flow, can distinguish which network flow is the target mouse flow and which network flow is the target elephant flow.

[0076] Further, in the specific implementation, in the above-mentioned receiving queue scheduling method provided by the embodiment of the application, the step of dividing the network flow into the target mouse flow and the target elephant flow according to the analysis result of the data frame length and the duration of the network flow can specifically include: setting the handshake time of the network flow as the initial time from the analysis result of the data frame length and the duration of the network flow, setting the first time when the data frame length of one of the packets of the network flow is greater than the set threshold value, and determining the corresponding packet as the suspected elephant flow, obtaining the total byte quantity at the first time; obtaining the total byte quantity at the second time when the duration of the network flow reaches the second time; the second time is the sum of the first time and the preset elephant flow duration parameter; and distinguishing the target elephant flow and the target mouse flow in the network flow according to the transmission quantity of the suspected elephant flow, the total byte quantity at the first time and the total byte quantity at the second time.

[0077] In the implementation, it is assumed that the host software presets the elephant flow duration parameter as ; the handshake time of the network flow can be recorded as t0 (i.e. the initial time) by the field programmable gate array hardware, the first time t1 is recorded when the data frame length of one of the packets (i.e. the suspected elephant flow) of the network flow is greater than the set threshold value (such as 1500), and the total byte quantity byte_1 at the first time t1 is recorded; the total byte quantity byte_t at the second time is recorded when the duration of the network flow reaches the second time , and the transmission quantity byte_x of the suspected elephant flow is recorded; at this time, the target elephant flow and the target mouse flow in the network flow are distinguished according to the transmission quantity byte_x of the suspected elephant flow, the total byte quantity byte_1 at the first time t1 and the total byte quantity byte_t at the second time .

[0078] Further, in the specific implementation, in the above-mentioned receiving queue scheduling method provided by the embodiment of the application, the step of distinguishing the target elephant flow and the target mouse flow in the network flow according to the transmission quantity of the suspected elephant flow, the total byte quantity at the first time and the total byte quantity at the second time can specifically include: judging whether the value obtained by dividing the transmission quantity of the suspected elephant flow by the difference between the total byte quantity at the first time and the total byte quantity at the second time is greater than the set percentage; if yes, the suspected elephant flow is the target elephant flow; and if no, the suspected elephant flow is the target mouse flow.

[0079] In implementation, the percentage can be set as 70%, when byte_x / (byte_t-byte_1)>70%, the elephant flow is determined as the target elephant flow. The specific value of the percentage can be determined according to actual conditions, which is not limited herein. The host can write the elephant flow determination parameter (such as the percentage) and notify the FPGA hardware.

[0080] Further, in the above-mentioned receiving queue scheduling method provided by the embodiment of the application, the step S102 can determine the key mouse flow by querying the whitelist, and specifically can include: judging whether the target mouse flow is marked according to the pre-created whitelist table; if marked, determining the marked mouse flow as a non-key mouse flow; if not marked, determining the unmarked mouse flow as a key mouse flow.

[0081] In implementation, as shown in Figure 2 the application can judge whether the target mouse flow is marked according to the pre-created whitelist table. The marking herein can be a marking of a user-specified key task, and the host can issue the marking of the user-specified key task to the FPGA and update it in real time, and then the FPGA transmits the marking. If marked, the marked mouse flow is determined as a mouse flow of a non-key task, which can be a non-schedulable flow by default. If not marked, the unmarked mouse flow is determined as a mouse flow of a key task, which can be a schedulable flow by default. The target elephant flow can be a non-schedulable flow by default.

[0082] It should be noted that the high bandwidth has a large scheduling cost after being divided into the processor, and the key task flow in the low delay cannot be scheduled. The remaining flows can be scheduled, and although the corresponding service will have a delay after being scheduled, the cost is small because it is a non-key and non-high bandwidth flow, and the effect of improving the processor utilization rate can be achieved.

[0083] Further, in the above-mentioned receiving queue scheduling method provided by the embodiment of the application, before judging whether the target mouse flow is marked, the method can further include: creating a task flow supporting user-specified marking, supporting multiple tuple switching, supporting custom start byte position and length, supporting specified destination processor, and supporting a whitelist table containing a hash value in the marking; judging whether the target mouse flow is marked according to the created whitelist table.

[0084] Table 1 shows the whitelist table created by the application.

[0085] Table 1 Whitelist Table

[0086]

[0087] The hash is to transform an input of arbitrary length into a fixed length output through a hash algorithm, and the output is the hash value. In a network card, a hash value can be obtained by hashing a five-tuple or four of them, which is used to identify a network flow; the application can support multiple tuple switching (such as four-tuple, five-tuple or seven-tuple). The hash function is a public function that can map a message M of arbitrary length to a value H(M) of shorter and fixed length, which is called hash value, hash value (Hash Value), hash value or message digest (Message Digest). It is a one-way cryptographic system, that is, an irreversible mapping from plaintext to ciphertext, only encryption process, no decryption process. The application can also support customization, such as custom start byte position and custom length. It should be noted that the white list table of the application can also be a destination processor for subsequent queue allocation.

[0088] In implementation, according to the created white list table, it is judged whether the target mouse flow is marked in the above steps, which can specifically include: calculating the hash value of the target mouse flow according to the indication in the created white list table; if the calculated hash value is equal to the hash value in the mark; if yes, it is determined that the target mouse flow is marked; if not, it is determined that the target mouse flow is not marked.

[0089] Further, in the above receiving queue scheduling method provided by the embodiment of the application, before the processor state is sent to the field programmable gate array hardware in step S103, it can further include: acquiring all processor idle states at a time; obtaining the usage rate of the idle process of the processor according to the acquired processor idle state; when the usage rate of the idle process of the processor is less than the set usage rate threshold, all processor states are sent to the field programmable gate array hardware.

[0090] In implementation, before the processor state is sent to the field programmable gate array hardware, it can be judged whether all processor states are balanced first, assuming that there are N processors, the idle state of all processors is acquired at a time using a monitoring tool; if the usage rate of the idle process of M (M≥1) processors is less than the set usage rate threshold (such as 10%), all processor states can be sent to the field programmable gate array hardware. The usage rate of the idle process of the M processors is less than the set usage rate threshold, which can be understood as that the M processors are in a state close to 0 (i.e. not idle state).

[0091] Further, in specific implementation, in the above-mentioned receiving queue scheduling method provided by the embodiment of the present application, when the processor state is sent to the field programmable gate array hardware in step S103, the corresponding relationship between the queue and the processor can also be sent to the field programmable gate array hardware, so that after the field programmable gate array hardware reads the corresponding relationship between the queue and the processor and the processor state, the critical mouse flow, the non-critical mouse flow and the target elephant flow are allocated to corresponding queues according to the read information.

[0092] In implementation, the software running on the host can pre-acquire the corresponding relationship between the queue and the processor (i.e., the corresponding relationship between the queue and the processor is fixed and not real-time changing), and acquire the processor state at a fixed time and update it in real time, and then send the processor state and the pre-acquired corresponding relationship between the queue and the processor to the field programmable gate array hardware. The field programmable gate array hardware can update in real time after acquiring the processor state, and can combine the flow state and the real-time updated processor state when finally allocating the network flow, and then perform data transmission.

[0093] Further, in specific implementation, in the above-mentioned receiving queue scheduling method provided by the embodiment of the present application, step S103 allocates the critical mouse flow, the non-critical mouse flow and the target elephant flow to corresponding queues, which can specifically include: for the critical mouse flow, allocating the queue according to the destination processor field and the corresponding relationship between the queue and the processor; for the non-critical mouse flow and the target elephant flow, calculating the corresponding queue number according to the total queue number by taking the remainder of the five-tuple hash result, and allocating the queue according to the calculated queue number.

[0094] In implementation, the allocation manner of the critical mouse flow and other network flows can be different: for the critical mouse flow, the queue can be allocated according to the destination processor field in the critical mouse flow and the corresponding relationship between the queue and the processor. For other network flows, such as the non-critical mouse flow and the target elephant flow, the queue number can be calculated according to the total queue number by taking the remainder of the five-tuple hash result, and the queue can be allocated according to the calculated queue number. For example, the hash result value is 100, the total queue number is 8, and the remainder result is 100 / 8=12 with a remainder of 4. The final queue number is 4.

[0095] Further, in the above-mentioned receiving queue scheduling method provided by the embodiment of the application, when the queue conflict notification signal sent by the FPGA hardware is received in the implementation, the application process corresponding to the critical mouse flow is scheduled to the idle processor, and the FPGA hardware is notified, and specifically, the step S104 can include: when the queue conflict notification signal sent by the FPGA hardware is received, whether the flow causing the queue conflict has a critical mouse flow is determined in response to the queue conflict notification signal; if the flow causing the queue conflict has a critical mouse flow, the application process corresponding to the critical mouse flow causing the queue conflict is scheduled to the idle processor, and the FPGA hardware is notified.

[0096] In the implementation, in the process of queue allocation, the FPGA hardware can determine whether a queue conflict occurs, and if a queue conflict occurs, a queue conflict notification signal is sent to the host. After the host receives the queue conflict notification signal sent by the FPGA hardware, the critical mouse flow is scheduled to other processors, and the flag is updated, and the FPGA hardware is notified. If no queue conflict occurs, the queue allocation is directly completed. After the queue allocation is completed, the FPGA hardware performs data uploading.

[0097] Further, in the above-mentioned receiving queue scheduling method provided by the embodiment of the application, before determining whether the flow causing the queue conflict has a critical mouse flow, it can further include: determining whether the flow causing the queue conflict has a non-critical mouse flow or a target elephant flow; if the flow causing the queue conflict has a non-critical mouse flow or a target elephant flow, the non-critical mouse flow or the target elephant flow is scheduled to the idle queue.

[0098] In the implementation, it can be determined whether a plurality of target elephant flows are allocated to the same queue, and if yes, it is determined that a queue conflict occurs; and if no, it is determined that no queue conflict occurs. It can also be determined whether a plurality of critical mouse flows and target elephant flows are allocated to the same queue, and if yes, it is determined that a queue conflict occurs; and if no, it is determined that no queue conflict occurs. When it is determined that a queue conflict occurs, the FPGA hardware actively sends a queue conflict notification signal to the host software through a register defined on a Base Address Register (BAR) in a peripheral component interconnect express (PCIE) device. After the host software receives the queue conflict notification signal, the critical mouse flow (i.e., a critical low-delay task) can be scheduled to a suitable processor, and the non-critical mouse flow or the target elephant flow can be scheduled to an idle queue, and the related state is updated. In this way, the host software is switched in time, the critical task is prevented from being disturbed and affected, and the implementation is simple and effective.

[0099] In the above embodiment, the receiving queue scheduling method is described in detail, and the application also provides a receiving queue scheduling device and a corresponding embodiment of the receiving queue scheduling device. It should be noted that the application describes the embodiments of the device from two aspects, one is based on the functional module, and the other is based on the hardware.

[0100] Figure 3 The structure diagram of the receiving queue scheduling device provided in the embodiment of the application is shown in the figure. The embodiment is based on the functional module, as shown in the figure, the device comprises: Figure 3

[0101] A network flow division module 10 is configured to perform preliminary analysis on the network flow, and divide the network flow into target mouse flow and target elephant flow.

[0102] A mouse flow determination module 11 is configured to determine the key mouse flow in the target mouse flow by querying the white list, and the remaining mouse flow in the target mouse flow except the key mouse flow is the non-key mouse flow.

[0103] A data sending module 12 is configured to send the processor state to the field programmable gate array hardware after receiving the target instruction, so that the field programmable gate array hardware performs corresponding queue allocation on the key mouse flow, the non-key mouse flow and the target elephant flow according to the processor state.

[0104] A conflict scheduling module 13 is configured to schedule the application process corresponding to the key mouse flow to the idle processor when receiving the queue conflict notification signal sent by the field programmable gate array hardware, and notify the field programmable gate array hardware.

[0105] In the above receiving queue scheduling device provided in the embodiment of the application, through the interaction of the above four modules, the network flow division module 10 divides the network flow into target mouse flow and target elephant flow according to the preliminary analysis result of the network flow, the mouse flow determination module 11 determines the key mouse flow by querying the white list, the data sending module 12 sends the processor state to the field programmable gate array hardware, and the field programmable gate array hardware can complete the effective allocation of the queue according to the processor state, which simplifies the process, meets the demand of the network card, and the conflict scheduling module 13 schedules the application process corresponding to the key mouse flow to the idle processor and notifies the field programmable gate array hardware when receiving the queue conflict notification signal sent by the field programmable gate array hardware, which avoids the interference and influence of the key task. The whole process is achieved by means of software and hardware cooperation, effectively completes the balance of the queue and the processor, can consider various tasks, and will not increase the delay of the task.

[0106] ​Since the embodiments of the device part correspond to the embodiments of the method part, the embodiments of the device part are described in the description of the embodiments of the method part, which will not be described here. And has the same beneficial effects as the above-mentioned receiving queue scheduling method.

[0107] Further, in specific implementation, in the above-mentioned receiving queue scheduling device provided by the embodiments of the application, the network flow division module 10 can be specifically used for preliminarily analyzing the network flow transmitted from the fiber interface to obtain the analysis results of the data frame length and the duration of the network flow; and dividing the network flow into the target mouse flow and the target elephant flow according to the analysis results of the data frame length and the duration of the network flow.

[0108] In implementation, the handshake moment of the network flow can be set as the initial moment from the analysis results of the data frame length and the duration of the network flow, when the data frame length of one of the packets of the network flow is greater than a set threshold value, the first moment is set and the corresponding packet is determined as a suspected elephant flow, the total byte quantity at the first moment is obtained; when the duration of the network flow reaches the second moment, the total byte quantity at the second moment is obtained; the second moment is the sum of the first moment and a preset elephant flow duration parameter; according to the transmission quantity of the suspected elephant flow, the total byte quantity at the first moment and the total byte quantity at the second moment, the target elephant flow and the target mouse flow in the network flow are distinguished.

[0109] Further, in specific implementation, in the above-mentioned receiving queue scheduling device provided by the embodiments of the application, the mouse flow determination module 11 can be specifically used for judging whether the target mouse flow is marked according to a pre-created whitelist table; if marked, determining that the marked mouse flow is a non-key mouse flow; if not marked, determining that the unmarked mouse flow is a key mouse flow.

[0110] Further, in specific implementation, in the above-mentioned receiving queue scheduling device provided by the embodiments of the application, the data sending module 12 can be specifically used for obtaining the idle state of all processors at a time; obtaining the usage rate of the idle process of the processor according to the obtained idle state of the processor; when the usage rate of the idle process of the processor is less than a set usage rate threshold value, sending the state of all processors to the field programmable gate array hardware.

[0111] The data sending module 12 can be specifically used for sending the correspondence between the queue and the processor to the field programmable gate array hardware at the same time of sending the processor state to the field programmable gate array hardware in real time, so that the field programmable gate array hardware reads the correspondence between the queue and the processor and the processor state, and then performs corresponding queue allocation on the key mouse flow, the non-key mouse flow and the target elephant flow according to the read information.

[0112] In implementation, for the critical mouse flow, queue allocation is performed according to the target processor field and the correspondence between the queue and the processor; for the non-critical mouse flow and the target elephant flow, the corresponding queue number is calculated according to the total queue number by taking the remainder of the five-tuple hash result, and queue allocation is performed according to the calculated queue number.

[0113] Further, in specific implementation, in the above-mentioned receiving queue scheduling device provided by the embodiment of the application, the conflict scheduling module 13 can be specifically used for, when receiving the queue conflict notification signal sent by the field programmable gate array hardware, judging whether the flow causing the queue conflict exists the critical mouse flow in response to the queue conflict notification signal; if the flow causing the queue conflict exists the critical mouse flow, scheduling the application process corresponding to the critical mouse flow causing the queue conflict to the idle processor, and notifying the field programmable gate array hardware.

[0114] Figure 4 The structure diagram of the receiving queue scheduling device provided by the embodiment of the application is shown in the figure. The embodiment is based on the hardware angle, as shown in the figure, the receiving queue scheduling device includes: Figure 4

[0115] The memory 20 is used for storing the computer program.

[0116] The processor 21 is used for implementing the steps of the receiving queue scheduling method mentioned in the above-mentioned embodiment when executing the computer program.

[0117] The processor 21 can include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one of a hardware form of a digital signal processor (DSP), a field programmable gate array (FPGA), a programmable logic array (PLA). The processor 21 can also include a main processor and a coprocessor, the main processor is a processor for processing data in the wake-up state, also known as CPU; the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 can be integrated with a graphics processing unit (GPU), which is used to render and draw the content required to be displayed by the display screen. In some embodiments, the processor 21 can also include an artificial intelligence (AI) processor, which is used to process machine learning related computing operations.

[0118] ​The memory 20 can include one or more non-volatile storage media, which can be non-transitory. The memory 20 can also include high-speed random access memory, and non-volatile memory such as one or more disk storage devices, flash memory devices. In this embodiment, the memory 20 is used at least to store the following computer program 201, wherein the computer program is loaded and executed by the processor 21, and can implement the related steps of the receiving queue scheduling method disclosed in any of the foregoing embodiments. In addition, the resources stored by the memory 20 can also include an operating system 202 and data 203, etc., and the storage mode can be temporary storage or permanent storage. The operating system 202 can include Windows, Unix, Linux, etc. The data 203 can include but is not limited to the data involved in the receiving queue scheduling method mentioned above.

[0119] In some embodiments, the receiving queue scheduling device can also include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26. Those skilled in the art can understand that, Figure 4 The structure shown in the figure does not constitute a limitation on the receiving queue scheduling device, and can include more or fewer components than shown. The receiving queue scheduling device provided by the embodiments of the present application includes a memory and a processor, and the processor can implement the following method when executing the program stored in the memory: the receiving queue scheduling method, and the effects are the same as above.

[0120] Finally, the present application also provides an embodiment of a non-volatile storage medium. The non-volatile storage medium stores a computer program, and the computer program is executed by a processor to implement the steps as described in the foregoing method embodiments.

[0121] It can be understood that if the method in the above embodiments is implemented in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or say the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and executes all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and various media that can store program codes. The non-volatile storage medium provided by the present application can implement the receiving queue scheduling method mentioned above, and the effects are the same as above.

[0122] Finally, the present application also provides a computer program product corresponding embodiment. The computer program product includes computer programs / instructions, which are executed by the processor to implement the steps described in the above receiving queue scheduling method embodiment. The computer program product provided by the present application can implement the above-mentioned receiving queue scheduling method, and the effect is the same as above.

[0123] It should also be noted that in the specification, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0124] The above describes the receiving queue scheduling method, device, medium and computer program product provided by the present application in detail. The embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts of each embodiment can be referred to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part. It should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, the present application can be improved and modified in several ways, and these improvements and modifications also fall within the protection scope of the present application.

Claims

1. A method for scheduling a receiving queue, characterized in that, The method includes: A preliminary analysis of the network stream transmitted from the fiber optic interface is performed to obtain the analysis results of the data frame length and duration of the network stream; Based on the analysis results of the data frame length and duration of the network flow, the handshake time of the network flow is set as the initial time. When the data frame length of one packet in the network flow is greater than the set threshold, the first time is set and the corresponding packet is identified as a suspected elephant flow. The total number of bytes at the first time is obtained. When the duration of the network stream reaches the second time point, the total number of bytes at the second time point is obtained; the second time point is the sum of the first time point and the preset elephant stream duration parameter; Determine whether the value obtained by dividing the number of transmissions of the suspected elephant stream by the difference between the total number of bytes at the first time and the total number of bytes at the second time is greater than a set percentage; if yes, the suspected elephant stream is the target elephant stream; if no, the suspected elephant stream is the target mouse stream. In the target mouse flow, a whitelist query method is used to identify the critical mouse flow; the remaining mouse flows in the target mouse flow other than the critical mouse flows are non-critical mouse flows. After receiving the target instruction, the processor status is sent to the field-programmable gate array hardware so that the field-programmable gate array hardware can perform corresponding queue allocation for the critical mouse stream, the non-critical mouse stream and the target elephant stream according to the processor status; When a queue conflict notification signal is received from the field-programmable gate array hardware via the base address register, in response to the queue conflict notification signal, if the stream with the queue conflict includes the non-critical mouse stream or the target elephant stream, the non-critical mouse stream or the target elephant stream is scheduled to the idle queue; if the stream with the queue conflict includes the critical mouse stream, the application process corresponding to the critical mouse stream with the queue conflict is scheduled to the idle processor, and the field-programmable gate array hardware is notified.

2. The receiving queue scheduling method according to claim 1, characterized in that, The key rat flow is determined by querying a whitelist, including: Based on a pre-created whitelist, determine whether the target rat stream has been marked; If a mouse flow is marked, it is determined to be a non-critical mouse flow; if it is not marked, it is determined to be a critical mouse flow.

3. The receiving queue scheduling method according to claim 2, characterized in that, Before determining whether the target mouse stream has been marked, the process also includes: Create task flows that support user-specified tags, support switching between multiple tuples, support custom start byte position and length, support specifying destination processors and whitelist tables containing hash values ​​from tags; Based on the created whitelist, determine whether the target mouse stream has been marked.

4. The receiving queue scheduling method according to claim 3, characterized in that, Based on the created whitelist, determine whether the target mouse stream is marked, including: The hash value of the target mouse stream is calculated based on the instructions in the created whitelist table; Determine if the calculated hash value is equal to the hash value in the tag; If yes, the target mouse stream is determined to be marked; otherwise, the target mouse stream is determined to be unmarked.

5. The receiving queue scheduling method according to claim 1, characterized in that, Before sending the processor state to the field-programmable gate array hardware, the following is also included: Periodically retrieve the idle status of all processors; Based on the obtained processor idle status, the utilization rate of idle processes on the processor is obtained; When the utilization rate of the processor's idle processes is less than the set utilization threshold, all processor states are sent to the field programmable gate array hardware.

6. The receiving queue scheduling method according to claim 1, characterized in that, In addition to sending the processor state to the field-programmable gate array hardware, the method also includes: The correspondence between queues and processors is sent to the field-programmable gate array (FPGA) hardware, so that the FPGA hardware can read the correspondence between queues and processors and the processor status, and then allocate queues accordingly to the critical mouse stream, the non-critical mouse stream and the target elephant stream based on the read information.

7. The receiving queue scheduling method according to claim 6, characterized in that, For the critical mouse flow, the non-critical mouse flow, and the target elephant flow, corresponding queue allocation is performed, including: For the critical mouse stream, queue allocation is performed based on the destination processor field and the correspondence between the queue and the processor; For the non-critical mouse flow and the target elephant flow, calculate the corresponding queue number by taking the remainder of the five-tuple hash result according to the total number of queues, and then allocate queues according to the calculated queue number.

8. A receiving queue scheduling device, characterized in that, The device includes: Memory, used to store computer programs; A processor, configured to implement the steps of the receive queue scheduling method as described in any one of claims 1 to 7 when executing the computer program.

9. A non-volatile storage medium, characterized in that, The non-volatile storage medium stores a computer program, which, when executed by a processor, implements the steps of the receive queue scheduling method as described in any one of claims 1 to 7.

10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the receive queue scheduling method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Message processing method and device

    CN105337896A

  • Dynamic tag threshold cache management method for micro burst suppression

    CN112929295A