Data packet scheduling method and device, electronic equipment and storage medium
By identifying the service and traffic types of data packets in the power communication network and implementing dynamic scheduling strategies, the queue congestion problem in traditional power communication networks when facing sudden or complex traffic is solved, achieving low latency and efficient data packet scheduling.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-04
- Publication Date
- 2026-03-31
AI Technical Summary
Traditional power communication networks are unable to intelligently identify and prioritize data streams when faced with sudden or complex traffic surges, leading to increased queue congestion and jitter, and failing to meet the high deterministic transmission requirements of smart grids.
By determining the dynamic feature parameters in the data packet metadata, and combining the deep learning inference engine and TCAM hardware unit, the service type and traffic type of the data packet are dynamically identified. The scheduling strategy is determined based on the first and second tags, and the hardware queue identifier is written into the data packet metadata to achieve precise scheduling of data packets.
When faced with sudden traffic surges or complex mixed traffic scenarios, it can smooth traffic, avoid queue backlog, reduce queuing latency and jitter, dynamically allocate queue resources, and improve the efficiency and determinism of packet scheduling.
Smart Images

Figure CN121771129A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power communication network technology, and in particular to a data packet scheduling method, apparatus, electronic device, and storage medium. Background Technology
[0002] As the digitalization and intelligence of smart grids continue to increase, the control and protection services of the power grid (such as differential protection and precise load control) place increasingly higher demands on the deterministic transmission capabilities of communication networks. The data streams of these services require predictable, microsecond-level end-to-end latency. Traditional "best-effort" network architectures and early QoS technologies can no longer meet this requirement. Power communication networks need an ultra-low-latency scheduling mechanism capable of intelligently identifying critical services and providing them with absolute priority guarantees.
[0003] Currently, TCAM (Tri-State Content Addressable Memory) is commonly used for high-speed traffic classification and tagging, combined with complex queue scheduling algorithms to manage traffic of different priorities. However, these technologies are mostly static or reactive, relying entirely on pre-configured static rules. They cannot perceive real-time changes in data flow behavior, and may place data packets that should be placed in low-priority queues into high-priority queues, causing sudden traffic spikes, which can lead to queue congestion, damage other equally important service flows, and exacerbate jitter. In other words, conventional technical solutions struggle to make forward-looking optimal decisions when facing sudden traffic spikes or complex traffic mixtures, limiting further breakthroughs in the performance of time-sensitive services. Summary of the Invention
[0004] This invention provides a packet scheduling method, apparatus, electronic device, and storage medium to fundamentally smooth traffic, avoid queue accumulation, and minimize queuing delays and jitter when facing sudden traffic surges or complex traffic mixtures.
[0005] According to one aspect of the present invention, a packet scheduling method is provided, the method comprising:
[0006] Determine the data packet metadata of the data packet to be processed, and determine dynamic feature parameters based on the data packet metadata;
[0007] A first tag is determined for the data packet to be processed based on the data packet metadata; the first tag is used to indicate the service type of the data packet to be processed.
[0008] The second tag of the data packet to be processed is determined based on dynamic feature parameters; the second tag is used to indicate the predicted traffic type of the data packet to be processed.
[0009] Based on the first tag and the second tag, a first scheduling policy for the data packet to be processed is determined, and the hardware queue identifier corresponding to the first scheduling policy is written into the data packet metadata; the first scheduling policy is used to describe the conditions and actions for triggering the invocation of the data packet to be processed.
[0010] According to another aspect of the present invention, a data packet scheduling apparatus is provided, the apparatus comprising:
[0011] The parameter determination module is used to determine the data packet metadata of the data packet to be processed, and to determine dynamic feature parameters based on the data packet metadata;
[0012] The first tag determination module is used to determine a first tag of the data packet to be processed based on the data packet metadata; the first tag is used to indicate the service type of the data packet to be processed.
[0013] The second label determination module is used to determine the second label of the data packet to be processed based on dynamic feature parameters; the second label is used to indicate the predicted traffic type of the data packet to be processed.
[0014] The scheduling strategy determination module is used to determine a first scheduling strategy for the data packet to be processed based on the first tag and the second tag, and write the hardware queue identifier corresponding to the first scheduling strategy into the data packet metadata; the first scheduling strategy is used to describe the conditions and actions for triggering the invocation of the data packet to be processed.
[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0016] At least one processor; and
[0017] A memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the packet scheduling method according to any embodiment of the present invention.
[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the packet scheduling method according to any embodiment of the present invention.
[0020] The technical solution of this invention determines the data packet metadata of the data packet to be processed, and determines dynamic feature parameters based on the data packet metadata; determines a second tag for the data packet to be processed to indicate the predicted traffic type of the data packet based on the dynamic feature parameters; achieves accurate prediction of the traffic type of the data packet to be processed from the current time to a future period of time; simultaneously, determines a first tag for the data packet to be processed to indicate the service type of the data packet based on the data packet metadata; achieves accurate determination of the service type of the data packet to be processed; then, based on the first tag and the second tag, determines a first scheduling strategy for the data packet to be processed, and writes the hardware queue identifier corresponding to the first scheduling strategy into the data packet metadata; the first scheduling strategy is used to describe the conditions and actions for triggering the call of the data packet to be processed, so as to fundamentally smooth traffic and avoid queue accumulation when facing sudden traffic or complex traffic mixed scenarios, and minimize queuing delay and jitter. The combination with the second tag can dynamically allocate appropriate queue resources, turning passive into active, and solving the problem of extensive management of static solutions.
[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a flowchart of a data packet scheduling method provided according to an embodiment of the present invention;
[0024] Figure 2 This is a flowchart of another data packet scheduling method provided according to an embodiment of the present invention;
[0025] Figure 3 This is a schematic diagram of a data packet scheduling device according to an embodiment of the present invention;
[0026] Figure 4 This is a schematic diagram of the structure of an electronic device that implements the data packet scheduling method of the present invention, according to an embodiment of the present invention. Detailed Implementation
[0027] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0029] Example 1
[0030] Figure 1 This is a flowchart illustrating a data packet scheduling method provided in an embodiment of the present invention. This embodiment is applicable to situations requiring reasonable scheduling of data packets. The method can be executed by a data packet scheduling device, which can be implemented in hardware and / or software. This data packet scheduling device can be configured in any electronic device with network communication capabilities. Figure 1 As shown, the data packet scheduling method of the present invention includes:
[0031] S110. Determine the data packet metadata of the data packet to be processed, and determine the dynamic characteristic parameters based on the data packet metadata.
[0032] Here, the data packets to be processed can be understood as data packets that have been received but have not yet been processed. Dynamic feature parameters can be understood as feature data corresponding to the micro-flow state of the data packets to be processed.
[0033] The process of receiving data packets to be processed can be as follows: In DPDK (Data Plane Development Kit) polling mode, when the data packet to be processed arrives at the network interface card (NIC) from the physical link, the NIC uses direct memory access technology to directly write the content of the data packet to be processed into a pre-allocated memory pool located in user space. At the same time, the NIC driver or DPDK program creates a metadata structure for each data packet to be processed, namely the data packet metadata. The data packet metadata includes basic information such as a 5-tuple, a pointer to the data packet to be processed, its length, and a high-precision hardware timestamp.
[0034] Furthermore, after the data packets to be processed are stored in memory, the DPDK software program running on the CPU or the dedicated extraction circuit integrated into the network card performs micro-flow feature extraction based on the data packet metadata, thereby obtaining dynamic feature parameters.
[0035] In an embodiment of the present invention, optionally, the data packet metadata includes a 5-tuple, which includes header information from the data link layer, network layer, and transport layer, such as MAC address, IP address, protocol type, and port number. Determining dynamic feature parameters based on the data packet metadata may include: obtaining a micro-flow state tracking table of the data packet to be processed; the micro-flow state tracking table is used to describe the correspondence between the 5-tuple and the data flow state; determining the data flow state of the data packet to be processed based on the micro-flow state tracking table and the 5-tuple in the data packet metadata; determining reference data items based on the data flow state of the data packet to be processed; and synthesizing the reference data items into dynamic feature parameters; the dynamic feature parameters are represented in the form of feature vectors.
[0036] The data stream status includes the timestamps of pending data packets, the total number of packets in the data stream, the total number of bytes, the total number of bytes within the current time window, and the duration of the data stream. Reference data items may include the packet arrival time intervals, the short-term average flow rate within the sliding window, and the time series of packet sizes. The packet arrival time intervals can be determined based on the timestamps of the pending data packets. The short-term average flow rate within the sliding window can be determined based on the total number of bytes within the current time window and the duration of the data stream; for example, the total number of bytes within the current time window divided by the duration of the data stream equals the short-term average flow rate within the sliding window. The time series of packet sizes can be understood as a sequence of all data packets included in the data stream status, ordered from smallest to largest timestamp.
[0037] Specifically, determining the data flow status of the data packet to be processed based on the micro-flow state tracking table and the 5-tuple in the data packet metadata can include: when the data packet to be processed arrives, querying the data flow status from the micro-flow state tracking table according to the 5-tuple in the data packet metadata; if a data flow status is found, outputting the data flow status of the data packet to be processed; if no data flow status is found, creating a new flow record, initializing the status, and determining the newly created flow record as the data flow status of the data packet to be processed.
[0038] In this embodiment of the invention, a micro-flow state tracking table is obtained to describe the correspondence between the quintuple and the data flow state of the data packet to be processed. This allows the data flow state of the data packet to be processed to be accurately determined based on the micro-flow state tracking table and the quintuple in the data packet metadata. Reference data items are then determined based on the data flow state of the data packet to be processed. The reference data items are then synthesized into dynamic feature parameters represented in the form of feature vectors to ensure that the second tag of the data packet to be processed can be accurately obtained based on the dynamic feature parameters.
[0039] S120. Determine the first tag of the data packet to be processed based on the data packet metadata; the first tag is used to indicate the service type of the data packet to be processed.
[0040] The data packet metadata includes information from the data packet header and fields from the preset protocol. The data packet header information mainly consists of Layer 2, Layer 3, and Layer 4 header information, namely the header information of the data link layer, network layer, and transport layer, such as MAC address, IP address, protocol type, and port number.
[0041] Specifically, data packet metadata is sent to a TCAM (Ternary Content Addressable Memory) hardware unit. The TCAM hardware unit stores pre-configured rule matching information. Within a single clock cycle, the TCAM hardware unit compares the data packet metadata with the rule matching information, selecting the service tag with the highest match as the first tag of the data packet to be processed. Simultaneously, it can also determine the processing priority of the data packet. The rule matching information includes the correspondence between data packet metadata and service tags, as well as the processing priority of the data packet to be processed.
[0042] S130. Determine the second label of the data packet to be processed based on dynamic feature parameters; the second label is used to indicate the traffic type of the predicted data packet to be processed.
[0043] The second label can include mouse streams, micro-burst streams, elephant streams, and interactive streams. A mouse stream refers to a short-duration data stream that consumes little bandwidth. An elephant stream, in contrast, refers to a longer-duration data stream that consumes a large amount of bandwidth. An interactive stream refers to a data stream composed of multiple sequential interactive actions in a front-end application or product. A micro-burst stream refers to a port receiving a large amount of burst data within a very short time (milliseconds), resulting in an instantaneous burst rate that is tens or hundreds of times higher than the average rate, or even exceeds the port bandwidth.
[0044] Specifically, the preset matching relationship between dynamic feature parameters and the second tag is obtained. After obtaining the dynamic feature parameters of the data packet to be processed, the second tag of the data packet to be processed is matched from the preset matching relationship.
[0045] In an embodiment of the present invention, optionally, determining the second tag of the data packet to be processed based on dynamic feature parameters may include steps A1-A3:
[0046] Step A1: The deep learning-based inference engine analyzes the dynamic feature parameters and predicts at least one reference label and a reference value corresponding to the reference label for the data packet to be processed; the reference label is the predicted traffic type of the data packet to be processed; the reference value is used to describe the probability value that the traffic type of the data packet to be processed is the reference label.
[0047] The deep learning-based inference engine can be a hardware-accelerated, lightweight computing unit, typically in the form of an FPGA or a dedicated AI accelerator IP core. It is primarily responsible for executing pre-trained, lightweight neural network or machine learning models. These pre-trained models describe the correspondence and correlation between dynamic feature parameters and reference labels.
[0048] Specifically, after obtaining the dynamic feature parameters, the dynamic feature parameters can be standardized using a preset standardization algorithm to obtain standardized dynamic feature parameters; the preset standardization algorithm can be Z-score standardization or Min-Max scaling.
[0049] Then, the standardized dynamic feature parameters are input into the deep learning inference engine for analysis to predict at least one reference label and the reference value corresponding to the reference label of the data packet to be processed.
[0050] Step A2: If the largest reference value among the reference values is greater than or equal to the preset probability value, then the reference label corresponding to the largest reference value among the reference values is determined as the second label.
[0051] Step A3: If the largest reference value among the reference values is less than the preset probability value, determine that the second label of the data packet to be processed is an unknown label or an unobserved label.
[0052] Here, "unknown tags" can be understood as tags for which no traffic type can be matched. "Tags to be observed" can be understood as tags for which no suitable traffic type could be matched in the current instance, and traffic matching needs to be performed again.
[0053] Specifically, if the largest reference value among the reference values is less than the first preset probability value, then the second label of the data packet to be processed is determined to be an unknown label; if the largest reference value among the reference values is less than the second preset probability value, then the second label of the data packet to be processed is determined to be an observation label, and then the dynamic feature parameters need to be analyzed multiple times within a preset period based on the deep learning inference engine. If the largest reference value among the reference values obtained within the preset period is greater than or equal to the preset probability value, then the reference label corresponding to the largest reference value among the reference values is determined to be the second label; if the second label of the data packet to be processed is still determined to be an observation label within the preset period, then the second label of the data packet to be processed is determined to be an unknown label.
[0054] In this embodiment of the invention, a deep learning-based inference engine analyzes dynamic feature parameters to predict at least one reference label and a corresponding reference value for the data packet to be processed. The reference label is the predicted traffic type of the data packet to be processed. The reference value describes the probability that the traffic type of the data packet to be processed is the reference label, so as to compare the reference value with a preset probability value and ensure the accuracy of the determined second label. That is, when the largest reference value is greater than the preset probability value, the reference label corresponding to the largest reference value is determined as the second label, that is, the reference label with the highest correlation is determined as the second label, ensuring the accuracy of the predicted traffic type. In addition, the deep learning-based inference engine's ability to learn and classify the behavior of unknown traffic ensures that even if there is no corresponding rule in TCAM, the inference engine can identify whether the data stream has time-sensitive characteristics by analyzing the traffic behavior pattern. Once identified as a time-sensitive flow, appropriate queue resources can be dynamically allocated to it, turning passive into active management and solving the problem of extensive management in static solutions.
[0055] S140. Based on the first label and the second label, determine the first scheduling policy of the data packet to be processed, and write the hardware queue identifier corresponding to the first scheduling policy into the data packet metadata; the first scheduling policy is used to describe the conditions and actions that trigger the call to the data packet to be processed.
[0056] Specifically, there is a preset association between different combination patterns of the first label and the second label and the scheduling strategy. After obtaining the first label and the second label, the first scheduling strategy belonging to the data packet to be processed is matched from the preset association based on the first label and the second label.
[0057] In an embodiment of the present invention, optionally, determining the first scheduling policy for the data packet to be processed based on the first label and the second label may include steps B1-B2:
[0058] Step B1: Obtain the context feature information and collaborative decision matrix corresponding to the data packet to be processed; the context feature information is the relevant data of the data flow state of the data packet to be processed; the collaborative decision matrix is used to describe the correspondence between different label combinations and different scheduling strategies.
[0059] Step B2: Based on contextual feature information, the first label, the second label, and the collaborative decision matrix, determine the first scheduling strategy for the data packets to be processed.
[0060] Specifically, determine the first weight percentage of the first tag and the second weight percentage of the second tag.
[0061] Based on the first label, the second label, the first weight ratio, and the second weight ratio, a label combination pattern is determined. Based on the label combination pattern, a third scheduling strategy for the data packets to be processed is matched from the collaborative decision matrix. Furthermore, different contextual feature information and the degree of priority adjustment of different scheduling strategies have a preset correspondence. The degree of adjustment can include the priority of the scheduling strategy increasing or decreasing. Contextual feature information is obtained, and an appropriate degree of adjustment is matched from the preset correspondence based on the contextual feature information. The third scheduling strategy is adjusted based on the degree of adjustment to obtain the first scheduling strategy.
[0062] Optionally, determining the first scheduling strategy for the data packet to be processed based on contextual feature information, the first label, the second label, and the collaborative decision matrix may further include: adjusting the second label based on contextual feature information to obtain an updated second label; and determining the first scheduling strategy for the data packet to be processed based on the first label, the updated second label, and the collaborative decision matrix.
[0063] Specifically, contextual feature information can also help determine the accuracy of the second label. Specifically, the confidence level of the second label is adjusted, that is, the second weight ratio of the second label is adjusted to update the second label. Then, based on the first label, the second label, the first weight ratio and the adjusted second weight ratio, a new label combination pattern is determined, and the first scheduling strategy of the data packet to be processed is matched from the collaborative decision matrix based on the new label combination pattern.
[0064] In this embodiment of the invention, context feature information corresponding to the data packet to be processed and a collaborative decision matrix for describing the correspondence between different label combinations and different scheduling strategies are obtained. This allows for a more accurate determination of the first scheduling strategy for the data packet to be processed based on the context feature information, the first label, the second label, and the collaborative decision matrix. By combining static service labels and dynamic prediction labels, intervention decisions can be made before congestion occurs, thereby fundamentally smoothing traffic, avoiding queue accumulation, and minimizing queuing delays and jitter.
[0065] Based on the above embodiments, optionally, after determining the first scheduling policy for the data packet to be processed, the method further includes steps C1-C3:
[0066] Step C1: If multiple first scheduling policies are triggered simultaneously, the first scheduling policies that are triggered simultaneously are determined as second scheduling policies, and the first priority and second priority of each second scheduling policy are obtained; the first priority is determined according to the first label corresponding to the second scheduling policy; the second priority is determined according to the second label corresponding to the second scheduling policy.
[0067] The first priority can be understood as a static factor that adjusts the priority of the second scheduling strategy; the second priority can be understood as a dynamic factor that adjusts the priority of the second scheduling strategy.
[0068] Specifically, the process of determining the second priority based on the second label corresponding to the second scheduling strategy can be as follows: obtain the label confidence of the second label corresponding to the second scheduling strategy, and determine the second priority based on the second label and / or the label confidence.
[0069] Accordingly, determining the second priority based on the second label may include: if the second label is a preset traffic type, and the action corresponding to the preset traffic type includes a preset action, then the second priority is determined to be the first value, where the first value is a positive number. For example, when the second label is a micro-burst traffic, and it includes an "isolation" or "degradation" action, then the second priority is determined to be the first value.
[0070] Determining the second priority based on label confidence can include: if the label confidence is less than a preset threshold, then the second priority is determined as the second value, and the second value is a negative number.
[0071] Determining the second priority based on the second label and label confidence level may include: if the second label is a preset traffic type and the action corresponding to the preset traffic type includes a preset action, then a first value is determined; if the label confidence level is less than a preset threshold, then a second value is determined; and the sum of the first value and the second value is determined as the second priority.
[0072] Step C2: Add the first priority and the second priority together to determine the third priority of the second scheduling strategy.
[0073] Step C3: Adjust the second scheduling policy according to the third priority to obtain the updated second scheduling policy, write the hardware queue identifier corresponding to the updated second scheduling policy into the data packet metadata, and delete the hardware queue identifier corresponding to the previous second scheduling policy.
[0074] In this embodiment of the invention, if multiple first scheduling policies are triggered simultaneously, the simultaneously triggered first scheduling policies are determined as second scheduling policies. A first priority determined by a first tag corresponding to the second scheduling policy and a second priority determined by a second tag corresponding to the second scheduling policy are obtained for each second scheduling policy. The first priority and the second priority are added together to determine a third priority of the second scheduling policy, so that the second scheduling policy can be adjusted according to the third priority to obtain an updated second scheduling policy. This ensures the accuracy of the scheduling policy used to describe the conditions and actions for triggering the invocation of the pending data packet, and ensures that the scheduling task for the pending data packet can be executed at an appropriate time.
[0075] Optionally, before writing the hardware queue identifier corresponding to the first scheduling policy into the data packet metadata, the method further includes: checking the resource status of the target queue corresponding to the hardware queue identifier; if the resource status indicates insufficient resources, triggering a degradation policy, and reducing the priority of the first scheduling policy based on the degradation policy. For example, mapping the data packet to be processed to a queue with a preset priority higher than the original target queue, and recording this event for network telemetry. This embodiment avoids the situation where the first scheduling policy is still executed when the resources of the target queue corresponding to the hardware queue identifier are insufficient, thus preventing queue congestion and achieving dynamic adjustment of the scheduling policy.
[0076] The technical solution of this invention determines the data packet metadata of the data packet to be processed, and determines dynamic feature parameters based on the data packet metadata; determines a second tag for the data packet to be processed to indicate the predicted traffic type of the data packet based on the dynamic feature parameters; achieves accurate prediction of the traffic type of the data packet to be processed from the current time to a future period of time; simultaneously, determines a first tag for the data packet to be processed to indicate the service type of the data packet based on the data packet metadata; achieves accurate determination of the service type of the data packet to be processed; then, based on the first tag and the second tag, determines a first scheduling strategy for the data packet to be processed, and writes the hardware queue identifier corresponding to the first scheduling strategy into the data packet metadata; the first scheduling strategy is used to describe the conditions and actions for triggering the call of the data packet to be processed, so as to fundamentally smooth traffic and avoid queue accumulation when facing sudden traffic or complex traffic mixed scenarios, and minimize queuing delay and jitter. The combination with the second tag can dynamically allocate appropriate queue resources, turning passive into active, and solving the problem of extensive management of static solutions.
[0077] Example 2
[0078] Figure 2 This is a flowchart of another data packet scheduling method provided by an embodiment of the present invention. The technical solution of this embodiment further optimizes the process of S140 in the aforementioned embodiments based on the above embodiments. This embodiment can be combined with various optional solutions in one or more of the above embodiments. For example... Figure 2 As shown, the data packet scheduling method of the present invention includes:
[0079] S210. Determine the data packet metadata of the data packet to be processed, and determine the dynamic characteristic parameters based on the data packet metadata.
[0080] S220. Determine the first tag of the data packet to be processed based on the data packet metadata; the first tag is used to indicate the service type of the data packet to be processed.
[0081] S230. Determine the second label of the data packet to be processed based on dynamic feature parameters; the second label is used to indicate the traffic type of the predicted data packet to be processed.
[0082] S240. Determine the service type of the current service based on the first label. Based on the service type, the first label, and the second label, determine the first scheduling policy of the data packet to be processed and write the hardware queue identifier corresponding to the first scheduling policy into the data packet metadata. The first scheduling policy is used to describe the conditions and actions that trigger the call to the data packet to be processed.
[0083] Specifically, different service types will be matched with a first scheduling strategy that uses a first label and / or a second label to determine the first scheduling strategy for the data packets to be processed. Specifically, if the service type is type 1, the first label is used to determine the first scheduling strategy for the data packets to be processed; if the service type is type 2, the second label is used to determine the first scheduling strategy for the data packets to be processed; if the service type is type 3, the first label and the second label are used to determine the first scheduling strategy for the data packets to be processed.
[0084] Optionally, determining the first scheduling strategy for the data packets to be processed based on the service type, the first label, and the second label may include: if the service type is a non-critical service and it is identified as a resource hog, then the first scheduling strategy for the data packets to be processed is determined based on the second label. A resource hog can be understood as a service with low value but high resource demand. The determination of a resource hog is made by the inference engine; that is, if the inference engine determines that a non-critical service will occupy a large amount of bandwidth for a long time, the decision-maker will override the default mapping of TCAM, forcibly map it to the rate-limiting queue, and impose a bandwidth cap on it to protect the overall network from congestion.
[0085] Optionally, determining the first scheduling strategy for the data packets to be processed based on the service type, the first label, and the second label may include: if the service type is an unknown service, then determining the first scheduling strategy for the data packets to be processed based on the second label. Specifically, the sensitivity of the traffic type is determined based on the second label. If it is determined to be a time-sensitive service flow, the decision-maker will promote it to a lower priority sub-queue in the low-latency queue group, giving it a service quality better than "best-effort".
[0086] Optionally, determining the first scheduling strategy for the data packet to be processed based on the service type, the first label, and the second label may include: if the service type is a core service, determining the operating status of the core service; the operating status is used to describe whether the core service is operating normally; and determining the first scheduling strategy for the data packet to be processed based on the operating status, the first label, and the second label.
[0087] Specifically, the weight ratios of the first and second labels differ depending on the operating state. The third weight ratio of the first label and the fourth weight ratio of the second label are determined based on the operating state. Based on the first label, second label, third weight ratio, and fourth weight ratio, the label combination pattern is determined. Based on the label combination pattern, the first scheduling strategy of the data packets to be processed is matched from the collaborative decision matrix. The collaborative decision matrix is used to describe the correspondence between different label combinations and different scheduling strategies.
[0088] Furthermore, when the business type is a core business, determining the first scheduling strategy for the data packets to be processed based on the operating status, the first label, and the second label may further include: if the operating status is normal, then the first scheduling strategy for the data packets to be processed is determined based on the first label. Specifically, the TCAM hardware unit stores pre-configured rule matching information, which is the correspondence between data packet metadata and business labels, as well as the processing priority of the data packets to be processed. The processing priority of the data packets to be processed is determined based on the rule matching information, and the first scheduling strategy for the data packets to be processed is determined based on the processing priority. If the operating status is abnormal, then the first scheduling strategy for the data packets to be processed is determined based on the second label. Specifically, different traffic types correspond to different priorities. The priority of the data packets to be processed is determined according to the second label, and the corresponding first scheduling strategy is matched based on the priority of the data packets to be processed. In this embodiment of the invention, when the business type is a core business, the reasonable determination of the scheduling strategy is achieved by judging the operating status, avoiding congestion caused by using only static strategies, and improving the efficiency of data packet scheduling.
[0089] Optionally, in this embodiment of the invention, after writing the hardware queue identifier corresponding to the first scheduling policy into the data packet metadata, the method may further include:
[0090] The hardware queue identifier is read from the data packet metadata of the data packet to be processed. Based on the hardware queue identifier, the target hardware queue is determined, and the descriptor corresponding to the data packet to be processed is placed into the lock-free circular buffer corresponding to the target hardware queue. The descriptor is a data structure containing a pointer to the actual memory address where the data packet to be processed is stored and information such as the length of the data packet to be processed. The lock-free circular buffer is an efficient data structure that allows a producer (CPU) and a consumer (hardware queue manager) to access it concurrently without using mutex locks, thereby avoiding the performance overhead and latency jitter caused by lock contention.
[0091] The hardware queue manager's internal scheduler, following its fixed algorithm, independently and in parallel retrieves descriptors corresponding to data packets to be processed from various hardware queues. Based on these descriptors, it uses direct memory access (DMI) technology to directly read the data of the corresponding data packets from main memory and send them to the physical link. This process achieves "zero copy," meaning that from the moment a data packet is received by the network card to its final transmission, there is only one copy in the entire host memory, eliminating the need for copying between kernel mode and user mode. This significantly improves throughput and reduces CPU usage.
[0092] The technical solution of this invention determines the data packet metadata of the data packet to be processed and determines dynamic feature parameters based on the data packet metadata. A first tag is determined for the data packet to be processed based on the data packet metadata; the first tag indicates the service type of the data packet to be processed. A second tag is determined for the data packet to be processed based on the dynamic feature parameters; the second tag indicates the predicted traffic type of the data packet to be processed. The service type of the current service is determined based on the first tag, and a first scheduling strategy for the data packet to be processed is determined by combining the service type, the first tag, and the second tag. The combination of the service type and the second tag can dynamically allocate appropriate queue resources, solving the problem of coarse management in static solutions, fundamentally smoothing traffic, avoiding queue accumulation, and minimizing queuing delays and jitter.
[0093] Example 3
[0094] Figure 3 This is a schematic diagram of a data packet scheduling device provided in an embodiment of the present invention. This embodiment is applicable to situations requiring reasonable scheduling of data packets. The data packet scheduling device can be implemented in hardware and / or software, and can be configured in any electronic device with network communication capabilities. Figure 3 As shown, the data packet scheduling device of the present invention may include:
[0095] The parameter determination module 310 is used to determine the data packet metadata of the data packet to be processed, and to determine dynamic feature parameters based on the data packet metadata;
[0096] The first tag determination module 320 is used to determine a first tag of the data packet to be processed based on the data packet metadata; the first tag is used to indicate the service type of the data packet to be processed.
[0097] The second tag determination module 330 is used to determine the second tag of the data packet to be processed based on dynamic feature parameters; the second tag is used to indicate the predicted traffic type of the data packet to be processed.
[0098] The scheduling strategy determination module 340 is used to determine a first scheduling strategy for the data packet to be processed based on the first tag and the second tag, and write the hardware queue identifier corresponding to the first scheduling strategy into the data packet metadata; the first scheduling strategy is used to describe the conditions and actions for triggering the call of the data packet to be processed.
[0099] Based on the above embodiments, optionally, the data packet metadata includes a quintuple, and the parameter determination module is used to: obtain the micro-flow state tracking table of the data packet to be processed; the micro-flow state tracking table is used to describe the correspondence between the quintuple and the data flow state; determine the data flow state of the data packet to be processed based on the micro-flow state tracking table and the quintuple in the data packet metadata; determine reference data items based on the data of the data flow state of the data packet to be processed, and synthesize the reference data items into dynamic feature parameters; the dynamic feature parameters are represented in the form of feature vectors.
[0100] Based on the above embodiments, optionally, the second label determination module is used to: analyze the dynamic feature parameters based on a deep learning inference engine, predict at least one reference label and a reference value corresponding to the reference label of the data packet to be processed; the reference label is the predicted traffic type of the data packet to be processed; the reference value is used to describe the probability value that the traffic type of the data packet to be processed is the reference label; if the largest reference value among the reference values is greater than or equal to a preset probability value, then the reference label corresponding to the largest reference value among the reference values is determined as the second label; if the largest reference value among the reference values is less than the preset probability value, then the second label of the data packet to be processed is determined to be an unknown label or an unobserved label.
[0101] Based on the above embodiments, optionally, the scheduling strategy determination module includes a data acquisition unit and a scheduling strategy determination unit. The data acquisition unit is used to acquire context feature information and a collaborative decision matrix corresponding to the data packet to be processed. The context feature information is related data of the data flow state of the data packet to be processed. The collaborative decision matrix is used to describe the correspondence between different label combinations and different scheduling strategies. The scheduling strategy determination unit is used to determine a first scheduling strategy for the data packet to be processed based on the context feature information, the first label, the second label, and the collaborative decision matrix.
[0102] Optionally, based on the above embodiments, after determining the first scheduling policy of the data packet to be processed, the data packet scheduling device further includes a scheduling policy adjustment module. The scheduling policy adjustment module is configured to: if multiple first scheduling policies are triggered simultaneously, determine the simultaneously triggered first scheduling policies as second scheduling policies, and obtain a first priority and a second priority for each second scheduling policy; the first priority is determined according to a first tag corresponding to the second scheduling policy; the second priority is determined according to a second tag corresponding to the second scheduling policy; add the first priority and the second priority to determine a third priority of the second scheduling policy; adjust the second scheduling policy according to the third priority to obtain an updated second scheduling policy, and write the hardware queue identifier corresponding to the updated second scheduling policy into the data packet metadata, and delete the hardware queue identifier corresponding to the unupdated second scheduling policy.
[0103] Based on the above embodiments, optionally, the scheduling strategy determination unit is configured to: adjust the second label based on the context feature information to obtain an updated second label; and determine a first scheduling strategy for the data packet to be processed based on the first label, the updated second label, and the collaborative decision matrix.
[0104] Optionally, based on the above embodiments, the scheduling strategy determination module is further configured to: determine the service type of the current service based on the first tag, and determine the first scheduling strategy of the data packet to be processed based on the service type, the first tag and the second tag.
[0105] The data packet scheduling device provided in this embodiment of the invention can execute the data packet scheduling method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0106] Example 4
[0107] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0108] Figure 4A schematic diagram of an electronic device that can be used to implement the packet scheduling method of embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0109] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0110] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0111] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as packet scheduling methods.
[0112] In some embodiments, the packet scheduling method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via read-only memory (ROM) 12 and / or communication unit 19. When the computer program is loaded into random access memory (RAM) 13 and executed by processor 11, one or more steps of the packet scheduling method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the packet scheduling method by any other suitable means (e.g., by means of firmware).
[0113] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0114] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0115] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0116] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0117] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0118] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0119] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0120] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A data packet scheduling method, characterized in that, The method includes: Determine the data packet metadata of the data packet to be processed, and determine dynamic feature parameters based on the data packet metadata; A first tag is determined for the data packet to be processed based on the data packet metadata; the first tag is used to indicate the service type of the data packet to be processed. The second tag of the data packet to be processed is determined based on dynamic feature parameters; the second tag is used to indicate the predicted traffic type of the data packet to be processed. Based on the first tag and the second tag, a first scheduling policy for the data packet to be processed is determined, and the hardware queue identifier corresponding to the first scheduling policy is written into the data packet metadata; the first scheduling policy is used to describe the conditions and actions for triggering the invocation of the data packet to be processed.
2. The method according to claim 1, characterized in that, The data packet metadata includes a quintuple, and dynamic feature parameters are determined based on the data packet metadata, including: Obtain the micro-flow state tracking table of the data packet to be processed; the micro-flow state tracking table is used to describe the correspondence between the quintuple and the data flow state; Based on the microflow state tracking table and the five-tuple in the data packet metadata, the data flow state of the data packet to be processed is determined; Based on the data stream state of the data packet to be processed, reference data items are determined, and the reference data items are synthesized into dynamic feature parameters; the dynamic feature parameters are represented in the form of feature vectors.
3. The method according to claim 2, characterized in that, Determining the second tag of the data packet to be processed based on dynamic feature parameters includes: A deep learning-based inference engine analyzes the dynamic feature parameters to predict at least one reference label and a reference value corresponding to the reference label of the data packet to be processed; the reference label is the predicted traffic type of the data packet to be processed; the reference value is used to describe the probability value that the traffic type of the data packet to be processed is the reference label. If the largest reference value among the reference values is greater than or equal to a preset probability value, then the reference label corresponding to the largest reference value among the reference values is determined as the second label; If the largest reference value among the reference values is less than a preset probability value, the second tag of the data packet to be processed is determined to be an unknown tag or an unobserved tag.
4. The method according to claim 3, characterized in that, Based on the first tag and the second tag, a first scheduling policy for the data packet to be processed is determined, including: Obtain the context feature information and collaborative decision matrix corresponding to the data packet to be processed; the context feature information is the relevant data of the data stream state of the data packet to be processed; the collaborative decision matrix is used to describe the correspondence between different label combinations and different scheduling strategies. Based on the contextual feature information, the first label, the second label, and the collaborative decision matrix, a first scheduling strategy for the data packet to be processed is determined.
5. The method according to claim 1 or 4, characterized in that, After determining the first scheduling policy for the data packet to be processed, the method further includes: If multiple first scheduling policies are triggered simultaneously, the first scheduling policies that are triggered simultaneously are determined as second scheduling policies, and the first priority and second priority of each second scheduling policy are obtained; the first priority is determined according to the first tag corresponding to the second scheduling policy; the second priority is determined according to the second tag corresponding to the second scheduling policy. The first priority and the second priority are added together to determine the third priority of the second scheduling strategy; The second scheduling policy is adjusted according to the third priority to obtain the updated second scheduling policy. The hardware queue identifier corresponding to the updated second scheduling policy is written into the data packet metadata, and the hardware queue identifier corresponding to the unupdated second scheduling policy is deleted.
6. The method according to claim 4, characterized in that, Based on the contextual feature information, the first tag, the second tag, and the collaborative decision matrix, a first scheduling strategy for the data packet to be processed is determined, including: The second label is adjusted based on the contextual feature information to obtain the updated second label; Based on the first label, the updated second label, and the collaborative decision matrix, a first scheduling strategy for the data packet to be processed is determined.
7. The method according to claim 1, characterized in that, Based on the first tag and the second tag, a first scheduling policy for the data packet to be processed is determined, including: Based on the first tag, the service type of the current service is determined, and based on the service type, the first tag, and the second tag, the first scheduling strategy of the data packet to be processed is determined.
8. A data packet scheduling device, characterized in that, The device includes: The parameter determination module is used to determine the data packet metadata of the data packet to be processed, and to determine dynamic feature parameters based on the data packet metadata; The first tag determination module is used to determine a first tag of the data packet to be processed based on the data packet metadata; the first tag is used to indicate the service type of the data packet to be processed. The second label determination module is used to determine the second label of the data packet to be processed based on dynamic feature parameters; the second label is used to indicate the predicted traffic type of the data packet to be processed. The scheduling strategy determination module is used to determine a first scheduling strategy for the data packet to be processed based on the first tag and the second tag, and write the hardware queue identifier corresponding to the first scheduling strategy into the data packet metadata; the first scheduling strategy is used to describe the conditions and actions for triggering the invocation of the data packet to be processed.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the packet scheduling method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the packet scheduling method of any one of claims 1-7.