A queue processing method and device, electronic equipment and readable storage medium
By monitoring and adjusting the queue deficit and integrity of the data packet queue, the queue deficit of the congestion queue was identified and reduced, thus solving the problem of low data packet transmission efficiency, improving the transmission rate of network connections, and reducing latency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA TELECOM CLOUD TECH CO LTD
- Filing Date
- 2024-12-06
- Publication Date
- 2026-06-16
Smart Images

Figure CN119854232B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data processing technology, and in particular relates to a queue processing method, apparatus, electronic device, and readable storage medium. Background Technology
[0002] With the continuous development of Internet technology, various devices (such as cloud servers, terminal devices, etc.) need to transmit a large number of network packets. In order to solve the link congestion problem, packet sending technology based on packet queues has emerged. This technology can put all the data sent by an interface into multiple packet queues and send packets according to the priority of each packet queue.
[0003] In related technologies, a queue deficit value is usually assigned to each data packet queue. Each data packet queue consumes the corresponding queue deficit value when sending data packets. When the queue deficit value of a data packet queue is too small, scheduling of that data packet queue is stopped. When the queue deficit values of all data packet queues are low, a deficit reset operation is triggered to reset the queue deficit values of all data packet queues and start the next round of scheduling.
[0004] If a data packet queue's deficit cannot be consumed in time due to unforeseen circumstances such as link congestion, it will be difficult to trigger a deficit reset operation, affecting the data transmission of other data packet queues and potentially impacting the overall transmission efficiency of the entire data packet queue set. Summary of the Invention
[0005] This invention provides a queue processing method, apparatus, electronic device, and readable storage medium to solve the technical problem of low data packet queue transmission efficiency in related technologies.
[0006] In a first aspect, the present invention provides a queue processing method, the method comprising:
[0007] Monitor the packet queue set during the first scheduling cycle, including the queue deficit value and packet integrity.
[0008] The target congestion queue is determined from the data packet queues whose queue deficit value is greater than the preset deficit value and whose data packet integrity is false;
[0009] Based on the deficit adjustment step size corresponding to the target congestion queue, the queue deficit value of the target congestion queue is reduced to trigger a deficit reset operation for the data packet queue set in the second scheduling cycle; wherein, the second scheduling cycle is later than the first scheduling cycle.
[0010] Optionally, determining the target congestion queue from the data packet queues whose queue deficit value is greater than a preset deficit value and whose data packet integrity is false includes:
[0011] From the set of data packet queues, determine the first queue whose queue deficit value is greater than a preset deficit value;
[0012] If the number of queues in the first queue is less than or equal to a preset number, the target congestion queue is determined from the first queue based on the data packet integrity of the first queue.
[0013] Optionally, determining the target congestion queue from the first queue based on the packet integrity of the first queue includes:
[0014] If no complete data packet exists in the first queue, obtain the first missing data amount of the data packet in the first queue;
[0015] If the first missing data amount is less than or equal to the preset data amount, the second missing data amount of the data packet is obtained after waiting for a preset time.
[0016] If the amount of the second missing data is greater than 0, the first queue will be identified as the target congestion queue.
[0017] Optionally, the method further includes:
[0018] Based on the header information of the data packets in the first queue, the complete packet length of the data packet is determined;
[0019] The first missing data amount of the data packet is determined based on the actual packet length and the complete packet length.
[0020] Optionally, the method further includes:
[0021] Obtain the deficit reset condition information of the data packet queue set;
[0022] The preset deficit value is determined based on the deficit reset condition information.
[0023] Optionally, reducing the queue deficit value of the target congestion queue based on the deficit adjustment step size corresponding to the target congestion queue includes:
[0024] The target correction coefficient is determined based on the number of continuous scheduling cycles of the target congestion queue; wherein, the number of continuous scheduling cycles represents the number of consecutive scheduling cycles in which the target congestion queue is the target congestion queue.
[0025] The queue deficit value is reduced based on the deficit adjustment step size and the target correction coefficient.
[0026] Optionally, the method further includes:
[0027] Obtain the maximum transmission unit value and the queue weight corresponding to the target congestion queue;
[0028] Based on the maximum transmission unit value and the queue weight, the deficit adjustment step size of the target congestion queue is calculated.
[0029] In a second aspect, the present invention provides a queue processing apparatus, the apparatus comprising:
[0030] The monitoring module is used to monitor the queue deficit and data packet integrity of the data packet queue set during the first scheduling cycle.
[0031] The queue module is used to determine the target congestion queue from the data packet queues where the queue deficit value is greater than a preset deficit value and the data packet integrity is false;
[0032] The reduction module is used to reduce the queue deficit value of the target congestion queue based on the deficit adjustment step size corresponding to the target congestion queue, so as to trigger the deficit reset operation for the data packet queue set in the second scheduling cycle; wherein the second scheduling cycle is later than the first scheduling cycle.
[0033] Optionally, the queue module includes:
[0034] The first queue submodule is used to determine, from the data packet queue set, the first queue whose queue deficit value is greater than a preset deficit value;
[0035] The target congestion queue submodule is used to determine the target congestion queue from the first queue based on the data packet integrity of the first queue when the number of queues in the first queue is less than or equal to a preset number.
[0036] Optionally, the target congestion queue submodule includes:
[0037] The first missing data unit is used to obtain the first missing data amount of the data packet in the first queue when there is no complete data packet in the first queue;
[0038] The second missing data unit is used to obtain the second missing data of the data packet after waiting for a preset time when the first missing data is less than or equal to a preset data.
[0039] The target congestion queue determination unit is used to determine the first queue as the target congestion queue when the second missing data amount is greater than 0.
[0040] Optionally, the device further includes:
[0041] The complete packet length module is used to determine the complete packet length of the data packet based on the packet header information of the data packets in the first queue;
[0042] The first missing data quantity determination module is used to determine the first missing data quantity of the data packet based on the actual packet length and the complete packet length.
[0043] Optionally, the device further includes:
[0044] The condition acquisition module is used to acquire the deficit reset condition information of the data packet queue set;
[0045] The preset deficit value module is used to determine the preset deficit value based on the deficit reset condition information.
[0046] Optionally, the reduction module includes:
[0047] The target correction coefficient submodule is used to determine the target correction coefficient based on the number of continuous scheduling cycles of the target congestion queue; wherein, the number of continuous scheduling cycles represents the number of consecutive scheduling cycles in which the target congestion queue is the target congestion queue.
[0048] The queue deficit reduction submodule is used to reduce the queue deficit value based on the deficit adjustment step size and the target correction coefficient.
[0049] Optionally, the device further includes:
[0050] The queue weight module is used to obtain the maximum transmission unit value and the queue weight corresponding to the target congested queue.
[0051] The deficit adjustment step size module is used to calculate the deficit adjustment step size of the target congestion queue based on the maximum transmission unit value and the queue weight.
[0052] Thirdly, the present invention provides an electronic device comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the above-described queue processing method when executing the program.
[0053] Fourthly, the present invention provides a readable storage medium that, when the instructions in the storage medium are executed by the processor of an electronic device, enables the electronic device to perform the above-described queue processing method.
[0054] In this embodiment of the invention, the method includes: monitoring the queue deficit value and data packet integrity of the data packet queue set in a first scheduling period; identifying a target congested queue from data packet queues whose queue deficit value is greater than a preset deficit value and whose data packet integrity is false; reducing the queue deficit value of the target congested queue based on the deficit adjustment step size corresponding to the target congested queue, thereby triggering a deficit reset operation for the data packet queue set in a second scheduling period; wherein the second scheduling period is later than the first scheduling period. Being able to identify the target congested queue from the data packet queue set based on the queue deficit value and data packet integrity, and reducing the queue deficit value of the target congested queue in each scheduling period, can improve the speed at which the data packet queue set meets the deficit reset conditions, thereby reducing the time when the data packet queue set is congested, which helps to improve the transmission rate of network connections based on the data packet queue set and reduce transmission latency. Attached Figure Description
[0055] To more clearly illustrate the technical solutions in the embodiments of the present invention or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0056] Figure 1 This is a flowchart of the steps of a queue processing method provided in an embodiment of the present invention;
[0057] Figure 2 This is a schematic diagram of a scheduling process provided by an embodiment of the present invention;
[0058] Figure 3 This is a flowchart of another queue processing method provided in an embodiment of the present invention;
[0059] Figure 4 This is a schematic diagram of an architecture provided by an embodiment of the present invention;
[0060] Figure 5 This is a structural diagram of a queue processing device provided in an embodiment of the present invention;
[0061] Figure 6 This is a structural diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0062] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0063] Reference Figure 1 , Figure 1 This is a flowchart illustrating the steps of a queue processing method provided in an embodiment of the present invention. Figure 1 As shown, the method may include:
[0064] Step 101: Monitor the packet queue set during the first scheduling cycle, including the packet queue deficit value and packet integrity.
[0065] To improve data transmission efficiency, speed, latency, and quality of service (QoS), a data packet queue set can be configured for the data transmission entity. Multiple data packet queues within this set carry the data packets the entity needs to send, and the packets are then transmitted through these queues. The data transmission entity can include, but is not limited to, interfaces, processes, applications, ports, routers, switches, and terminal devices; this embodiment of the invention does not impose specific limitations.
[0066] A packet queue set can consist of multiple packet queues, which can be used to store packets of different priorities, types, or origins. In this embodiment of the invention, the type of packet queue may include, but is not limited to, a priority queue, a weighted fair queue (WFQ), an earliest-deadline-first queue, etc., and this embodiment of the invention does not impose specific limitations.
[0067] Network devices or systems typically schedule or process packet queues intermittently, sending packets from the packet queues during each scheduling or processing cycle. The same mechanism is applied to the set of packet queues, with all packet queues in the set being processed uniformly during each scheduling or processing cycle. Each scheduling or processing cycle of the set of packet queues can be called a scheduling cycle.
[0068] The queue deficit value (Deficit) can be used to characterize the data flow limit of a packet queue. In this embodiment of the invention, each packet queue can have a corresponding deficit counter storing the queue deficit value corresponding to that queue. The queue deficit value of a packet queue can be initialized to the maximum number of bytes allowed during a scheduling period, thereby limiting the data flow of the packet queue. It should be noted that the method of initializing the queue deficit value can vary depending on the scheduling strategy adopted. For example, if a Deficit Round Robin scheduling strategy is adopted, the queue deficit value can be initialized to the maximum transmission unit (MTU) of the transmission interface corresponding to the packet queue, or other fixed values; if a Weighted Deficit Round Robin scheduling strategy is adopted, the queue deficit value can be initialized to the product of the MTU of the transmission interface corresponding to the packet queue and the queue weight, or other dynamic values. This embodiment of the invention does not impose specific limitations.
[0069] At the start of each scheduling round, each packet queue initializes its queue deficit value. The initial value of the queue deficit can be flexibly set according to actual business needs (e.g., 0 or the quantization value of the packet queue). During each scheduling cycle, the queue deficit value of each packet queue can be increased by a corresponding quantization value (Quantum). The quantization values of different packet queues can be the same or different. In each scheduling cycle, if the queue deficit value of a packet queue is greater than or equal to a set value (e.g., 0), packets in that packet queue can be sent, and the queue deficit value of that packet queue will be reduced, decreasing the size of the sent packets. If a packet queue does not send any packets in the current scheduling cycle (e.g., the queue is empty or the queue deficit value is insufficient), its queue deficit value will be carried over to the next round. Through the above operations, flow control of each packet queue can be achieved.
[0070] In this embodiment of the invention, data packet integrity can represent whether data packets in the data packet queue are complete. Data packet integrity can also be represented by data packet status, which can include two states: containing complete data packets and not containing complete data packets. In one implementation, since some protocols use specific flags or end symbols to indicate the boundaries of data packets—for example, HTTP / 1.1 can use the termination flag n0 to indicate the end of a data packet—data packet integrity can be determined by detecting the termination flag in the data packet. If a complete data packet exists in the data packet queue, the data packet integrity of the data packet queue can be considered true. In another implementation, data packets can also be verified to obtain a verification result. The integrity of the data packet can be determined based on the verification result. For example, if the data packet transmission protocol uses CRC verification, a CRC verification can be performed on the data packet to obtain a CRC verification result. If the verification result indicates successful verification, the data packet is considered complete. If the data packet queue does not contain a complete data packet, the data packet integrity of the data packet queue can be considered false.
[0071] It should be noted that technicians can flexibly configure the method for obtaining data packet integrity according to actual business needs and data packet transmission protocols, and this embodiment of the invention does not impose specific limitations. Due to different scheduling strategies, in each scheduling cycle, the data packet queues scheduled in the data packet queue set can be all, one, or a portion. For example, in a round-robin scheduling strategy, only one data packet queue may be scheduled in each scheduling cycle. Therefore, in this embodiment of the invention, only the data packet queues scheduled in the scheduling cycle can be detected, and subsequent steps can be performed, i.e., the target congestion queue can be determined from the scheduled data packet queues.
[0072] Step 102: Determine the target congestion queue from the data packet queues whose queue deficit value is greater than the preset deficit value and whose data packet integrity is false.
[0073] In this embodiment of the invention, the packet queue is determined as a target congestion queue based on the queue deficit value and packet integrity, that is, the target congestion queue is determined from the combination of packet queues.
[0074] In typical scheduling strategies, if a data packet queue lacks a complete data packet that can be sent due to data congestion, untimely data transmission, or other reasons, the data packet queue will not be processed in the current scheduling cycle, and no data packets will be sent from it. Consequently, the queue deficit value of the data packet queue will not be consumed, which can easily lead to the depletion of the queue deficit values of other data packet queues in the data packet queue set, which cannot be reset and replenished for a long time. This can result in the entire data packet queue being unable to send data packets, easily causing network latency and network congestion.
[0075] In this embodiment of the invention, the target congested queue experiencing data blockage can be accurately located from the data packet queue set using the queue deficit value and data packet integrity. Specifically, in one implementation, the data packet queue with a queue deficit value greater than a preset deficit value and false data packet integrity can be identified as the target congested queue. In another implementation, the data packet queue with the largest queue deficit value among the data packet queues with queue deficit values greater than the preset deficit value and false data packet integrity can also be identified as the target congested queue.
[0076] Step 103: Based on the deficit adjustment step size corresponding to the target congestion queue, reduce the queue deficit value of the target congestion queue to trigger the deficit reset operation for the data packet queue set in the second scheduling cycle; wherein, the second scheduling cycle is later than the first scheduling cycle.
[0077] In this embodiment of the invention, the difference between the deficit adjustment step size corresponding to the target congestion queue and the queue deficit value of the target congestion queue can be calculated to determine the target deficit value for adjusting the queue deficit value of the target congestion queue. Then, the queue deficit value of the target congestion queue is reset to the target deficit value. This target deficit value is less than the aforementioned queue deficit value. Alternatively, the queue deficit value can be directly reduced by the deficit adjustment step size to update the queue deficit value; this embodiment of the invention does not impose specific limitations.
[0078] Specifically, the target deficit value of the target congested queue can be obtained by subtracting the corresponding deficit adjustment step size from the current queue deficit value of the target congested queue. The aforementioned deficit adjustment step size represents the adjustment range that the target congested queue needs to be adjusted in each scheduling cycle. The deficit adjustment step size can be preset to a fixed value (e.g., 100), and all data packet queues can share the same deficit adjustment step size. Alternatively, the deficit adjustment step size can be set according to the bandwidth limitations of the data packet queues, so that different data packet queues can have different deficit adjustment step sizes. This embodiment of the invention does not impose specific limitations on this.
[0079] For example, if, in the current scheduling period, no complete data packets are detected in data packet queue A, and the queue deficit value of data packet queue A is high, then data packet queue A can be identified as a target congestion queue. For all target congestion queues identified in the current scheduling period, the target deficit value for each target congestion queue can be obtained by subtracting its corresponding queue deficit value from its deficit adjustment step size. For example, if the queue deficit value of data packet queue A in the current scheduling period is 300, and the corresponding deficit adjustment step size for data packet queue A is 100, then its corresponding target deficit value can be calculated as 300 - 100 = 200.
[0080] After calculating the target deficit value of the target congestion queue, the corresponding target deficit value can be applied to the target congestion queue. That is, the queue deficit value of the target congestion queue is adjusted to the target deficit value, realizing the operation of reducing the queue deficit value based on the deficit adjustment step size.
[0081] Once the current scheduling cycle ends and the queue deficit values of all target congestion queues have been reduced, the next scheduling cycle can begin. In the next scheduling cycle, the above operations are repeated to determine new target congestion queues and reduce the queue deficit values of these target congestion queues until the packet queue set reaches the deficit reset condition. Then, the deficit reset operation is performed on the packet queue set.
[0082] The deficit reset condition can include the number of queues in the data packet queue set whose deficit value is greater than a preset deficit value. This number can be 0 or any other integer value less than the number of queues in the data packet queue set. For example, if a data packet queue set contains 10 data packet queues and the preset deficit value is set to 0, as scheduling continues, only 0 data packet queues with a deficit value greater than 0 remain out of the 10 data packet queues. This meets the deficit reset condition and can trigger a deficit reset operation for the data packet queue set.
[0083] In one embodiment, the deficit reset operation may include setting the queue deficit value of all data packet queues in the data packet queue set to an initial value. The initial values corresponding to each data packet queue may be the same or different. For example, the initial value may be the maximum transmission unit (MTU) of the transmission interface corresponding to the data packet queue, or the MTU value of the transmission interface corresponding to the data packet queue, or the product of the MTU value and the queue weight. This embodiment of the invention does not impose specific limitations.
[0084] In another implementation, the deficit reset operation described above may include: setting the queue deficit value of all packet queues in the packet queue set to the sum of the current queue deficit value and the initial value, that is, retaining the current queue deficit value in the next round of scheduling, thereby further improving the flow control accuracy of each packet queue. Specifically, the queue deficit value Deficiit can be reset using the following formula: Deficiit += Weight * MTU.
[0085] Reference Figure 2 , Figure 2 This diagram illustrates a scheduling process according to an embodiment of the present invention, such as... Figure 2As shown, assuming there are 3 packet queues in the packet queue set, the data traffic allocation ratio for these 3 packet queues is 5:3:2. This can be simplified to understand that in a round of 10 scheduling cycles, packet queue 1 uses 5 scheduling cycles to consume its queue deficit, packet queue 2 uses 3 scheduling cycles to consume its queue deficit, and packet queue 3 uses 2 scheduling cycles to consume its queue deficit. If the data transmission of packet queue 1 is normal and the packet integrity is true, while the data transmission of packet queues 2 and 3 is congested, then in the first 5 scheduling cycles, packet queue 1 is scheduled, and the queue deficit of packet queue 1 is consumed to less than or equal to the preset deficit value. In the 6th and 7th scheduling cycles, the packet integrity of packet queues 2 and 3 is false, and there are no complete packets available for scheduling. Therefore, they are in an idle state in the 6th and 7th scheduling cycles, and the queue deficit of packet queues 2 and 3 can be reduced. If in the 8th scheduling cycle, the packet integrity of packet queue 2 becomes true, and the queue deficit of packet queue 2 is greater than the preset deficit value... If 1, then data packet queue 2 can still send data packets. Assuming it lasts for one scheduling cycle, the 8th scheduling cycle is occupied by data packet queue 2, and the queue deficit value of data packet queue 2 is less than or equal to the preset deficit value after the 8th scheduling cycle ends. Starting from the 9th scheduling cycle, the data packet integrity of data packet queue 3 becomes true, and data packets in data packet queue 3 can continue to be scheduled until the data packet integrity of data packet queue 3 becomes false in the 11th scheduling cycle. Then, in the 12th scheduling cycle, the queue deficit value of data packet queue 3 continues to be reduced, triggering the queue deficit reset of the data packet queue set, and starting the next round of scheduling.
[0086] Therefore, this solution can not only speed up the reset of the queue deficit value of each data packet queue when the data packet queue is congested, but also promptly schedule and send data packets when the data packet integrity change of a congested data packet queue is true. Compared with the solution of directly resetting the queue deficit value of all data packet queues when the data packet queue is congested, this solution can effectively balance the traffic of each data packet queue and avoid the situation where congested data packet queues are difficult to schedule to a certain extent.
[0087] In summary, the queue processing method provided by this invention includes: monitoring the queue deficit value and data packet integrity of a data packet queue set in a first scheduling period; determining a target congested queue from data packet queues whose queue deficit value is greater than a preset deficit value and whose data packet integrity is false; reducing the queue deficit value of the target congested queue based on the deficit adjustment step size corresponding to the target congested queue, thereby triggering a deficit reset operation for the data packet queue set in a second scheduling period; wherein the second scheduling period is later than the first scheduling period. The ability to determine the target congested queue from the data packet queue set based on the queue deficit value and data packet integrity, and to reduce the queue deficit value of the target congested queue in each scheduling period, can improve the speed at which the data packet queue set meets the deficit reset conditions, thereby reducing the time when the data packet queue set becomes congested, which helps to improve the transmission rate of network connections based on the data packet queue set and reduce transmission latency.
[0088] Reference Figure 3 , Figure 3 This is a flowchart of another queue processing method provided in an embodiment of the present invention. Figure 3 As shown, the method may include:
[0089] Step 201: Monitor the packet queue set during the first scheduling cycle, including the packet queue deficit value and packet integrity.
[0090] This step can be found in step 101, and will not be repeated in this embodiment of the invention.
[0091] Furthermore, the queue deficit value and / or data packet integrity of each data packet queue can be provided autonomously by each data packet queue, or determined by the queue scheduling strategy, or determined by an independent process or program outside the queue scheduling strategy. This embodiment of the invention does not impose specific limitations.
[0092] Step 202: Determine the first queue from the data packet queue set whose queue deficit value is greater than a preset deficit value.
[0093] If the queue deficit value of a data packet queue is less than or equal to the preset deficit value, it means that the data packet queue has exhausted its allocated traffic and should be waiting for traffic reallocation. However, for data packet queues with a queue deficit value greater than the preset deficit value, they have not yet exhausted all their traffic quota and may belong to the target congestion queue where congestion is likely to occur.
[0094] In this embodiment of the invention, to improve execution efficiency, a queue deficit value determination can be performed on each data packet queue in the data packet queue set first, and the first queue with a queue deficit value greater than a preset deficit value can be determined from the data packet queue set. Here, the first queue refers to the data packet queue in the data packet queue set whose queue deficit value is greater than the preset deficit value.
[0095] Optionally, the preset deficit value can be calculated based on the following steps A1 to A2:
[0096] Step A1: Obtain the deficit reset condition information of the data packet queue set.
[0097] In this embodiment of the invention, different packet queues can be combined using different scheduling strategies, and different scheduling strategies (such as Deficit Round Robin scheduling strategy, Weighted Deficit Round Robin scheduling strategy, etc.) have different deficit reset conditions. In order to improve the applicability of this solution and make the determination of the target congestion queue more accurate, the deficit reset condition information of the packet queue set can be obtained, and the corresponding preset deficit value can be determined based on the deficit reset condition information.
[0098] The deficit reset condition information may include, but is not limited to, the deficit reset condition identifier, the scheduling strategy identifier corresponding to the deficit reset condition, the condition definition of the deficit reset condition, etc., and the embodiments of the present invention do not impose specific limitations.
[0099] Step A2: Determine the preset deficit value based on the deficit reset condition information.
[0100] In this embodiment of the invention, a corresponding preset deficit value can be determined based on deficit reset condition information. This preset deficit value can be the lower limit of the queue deficit that triggers the deficit reset of the data packet queue set. Therefore, by using the preset deficit value, data packet queues that do not meet the deficit reset conditions can be selected and their queue deficit values reduced, which helps to improve the efficiency and accuracy of the deficit reset operation corresponding to the deficit reset conditions used to trigger the current data packet queue set.
[0101] Step 203: If the number of queues in the first queue is less than or equal to a preset number, determine the target congestion queue from the first queue based on the data packet integrity of the first queue.
[0102] Data packet queues that have exhausted their traffic quota (excluding the first queue) in the data packet queue set will be in a waiting state for traffic allocation and will not be able to participate in data packet transmission. Therefore, the more data packet queues that have exhausted their traffic quota, the greater the cost of congestion in the first queue.
[0103] Therefore, after identifying the first queue, the number of queues in the first queue within the data packet queue set can be further determined. If the number of queues in the first queue is less than or equal to a preset number (e.g., 1), it indicates that a large number of data packet queues in the data packet queue set have exhausted their traffic quota. In this case, the target congestion queue can be further identified from the first queue. If the number of queues in the first queue is greater than the preset number, it indicates that a small number of data packet queues in the data packet queue set have exhausted their traffic quota. Even if the first queue becomes congested, it will not have a serious impact. The current scheduling cycle can be skipped, and the target congestion queue can not be further identified, thereby improving the stability of the data packet queue set operation.
[0104] It should be noted that step 203 above can be executed only after the first queue is determined from the set of data packet queues, that is, only if the first queue exists in the set of data packet queues. Therefore, the number of queues in the first queue is a positive integer greater than 0.
[0105] In this embodiment of the invention, when the number of queues in the first queue is less than or equal to a preset number, the target congestion queue can be determined from the first queue based on the data packet integrity. This avoids performing data packet integrity checks in every cycle, which helps improve the execution efficiency of this scheme. Furthermore, it can determine whether potential congestion in the first queue could seriously affect the network based on the number of queues in the first queue, and skip the determination step of the subsequent target congestion queue in scheduling cycles where the impact is not severe, which helps to further improve the execution efficiency of the scheme and the operational stability of the data packet queue set.
[0106] Optionally, step 203 may include:
[0107] Sub-step 2031: If there is no complete data packet in the first queue, obtain the first missing data amount of the data packet in the first queue.
[0108] To further improve data transmission efficiency, packet integrity checks can be performed on the first queue. If no complete data packet exists in the first queue, meaning the first queue has not yet completed the reception of a complete data packet, the first missing data amount in the first queue can be obtained. Based on the first missing data amount, it can be determined whether to further identify the target congestion queue. Here, the first missing data amount represents the amount of data missing from the incomplete data packets in the first queue.
[0109] It should be noted that if the first queue contains multiple incomplete data packets, the missing data amount of the closest complete data packet can be determined as the first missing data amount. If the first queue is empty, this step can be skipped.
[0110] Optionally, the first amount of missing data can be calculated based on the following steps B1 to B2:
[0111] Step B1: Determine the complete packet length of the data packet based on the packet header information of the data packets in the first queue.
[0112] In this embodiment of the invention, to improve the efficiency of detecting the first missing data amount in the data packets in the first queue, the complete packet length of the data packets can be determined based on the packet header information of the data packets in the first queue. Since the first queue can be a queue for different scenarios and needs, the types of data packets it stores may also be different. For example, common data packets at the link layer may include, but are not limited to, Ethernet frames and Wi-Fi packets, while common data packets at the network layer may include, but are not limited to, IPv4 packets and IPv6 packets. Therefore, the data packet type can be determined first based on the packet header information, and then the storage format of the packet length information can be determined based on the data packet type. The packet header information can then be parsed according to this storage format to obtain the complete packet length of the data packet.
[0113] Step B2: Determine the first missing data amount of the data packet based on the actual packet length and the complete packet length.
[0114] In this embodiment of the invention, the actual packet length of the data packet can be obtained. The actual packet length represents the amount of data actually occupied by the data packet in the data packet queue. The actual packet length can be determined by monitoring the data packet flow in the data packet queue, or it can be obtained by actually measuring the space occupied by the current data packet. This embodiment of the invention does not make any specific limitation.
[0115] The first missing data amount can be calculated based on the actual packet length and the complete packet length. Specifically, the packet length difference between the complete packet length and the actual packet length can be calculated to obtain the first missing data amount. It should be noted that the second missing data amount in this embodiment of the invention can also be calculated using the same or similar method as the first missing data amount, and will not be elaborated further in this embodiment.
[0116] By analyzing the header information of data packets in the first queue, the complete packet length is determined; based on the actual packet length and the complete packet length, the initial amount of missing data is determined. This method can improve the accuracy of calculating the amount of missing data to some extent.
[0117] Sub-step 2032: If the first missing data amount is less than or equal to a preset data amount, wait for a preset time and then obtain the second missing data amount of the data packet.
[0118] In this embodiment of the invention, a preset data volume can be set. This preset data volume can be used to measure whether incomplete data packets in the first queue are about to be transmitted, that is, to determine whether a complete data packet is about to appear in the first queue. If a complete data packet is about to appear in the first queue, a waiting period can be initiated, triggering the normal data packet transmission process of the first queue, thereby naturally reducing the queue deficit value of the first queue.
[0119] Specifically, if the first missing data amount is less than or equal to a preset data amount, after waiting for a preset time, the missing data amount of the data packet corresponding to the first missing data amount can be obtained again to obtain the second missing data amount. The acquisition time of the second missing data amount is later than the acquisition time of the first missing data amount. The preset time can be flexibly set by technical personnel according to actual business needs, for example, 0.1ms; this embodiment of the invention does not impose a specific limitation.
[0120] Sub-step 2033: If the amount of the second missing data is greater than 0, the first queue is determined as the target congestion queue.
[0121] Since the second missing data volume and the first missing data volume belong to the same data packet, if the data packet is transmitted within the preset time period, the obtained second missing data volume is 0; if it is not transmitted within the preset time period, the obtained second missing data volume is greater than 0. Therefore, if the second missing data volume is greater than 0, it means that the first queue still does not have a complete data packet after the preset time period, and its data packet integrity is still false. At this time, it can be determined that the first queue cannot be restored to smooth flow in a short period of time, and there is a high probability that congestion will continue. The first queue can be identified as the target congestion queue. Specifically, the first queue can be identified as the target congestion queue when the second missing data volume is greater than 0.
[0122] If no complete data packet exists in the first queue, the first missing data amount of the data packet in the first queue is obtained; if the first missing data amount is less than or equal to a preset data amount, the second missing data amount of the data packet is obtained after waiting for a preset time; if the second missing data amount is greater than 0, the first queue is determined as the target congestion queue, thereby the determined target congestion queue has a high probability of congestion, further improving the accuracy of determining the target congestion queue.
[0123] Step 204: Determine the target correction coefficient based on the number of continuous scheduling cycles of the target congestion queue; wherein, the number of continuous scheduling cycles represents the number of consecutive scheduling cycles in which the target congestion queue is the target congestion queue.
[0124] Since a longer continuous scheduling period for a packet queue as a target congestion queue indicates a more severe impact on the packet queue set, potentially preventing other packet queues from resetting their queue deficits for an extended period, a target correction coefficient can be determined based on the continuous scheduling period of the target congestion queue. Then, the reduction in the queue deficit of the target congestion queue during the current scheduling period can be adjusted according to this coefficient, resulting in a larger reduction in deficit for packet queues that have been continuously designated as target congestion queues for a longer period. Here, the continuous scheduling period represents the number of consecutive scheduling periods during which the target congestion queue has served as the target congestion queue.
[0125] For example, after scheduling begins, if packet queue A is identified as the target congestion queue in the first and second scheduling cycles, is not the target congestion queue in the third scheduling cycle, and is identified as the target congestion queue in the fourth to sixth scheduling cycles; then, in the second scheduling cycle, the number of continuous scheduling cycles for packet queue A is 2; in the fourth scheduling cycle, the number of continuous scheduling cycles for packet queue A is 1; and in the sixth scheduling cycle, the number of continuous scheduling cycles for the target congestion queue is 3.
[0126] Specifically, a preset relationship can be set between the number of continuous scheduling cycles and the correction coefficient. This preset relationship can be expressed as a function, table, model, rule, etc., and the embodiments of the present invention are not specifically limited thereto. In the above preset relationship, a smaller number of continuous scheduling cycles can correspond to a smaller correction coefficient, and a larger number of continuous scheduling cycles can correspond to a larger correction coefficient.
[0127] For example, the following illustrates a preset relationship provided by an embodiment of the present invention:
[0128]
[0129] Where A represents the correction coefficient and C represents the number of continuous scheduling cycles; when the number of continuous scheduling cycles is 1, the corresponding correction coefficient is 1. The larger the number of continuous scheduling cycles, the larger the corresponding correction coefficient. The value range of the correction coefficient can be [1,2].
[0130] Alternatively, the deficit adjustment step size can be calculated using the following steps C1 to C2:
[0131] C1, obtain the maximum transmission unit value and the queue weight corresponding to the target congestion queue.
[0132] In this embodiment of the invention, different queue weights can be set for different data packet queues. Since the bandwidth allocated to data packet queues with different weights differs, i.e., the queue deficit values differ, in order to maintain consistency in reducing the deficit value for different target congested queues, the maximum transmission unit value of the transmission link served by the target congested queue and the queue weight of the target congested queue can be obtained. The deficit adjustment step size corresponding to the target congested queue can be calculated based on the maximum transmission unit value and the queue weight. The queue weight can be automatically allocated by the scheduling strategy used by the data packet queue set, or it can be set by a technician; this embodiment of the invention does not impose specific limitations.
[0133] C2, based on the maximum transmission unit value and the queue weight, calculate the deficit adjustment step size of the target congestion queue.
[0134] In this embodiment of the invention, the maximum transmission unit value can be multiplied by the queue weight of the target congested queue to obtain the deficit adjustment step size of the target congested queue. By obtaining the maximum transmission unit value and the queue weight corresponding to the target congested queue, and calculating the deficit adjustment step size of the target congested queue based on the maximum transmission unit value and the queue weight, the deficit adjustment step size can be adapted to the queue weight of the target congested queue and the link environment in which the target congested queue is located. Therefore, reducing the queue deficit value of the target congested queue according to the deficit adjustment step size can improve the consistency of the reduction effect.
[0135] Step 205: Reduce the queue deficit value based on the deficit adjustment step size and the target correction coefficient.
[0136] In this embodiment of the invention, the queue deficit value of the target congestion queue can be reduced by adjusting the deficit step size and the target correction coefficient. Specifically, the deficit adjustment step size can be multiplied by the target correction coefficient to obtain the target adjustment step size, and the queue deficit value can be reduced by adjusting the target adjustment step size.
[0137] For example, if a target congestion queue has a deficit adjustment step size of 10, a queue deficit value of 30, and a target correction coefficient of 1.2, then the reduced queue deficit value can be calculated to be 30 - 10 * 1.2 = 18.
[0138] The target correction coefficient is determined based on the number of continuous scheduling cycles of the target congestion queue; where the number of continuous scheduling cycles represents the number of consecutive scheduling cycles in which the target congestion queue is considered a target congestion queue. The queue deficit value is reduced based on the deficit adjustment step size and the target correction coefficient. This method can accelerate the reduction of the queue deficit value for packet queues that are congested for a long time, which helps to improve the speed at which the packet queue set triggers the queue deficit reset under network congestion conditions, and further optimizes the transmission latency and transmission efficiency of the packet queue.
[0139] Reference Figure 4 , Figure 4 A schematic diagram of an architecture provided by an embodiment of the present invention is shown, such as... Figure 4 As shown, this scheme can be implemented by modifying the scheduling policy, or by a process or program independent of the scheduling policy. The data packets to be transmitted by the data packet queue can be a first-in-first-out (FIFO) queue; that is, each data packet queue can be implemented using a FIFO queue. The data packet queue can receive data packets as input and output a data packet integrity signal pkt_whole_vld and a queue deficit value signal usedw, as shown below. Figure 4 As shown, packet queue 1 outputs fifo1_usedw, packet queue 2 outputs fifo2_usedw, and packet queue 3 outputs fifo3_usedw. The scheduling strategy module can receive the outputs of each packet queue and, when the packet integrity signal and queue deficit value signal output by the packet queue meet the requirements (i.e., the packet integrity signal is true, and the queue deficit value signal indicates that its queue deficit value is greater than the preset deficit value), output the deficit value reduction signal chnl_grant to the packet queue to reduce the queue deficit value of the corresponding packet queue.
[0140] In summary, another queue processing method provided by this embodiment of the invention includes: monitoring the queue deficit value and data packet integrity of the data packet queue set in a first scheduling period; determining a target congested queue from the data packet queues whose queue deficit value is greater than a preset deficit value and whose data packet integrity is false; reducing the queue deficit value of the target congested queue based on the deficit adjustment step size corresponding to the target congested queue, thereby triggering a deficit reset operation for the data packet queue set in a second scheduling period; wherein the second scheduling period is later than the first scheduling period. Being able to determine the target congested queue from the data packet queue set based on the queue deficit value and data packet integrity, and reducing the queue deficit value of the target congested queue in each scheduling period, can improve the speed at which the data packet queue set meets the deficit reset conditions, thereby reducing the time when the data packet queue set becomes congested, which helps to improve the transmission rate of network connections based on the data packet queue set and reduce transmission latency.
[0141] Reference Figure 5 , Figure 5 This is a structural diagram of a queue processing device provided in an embodiment of the present invention. The queue processing device 50 may include:
[0142] Monitoring module 51 is used to monitor the queue deficit value and data packet integrity of the data packet queue set in the first scheduling cycle;
[0143] Queue module 52 is used to determine the target congestion queue from the data packet queues where the queue deficit value is greater than a preset deficit value and the data packet integrity is false;
[0144] The reduction module 53 is used to reduce the queue deficit value of the target congestion queue based on the deficit adjustment step size corresponding to the target congestion queue, so as to trigger the deficit reset operation for the data packet queue set in the second scheduling cycle; wherein the second scheduling cycle is later than the first scheduling cycle.
[0145] Optionally, the queue module includes:
[0146] The first queue submodule is used to determine, from the data packet queue set, the first queue whose queue deficit value is greater than a preset deficit value;
[0147] The target congestion queue submodule is used to determine the target congestion queue from the first queue based on the data packet integrity of the first queue when the number of queues in the first queue is less than or equal to a preset number.
[0148] Optionally, the target congestion queue submodule includes:
[0149] The first missing data unit is used to obtain the first missing data amount of the data packet in the first queue when there is no complete data packet in the first queue;
[0150] The second missing data unit is used to obtain the second missing data of the data packet after waiting for a preset time when the first missing data is less than or equal to a preset data.
[0151] The target congestion queue determination unit is used to determine the first queue as the target congestion queue when the second missing data amount is greater than 0.
[0152] Optionally, the device further includes:
[0153] The complete packet length module is used to determine the complete packet length of the data packet based on the packet header information of the data packets in the first queue;
[0154] The first missing data quantity determination module is used to determine the first missing data quantity of the data packet based on the actual packet length and the complete packet length.
[0155] Optionally, the device further includes:
[0156] The condition acquisition module is used to acquire the deficit reset condition information of the data packet queue set;
[0157] The preset deficit value module is used to determine the preset deficit value based on the deficit reset condition information.
[0158] Optionally, the reduction module includes:
[0159] The target correction coefficient submodule is used to determine the target correction coefficient based on the number of continuous scheduling cycles of the target congestion queue; wherein, the number of continuous scheduling cycles represents the number of consecutive scheduling cycles in which the target congestion queue is the target congestion queue.
[0160] The queue deficit reduction submodule is used to reduce the queue deficit value based on the deficit adjustment step size and the target correction coefficient.
[0161] Optionally, the device further includes:
[0162] The queue weight module is used to obtain the maximum transmission unit value and the queue weight corresponding to the target congested queue.
[0163] The deficit adjustment step size module is used to calculate the deficit adjustment step size of the target congestion queue based on the maximum transmission unit value and the queue weight.
[0164] In summary, the queue processing device provided in this embodiment of the invention can determine the target congested queue from the data packet queue set based on the queue deficit value and data packet integrity, and reduce the queue deficit value of the target congested queue in each scheduling cycle. This can improve the speed at which the data packet queue set meets the deficit reset condition, thereby reducing the time when the data packet queue set is congested. This helps to improve the transmission rate of network connections based on the data packet queue set and reduce transmission latency.
[0165] Reference Figure 6 The present invention also provides a structural diagram of an electronic device, such as... Figure 6 As shown, it includes: a processor 1101, a memory 1102, and a computer program 11021 stored in the memory and executable on the processor. When the processor executes the program, it implements the queue processing method of the foregoing embodiment.
[0166] The present invention also provides a readable storage medium that, when the instructions in the storage medium are executed by the processor of an electronic device, enables the electronic device to perform the queue processing method of the foregoing embodiments.
[0167] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0168] It should be noted that all information and data obtained in the embodiments of the present invention were obtained with the authorization of the information / data holder.
[0169] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of the invention.
[0170] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0171] Similarly, it should be understood that, in order to simplify the invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, this disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into this detailed description, wherein each claim itself is a separate embodiment of the invention.
[0172] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0173] The various component embodiments of the present invention can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the present invention. The present invention can also be implemented as a device or apparatus program for performing part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
[0174] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.
[0175] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0176] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0177] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A queue processing method, characterized in that, The method includes: Monitor the packet queue set during the first scheduling cycle, including the queue deficit value and packet integrity. The target congestion queue is determined from the data packet queues whose queue deficit value is greater than the preset deficit value and whose data packet integrity is false; Based on the deficit adjustment step size corresponding to the target congestion queue, the queue deficit value of the target congestion queue is reduced to trigger the deficit reset operation for the data packet queue set in the second scheduling cycle; wherein, the second scheduling cycle is later than the first scheduling cycle; Wherein, the step of reducing the queue deficit value of the target congestion queue based on the deficit adjustment step size corresponding to the target congestion queue includes: The target correction coefficient is determined based on the number of continuous scheduling cycles of the target congestion queue; wherein, the number of continuous scheduling cycles represents the number of consecutive scheduling cycles in which the target congestion queue is the target congestion queue. The queue deficit value is reduced based on the deficit adjustment step size and the target correction coefficient.
2. The method according to claim 1, characterized in that, The step of determining the target congestion queue from the data packet queues whose queue deficit value is greater than a preset deficit value and whose data packet integrity is false includes: From the set of data packet queues, determine the first queue whose queue deficit value is greater than a preset deficit value; If the number of queues in the first queue is less than or equal to a preset number, the target congestion queue is determined from the first queue based on the data packet integrity of the first queue.
3. The method according to claim 2, characterized in that, The step of determining the target congestion queue from the first queue based on the packet integrity of the first queue includes: If no complete data packet exists in the first queue, obtain the first missing data amount of the data packet in the first queue; If the first missing data amount is less than or equal to the preset data amount, the second missing data amount of the data packet is obtained after waiting for a preset time. If the amount of the second missing data is greater than 0, the first queue will be identified as the target congestion queue.
4. The method according to claim 3, characterized in that, The method further includes: Based on the header information of the data packets in the first queue, the complete packet length of the data packet is determined; The first missing data amount of the data packet is determined based on the actual packet length and the complete packet length.
5. The method according to claim 2, characterized in that, The method further includes: Obtain the deficit reset condition information of the data packet queue set; The preset deficit value is determined based on the deficit reset condition information.
6. The method according to claim 1, characterized in that, The method further includes: Obtain the maximum transmission unit value and the queue weight corresponding to the target congestion queue; Based on the maximum transmission unit value and the queue weight, the deficit adjustment step size of the target congestion queue is calculated.
7. A queue processing device, characterized in that, The device includes: The monitoring module is used to monitor the queue deficit and data packet integrity of the data packet queue set during the first scheduling cycle. The queue module is used to determine the target congestion queue from the data packet queues where the queue deficit value is greater than a preset deficit value and the data packet integrity is false; The reduction module is used to reduce the queue deficit value of the target congestion queue based on the deficit adjustment step size corresponding to the target congestion queue, so as to trigger the deficit reset operation for the data packet queue set in the second scheduling cycle; wherein, the second scheduling cycle is later than the first scheduling cycle; The reduction module is further configured to determine a target correction coefficient based on the number of continuous scheduling cycles of the target congestion queue; wherein, the number of continuous scheduling cycles represents the number of consecutive scheduling cycles in which the target congestion queue is the target congestion queue. The queue deficit value is reduced based on the deficit adjustment step size and the target correction coefficient.
8. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method as described in any one of claims 1-6.
9. A readable storage medium, characterized in that, When the instructions in the readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the method of any one of claims 1-6.