Data processing method, data processing system, computing device and storage medium
By optimizing and selecting the load information of the processor unit and message sending queue in the target processor, the high latency problem caused by excessive load of the processor unit under the RR mechanism is solved, and the processor performance is improved.
Patent Information
- Application Number
- CN202411672141.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-20
AI Technical Summary
The existing RR mechanism does not consider the workload of the processor unit when allocating network messages, resulting in excessive load of a processor unit, causing high latency and affecting processor performance.
By determining the target processor unit corresponding to the target message data based on the unit load information of each processor unit in the target processor, and determining the target message transmission queue based on the queue load information of the message transmission queue corresponding to the target processor unit, the target message transmission queue is selected and the processor unit with a smaller load for processing.
The load optimization selection of processor units and message sending queues is realized, avoiding high latency caused by excessive load of a single processor unit, and ensuring the overall performance of the target processor.
Smart Images

Figure CN119211242B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of computer technology, and in particular, to a data processing method, a data processing system, a computing device, and a storage medium. Background Art
[0002] In practical applications, the distribution of network packets can be achieved through a simple RR mechanism. The RR mechanism is a load balancing strategy that can be used to distribute network packets to different processor units in the processor in a round-robin manner. However, the RR mechanism does not consider the current workload of each processor unit when distributing network packets. Therefore, when a processor unit is overloaded due to too many network packet processing tasks, it will have a high latency effect on the processor, affecting the forwarding delay of the entire processor, resulting in an increase in the forwarding delay of the entire processor, thereby affecting the performance of the entire processor. Therefore, an effective technical solution is urgently needed to solve the above problems. Summary of the invention
[0003] In view of this, an embodiment of this specification provides a data processing method. One or more embodiments of this specification also relate to a data processing device, a data processing system, a computing device, a computer-readable storage medium and a computer program product to solve the technical defects existing in the prior art.
[0004] According to a first aspect of an embodiment of this specification, a data processing method is provided, including:
[0005] Determine the target processor unit corresponding to the target message data according to the unit load information of each processor unit in the target processor, wherein the unit load information of the target processor unit is less than the unit load information of other processor units;
[0006] Determining a target message sending queue from the multiple message sending queues according to queue load information of the multiple message sending queues corresponding to the target processor unit, wherein the queue load information of the target message sending queue is less than the queue load information of other message sending queues;
[0007] The target message data is sent to the target processor unit for processing through the target message sending queue.
[0008] According to a second aspect of an embodiment of this specification, there is provided a data processing device, including:
[0009] A first determination module is configured to determine a target processor unit corresponding to the target message data according to unit load information of each processor unit in the target processor, wherein the unit load information of the target processor unit is less than the unit load information of other processor units;
[0010] A second determination module is configured to determine a target message sending queue from the multiple message sending queues according to queue load information of the multiple message sending queues corresponding to the target processor unit, wherein the queue load information of the target message sending queue is less than the queue load information of other message sending queues;
[0011] The sending module is configured to send the target message data to the target processor unit for processing through the target message sending queue.
[0012] According to a third aspect of the embodiments of this specification, a data processing system is provided, including a network connection device, a load balancing engine and a target processor, wherein:
[0013] The network connection device is configured to receive target message data and send the target message data to the load balancing engine;
[0014] The load balancing engine is configured to determine the target processor unit corresponding to the target message data based on the unit load information of each processor unit in the target processor; determine the target message sending queue from the multiple message sending queues based on the queue load information of the multiple message sending queues corresponding to the target processor unit; and send the target message data to the target processor unit for processing through the target message sending queue, wherein the unit load information of the target processor unit is smaller than the unit load information of other processor units, and the queue load information of the target message sending queue is smaller than the queue load information of other message sending queues.
[0015] According to a fourth aspect of an embodiment of this specification, a computing device is provided, including:
[0016] Memory and processor;
[0017] The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the above method are implemented.
[0018] According to a fifth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores a computer program / instruction, and the steps of the above method are implemented when the computer program / instruction is executed by a processor.
[0019] According to a sixth aspect of the embodiments of this specification, a computer program product is provided, comprising a computer program / instruction, which implements the steps of the above method when executed by a processor.
[0020] An embodiment of the present specification provides a data processing method, comprising: determining a target processor unit corresponding to target message data based on unit load information of each processor unit in a target processor, wherein the unit load information of the target processor unit is less than the unit load information of other processor units; determining a target message sending queue from the multiple message sending queues based on queue load information of multiple message sending queues corresponding to the target processor unit, wherein the queue load information of the target message sending queue is less than the queue load information of other message sending queues; and sending the target message data to the target processor unit for processing via the target message sending queue.
[0021] The above method determines the target processor unit corresponding to the target message data according to the unit load information of each processor unit in the target processor, determines the target message sending queue from multiple message sending queues according to the queue load information of multiple message sending queues corresponding to the target processor unit, sends the target message data to the target processor unit through the target message sending queue, selects the target processor unit and the target message sending queue with smaller load, realizes load optimization selection of the processor unit and the message sending queue, avoids the high delay of network message forwarding caused by the high load of a single processor unit in the target processor through double-layer scheduling, thereby ensuring the overall performance of the target processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is a schematic diagram of an application scenario of a data processing method provided by an embodiment of this specification;
[0023] Figure 2 is a flow chart of a data processing method provided by an embodiment of this specification;
[0024] Figure 3 It is a flowchart of token maintenance of a processor unit in a data processing method provided in one embodiment of the present specification;
[0025] Figure 4 It is a flow chart of determining a target processor unit and a target message sending queue in a data processing method provided by an embodiment of this specification;
[0026] Figure 5 It is a flowchart of token maintenance of a message sending queue in a data processing method provided in one embodiment of this specification;
[0027] Figure 6 is a processing flow chart of a data processing method provided by an embodiment of this specification;
[0028] Figure 7is a structural schematic diagram of a data processing device provided by an embodiment of this specification;
[0029] Figure 8 is a structural diagram of a data processing system provided by an embodiment of this specification;
[0030] Fig. 9 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0031] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0032] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0033] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0034] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0035] First, the terms involved in one or more embodiments of this specification are explained.
[0036] CPU: Central Processing Unit is the main arithmetic and logical operation unit of the computer, responsible for executing instructions and controlling other parts of the computer.
[0037] CPU Core: Central Processing Unit Core. Modern multi-core processors contain multiple independent computing units, each of which is called a "core". Each core can execute an instruction set independently.
[0038] Docker: It is an application container engine that can package applications and dependent packages into a portable container and then publish them to the machine. It can also achieve virtualization.
[0039] PCIE: Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard used to connect high-speed devices to a computer motherboard.
[0040] DMA: Direct Memory Access. This is a technology that allows a hardware subsystem or device to interact directly with memory outside the main processor without the intervention of the central processor.
[0041] ID: Identifier or identity. Usually refers to a number or code that uniquely identifies an object, user, entity or record.
[0042] In actual applications, during the network message forwarding process, the network messages can be distributed according to the RR mechanism, so as to break up the elephant flow to each processor unit in the processor, thereby reducing the impact of the elephant flow. However, since the status of the processor and each processor unit is not taken into account when distributing the network message according to the RR mechanism, once the network message is distributed to a high-load processor unit, the processor unit will be overloaded and high latency will be introduced. Under the hardware message order preservation requirement, the forwarding delay and performance of the entire processor will be further affected. Therefore, an effective technical solution is urgently needed to solve the above problems.
[0043] In this specification, a data processing method is provided. This specification also relates to a data processing device, a data processing system, a computing device, a computer-readable storage medium and a computer program product, which are described in detail one by one in the following embodiments.
[0044] See also Figure 1 , Figure 1 A schematic diagram of an application scenario of a data processing method provided according to an embodiment of the present specification is shown, and the data processing method specifically includes the following steps.
[0045] Determine the target processor unit corresponding to the target message data according to the unit load information of each processor unit in the target processor, wherein the unit load information of the target processor unit is less than the unit load information of other processor units;
[0046] Determining a target message sending queue from the multiple message sending queues according to queue load information of the multiple message sending queues corresponding to the target processor unit, wherein the queue load information of the target message sending queue is less than the queue load information of other message sending queues;
[0047] The target message data is sent to the target processor unit for processing through the target message sending queue.
[0048] Specifically, Figure 1 The network connection device 102 and the target processor 104 are included. The network connection device 102 may be a network card, and the target processor 104 may include multiple processor units.
[0049] During specific implementation, after the network connection device 102 receives the target message data, it can determine the processor unit in the target processor whose unit load information is smaller than that of other processor units as the target processor unit corresponding to the target message data based on the unit load information of each processor unit in the target processor 104 corresponding to the target message data, and determine the message sending queue in multiple message sending queues whose queue load information is smaller than that of other message sending queues as the target message sending queue based on the queue load information of multiple message sending queues bound to the target processor unit, and send the target message data to the target processor unit in the target processor 104 through the target message sending queue, and process the target message data through the target processor unit, thereby avoiding forwarding delay caused by the high load of a single processor unit in the target processor and ensuring the performance of the target processor.
[0050] See also Figure 2 , Figure 2 A flow chart of a data processing method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.
[0051] Step 202: Determine the target processor unit corresponding to the target message data according to the unit load information of each processor unit in the target processor, wherein the unit load information of the target processor unit is smaller than the unit load information of other processor units.
[0052] Specifically, the data processing method provided in the embodiments of this specification can be applied to a network connection device, which may be a network card, for example.
[0053] Among them, the target message data can be understood as the network message data that needs to be sent. The target processor can be understood as the CPU to which the target message data is sent. Each processor unit in the target processor can be understood as multiple CPU cores in the CPU. The unit load information can be understood as the current load of the CPU core. The target processor unit corresponding to the target message data can be understood as the CPU core determined from multiple CPU cores to which the target message data needs to be sent. Other processor units can be understood as other processor units among the multiple processor units included in the target processor, except the target processor unit.
[0054] Specifically, the target CPU core to which the target message data needs to be sent may be determined from among the multiple CPU cores in the target CPU according to the current load of each CPU core in the target CPU.
[0055] In one embodiment of the present specification, before determining the target processor unit corresponding to the target message data according to the unit load information of each processor unit in the target processor, the method further includes:
[0056] Determine target message data, and determine a target processor corresponding to the target message data, wherein the target processor includes a plurality of processor units.
[0057] Specifically, target message data to be sent may be received from a network server, and a CPU to which the target message data needs to be sent may be determined, wherein the CPU includes a plurality of CPU cores.
[0058] In summary, after receiving the target message data, determining the CPU to which the target message data needs to be sent facilitates subsequent determination of the CPU core that processes the target message data.
[0059] During specific implementation, the target processor transmits messages through a PCIE virtual device;
[0060] After determining the target processor corresponding to the target message data, the method further includes:
[0061] Determine, according to the device attribute information of the PCIE virtual device, a plurality of processor units bound to the PCIE virtual device;
[0062] The multiple processor units bound to the PCIE virtual device are determined as the processor units in the target processor.
[0063] Among them, the device attribute information of the PCIE virtual device can be understood as the device ID of the PCIE virtual device.
[0064] In actual applications, in a cloud network, a portion of the processor units and a PCIE virtual device with a specified number of DMA queues can be taken over in the form of a Docker container to send and receive network message data. Each processor unit in Docker is used to host one or more DMA queues for sending and receiving network message data.
[0065] Based on this, in order to achieve hardware load balancing, multiple processor units bound to the PCIE device can be selected according to the device ID of the PCIE virtual device, and the multiple processor units bound to the PCIE virtual device can be determined as the processor units in the target processor, so as to facilitate the subsequent selection of processor units according to the unit load information of the multiple processor units.
[0066] In summary, one or more processor units bound to the PCIE virtual device can be selected according to the device ID of the PCIE virtual device, thereby facilitating subsequent selection of a processor unit with the smallest load from the one or more processor units.
[0067] Specifically, determining the target processor unit corresponding to the target message data according to the unit load information of each processor unit in the target processor includes:
[0068] Comparing unit load information of each processor unit in the target processor to obtain a unit load comparison result;
[0069] According to the unit load comparison result, a processor unit among the processor units that meets a preset load condition is determined as a target processor unit corresponding to the target message data.
[0070] The target processor unit may be understood as a processor unit with the smallest load among multiple processor units.
[0071] Based on this, the current loads of multiple processor units included in the target processor can be compared to obtain a unit load comparison result. According to the unit load comparison result, the processor unit with the smallest current load can be determined from the multiple processor units as the target processor unit.
[0072] In addition, the target processor unit may be determined from multiple processor units according to other selection strategies. The specific selection strategy may be set according to actual needs, and the embodiments of this specification do not limit this.
[0073] In summary, by selecting the processor unit with the smallest current load as the target processor unit, the load of the target processor can be dynamically sensed to avoid excessive load on a single processor unit.
[0074] In addition, before determining the target processor unit corresponding to the target message data according to the unit load information of each processor unit in the target processor, the method further includes:
[0075] Determining unit load information of each processor unit in the target processor;
[0076] The determining of unit load information of each processor unit in the target processor includes:
[0077] sequentially determining each processor unit in the target processor as an initial processor unit;
[0078] Determining a number of third messages received by the initial processor unit, and determining a number of fourth messages sent by the initial processor unit;
[0079] The unit load information of the initial processor unit is calculated according to the third number of messages and the fourth number of messages to obtain the unit load information of each processor unit in the target processor.
[0080] Wherein, determining each processor unit in the target processor as the initial processor unit can be understood as the process of performing the above-mentioned unit load information determination on each processor unit in the target processor. That is to say, the initial processor unit can be understood as each processor unit in the target processor. The number of third messages received by the initial processor unit can be understood as the number of messages received by the initial processor unit, and the number of fourth messages sent by the initial processor unit can be understood as the number of messages sent by the initial processor unit.
[0081] Specifically, taking one of the processor units in the target processor as the initial processor unit as an example, the number of third messages received by the initial processor unit is determined, and the number of fourth messages sent by the initial processor unit is determined, and the difference between the third message number and the fourth message number is calculated, and the current load of the initial processor unit is determined according to the difference. Similarly, similar processing is performed on each processor unit in the target processor.
[0082] In practical applications, the difference between the number of the third message and the number of the fourth message can be calculated in the form of tokens. Figure 3 , Figure 3A flowchart of token maintenance of a processor unit in a data processing method provided in an embodiment of the present specification is shown, wherein the token of the processor unit can be understood as a counter for receiving and / or sending messages by the processor unit, for example, when the processor unit receives a message data, the token is increased by 1, and when the processor unit sends a message data, the token is decreased by 1. Specifically, the token of the processor unit can be subtracted or increased according to information such as the length and type of the message data received or sent by the processor unit. Specifically, when it is determined that the message data received by the processor unit (i.e., the message sent) belongs to the processor unit, the token of the processor unit is subtracted or increased according to information such as the length and type of the message data; when it is determined that the message data sent by the processor unit (i.e., the message sent) belongs to the processor unit, the token of the processor unit can be increased / subtracted according to information such as the length and type of the message data.
[0083] In addition, when a processor unit enters an abnormal working state and is unable to execute instructions or respond to requests, the CPU monitoring process can promptly issue instructions to shield the abnormal processor unit.
[0084] In summary, token maintenance is performed based on the information of the upward and downward messages. One direction (upward or downward) is used to increase tokens, and the other direction (downward or upward) is used to reduce tokens, thereby realizing load perception of each processor unit and establishing CPU core-granular load maintenance based on DMA upstream / downstream traffic inside the network card.
[0085] Step 204: Determine a target message sending queue from the multiple message sending queues according to the queue load information of the multiple message sending queues corresponding to the target processor unit, wherein the queue load information of the target message sending queue is smaller than the queue load information of other message sending queues.
[0086] The message sending queue can be understood as a DMA queue. The queue load information can be understood as the current load of the DMA queue. Other message sending queues can be understood as other message sending queues among multiple message sending queues except the target message sending queue.
[0087] Specifically, the target DMA queue may be determined from the multiple DMA queues according to the current load of each DMA queue in the multiple DMA queues corresponding to the target CPU core.
[0088] In an actual application, before determining the target message sending queue from the multiple message sending queues according to the queue load information of the multiple message sending queues corresponding to the target processor unit, the method further includes:
[0089] According to the binding relationship between the processor unit and the message sending queue, a plurality of message sending queues bound to the target processor unit are determined.
[0090] Specifically, a processor unit may be bound to multiple message sending queues, and the multiple message sending queues bound to the target processor unit may be determined according to the binding relationship between the processor unit and the message sending queues.
[0091] In actual applications, the processor unit ID attribute information can be added to the queue attribute information of the DMA queue, so that when the CPU selects the queue, the processor unit ID bound to the DMA queue can be sent to the mapping information part in the load balancing engine through the queue management module of the DMA queue for storage. When the network card receives the target network message, it can determine to which PCIE virtual device the target network message should be sent through data logic processing, and send the target network message to the load balancing engine for selection of the target DMA queue.
[0092] In summary, by establishing a binding relationship between the message sending queue and the processor unit, and sending the queue attributes to the hardware, a mapping relationship between the network card and the processor unit is established, which facilitates the selection of the target processor unit and the target DMA queue.
[0093] Further, after determining the multiple message sending queues bound to the target processor unit, the method further includes:
[0094] According to a preset determination rule, the target message sending queue is determined from the multiple message sending queues.
[0095] The preset determination rule may be understood as a selection strategy for selecting a target DMA queue, and the preset determination rule may include but is not limited to a priority arbitration rule, a polling arbitration rule, a priority-based polling arbitration rule, and the like.
[0096] In a specific implementation, determining the target message sending queue from the multiple message sending queues according to a preset determination rule includes:
[0097] Determine queue priority information of the multiple message sending queues, and determine the target message sending queue from the multiple message sending queues according to the queue priority information; or
[0098] The multiple message sending queues are polled to obtain a polling result, and the target message sending queue is determined from the multiple message sending queues according to the polling result.
[0099] Specifically, in one embodiment of the present specification, based on the queue priority information of each message sending queue in the multiple message sending queues, and based on the queue priority information of each message sending queue, a message sending queue with the highest priority can be selected from multiple message sending queues as the target message sending queue.
[0100] In another embodiment of the present specification, the message sending queue may be polled to obtain the polling result, and according to the polling result, a message sending queue is randomly determined from multiple message sending queues as the target message sending queue.
[0101] In summary, the target message sending queue is determined according to the queue priority information or the polling result.
[0102] Specifically, determining a target message sending queue from the multiple message sending queues according to queue load information of the multiple message sending queues corresponding to the target processor unit includes:
[0103] Comparing queue load information of multiple message sending queues corresponding to the target processor unit to obtain a queue load comparison result;
[0104] According to the queue load comparison result, a message sending queue that meets a preset load condition among the multiple message sending queues is determined as the target message sending queue.
[0105] The target message sending queue can be understood as a message sending queue with a smaller load among multiple message sending queues. Meeting the preset load condition can be understood as queue load information being less than a preset load threshold, or queue load information being less than queue load information of other message sending queues.
[0106] Based on this, the current load amounts of multiple message sending queues can be compared to obtain queue load comparison results. According to the queue load comparison results, a message sending queue whose current load amount is less than the current load amounts of other message sending queues can be determined from multiple message sending queues as the target message sending queue.
[0107] In practical applications, see Figure 4 , Figure 4 FIG. 1 shows a flow chart of determining a target processor unit and a target message sending queue in a data processing method provided according to an embodiment of the present specification. Figure 4As shown, multiple processor units bound to the PCIE virtual device can be selected according to the device ID of the PCIE virtual device, and according to the unit load information of the multiple processor units, the processor unit with the smallest load is selected as the target processor unit through a specific algorithm, and multiple message sending queues belonging to the target processor unit are selected, and the message sending queue with the smallest load is selected as the target message sending queue according to the queue load information of the multiple message sending queues.
[0108] In addition, the target message sending queue may be determined from multiple message sending queues according to other selection strategies. The specific selection strategy may be set according to actual needs, and the embodiments of this specification do not limit this.
[0109] In summary, when sending message data, the optimal selection of the processor unit and the optimal selection of the target message sending queue on the target processor unit are established based on different scheduling algorithms. Double-layer scheduling is used to avoid high latency of the network card order-preserving forwarding caused by high single-core load.
[0110] Further, before determining the target message sending queue from the multiple message sending queues according to the queue load information of the multiple message sending queues corresponding to the target processor unit, the method further includes:
[0111] Determining queue load information of each message sending queue in the multiple message sending queues;
[0112] The determining the queue load information of each message sending queue in the multiple message sending queues includes:
[0113] Determining each of the multiple message sending queues as a message sending queue to be processed in sequence;
[0114] Determine the number of first messages processed by the to-be-processed message sending queue in a first sending direction, and determine the number of second messages processed by the to-be-processed message sending queue in a second sending direction, wherein the first sending direction is a direction in which message data is sent from the network connection device to the target processor, and the second sending direction is a direction in which message data is sent from the target processor to the network connection device;
[0115] The queue load information of the to-be-processed message sending queue is calculated according to the first message quantity and the second message quantity to obtain the queue load information of each message sending queue in the multiple message sending queues.
[0116] Among them, the network connection device can be understood as a network card, the first sending direction can be understood as an upward sending direction (i.e., the direction in which the processor unit receives message data), and the second sending direction can be understood as a downward sending direction (i.e., the direction in which the processor unit sends message data). The message sending queues in the multiple message sending queues are sequentially determined as the message sending queues to be processed, which can be understood as the process of determining the queue load information of each message sending queue in the multiple message sending queues. The first message quantity can be understood as the number of messages processed by the message sending queue to be processed in the first sending direction. For example, the message sending queue to be processed currently sends 5 message data from the network connection device to the target processor, then the first message quantity is 5. The second message quantity can be understood as the number of messages processed by the message sending queue to be processed in the second sending direction. For example, the message sending queue to be processed currently sends 6 message data from the target processor to the network connection device, then the second message quantity is 6.
[0117] Specifically, taking one of the multiple message sending queues as a to-be-processed message sending queue as an example, the first message quantity processed by the to-be-processed message sending queue in the uplink direction and the second message quantity processed in the downlink direction are determined, the quantity difference between the first message quantity and the second message quantity is calculated, and the current load of the to-be-processed message sending queue is determined according to the quantity difference. Similarly, similar processing is performed on each of the multiple message sending queues.
[0118] In practical applications, the difference between the first message quantity and the second message quantity can be calculated in the form of tokens. Figure 5 , Figure 5 A flowchart of token maintenance of a message sending queue in a data processing method provided in an embodiment of the present specification is shown, wherein the token of the message sending queue can be understood as a counter of the message sending queue processing message data in the upward / downward direction. For example, when the message sending queue sends a message data from a network connection device to a target processor, the token is increased by 1; when the message sending queue sends a message data from the target processor to the network connection device, the token is decreased by 1. Specifically, the token of the message sending queue can be reduced or increased according to information such as the length and type of the message data received or sent by the message sending queue in the upward / downward direction. Specifically, when it is determined that an upward message belongs to the message sending queue, the token of the message sending queue is reduced / increased according to information such as the length and type of the message data; when it is determined that a downward message belongs to the message sending queue, the token of the message sending queue can be increased / reduced according to information such as the length and type of the message data.
[0119] In summary, queue-granularity load maintenance is established inside the network card based on DMA upstream / downstream traffic.
[0120] Step 206: Send the target message data to the target processor unit for processing through the target message sending queue.
[0121] Specifically, after determining the target processor unit and the target message sending queue, the target message sending queue can be used as an uplink queue to send the target message data to the target processor unit through the target message sending queue so that the target processor unit processes the target message data.
[0122] In addition, after the target processor unit processes the target message data, the target message sending queue can be used as a sending queue, and the processed target message data can be sent to the network connection device through the target message sending queue.
[0123] To summarize, the above method determines the target processor unit corresponding to the target message data according to the unit load information of each processor unit in the target processor, determines the target message sending queue from multiple message sending queues according to the queue load information of multiple message sending queues corresponding to the target processor unit, and sends the target message data to the target processor unit through the target message sending queue, thereby realizing load optimization selection of processor units and message sending queues, and avoiding high delay in network message forwarding caused by high load of a single processor unit in the target processor through double-layer scheduling, thereby ensuring the overall performance of the target processor.
[0124] The following combination Figure 6 , taking the application of the data processing method provided in this specification in network message distribution as an example, the data processing method is further explained. Figure 6 A processing flow chart of a data processing method provided by an embodiment of this specification is shown as follows: Figure 6As shown, the network connection device (i.e., the network card) is used to receive the target message data sent by the network server, determine the PCIE virtual device to which the target message data is sent through data logic processing, and send the device information of the PCIE virtual device and the target message data to the load balancing engine. The load balancing engine can select the CPU core bound to the PCIE virtual device according to the device ID of the PCIE virtual device, and select the CPU core with the smallest load through a specific algorithm according to the load information of these CPU cores, and select the DMA queue belonging to the CPU core, and select the DMA queue with the smallest load as the uplink queue (i.e., the RX DMA engine) and the downlink queue (i.e., the TX DMA engine) according to the load information of the DMA queue, and send the target message data to the CPU core with the smallest load through the PCIE virtual device through the uplink queue. After the CPU core processes the target message data, it is sent to the network card through the downlink queue. In addition, the load balancing engine can also perform token maintenance based on the uplink message information and downlink message information of the DMA engine. The load balancing engine can also add a binding relationship of the ID attribute information of a CPU core for the DMA queue, and send the ID information of the CPU core bound to each DMA queue to the mapping information part in the load balancing engine for storage through the DMA queue management module.
[0125] Corresponding to the above method embodiment, this specification also provides a data processing device embodiment, Figure 7 FIG. 1 is a schematic diagram showing the structure of a data processing device provided by an embodiment of the present specification. Figure 7 As shown, the device comprises:
[0126] A first determination module 702 is configured to determine a target processor unit corresponding to the target message data according to unit load information of each processor unit in the target processor, wherein the unit load information of the target processor unit is less than the unit load information of other processor units;
[0127] The second determining module 704 is configured to determine a target message sending queue from the multiple message sending queues according to the queue load information of the multiple message sending queues corresponding to the target processor unit, wherein the queue load information of the target message sending queue is less than the queue load information of the other message sending queues;
[0128] The sending module 706 is configured to send the target message data to the target processor unit for processing through the target message sending queue.
[0129] In an optional embodiment, the second determining module 704 is further configured to:
[0130] Comparing queue load information of multiple message sending queues corresponding to the target processor unit to obtain a queue load comparison result;
[0131] According to the queue load comparison result, a message sending queue that meets a preset load condition among the multiple message sending queues is determined as the target message sending queue.
[0132] In an optional embodiment, the second determining module 704 is further configured to:
[0133] Determining queue load information of each message sending queue in the multiple message sending queues;
[0134] Determining each of the multiple message sending queues as a message sending queue to be processed in sequence;
[0135] Determine the number of first messages processed by the to-be-processed message sending queue in a first sending direction, and determine the number of second messages processed by the to-be-processed message sending queue in a second sending direction, wherein the first sending direction is a direction in which message data is sent from the network connection device to the target processor, and the second sending direction is a direction in which message data is sent from the target processor to the network connection device;
[0136] The queue load information of the to-be-processed message sending queue is calculated according to the first message quantity and the second message quantity to obtain the queue load information of each message sending queue in the multiple message sending queues.
[0137] In an optional embodiment, the second determining module 704 is further configured to:
[0138] According to the binding relationship between the processor unit and the message sending queue, a plurality of message sending queues bound to the target processor unit are determined.
[0139] In an optional embodiment, the second determining module 704 is further configured to:
[0140] According to a preset determination rule, the target message sending queue is determined from the multiple message sending queues.
[0141] In an optional embodiment, the second determining module 704 is further configured to:
[0142] Determine queue priority information of the multiple message sending queues, and determine the target message sending queue from the multiple message sending queues according to the queue priority information; or
[0143] The multiple message sending queues are polled to obtain a polling result, and the target message sending queue is determined from the multiple message sending queues according to the polling result.
[0144] In an optional embodiment, the first determining module 702 is further configured to:
[0145] Comparing unit load information of each processor unit in the target processor to obtain a unit load comparison result;
[0146] According to the unit load comparison result, a processor unit among the processor units that meets a preset load condition is determined as a target processor unit corresponding to the target message data.
[0147] In an optional embodiment, the first determining module 702 is further configured to:
[0148] Determining unit load information of each processor unit in the target processor;
[0149] sequentially determining each processor unit in the target processor as an initial processor unit;
[0150] Determining a number of third messages received by the initial processor unit, and determining a number of fourth messages sent by the initial processor unit;
[0151] The unit load information of the initial processor unit is calculated according to the third number of messages and the fourth number of messages to obtain the unit load information of each processor unit in the target processor.
[0152] In an optional embodiment, the first determining module 702 is further configured to:
[0153] Determine target message data, and determine a target processor corresponding to the target message data, wherein the target processor includes a plurality of processor units.
[0154] In an optional embodiment, the target processor transmits the message through a PCIE virtual device;
[0155] The first determining module 702 is further configured to:
[0156] Determine, according to the device attribute information of the PCIE virtual device, a plurality of processor units bound to the PCIE virtual device;
[0157] The multiple processor units bound to the PCIE virtual device are determined as the processor units in the target processor.
[0158] To summarize, the above-mentioned device determines the target processor unit corresponding to the target message data according to the unit load information of each processor unit in the target processor, determines the target message sending queue from multiple message sending queues according to the queue load information of multiple message sending queues corresponding to the target processor unit, and sends the target message data to the target processor unit through the target message sending queue, thereby realizing load optimization selection of processor units and message sending queues, and avoiding high delays in network message forwarding caused by high load of a single processor unit in the target processor through double-layer scheduling, thereby ensuring the overall performance of the target processor.
[0159] The above is a schematic scheme of a data processing device of this embodiment. It should be noted that the technical scheme of the data processing device and the technical scheme of the above data processing method belong to the same concept, and the details of the technical scheme of the data processing device that are not described in detail can be referred to the description of the technical scheme of the above data processing method.
[0160] Corresponding to the above method embodiment, this specification also provides a data processing system embodiment. Figure 8 FIG. 1 shows a schematic diagram of a data processing system provided by an embodiment of the present specification. Figure 8 As shown, the system includes: a network connection device 802, a load balancing engine 804 and a target processor 806, wherein:
[0161] The network connection device 802 is configured to receive target message data and send the target message data to the load balancing engine 804;
[0162] The load balancing engine 804 is configured to determine the target processor unit corresponding to the target message data based on the unit load information of each processor unit in the target processor 806; determine the target message sending queue from the multiple message sending queues based on the queue load information of the multiple message sending queues corresponding to the target processor unit; and send the target message data to the target processor unit for processing through the target message sending queue, wherein the unit load information of the target processor unit is smaller than the unit load information of other processor units, and the queue load information of the target message sending queue is smaller than the queue load information of other message sending queues.
[0163] The above-mentioned system determines the target processor unit corresponding to the target message data according to the unit load information of each processor unit in the target processor, determines the target message sending queue from multiple message sending queues according to the queue load information of multiple message sending queues corresponding to the target processor unit, and sends the target message data to the target processor unit through the target message sending queue, thereby realizing load optimization selection of processor units and message sending queues, and avoiding high delay in network message forwarding caused by high load of a single processor unit in the target processor through double-layer scheduling, thereby ensuring the overall performance of the target processor.
[0164] The above is a schematic scheme of a data processing system of this embodiment. It should be noted that the technical scheme of the data processing system and the technical scheme of the above data processing method belong to the same concept, and the details not described in detail in the technical scheme of the data processing system can be referred to the description of the technical scheme of the above data processing method.
[0165] Fig. 9 The structure block diagram of a computing device 900 provided according to an embodiment of the present specification is shown. The components of the computing device 900 include but are not limited to a memory 910 and a processor 920. The processor 920 is connected to the memory 910 via a bus 930, and a database 950 is used to store data.
[0166] The computing device 900 also includes an access device 940 that enables the computing device 900 to communicate via one or more networks 960. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 940 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0167] In one embodiment of the present application, the above components of the computing device 900 and Fig. 9 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig. 9 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0168] The computing device 900 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 900 may also be a mobile or stationary server.
[0169] The processor 920 is used to execute the following computer program / instructions, which implement the steps of the above-mentioned data processing method when executed by the processor.
[0170] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computing device embodiment, since it is basically similar to the data processing method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the data processing method embodiment.
[0171] An embodiment of the present specification further provides a computer-readable storage medium storing a computer program / instruction, which implements the steps of the above-mentioned data processing method when executed by a processor.
[0172] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computer-readable storage medium embodiment, since it is basically similar to the data processing method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the data processing method embodiment.
[0173] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which implements the steps of the above data processing method when executed by a processor.
[0174] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the above data processing method belong to the same concept, and the details not described in detail in the technical scheme of the computer program product can be referred to the description of the technical scheme of the above data processing method.
[0175] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0176] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0177] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0178] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0179] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.
Claims
1. A data processing method, comprising: Determine the target processor unit corresponding to the target message data according to the unit load information of each processor unit in the target processor, wherein the unit load information of the target processor unit is less than the unit load information of other processor units; Determining a target message sending queue from the multiple message sending queues according to queue load information of the multiple message sending queues corresponding to the target processor unit, wherein the queue load information of the target message sending queue is less than the queue load information of other message sending queues, and the queue load information of the multiple message sending queues is determined according to the number of first messages processed in a first sending direction and the number of second messages processed in a second sending direction, wherein the first sending direction is a direction in which message data is sent from a network connection device to the target processor, and the second sending direction is a direction in which message data is sent from the target processor to the network connection device; The target message data is sent to the target processor unit for processing through the target message sending queue.
2. The method according to claim 1, wherein determining a target message sending queue from the multiple message sending queues according to queue load information of the multiple message sending queues corresponding to the target processor unit comprises: Comparing queue load information of multiple message sending queues corresponding to the target processor unit to obtain a queue load comparison result; According to the queue load comparison result, a message sending queue that meets a preset load condition among the multiple message sending queues is determined as the target message sending queue.
3. The method according to claim 1, before determining the target message sending queue from the multiple message sending queues according to the queue load information of the multiple message sending queues corresponding to the target processor unit, further comprising: Determining queue load information of each message sending queue in the multiple message sending queues; The determining the queue load information of each message sending queue in the multiple message sending queues includes: Determining each of the multiple message sending queues as a message sending queue to be processed in sequence; Determine the number of first messages processed by the pending message sending queue in the first sending direction, and determine the number of second messages processed by the pending message sending queue in the second sending direction; The queue load information of the to-be-processed message sending queue is calculated according to the first message quantity and the second message quantity to obtain the queue load information of each message sending queue in the multiple message sending queues.
4. The method according to any one of claims 1 to 3, before determining the target message sending queue from the multiple message sending queues according to the queue load information of the multiple message sending queues corresponding to the target processor unit, further comprising: According to the binding relationship between the processor unit and the message sending queue, a plurality of message sending queues bound to the target processor unit are determined.
5. The method according to claim 4, after determining the multiple message sending queues bound to the target processor unit, further comprising: According to a preset determination rule, the target message sending queue is determined from the multiple message sending queues.
6. The method according to claim 5, wherein determining the target message sending queue from the plurality of message sending queues according to a preset determination rule comprises: Determine queue priority information of the multiple message sending queues, and determine the target message sending queue from the multiple message sending queues according to the queue priority information; or The multiple message sending queues are polled to obtain a polling result, and the target message sending queue is determined from the multiple message sending queues according to the polling result.
7. The method according to claim 1, wherein determining the target processor unit corresponding to the target message data according to the unit load information of each processor unit in the target processor comprises: Comparing unit load information of each processor unit in the target processor to obtain a unit load comparison result; According to the unit load comparison result, a processor unit among the processor units that meets a preset load condition is determined as a target processor unit corresponding to the target message data.
8. The method according to any one of claims 1-3, 5-6, before determining the target processor unit corresponding to the target message data according to the unit load information of each processor unit in the target processor, further comprising: Determining unit load information of each processor unit in the target processor; The determining of unit load information of each processor unit in the target processor includes: sequentially determining each processor unit in the target processor as an initial processor unit; Determining a number of third messages received by the initial processor unit, and determining a number of fourth messages sent by the initial processor unit; The unit load information of the initial processor unit is calculated according to the third number of messages and the fourth number of messages to obtain the unit load information of each processor unit in the target processor.
9. The method according to any one of claims 1-3 and 5-7, before determining the target processor unit corresponding to the target message data according to the unit load information of each processor unit in the target processor, further comprising: Determine target message data, and determine a target processor corresponding to the target message data, wherein the target processor includes a plurality of processor units.
10. The method according to claim 9, wherein the target processor transmits the message through a PCIE virtual device; After determining the target processor corresponding to the target message data, the method further includes: Determine, according to the device attribute information of the PCIE virtual device, a plurality of processor units bound to the PCIE virtual device; The multiple processor units bound to the PCIE virtual device are determined as the processor units in the target processor.
11. A data processing system, comprising a network connection device, a load balancing engine and a target processor, wherein: The network connection device is configured to receive target message data and send the target message data to the load balancing engine; The load balancing engine is configured to determine the target processor unit corresponding to the target message data according to the unit load information of each processor unit in the target processor; According to the queue load information of multiple message sending queues corresponding to the target processor unit, a target message sending queue is determined from the multiple message sending queues; through the target message sending queue, the target message data is sent to the target processor unit for processing, wherein the unit load information of the target processor unit is smaller than the unit load information of other processor units, the queue load information of the target message sending queue is smaller than the queue load information of other message sending queues, and the queue load information of the multiple message sending queues is determined according to the number of first messages processed in a first sending direction and the number of second messages processed in a second sending direction, the first sending direction is the direction in which message data is sent from a network connection device to the target processor, and the second sending direction is the direction in which message data is sent from the target processor to the network connection device.
12. A computing device comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the method described in any one of claims 1 to 10 are implemented.
13. A computer-readable storage medium storing a computer program / instruction, wherein the computer program / instruction, when executed by a processor, implements the steps of the method according to any one of claims 1 to 10.
14. A computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Data transmission system of cache mirroring of double-controller storage system
CN107193767A
Methods and systems for load balancing in network devices
US10740155B1