Message distribution decision method and device

By counting the Core idle rate and cache queue footprint, weighted compensation and load adjustment are performed, the problem of load imbalance in the DPU operating system is solved, uniform distribution of messages and resource optimization is achieved, energy consumption and delay are reduced, and the System performance and throughput.

CN118921325AActive Publication Date: 2024-11-08SHENZHEN AOWEI LINGXIN TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

DPU operating systems are unable to effectively allocate tasks to each core evenly, resulting in load imbalance, causing some cores to overload loads to consume more energy, and other cores to waste energy, increasing overall energy consumption and extending response time.

Method used

By counting the idle rate and cache queue footprint of each core, calculating the estimated processing time and idle rate, performing weighted compensation, adjusting the packet distribution ratio, ensuring load balancing, and dynamically adjusting the distribution strategy to optimize resource utilization.

Benefits of technology

It realizes even distribution of packets, reduces packet loss and delay, makes full use of system resources, reduces resource waste and energy consumption, improves processing capacity and throughput, and saves energy costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118921325A_ABST
    Figure CN118921325A_ABST
Patent Text Reader

Abstract

The invention discloses a message distribution decision-making method and device, belongs to the technical field of network communication, aims at solving the problem that an existing DPU operating system cannot balance service loads among all Core, and comprises the steps that all Core counts the Core idle rate Ilast of the last period, the Core idle rate Ilast is fed back to a message distribution module for message distribution decision-making, and the message distribution decision-making module carries out message distribution decision-making on the Core idle rate Ilast of the last period. Acquiring the number of spaces occupied by each level of cache queue of each Core in real time at the boundary of the distribution decision cycle; according to the method, the messages can be accurately and uniformly hashed to different Core, and when the flow is relatively large, the messages are distributed according to the estimated processing capacity, so that the occurrence of packet loss is reduced as far as possible; when the flow is small, the messages are uniformly dispersed to different Core to be processed, so that the queuing waiting time of the messages is shortened, and the processing delay of a single message is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of network communications, and in particular relates to a message distribution decision method and device. Background Art

[0002] DPU stands for data processing unit. The DPU system is a hardware and software integrated system specifically used for processing data. The DPU system contains multiple Cores (processor cores) for processing network message data, and each Core has an independent message cache queue to achieve lock-free programming. When processing messages, each Core usually includes multiple different processing steps, as well as multi-level cache queues, and each processing step has a front-to-back dependency, namely: Step 1 reads data from queue Q1 and stores it in queue Q2 after processing; Step 2 reads data from queue Q2 and stores it in queue Q3 after processing; and so on, Step m-1 reads data from Qm-1 and stores it in queue Qm after processing; the execution time of each step can be estimated in advance, and the DPU system includes a message distribution module, which is used to distribute the received messages to each Core for business processing.

[0003] In the prior art, the DPU operating system cannot effectively distribute tasks to each core in a balanced manner, 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, resulting in a waste of resources. At the same time, it takes longer to complete the task for the overloaded core, resulting in a delay in the overall response time.

[0004] Therefore, a message distribution decision method and device are needed to solve the problem in the prior art that the DPU operating system cannot balance the business load between the cores. Summary of the invention

[0005] The purpose of the present invention is to provide a message distribution decision method and device to solve the problems raised in the above background technology.

[0006] To achieve the above object, the present invention provides the following technical solution: a message distribution decision method and device, the following steps:

[0007] S1, each Core counts the Core idle rate I_last of the previous cycle;

[0008] S2, feeding back the Core idle rate I_last to the message distribution module for message distribution decision;

[0009] S3, obtains the space occupied by each Core cache queue at each level in real time at the boundary of the distribution decision cycle, and calculates the estimated processing time of the Core in the next cycle according to the location of the queue.

[0010] Tpre=Q1*A1+Q2*A2+…+Qm-1*Am-1, where Q1~Qm-1 are the number of messages to be processed in the cache queue, A1~Am-1 are the adjustable coefficients related to the time consumed by each message processing step of the Core. Assuming that the time consumed by each message to execute all steps is S, the processing time consumed by a single processing step is S1~Sm-1 respectively.

