A method and device for message distribution decision-making

By counting and estimating the idle rate and processing time of each Core in the DPU system, load balancing decisions are made, the problem of unbalanced task allocation in the DPU operating system is solved, and efficient utilization of system resources and optimization of energy consumption is achieved.

CN118921325BActive Publication Date: 2025-06-10SHENZHEN AOWEI LINGXIN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410945314.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2025-06-10
Estimated Expiration
2044-07-15

AI Technical Summary

Technical Problem

The DPU operating system cannot effectively allocate tasks to each core evenly, resulting in some cores being overloaded while others being idle, resulting in unbalanced energy consumption, waste of resources and delayed response time.

Method used

By counting the idle rate of each Core and the amount of space occupied by the cache queue, calculating the estimated processing time and predicting idle rate, weighted compensation, and calculating the estimated idle rate after compensation, it is used to determine the packet distribution ratio and ensure load balancing.

Benefits of technology

Load balancing of each Core is achieved, energy consumption imbalance and resource waste are reduced, overall processing capacity and throughput of the system are improved, and system power consumption and response time delay are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118921325B_ABST
    Figure CN118921325B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for packet distribution decision-making, belonging to the field of network communication technology. Aiming at the problem that the existing DPU operating system cannot balance the service loads among each Core, each Core calculates the Core idle rate I_last of the previous cycle, feeds back the Core idle rate I_last to the packet distribution module for packet distribution decision-making, and obtains the occupied space quantity of each Core's cache queues at all levels in real time at the boundary of the distribution decision-making cycle; The present invention can accurately hash packets evenly to different Cores. When the traffic is large, packet distribution is performed according to the estimated processing capacity to minimize packet loss as much as possible; When the traffic is small, packets are evenly dispersed to different Cores for processing, reducing the queuing waiting time of packets and the delay of single-packet processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of network communication technologies, and particularly relates to a method and device for packet distribution decision-making. Background Art

[0002] A DPU, i.e., a data processing unit, and a DPU system is an integrated system of hardware and software dedicated to data processing. The DPU system contains multiple Cores (processor cores) for processing network packet data, and each Core has an independent packet cache queue to achieve lock-free programming. When each Core processes packets, it usually includes multiple different processing steps, and also includes multiple levels of cache queues, and there are dependencies between each processing step, that is: Step1 reads data from queue Q1, processes it, and stores it in queue Q2; Step2 reads data from queue Q2, processes it, and stores it in queue Q3; and so on, Stepm-1 reads data from Qm-1, processes it, and stores it in queue Qm; the execution time of each step can be estimated in advance. The DPU system includes a packet distribution module, and the packet distribution module is used to distribute the received packets to each Core for service processing.

[0003] In the prior art, the DPU operating system cannot effectively allocate tasks evenly to each core, resulting in some cores being overloaded while other cores are idle. In the case of load imbalance, the overloaded cores may consume more energy, while the idle cores waste energy. Such energy consumption imbalance leads to an increase in the overall energy consumption of the system, causing resource waste. At the same time, it takes longer for the overloaded cores to complete tasks, resulting in a delay in the overall response time.

[0004] Therefore, a method and device for packet distribution decision-making are needed to solve the problem that the DPU operating system in the prior art cannot balance the service loads among each Core. Summary of the Invention

[0005] The purpose of the present invention is to provide a method and device for packet distribution decision-making to solve the problems raised in the above background art.

[0006] To achieve the above purpose, the present invention provides the following technical solutions: A method and device for packet distribution decision-making, the following steps:

[0007] S1. Each Core counts the Core idle rate I_last in the previous cycle;

[0008] S2. Feed back the Core idle rate I_last to the packet distribution module for packet distribution decision-making;

[0009] S3. Obtain the occupied space quantities of the cache queues at all levels of each Core in real time at the boundary of the distribution decision cycle, and calculate the estimated processing time of the Core in the next cycle according to the different positions of the queues.

[0010] Tpre = Q1 * A1 + Q2 * A2 + … + Qm-1 * Am-1, where Q1 to Qm-1 are the number of packets to be processed in the cache queues, and A1 to Am-1 are the adjustable coefficients related to the time consumed by each packet processing step of the Core. Assume that the time consumed for each packet to complete all steps is S, and the processing times consumed for individual processing steps are S1 to Sm-1.

[0011] And S = S1 + S2 + … + Sm-1, then A1 = (S1 + S2 + … + Sm-1) / S = 1, A2 = (S2 + … + Sm-1) / S, …, Am-1 = (Sm-1) / S;

[0012] S4. Calculate the predicted idle rate of the Core in the next cycle, I_pre = (T - Tpre) / T;

[0013] S5. Refer to the measured value I_last of the idle rate of the Core in the previous cycle, and make a weighted compensation with the predicted value I_pre of the processing time of the Core queue cache in the next cycle, and calculate the predicted value of the idle rate of the Core in the next cycle after compensation, I_curr = I_last * k + (1 - k) * I_pre;

[0014] S6. The deviation ratio offset of the predicted idle rate value in the previous cycle = (I_curr - I_last) / I_last, and the deviation value is used to fine-tune the weighted coefficient k in the current cycle, k = k + I_offset;

[0015] S7. Synthesize the estimated idle rates of all Cores in the next cycle, and calculate the proportion of packets distributed to Corex during the packet distribution cycle: N_prex = I_currx / (I_curr1 + I_curr2 + … + I_currx + … + I_currn);

[0016] S8. The distribution module counts the total number of packets P_all received currently and the number of packets P distributed to each Core, and calculates the distributed proportion N_currx = P / P_all;

[0017] S9. When the distributed proportion N_curr of a certain Core >= N_pre, stop distributing packets to this Core;

[0018] S10. When the distributed ratio of one or more Cores satisfies the condition N_curr < N_pre, sort the Cores that meet the condition according to N_curr, and distribute the packets proportionally in descending order;

[0019] S11. When the distributed ratio of all Cores satisfies the condition N_curr > N_pre, the remaining packets within the distribution period are sequentially and proportionally fed into each Core queue.

[0020] It should be noted in the solution that the above steps one to seven are the decision-making period.

[0021] Furthermore, it is worth noting that the above steps eight to eleven are the distribution period.

[0022] Even further, it should be noted that I_last is the percentage of the idle rate of each CPU core in the previous time period.

[0023] As a preferred implementation manner, during the packet distribution process, the status and performance metrics of each Core queue are continuously monitored.

[0024] As a preferred implementation manner, a packet distribution decision-making device is proposed, which is used to implement a packet distribution decision-making method as described above, including:

[0025] A traffic monitoring module, which is responsible for monitoring network traffic;

[0026] A traffic classification module, which classifies traffic according to the characteristics of data packets;

[0027] A policy management module, which is responsible for managing distribution policies;

[0028] A decision-making module, which decides the next operation of each data packet according to the results of traffic classification and policy management;

[0029] A QoS management module, which is responsible for managing the service levels applied to different types of traffic;

[0030] A security management module, which is responsible for managing security policies, including access control, firewall rules, intrusion detection, etc.;

[0031] A dynamic adjustment module, which is responsible for dynamically adjusting distribution policies and decisions according to changes in network traffic and conditions;

[0032] A reporting and logging module, which is responsible for generating reports and recording logs to record the results of traffic distribution decisions, performance metrics, and security events.

[0033] As a preferred embodiment, the traffic monitoring interacts with a network interface card or other network devices.

[0034] As a preferred embodiment, the reporting and logging module provides an interface for a user to interact with the packet distribution device.

[0035] Compared with the prior art, a packet distribution decision method and device provided by the present invention have at least the following beneficial effects:

[0036] (1) By periodically observing the Core utilization rate and the packet cache queue, iteratively estimating the Core utilization rate of the next period, and using the estimation result as a reference for packet distribution, packets can be accurately and evenly hashed to different Cores. When the traffic is large, packet distribution is performed according to the estimated processing capacity to minimize packet loss as much as possible; when the traffic is small, packets are evenly distributed to different Cores for processing to reduce the queuing waiting time of packets and reduce the delay of single-packet processing.

[0037] (2) By balancing the service loads among various Cores, it is possible to avoid the occurrence of performance bottlenecks caused by overloading of certain cores, which helps to fully utilize system resources, improve the overall processing capacity and throughput of the system. At the same time, load balancing can effectively allocate and utilize system resources, avoid unnecessary resource waste and energy consumption, and reduce the power consumption of the system and save energy costs by reasonably scheduling tasks. Description of the Drawings

[0038] Figure 1 It is a flowchart of packet distribution decision for the DPU system of the present invention;

[0039] Figure 2 It is a packet distribution structure diagram of the DPU system of the present invention. Detailed Embodiments

[0040] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0041] Please refer to Figure 1-2 , the present invention provides a packet distribution decision method and device, including the following steps:

[0042] S1. Each Core counts the Core idle rate I_last of the previous period;

[0043] S2. Feed the Core idle rate I_last back to the packet distribution module for packet distribution decision-making;