[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 weighted compensation with the estimated value I_pre of the processing time of the next cycle by the Core queue cache, and calculate the estimated 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 idle rate estimation deviation ratio of the previous cycle offset = (I_curr-I_last) / I_last, the deviation value is used to fine-tune the weighting coefficient k in the current cycle, k = k + I_offset;

[0015] S7. Based on the estimated idle rates of all Cores in the next cycle, calculate the proportion of messages distributed to Corex in the message distribution cycle: N_prex = I_currx / (I_curr1+I_curr2+…+I_currx+…+I_currn);

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

[0017] S9. When the distribution ratio of a certain Core is N_curr>=N_pre, stop distributing messages to the 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 fed into each Core queue in proportion.

[0020] It should be noted in the solution that steps 1 to 7 are the decision-making period.

[0021] Furthermore, it is worth noting that steps 8 to 11 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, during the packet distribution process, the status and performance metrics of each Core queue are continuously monitored.

[0024] As a preferred implementation, 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 implementation, the traffic monitoring interacts with a network interface card or other network devices.

[0034] As a preferred implementation, the report and log module provides an interface for the user to interact with the message distribution device.

[0035] Compared with the prior art, the message 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 and packet cache queue, the core utilization of the next period is iteratively estimated, and the estimated result is used as a reference for packet distribution, so that packets can be accurately and evenly hashed to different cores. When the traffic is large, packets are distributed according to the estimated processing capacity to minimize packet loss. When the traffic is small, packets are evenly distributed to different cores for processing, which reduces the queuing waiting time of packets and reduces the delay of single packet processing.

[0037] (2) By balancing the business load among the cores, performance bottlenecks caused by overloading of some cores can be avoided, which helps to make full use of system resources and improve the overall processing power and throughput of the system. At the same time, load balancing can effectively allocate and utilize system resources, avoid unnecessary waste of resources and energy consumption, and reduce system power consumption and save energy costs by reasonably scheduling tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 It is a decision flow chart of message distribution of DPU system of the present invention;

[0039] Figure 2 This is a diagram of the message distribution structure of the DPU system of the present invention. DETAILED DESCRIPTION

[0040] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0041] See also Figure 1-2 The present invention provides a message distribution decision method and device, comprising the following steps:

[0042] S1, each Core counts the Core idle rate I_last of the previous cycle;

[0043] S2, feeding back the Core idle rate I_last to the message distribution module for message distribution decision;

[0044] S3, obtains the space occupied by each Core cache queue at each level in real time at the boundary of the distribution decision cycle, and calculates the estimated processing time of the Core in the next cycle according to the location of the queue.

[0045] Tpre=Q1*A1+Q2*A2+…+Qm-1*Am-1, where Q1~Qm-1 are the number of messages to be processed in the cache queue, A1~Am-1 are the adjustable coefficients related to the time consumed by each message processing step of the Core. Assuming that the time consumed by each message to execute all steps is S, the processing time consumed by a single processing step is S1~Sm-1 respectively.

[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 idle rate of the Core in the previous cycle, and make weighted compensation with the estimated value I_pre of the processing time of the next cycle by the Core queue cache, and calculate the estimated value of the idle rate of the Core in the next cycle after compensation, I_curr = I_last*k+(1-k)*I_pre;

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

[0050] S7. Based on the estimated idle rates of all Cores in the next cycle, calculate the proportion of messages distributed to Corex in the message distribution cycle: N_prex = I_currx / (I_curr1+I_curr2+…+I_currx+…+I_currn);

[0051] S8, the distribution module counts the total number of messages currently received P_all and the number of messages distributed to each Core P, and calculates the distribution ratio N_currx = P / P_all;

[0052] S9. When the distribution ratio of a certain Core is N_curr>=N_pre, stop distributing messages to the Core;

[0053] S10. When the distribution ratios of one or more Cores satisfy 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 ratios of all Cores satisfy the condition N_curr > N_pre, the remaining packets within the distribution period are sequentially sent into the queues of each Core proportionally in order.

[0055] Furthermore, as Figure 1 shown, it is worth specifically stating 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, performance limitations of hardware and software, and data communication synchronization requirements 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 stating 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 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 performance of the system under different distribution periods through simulation or experiments and select the optimal distribution period.

[0057] Furthermore, as Figure 1 shown, it is worth specifically stating 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 proportion of time each CPU core is 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 is idle in the previous time period, and (T_{total}) is the total time of the previous time period. These indicators are very important for system performance analysis and optimization. They are used to help determine whether the CPU core is effectively utilized and can provide useful information for load balancing and resource management.

[0060] Further Figure 1 and Figure 2 As shown, it is worth mentioning that the status and performance indicators of each Core queue are continuously monitored during the message distribution process. Real-time monitoring of the Core queue can help discover performance bottlenecks and bottleneck causes. By monitoring the status of the queue, it is possible to timely discover whether there is a queue backlog, whether there are a large number of waiting messages, whether there is a blockage caused by abnormal messages, etc., so as to take optimization measures in time to improve system performance. If messages are backlogged or lost in the Core queue, it may cause system function abnormality or performance degradation. Real-time monitoring of the Core queue can timely discover these problems and quickly locate the cause of the fault, thereby speeding up the troubleshooting speed and reducing the impact of system faults on the business; at the same time, real-time monitoring of the Core queue can help analyze the performance bottlenecks and bottleneck causes of the system. By collecting and analyzing the status information of the queue, you can deeply understand the system's working mode, message processing flow and the performance of each link, and provide 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 issue an alarm in time to notify relevant personnel to handle it, so as to avoid potential system failures or performance problems.

[0061] Further Figure 1 and Figure 2 As shown, it is worth specifically stating that a message distribution decision device includes:

[0062] Traffic monitoring module, which is responsible for monitoring network traffic; it collects data packets from network interfaces and analyzes them to understand traffic patterns, traffic volume, and characteristics of data packets;

[0063] Traffic classification module: The traffic classification module classifies traffic according to the characteristics of data packets; it can be classified 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] Policy management module, which is responsible for managing distribution policies, including configuration, update and deletion of policies, and management of policies applied to different traffic types;