[0044] S3. Real-time obtain the occupied space quantity of each Core's cache queues at all levels at the boundary of the distribution decision cycle, and calculate the estimated processing time of the Core in the next cycle according to the different positions of the queues.

[0045] Tpre = Q1 * A1 + Q2 * A2 + … + Qm-1 * Am-1, where Q1 to Qm-1 are the number of packets to be processed in the cache queues, and A1 to Am-1 are adjustable coefficients related to the time consumed by each packet processing step of the Core. Assume that the time consumed by each packet to complete all steps is S, and the processing times consumed by individual processing steps are S1 to Sm-1.

[0046] And S = S1 + S2 + … + Sm-1, then A1 = (S1 + S2 + … + Sm-1) / S = 1, A2 = (S2 + … + Sm-1) / S, …, Am-1 = (Sm-1) / S;

[0047] S4. Calculate the predicted idle rate of the Core in the next cycle, I_pre = (T - Tpre) / T;

[0048] S5. Refer to the measured value I_last of the Core's idle rate in the previous cycle, and make weighted compensation with the predicted value I_pre of the Core queue cache's processing time in the next cycle, and calculate the predicted value of the Core's idle rate in the next cycle after compensation, I_curr = I_last * k + (1 - k) * I_pre;

[0049] S6. The deviation ratio offset of the predicted idle rate in the previous cycle = (I_curr - I_last) / I_last, and the deviation value is used to fine-tune the weighting coefficient k in the current cycle, k = k + I_offset;

[0050] S7. Synthesize the estimated idle rates of all Cores in the next cycle, and calculate the proportion of packets distributed to Corex during the packet distribution cycle: N_prex = I_currx / (I_curr1 + I_curr2 + … + I_currx + … + I_currn);

[0051] S8. The distribution module counts the total number of packets P_all currently received and the number of packets P already distributed to each Core, and calculates the distributed proportion N_currx = P / P_all;

[0052] S9. When the distributed proportion N_curr of a certain Core >= N_pre, stop distributing packets to this Core;

[0053] S10. When the distribution ratio of one or more Cores satisfies the condition N_curr < N_pre, sort the Cores that meet the condition according to N_curr, and distribute the packets proportionally in descending order;

[0054] S11. When the distribution ratio of all Cores satisfies the condition N_curr > N_pre, the remaining packets within the distribution period are sequentially sent into each Core queue proportionally.

[0055] Furthermore, as Figure 1 shown, it is worth specifically explaining that steps one to seven are the decision-making period. The decision-making period is used to estimate the Core idle rate and packet distribution ratio in the next period. The decision-making period refers to the time interval in the packet scheduling system for how often the decision-making algorithm performs a scheduling operation. The setting of this period is crucial for the performance and efficiency of the system because it directly affects the packet processing speed, system responsiveness, and resource utilization. Factors such as system load, packet processing requirements, system scalability and flexibility, hardware and software performance limitations, and data communication synchronization requirements will all affect the setting of the decision-making period. Adopt a dynamic adjustment strategy to adaptively adjust the decision-making period according to the real-time monitored system load and performance metrics to achieve optimal system performance and response speed.

[0056] Furthermore, as Figure 1 shown, it is worth specifically explaining that steps eight to eleven are the distribution period. The distribution period refers to the time interval in the packet scheduling system for determining when to allocate packets to different processing units or cores. The setting of this period depends on system requirements, performance goals, and specific packet distribution strategies. Factors such as packet arrival rate, load conditions of processing units, real-time requirements, system resources and performance limitations, data communication and synchronization requirements, and system dynamics will all affect the distribution period. The distribution period can be dynamically adjusted according to the real-time monitored system state and performance metrics to adapt to different workloads and environmental changes. Evaluate the system performance under different distribution periods through simulation or experiments and select the optimal distribution period.

[0057] Furthermore, as Figure 1 shown, it is worth specifically explaining that I_last is the percentage of the idle rate of each CPU core in the previous time period. The idle rate is usually used to measure the time proportion of each CPU core in an idle state within a specific time period, that is, the time when it is not processing tasks or executing any instructions. The idle rate of each CPU core can be expressed by the following formula:

[0058] [I_{last}=\frac{T_{idle}}{T_{total}}\times 100%]

[0059] Among them, (T_{idle}) is the total time that the core was in the idle state during the previous time period, and (T_{total}) is the total time of the previous time period. These metrics are very important for system performance analysis and optimization, used to help determine whether the CPU core is effectively utilized, and can provide useful information for load balancing and resource management.