[0065] Decision-making module, the decision-making module determines the next operation of each data packet based on the results of traffic classification and policy management; it involves operations such as routing selection, packet forwarding, discarding or storing packets;

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

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

[0068] Dynamic adjustment module: The dynamic adjustment module is responsible for dynamically adjusting distribution strategies and decisions according to changes in network traffic and conditions. It includes automated algorithms and policy update mechanisms to adapt to changing network environments and needs.

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

[0070] Further as Figure 1 and Figure 2 As shown, it is worth specifying that traffic monitoring interacts with network interface cards or other network devices. By interacting with network interface cards or other network devices, traffic conditions 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 timely measures to deal with them. At the same time, by interacting with network devices, network faults can be quickly located. Monitoring traffic and analyzing data from interactions with devices can help determine the location and cause of the fault, speed up troubleshooting, and reduce system downtime.

[0071] Further as Figure 1 and Figure 2As shown, it is worth explaining in detail 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 indicators, event logs and other information to help users promptly discover and solve potential problems; the report and log interface provides the necessary information for the management system. Users can understand the system's operation status, historical records, etc. by viewing system logs, generating reports and other functions, which facilitates system management and maintenance; the report and log interface provides rich data for performance analysis and optimization. Users can understand the system's operation status, performance bottlenecks, etc. by analyzing report and log data, so as to make targeted optimization and improvements.

[0072] In summary: by periodically observing the Core utilization and message cache queue, iteratively estimating the Core utilization of the next cycle, and using the estimated results as a reference for message distribution, the messages can be accurately and evenly hashed to different Cores. When the traffic is large, the messages are distributed according to the estimated processing capacity to minimize packet loss. When the traffic is small, the messages are evenly distributed to different Cores for processing to reduce the queuing waiting time of the messages and the delay of single message processing. By balancing the business load between the Cores, the performance bottleneck caused by excessive load on some cores can be avoided, which helps to make full use of system resources and 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 waste of resources and energy consumption, and reduce system power consumption and save energy costs by reasonably scheduling tasks.

[0073] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that 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 in the previous cycle; S2. Feed back the Core idle rate I_last to the packet distribution module for packet distribution decision-making; S3. At the boundary of the distribution decision cycle, obtain the occupied space quantity of each Core's cache queues at all levels in real time, 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 to Qm-1 are the number of packets to be processed in the cache queue, 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 for each packet to complete all steps is S, and the processing times consumed by individual processing steps are S1 to Sm-1. 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 predicted value I_curr of the idle rate of the Core in the next cycle after compensation, I_curr = I_last*k + (1 - k)*I_pre; S6. The deviation ratio offset of the predicted value of the 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; 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_currx / (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 the queues of each Core in equal proportion in sequence.

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

3. A message distribution decision method according to claim 1, characterized in that: Steps 8 to 11 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 according to claim 1, 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, intrusion detection, etc.; 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 a network interface card or other network devices.

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

  • Load balancing method and device, storage medium and electronic equipment

    CN118041864A

  • Systems and methods for web logging of trace data in a multi-core system

    US20100325371A1