[0060] Furthermore, as Figure 1 and Figure 2 shown, specifically, during the packet distribution process of each Core queue, its status and performance metrics are continuously monitored. Real-time monitoring of the Core queue can help discover performance bottlenecks and the reasons for the bottlenecks. By monitoring the status of the queue, it is possible to promptly detect whether there is queue backlog, whether there are a large number of waiting packets, whether there is blockage caused by abnormal packets, etc., so as to promptly take optimization measures to improve system performance. If packets are backlogged or lost in the Core queue, it may lead to abnormal system functions or performance degradation. Real-time monitoring of the Core queue can promptly discover these problems and quickly locate the cause of the failure, thereby accelerating the speed of troubleshooting and reducing the impact of system failures on the business; at the same time, real-time monitoring of the Core queue can help analyze the performance bottlenecks and the reasons for the bottlenecks of the system. By collecting and analyzing the status information of the queue, it is possible to deeply understand the working mode of the system, the packet processing flow, and the performance performance of each link, providing data support for system performance optimization. Based on the real-time monitoring of the Core queue, an early warning mechanism can be established. When the queue reaches a certain early warning threshold, the system can promptly issue an alarm to notify relevant personnel for processing to avoid potential system failures or performance problems.

[0061] Furthermore, as Figure 1 and Figure 2 shown, specifically, a packet distribution decision device includes:

[0062] A traffic monitoring module, which is responsible for monitoring network traffic; it will collect data packets from network interfaces and analyze them to understand traffic patterns, traffic volumes, and the characteristics of data packets;

[0063] A traffic classification module, which classifies traffic according to the characteristics of data packets; it can classify based on factors such as source address, destination address, protocol type, port number, etc. The purpose of classification is to provide a basis for subsequent policy formulation;

[0064] A policy management module, which is responsible for managing distribution policies; including the configuration, update, and deletion of policies, as well as managing the policies applied to different traffic types;

[0065] The decision-making module makes decisions on the next operations for each data packet based on the results of traffic classification and policy management; operations include routing selection, data packet forwarding, discarding, or storing data packets, etc.

[0066] The QoS management module is responsible for managing the service levels applied to different types of traffic; it performs operations such as priority allocation and bandwidth control on traffic according to the QoS requirements defined in the policy.

[0067] The security management module is responsible for managing security policies, including access control, firewall rules, intrusion detection, etc.; it ensures network security and prevents malicious traffic from entering or leaving the network.

[0068] The dynamic adjustment module is responsible for dynamically adjusting the distribution policy and decisions according to changes in network traffic and conditions; it includes automated algorithms and policy update mechanisms to adapt to the changing network environment and requirements.

[0069] The reporting and logging module is responsible for generating reports and recording logs to record the results of traffic distribution decisions, performance metrics, and security events; the reports and logs can be used for purposes such as monitoring network performance, troubleshooting, and security auditing.

[0070] Furthermore, as Figure 1 and Figure 2 shown, it is worth specifically noting that traffic monitoring interacts with the network interface card or other network devices. By interacting with the network interface card or other network devices, the traffic situation can be monitored in real time, and the status and performance of the network can be understood in a timely manner; this helps to detect abnormal traffic, network congestion, or other problems and take measures to respond in a timely manner. At the same time, by interacting with network devices, network faults can be quickly located. Monitoring traffic and analyzing the data interacting with the devices can help determine the location and cause of the fault, speed up the troubleshooting process, and reduce system downtime.

[0071] Furthermore, as Figure 1 and Figure 2As shown, it is worth specifically noting that the report and log module provides an interface for users to interact with the message distribution device. Users can monitor the operation of the message distribution device in real time through the report and log interface, which includes viewing real-time system status, performance metrics, event logs, and other information to help users promptly discover and solve potential problems. The report and log interface provides essential information for system management. Users can understand the system's operation and historical records through functions such as viewing system logs and report generation, facilitating system management and maintenance. The report and log interface provides rich data for performance analysis and optimization. Users can analyze the report and log data to understand the system's operation status, performance bottlenecks, etc., and thus make targeted optimizations and improvements.

[0072] In summary: By periodically observing the Core utilization rate and message cache queue, iteratively estimating the Core utilization rate for the next cycle, and using the estimation result as a reference for message distribution, messages can be accurately and evenly hashed to different Cores. When the traffic is large, message distribution is performed based on the estimated processing capacity to minimize packet loss. When the traffic is small, messages are evenly distributed to different Cores for processing to reduce the queuing waiting time of messages and the latency of individual message processing. By balancing the service loads among different Cores, it is possible to avoid performance bottlenecks caused by overloading of certain cores, which helps to fully utilize system resources, improve the overall processing capacity and throughput of the system. At the same time, load balancing can effectively allocate and utilize system resources, avoid unnecessary resource waste and energy consumption, and reduce the power consumption of the system and save energy costs by reasonably scheduling tasks.

[0073] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A message distribution decision method, characterized in that: It includes the following steps: S1. Each Core calculates the Core idle rate I_last of the previous cycle; S2. Feed back the Core idle rate I_last to the packet distribution module for packet distribution decision-making; S3. Obtain the occupied space quantity of each Core's cache queues at all levels in real time at the boundary of the distribution decision cycle, and calculate the estimated processing time of the Core in the next cycle according to the different positions of the queues, Tpre = Q1*A1 + Q2*A2 + … + Qm-1*Am-1, where Q1~Qm-1 are the number of packets to be processed in the cache queues, and A1~Am-1 are adjustable coefficients related to the time S consumed by each Core to process a packet. Assume that the time consumed by each packet to complete all S is S, and the processing times consumed by a single processing S are S1~Sm-1 respectively, and S = S1 + S2 + … + Sm-1, then A1 = (S1 + S2 + … + Sm-1) / S = 1, A2 = (S2 + … + Sm-1) / S, …, Am-1 = (Sm-1) / S; S4. Calculate the predicted idle rate of the Core in the next cycle, I_pre = (T - Tpre) / T; S5. Refer to the measured value I_last of the idle rate of the Core in the previous cycle, and make a weighted compensation with the predicted value I_pre of the processing time of the Core queue cache in the next cycle, and calculate the estimated idle rate of the Core in the next cycle after compensation, I_curr = I_last*k + (1 - k)*I_pre; S6. The deviation ratio I_offset of the idle rate estimate in the previous cycle is I_offset = (I_curr - I_last) / I_last, and the deviation value is used to fine-tune the weighting coefficient k in the current cycle, k = k + I_I_offset; S7. Synthesize the estimated idle rates of all Cores in the next cycle, and calculate the proportion of packets distributed to Core x in the packet distribution cycle: N_prex = I_curr / (I_curr1 + I_curr2 + … + I_currx + … + I_currn); S8. The distribution module counts the total number of packets P_all received currently and the number of packets P distributed to each Core, and calculates the distributed proportion N_currx = P / P_all; S9. When the distributed proportion N_curr of a certain Core >= N_pre, stop distributing packets to this Core; S10. When the distributed proportions of one or more Cores meet the condition N_curr < N_pre, sort the Cores that meet the condition according to N_curr, and distribute packets in equal proportion in descending order; S11. When the distributed proportions of all Cores meet the condition N_curr > N_pre, the remaining packets in the distribution cycle are sent into each Core queue in equal proportion in sequence.

2. A message distribution decision method according to claim 1, characterized in that: S1 to S7 are the decision cycle.

3. A message distribution decision method according to claim 1, characterized in that: S8 to S11 are the distribution cycle.

4. A message distribution decision method according to claim 1, characterized in that: The I_last is the percentage of the idle rate of each CPU core in the previous time cycle.

5. A message distribution decision method according to claim 1, characterized in that: During the message distribution process, the status and performance indicators of each Core queue are continuously monitored.

6. A message distribution decision device, characterized in that: A method for implementing a message distribution decision method as claimed in any one of claims 1 to 5, comprising: A traffic monitoring module, which is responsible for monitoring network traffic; A traffic classification module, wherein the traffic classification module classifies traffic according to characteristics of data packets; A policy management module, which is responsible for managing distribution policies; A decision-making module, which determines the next operation of each data packet based on the results of traffic classification and policy management; A QoS management module, wherein the QoS management module is responsible for managing the service levels applied to different types of traffic; A security management module, which is responsible for managing security policies, including access control, firewall rules, and intrusion detection; A dynamic adjustment module, which is responsible for dynamically adjusting distribution strategies and decisions according to changes in network traffic and conditions; A reporting and logging module is responsible for generating reports and recording logs to record the results of traffic distribution decisions, performance indicators, and security events.

7. A message distribution decision device according to claim 6, characterized in that: The traffic monitoring interacts with the network interface card.

8. A message distribution decision device according to claim 6, characterized in that: The report and log module provides an interface for users to interact with the message distribution device.

Citation Information

Patent Citations

  • Data distribution processing method and device based on node capability

    CN113419863A

  • Intelligent data aggregation software system based on Internet of Things

    CN117971173A